code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
<div class="quancao_area2">
<div class="bannercenter">
<img src="<?=url?>templates/images/bannercenter/banner_center1.jpg" width="300" />
<img src="<?=url?>templates/images/bannercenter/banner_center2.jpg" width="300" />
<img src="<?=url?>templates/images/bannercenter/banner_center3.jpg" width="300" />
<img src="<?=url?>templates/images/bannercenter/banner_center1.jpg" width="300" />
<img src="<?=url?>templates/images/bannercenter/banner_center2.jpg" width="300" />
<img src="<?=url?>templates/images/bannercenter/banner_center3.jpg" width="300" />
</div>
<div class="clear"></div> | 123gosaigon | trunk/ 123gosaigon/site/components/banner/views/center.php | PHP | asf20 | 650 |
<div class="quancao_area1"><img src="<?=url?>uploads/temp/qc-yamaha.jpg" width="980" /></div>
| 123gosaigon | trunk/ 123gosaigon/site/components/banner/views/top.php | PHP | asf20 | 95 |
<div class="area1-news-qc"><!--<img src="<?=url()?>uploads/temp/area1-news-qc.jpg" width="300" height="519" />-->
<img src="<?=url()?>templates/images/banner-rec-1.jpg" width="300" height="250" />
<img src="<?=url()?>templates/images/banner-rec-2.jpg" width="300" height="250" style="margin:8px 0;" />
<!--<img src="<?=url()?>templates/images/kinhdoanh-qc.jpg" width="300" height="100" style="margin:8px 0 0;" />-->
</div>
| 123gosaigon | trunk/ 123gosaigon/site/components/banner/views/right.php | PHP | asf20 | 444 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Banner_model extends CI_Model
{
function __construct(){
parent::__construct();
}
function get_all($tbl, $num=20, $start=0)
{
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl, $num, $start);
return $query->result() ;
}
function count_all($tbl)
{
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl);
return $query->num_rows() ;
}
function get_id($tbl, $name, $id)
{
if($id) $this->db->where($name, $id) ;
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl);
return $query->row() ;
}
function save($tbl, $data, $name='', $id=0)
{
if($name)
{
$this->db->where($name, $id) ;
if($this->db->update($tbl, $data))
return $id ;
else return false;
}
else
{
if($this->db->insert($tbl,$data))
return $this->db->insert_id();
else return false;
}
}
function del($tbl, $id, $name)
{
if($id){
$this->db->where($name, $id) ;
$this->db->delete($tbl) ;
}
}
function trash($tbl, $id, $name)
{
if($id){
$this->db->where($name, $id);
return $this->db->update($tbl, array('bl_active'=>-1));
}
}
function restore($tbl, $id, $name)
{
if($id){
$this->db->where($name, $id);
return $this->db->update($tbl, array('bl_active'=>1));
}
}
function remove($tbl)
{
$date = new DateTime();
$date->modify('-3 month');
$date_del = $date->format('Y-m-d H:i:s');
$this->db->where('bl_active', -1);
$this->db->where('dt_create <', $date_del);
if($this->db->delete($tbl)){
return true;
}else{
return false;
}
}
function get_result($tbl, $num=10, $start=0, $wh='', $value=0)
{
if($wh) $this->db->where($wh, $value) ;
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl, $num, $start);
return $query->result() ;
}
function get_where($tbl, $wh='', $value=0, $num=100, $start=0, $order='')
{
if($wh) $this->db->where($wh, $value) ;
if($order) $this->db->order_by($order, 'DESC') ;
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl, $num, $start);
return $query->result() ;
}
function count_where($tbl, $where='', $id=0)
{
if($where) $this->db->where($where, $id) ;
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl);
return $query->num_rows() ;
}
function get_name($tbl, $field, $wh='', $value=0)
{
$this->db->select($field) ;
if($wh) $this->db->where($wh, $value) ;
$this->db->where('bl_active', 1) ;
$query = $this->db->get($tbl);
return $query->row() ;
}
function get_field($tbl, $field, $wh='', $value=0)
{
$this->db->select($field) ;
if($wh) $this->db->where($wh, $value) ;
$this->db->where('bl_active', 1) ;
$rs = $this->db->get($tbl)->row();
if($rs)
return $rs->$field ;
else
return ;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/components/banner/models/banner_model.php | PHP | asf20 | 2,986 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Banner extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('banner_model', 'banner') ;
}
function index()
{
$data['title'] = "Đăng nhập website" ;
$data['page'] = 'top' ;
$this->load->view('top') ;
}
public function top()
{
$this->load->view('top');
}
public function center()
{
$this->load->view('center') ;
}
public function right()
{
$this->load->view('right') ;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/components/banner/controllers/banner.php | PHP | asf20 | 579 |
<?php echo modules::run('danhmuc');?>
<!---------------- cus-temp ----------------------->
<div class="cus-temp">
<div class="cus-templeft">
<div class="templates">
<div class="templates-title"> <a href=""> <img src="<?php echo site().'templates/images/icon-temp.gif'?>" width="47" height="47">
<h2>Chọn mẫu in</h2>
</a> </div>
<div class="clear"></div>
<p class="notify">Bắt buột bạn phải tìm cho mình 1 hoặc nhiều mẫu. chúng tôi dựa vào đó tính và báo giá cho các các bạn.</p>
<div class="line-templeft">
<div></div>
<a href="">Click here</a></div>
</div>
<div class="templates">
<div class="templates-title"><a href=""><img src="<?php echo site().'templates/images/icon-upload.gif'?>" width="47" height="47">
<h2>Upload mẫu</h2>
</a></div>
<div class="clear"></div>
<p class="customer">Khách hàng có thể gửi file và yêu cầu bào giá.</p>
<p class="note">Luu ý: Ghi đầy đủ nội dung yêu cầu của các bạn để chúng tôi báo giá chính xác hơn..</p>
<div class="line-templeft">
<div></div>
<a href="">Click here</a></div>
</div>
</div>
<div class="cus-tempright"></div>
</div>
<!---------------- end cus-temp ----------------------->
<div class="clear"></div>
<!---------------- area ----------------------->
<div class="area">
<div class="block"><!---------------- block ----------------------->
<div class="block-nt">
<h1 class="tag_lv">Lĩnh Vực Chính</h1>
<div class="block-main-none"></div>
<div class="block-main">
<!-- Arrow Left -->
<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 860px; height: 200px; ">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;"> </div>
<div style="position: absolute; display: block; background: url(../templates/images/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;"> </div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 860px; height: 200px; overflow: hidden;">
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image"src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
</div>
<div u="arrowleft" class="row-left jssora03l"></div>
<div u="arrowright" class="row-right jssora03r"></div>
<!-- Arrow Navigator Skin End -->
</div>
</div>
<div class="block-main">
<div id="slider2_container" style="position: relative; top: 0px; left: 0px; width: 860px; height: 200px; ">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;"> </div>
<div style="position: absolute; display: block; background: url(../templates/images/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;"> </div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 860px; height: 200px; overflow: hidden;">
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image"src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
</div>
<!-- Arrow Left -->
<div u="arrowleft" class="row-left jssora03l"></div>
<div u="arrowright" class="row-right jssora03r"></div>
<!-- Arrow Navigator Skin End -->
</div>
</div>
</div>
</div><!---------------- end block ----------------------->
<div class="block"><!---------------- block ----------------------->
<div class="block-nt">
<h1 class="tag">Giải Pháp Nhanh</h1>
<div class="block-main-none"></div>
<!---------------------------->
<div class="block-main">
<div id="slider3_container" style="position: relative; top: 0px; left: 0px; width: 860px; height: 200px; ">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;"> </div>
<div style="position: absolute; display: block; background: url(../templates/images/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;"> </div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 860px; height: 200px; overflow: hidden;">
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image"src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
</div>
<!-- Arrow Left -->
<div u="arrowleft" class="row-left jssora03l"></div>
<div u="arrowright" class="row-right jssora03r"></div>
<!-- Arrow Navigator Skin End -->
</div>
</div>
<!---------------------------->
<div class="block-main">
<div id="slider4_container" style="position: relative; top: 0px; left: 0px; width: 860px; height: 200px; ">
<!-- Loading Screen -->
<div u="loading" style="position: absolute; top: 0px; left: 0px;">
<div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block;
background-color: #000; top: 0px; left: 0px;width: 100%;height:100%;"> </div>
<div style="position: absolute; display: block; background: url(../templates/images/loading.gif) no-repeat center center;
top: 0px; left: 0px;width: 100%;height:100%;"> </div>
</div>
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 860px; height: 200px; overflow: hidden;">
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image"src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
<div><a href=""><img u="image" src="<?php echo site().'templates/images/sanpham.jpg'?>" >
<h2>Văn Phòng Phẩm</h2>
</a></div>
</div>
<!-- Arrow Left -->
<div u="arrowleft" class="row-left jssora03l"></div>
<div u="arrowright" class="row-right jssora03r"></div>
<!-- Arrow Navigator Skin End -->
</div>
</div>
<!-------------------------------------->
</div>
</div>
<!---------------- end block ----------------------->
</div>
<!---------------- end area ----------------------->
| 123gosaigon | trunk/ 123gosaigon/site/views/home/index.php | PHP | asf20 | 10,166 |
<!-------------- quitrinh ----------------------->
<div class="quitrinh">
<div class="text">Quy Trình In</div>
<div class="search">
<div class="txt-search">Tìm kiếm nhanh </div>
<div class="drop-search">
<select name="drop_search" id="drop_search">
<option value="">Roll click</option>
</select>
</div>
</div>
</div><!-------------- end quitrinh ----------------------->
<div class="clear"></div>
<!-------------- slider-print ----------------------->
<div class="slider-print">
<div class="slider-item">
<h2>Ký hợp đồng in</h2>
<p>Hợp đồng là những cam kết, thoả thuận mà hai bên đã thống nhất, bàn bạc trong quá trình hai bên đã trao đổi. </p>
<span class="img_tem"></span>
</div>
<div class="slider-item">
<h2>Ký hợp đồng in</h2>
<p>Hợp đồng là những cam kết, thoả thuận mà hai bên đã thống nhất, bàn bạc trong quá trình hai bên đã trao đổi. </p>
<span class="img_tem"></span>
</div>
<div class="slider-item">
<h2>Ký hợp đồng in</h2>
<p>Hợp đồng là những cam kết, thoả thuận mà hai bên đã thống nhất, bàn bạc trong quá trình hai bên đã trao đổi. </p>
<span class="img_tem"></span>
</div>
<div class="slider-item">
<h2>Ký hợp đồng in</h2>
<p>Hợp đồng là những cam kết, thoả thuận mà hai bên đã thống nhất, bàn bạc trong quá trình hai bên đã trao đổi. </p>
<span class="img_tem"></span>
</div>
</div><!-------------- end slider-print ----------------------->
<div class="clear"></div>
<div class="hoadon">
<div class="hoadon-title">
<ul>
<li><a href="">In hoá đơn GTGT</a>|</li>
<li><a href="">Hoá đơn nội bộ</a>|</li>
<li><a href="">Bao thư</a>|</li>
<li><a href="">Biểu mẫu</a>|</li>
<li><a href="">Chứng từ,...</a></li>
</ul>
</div>
<div class="clear"></div>
<div class="line-hoadon"></div>
<div class="hoadon-main">
<div class="hoadon-block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
<div class="hoadon">
<div class="hoadon-title">
<ul>
<li><a href="">In hoá đơn GTGT</a>|</li>
<li><a href="">Hoá đơn nội bộ</a>|</li>
<li><a href="">Bao thư</a>|</li>
<li><a href="">Biểu mẫu</a>|</li>
<li><a href="">Chứng từ,...</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="line-hoadon"></div>
<div class="hoadon-main">
<div class="hoadon-block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
<div class="hoadon">
<div class="hoadon-title">
<ul>
<li><a href="">In hoá đơn GTGT</a>|</li>
<li><a href="">Hoá đơn nội bộ</a>|</li>
<li><a href="">Bao thư</a>|</li>
<li><a href="">Biểu mẫu</a>|</li>
<li><a href="">Chứng từ,...</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="line-hoadon"></div>
<div class="hoadon-main">
<div class="hoadon-block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
<div class="hoadon">
<div class="hoadon-title">
<ul>
<li><a href="">In hoá đơn GTGT</a>|</li>
<li><a href="">Hoá đơn nội bộ</a>|</li>
<li><a href="">Bao thư</a>|</li>
<li><a href="">Biểu mẫu</a>|</li>
<li><a href="">Chứng từ,...</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="line-hoadon"></div>
<div class="hoadon-main">
<div class="hoadon-block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'; ?>"><h2>Hoá đơn GTGT</h2></a></li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
<div class="quidinh_bottom"></div> | 123gosaigon | trunk/ 123gosaigon/site/views/quitrinh.php | PHP | asf20 | 6,760 |
<div class="sp-banner">
<div class="namecard"><a href=""><img src="<?php echo site.'templates/images/namecard.gif'?>" width="400"></a></div>
<div class="imgcard">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>"></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>"></a></li>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>"></a></li>
</ul>
</div>
</div>
<div class="clear"></div>
<!-------------- sp --------------------->
<div class="sp">
<!-------------- sp-left --------------------->
<div class="sp-left">
<div class="promain">
<div class="promain-title">Sản phẩm Chính</div>
<div class="line-pro"></div>
<div class="promain-row">
<ul>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Danh Thiếp</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Bao Thư</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Văn phòng phẩm</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Sticker</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Label</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Decal</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Tờ rơi</a></li>
<li><a href=""><img src="<?php echo site .'templates/images/index-pro.gif'?>" width="4" height="4">Thiệp Mời</a></li>
</ul>
</div>
</div>
</div><!-------------- end sp-left --------------------->
<!-------------- sp-right --------------------->
<div class="sp-right">
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
<div class="block">
<ul>
<li><a href=""><img src="<?php echo site.'templates/images/sanpham.jpg'?>" ><h2>Văn Phòng Phẩm</h2></a></li>
</ul>
</div>
</div><!-------------- end sp-right --------------------->
</div><!-------------- end sp --------------------->
<div class="clear quidinh_bottom"></div> | 123gosaigon | trunk/ 123gosaigon/site/views/sanpham/index.php | PHP | asf20 | 5,654 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/views/index.html | HTML | asf20 | 114 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome to CodeIgniter</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#body{
margin: 0 15px 0 15px;
}
p.footer{
text-align: right;
font-size: 11px;
border-top: 1px solid #D0D0D0;
line-height: 32px;
padding: 0 10px 0 10px;
margin: 20px 0 0 0;
}
#container{
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
</style>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter!</h1>
<div id="body">
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
<p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/welcome_message.php</code>
<p>The corresponding controller for this page is found at:</p>
<code>application/controllers/welcome.php</code>
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/views/welcome_message.php | Hack | asf20 | 1,933 |
<?
function datemysql($day=''){
return strftime("%Y-%m-%d", strtotime($day));
}
function datevn2mysql($day=''){
$data = explode("/", $day) ;
return $data[2]."-".$data[1]."-".$data[0];
}
function dateus2mysql($day=''){
$data = explode("/", $day) ;
return $data[2]."-".$data[0]."-".$data[1];
}
function datevn($day='', $dot='.'){
if(empty($day)) return '';
return strftime("%d$dot%m$dot%Y", strtotime($day));
}
function shortdayvn($day='', $dot='/'){
if(empty($day)) return '';
return strftime("%d$dot%m", strtotime($day));
}
function disdate($d1,$d2){
//date yyyy-mm-dd
$ar = explode("-",$d1) ;
$br = explode("-",$d2) ;
$a = mktime(0,0,0,intval($ar[1]),intval($ar[2]),intval($ar[0])) ;
$b = mktime(0,0,0,intval($br[1]),intval($br[2]),intval($br[0])) ;
$c = $b - $a ;
$e = $c / (24 * 60 * 60) ;
return $e ;
}
function countdate($date, $str)
{
$date = new DateTime($date);
$date->modify($str);
return $date->format('Y-m-d');
}
/**
** @deription get time hiển thị thứ, ngày, tháng, năm.
** @param dt_create '2014-10-05 15:16:00'
** @return $str time
**/
function GetTime($dt_create) {
$weekday = date("l",strtotime($dt_create));
switch(strtolower($weekday)) {
case 'monday':
$weekday = 'Thứ hai';
break;
case 'tuesday':
$weekday = 'Thứ ba';
break;
case 'wednesday':
$weekday = 'Thứ tư';
break;
case 'thursday':
$weekday = 'Thứ năm';
break;
case 'friday':
$weekday = 'Thứ sáu';
break;
case 'saturday':
$weekday = 'Thứ bảy';
break;
default:
$weekday = 'Chủ nhật';
break;
}
return $weekday.' '.date('d/m/Y H:i',strtotime($dt_create));
}
function slipDate($date){
if(empty($date)) return '';
$arr_date =explode('-',$date);
return $arr_date;
}
?> | 123gosaigon | trunk/ 123gosaigon/site/helpers/date_helper.php | PHP | asf20 | 2,050 |
<?php
function fn_resize_image($src, $dest, $new_width = 0, $new_height = 0, $make_box = true, $bg_color = '#ffffff', $save_original = false)
{
static $notification_set = false;
static $gd_settings = array();
if (file_exists($src) && !empty($dest) && (!empty($new_width) || !empty($new_height)) && extension_loaded('gd')) {
$img_functions = array(
'png' => function_exists('imagepng'),
'jpg' => function_exists('imagejpeg'),
'gif' => function_exists('imagegif'),
);
/*
if (empty($gd_settings)) {
$gd_settings = fn_get_settings('Thumbnails');
}
*/
$dst_width = $new_width;
$dst_height = $new_height;
list($width, $height, $mime_type) = fn_get_image_size($src);
if (empty($width) || empty($height)) {
return false;
}
if ($width < $new_width) {
$new_width = $width;
}
if ($height < $new_height) {
$new_height = $height;
}
if ($dst_height == 0) { // if we passed width only, calculate height
$new_height = $dst_height = ($height / $width) * $new_width;
} elseif ($dst_width == 0) { // if we passed height only, calculate width
$new_width = $dst_width = ($width / $height) * $new_height;
} else { // we passed width and height, limit image by height! (hm... not sure we need it anymore?)
if ($new_width * $height / $width > $dst_height) {
$new_width = $width * $dst_height / $height;
}
$new_height = ($height / $width) * $new_width;
if ($new_height * $width / $height > $dst_width) {
$new_height = $height * $dst_width / $width;
}
$new_width = ($width / $height) * $new_height;
}
$w = number_format($new_width, 0, ',', '');
$h = number_format($new_height, 0, ',', '');
$ext = fn_get_image_extension($mime_type);
if (!empty($img_functions[$ext])) {
if ($make_box) {
$dst = imagecreatetruecolor($dst_width, $dst_height);
} else {
$dst = imagecreatetruecolor($w, $h);
}
if (function_exists('imageantialias')) {
imageantialias($dst, true);
}
} elseif ($notification_set == false) {
$msg = fn_get_lang_var('error_image_format_not_supported');
$msg = str_replace('[format]', $ext, $msg);
fn_set_notification('E', fn_get_lang_var('error'), $msg);
$notification_set = true;
return false;
}
if ($ext == 'gif' && $img_functions[$ext] == true) {
$new = imagecreatefromgif($src);
} elseif ($ext == 'jpg' && $img_functions[$ext] == true) {
$new = imagecreatefromjpeg($src);
} elseif ($ext == 'png' && $img_functions[$ext] == true) {
$new = imagecreatefrompng($src);
} else {
return false;
}
// Set transparent color to white
// Not sure that this is right, but it works
// FIXME!!!
// $c = imagecolortransparent($new);
list($r, $g, $b) = fn_parse_rgb($bg_color);
$c = imagecolorallocate($dst, $r, $g, $b);
//imagecolortransparent($dst, $c);
if ($make_box) {
imagefilledrectangle($dst, 0, 0, $dst_width, $dst_height, $c);
$x = number_format(($dst_width - $w) / 2, 0, ',', '');
$y = number_format(($dst_height - $h) / 2, 0, ',', '');
} else {
imagefilledrectangle($dst, 0, 0, $w, $h, $c);
$x = 0;
$y = 0;
}
imagecopyresampled($dst, $new, $x, $y, 0, 0, $w, $h, $width, $height);
//if ($gd_settings['convert_to'] == 'original') {
$gd_settings['convert_to'] = $ext;
// }
if (empty($img_functions[$gd_settings['convert_to']])) {
foreach ($img_functions as $k => $v) {
if ($v == true) {
$gd_settings['convert_to'] = $k;
break;
}
}
}
$pathinfo = pathinfo($dest);
$new_filename = $pathinfo['dirname'] . '/' . basename($pathinfo['basename'], empty($pathinfo['extension']) ? '' : '.' . $pathinfo['extension']);
// Remove source thumbnail file
/*
if (!$save_original) {
fn_rm($src);
}
*/
switch ($gd_settings['convert_to']) {
case 'gif':
$new_filename .= '.gif';
imagegif($dst, $new_filename);
break;
case 'jpg':
$new_filename .= '.jpg';
imagejpeg($dst, $new_filename, 90);
break;
case 'png':
$new_filename .= '.png';
imagepng($dst, $new_filename);
break;
}
$dest = $new_filename;
@chmod($dest, '775');
return true;
}
return false;
}
//
// Check supported GDlib formats
//
function fn_check_gd_formats()
{
$avail_formats = array(
'original' => fn_get_lang_var('same_as_source'),
);
if (function_exists('imagegif')) {
$avail_formats['gif'] = 'GIF';
}
if (function_exists('imagejpeg')) {
$avail_formats['jpg'] = 'JPEG';
}
if (function_exists('imagepng')) {
$avail_formats['png'] = 'PNG';
}
return $avail_formats;
}
//
// Get image extension by MIME type
//
function fn_get_image_extension($image_type)
{
static $image_types = array (
'image/gif' => 'gif',
'image/pjpeg' => 'jpg',
'image/jpeg' => 'jpg',
'image/png' => 'png',
'application/x-shockwave-flash' => 'swf',
'image/psd' => 'psd',
'image/bmp' => 'bmp',
);
return isset($image_types[$image_type]) ? $image_types[$image_type] : false;
}
//
// Getimagesize wrapper
// Returns mime type instead of just image type
// And doesn't return html attributes
function fn_get_image_size($file)
{
// File is url, get it and store in temporary directory
if (strpos($file, '://') !== false) {
$tmp = fn_create_temp_file();
if (fn_put_contents($tmp, fn_get_contents($file)) == 0) {
return false;
}
$file = $tmp;
}
list($w, $h, $t, $a) = @getimagesize($file);
if (empty($w)) {
return false;
}
$t = image_type_to_mime_type($t);
return array($w, $h, $t);
}
function fn_attach_image_pairs($name, $object_type, $object_id = 0, $lang_code = CART_LANGUAGE, $object_ids = array (), $parent_object = '', $parent_object_id = 0)
{
$icons = fn_filter_uploaded_data($name . '_image_icon');
$detailed = fn_filter_uploaded_data($name . '_image_detailed');
$pairs_data = !empty($_REQUEST[$name . '_image_data']) ? $_REQUEST[$name . '_image_data'] : array();
return fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id, $object_type, $object_ids, $parent_object, $parent_object_id, true, $lang_code);
}
function fn_generate_thumbnail($image_path, $width, $height = 0, $make_box = false)
{
if (empty($image_path)) {
return '';
}
if (strpos($image_path, '://') === false) {
if (strpos($image_path, '/') !== 0) { // relative path
$image_path = Registry::get('config.current_path') . '/' . $image_path;
}
$image_path = (defined('HTTPS') ? ('https://' . Registry::get('config.https_host')) : ('http://' . Registry::get('config.http_host'))) . $image_path;
}
$_path = str_replace(Registry::get('config.current_location') . '/', '', $image_path);
$image_url = explode('/', $_path);
$image_name = array_pop($image_url);
$image_dir = array_pop($image_url);
$image_dir .= '/' . $width . (empty($height) ? '' : '/' . $height);
$filename = $image_dir . '/' . $image_name;
$real_path = htmlspecialchars_decode(DIR_ROOT . '/' . $_path, ENT_QUOTES);
$th_path = htmlspecialchars_decode(DIR_THUMBNAILS . $filename, ENT_QUOTES);
if (!fn_mkdir(DIR_THUMBNAILS . $image_dir)) {
return '';
}
if (!file_exists($th_path)) {
if (fn_get_image_size($real_path)) {
$image = fn_get_contents($real_path);
fn_put_contents($th_path, $image);
fn_resize_image($th_path, $th_path, $width, $height, $make_box, Registry::get('settings.Thumbnails.thumbnail_background_color'));
$filename_info = pathinfo($filename);
$th_path_info = pathinfo($th_path);
$filename = $filename_info['dirname'] . '/' . $th_path_info['basename'];
} else {
return '';
}
}
return Registry::get('config.thumbnails_path') . $filename;
}
function fn_parse_rgb($color)
{
$r = hexdec(substr($color, 1, 2));
$g = hexdec(substr($color, 3, 2));
$b = hexdec(substr($color, 5, 2));
return array($r, $g, $b);
}
function fn_find_valid_image_path($image_pair, $object_type, $get_flash, $lang_code)
{
if (isset($image_pair['icon']['absolute_path']) && is_file($image_pair['icon']['absolute_path'])) {
if (!$get_flash && isset($image_pair['icon']['is_flash']) && $image_pair['icon']['is_flash']) {
// We don't need Flash at all -- no need to crawl images any more.
return false;
} else {
return $image_pair['icon']['image_path'];
}
}
// Try to get the product's image.
if (!empty($image_pair['image_id'])) {
$image = fn_get_image($image_pair['image_id'], $object_type, 0, $lang_code);
if (isset($image['absolute_path']) && is_file($image['absolute_path'])) {
if (!$get_flash && isset($image['is_flash']) && $image['is_flash']) {
return false;
}
return $image['image_path'];
}
}
// If everything above failed, try to generate the thumbnail.
if (!empty($image_pair['detailed_id'])) {
$image = fn_get_image($image_pair['detailed_id'], 'detailed', 0, $lang_code);
if (isset($image['absolute_path']) && is_file($image['absolute_path'])) {
if (isset($image['is_flash']) && $image['is_flash']) {
if ($get_flash) {
// No need to call fn_generate_thumbnail()
return $image['image_path'];
} else {
return false;
}
}
$image = fn_generate_thumbnail($image['image_path'], Registry::get('settings.Thumbnails.product_details_thumbnail_width'), Registry::get('settings.Thumbnails.product_details_thumbnail_height'), false);
if (!empty($image)) {
return $image;
}
}
}
return false;
}
function fn_convert_relative_to_absolute_image_url($image_path)
{
return 'http://' . Registry::get('config.http_host') . $image_path;
}
function fn_show_banner($filename, $link='', $w='', $h='', $title='', $id='bnqc'){
$ext = file_extension($filename);
$w = !empty($w) ? ' width='.$w.'px' : '' ;
$h = !empty($h) ? ' height='.$h.'px' : '' ;
$title = !empty($title) ? ' title='.$title : '' ;
$id = !empty($id) ? ' id='.$id : '' ;
switch($ext){
case "swf" :
$img='<a href="'.$link.'" target="_blank" '.$title.'><embed '.$h.' '.$w.' src="'.$filename.'" wmode="transparent" rel="'.$link.'" '.$id.' /></a>' ;
break ;
default :
$img='<a href="'.$link.'" target="_blank" '.$title.' '.$id.'><img src="'.$filename.'" border=0 '.$h.' '.$w.' '.$title.' '.$id.' /></a>' ;
break ;
}
return $img ;
}
function file_extension($filename)
{
$path_info = pathinfo($filename);
return $path_info['extension'];
}
?>
| 123gosaigon | trunk/ 123gosaigon/site/helpers/img_helper.php | PHP | asf20 | 12,198 |
<? if (! defined('BASEPATH')) exit('No direct script access allowed');
function site()
{
$CI =& get_instance();
$index = $CI->config->item('index_page') ;
if($index)
return $CI->config->base_url().'/'.$index.'/';
else
return $CI->config->base_url();
}
function url($uri = '')
{
$CI =& get_instance();
return $CI->config->base_url($uri);
}
if ( ! function_exists('stream_url'))
{
function stream_url()
{
$CI =& get_instance();
return $CI->config->slash_item('stream_url');
}
}
if ( ! function_exists('show_url'))
{
function show_url()
{
$CI =& get_instance();
return $CI->config->slash_item('show_url');
}
}
if ( ! function_exists('music_url'))
{
function music_url()
{
$CI =& get_instance();
return $CI->config->slash_item('music_url');
}
}
if ( ! function_exists('images_url'))
{
function images_url()
{
$CI =& get_instance();
return $CI->config->slash_item('images_url');
}
}
function get_alias($str)
{
$alias = str_replace(".html",'', $str);
return $alias;
}
?> | 123gosaigon | trunk/ 123gosaigon/site/helpers/MY_url_helper.php | PHP | asf20 | 1,068 |
<?php
function getcaptcha()
{
$md5_hash = md5(rand(0,999));
$security_code = substr($md5_hash, 15, 5);
$_SESSION["security_code"] = $security_code;
//$this->session->set_userdata(array('security_code'=>$security_code)) ;
$width = 100;
$height = 28;
$image = imagecreate($width, $height);
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $black);
imagestring($image, 10, 28, 6, $security_code, $white);
header("Content-Type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
} | 123gosaigon | trunk/ 123gosaigon/site/helpers/captcha_helper.php | PHP | asf20 | 614 |
<?php
function str_limit($str, $n = 300)
{
if (strlen($str) <= $n)
{
return $str;
}
$limit = strpos($str,' ', $n) ;
while($limit==false&&$n>1)
{ $n--;
$limit = strpos($str,' ', $n) ;
}
$limit = $limit ? $limit : $n ;
$out = substr($str, 0, $limit) ;
return $out.' ...' ;
}
function kodau($str)
{
$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
$str = preg_replace("/(đ)/", 'd', $str);
$str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
$str = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $str);
$str = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $str);
$str = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $str);
$str = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $str);
$str = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $str);
$str = preg_replace("/(Đ)/", 'D', $str);
$str = preg_replace("/( )/", '-', $str);
$str = preg_replace("/(\'|\"|`|&|,|\.|\?)/", '', $str);
$str = preg_replace("/(---|--)/", '-', $str);
$pattern = '/([^a-z0-9\-\._])/i';
$str = preg_replace($pattern, '', $str);
$str = strtolower($str);
return $str;
}
function op_town()
{
$ci = get_instance();
$list = $ci->db->query('select * from town order by town_name')->result() ;
$str = '<option value="0"> -- </option>' ;
foreach ($list as $rs) :
$str .= '<option value="'.$rs->town_id.'">'.$rs->town_name.'</option>' ;
endforeach ;
return $str ;
}
function ajax_paging($totalrow,$curpage,$pageto,$maxrow=5,$maxpage=3)
{
$paging = "";
if($totalrow % $maxrow == 0) {
$totalpage = (int)($totalrow/$maxrow);
} else {
$totalpage = (int)($totalrow /$maxrow)+ 1;
}
if($totalrow > $maxrow ){
$start = 1;
$end = 1;
$navi = "" ;
//$list = "Page: ".$curpage ." in ".$totalpage ." ";
$list = "" ;
for($i=0;$i<=$totalpage;$i++){
if(($i > ((int)(($curpage - 1)/$maxpage))*$maxpage)&&($i <= ((int)(($curpage -1)/$maxpage + 1))*$maxpage)){
if($start ==1 )$start = $i ;
if($i == $curpage){
$navi .= "<strong>".$i ."</strong>";
}else {
if($pageto=='javascript')
$navi .= "<a href='javascript:gotopage(".$i.")'>$i</a>" ;
else
$navi .= "<a href='".$pageto."&page=$i'>$i</a>";
}
$end = $i ;
}
}
//khai báo preview
if($curpage > $maxpage){
if($pageto=='javascript')
$preview = "<a href='javascript:gotopage(".($start - 1).")'><span class=prev> </span></a>";
else
$preview = "<a href='".$pageto."&page=".($start - 1)."'><span class=prev> </span></a>";
}else{
$preview = '';//"<strong><<</strong>" ;
}
// khai báo next
$i = ((int)(($curpage -1)/$maxpage + 1))*$maxpage;
if($i < $totalpage){
if($pageto=='javascript')
$next = "<a href='javascript:gotopage(".($end + 1).")'><span class=next> </span></a>";
else
$next = "<a href='".$pageto."&page=".($end + 1)."'><span class=next> </span></a>";
} else {
$next = '';//"<strong> >> </strong>" ;
}
$paging .= $list . $preview . $navi .$next ;
}
return $paging ;
}
function pricevn($price)
{
return number_format($price, 0,',',".") ;
}
function get_id_from_alias($url)
{
$str_id = end(explode('-',$url));
$pos = strpos($str_id,'.html');
if($pos===false){
$id=0;
}else{
$id = (int)substr($str_id,0,$pos);
}
return $id;
}
function getIp() {
return (getenv('HTTP_X_FORWARDED_FOR')) ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR');
}
function getUserFromEmail($email) {
$arrEamil=explode('@',$email);
return $arrEamil[0];
}
function rand_string($size){
$string = "aAbBcCdDeEeFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVmWxXzYyZ";
$rand_str = "";
for ($i=0; $i<$size; $i++)
{
$rand_str .= substr($string, rand(0, strlen($string)-1), 1);
}
return $rand_str;
}
function encrypt($str){
for($i = 0; $i <2; $i ++){
$str = base64_encode(base64_encode($str));
}
$str= rand_string(5).$str;
return $str;
}
function decrypt($str){
$str=substr($str,5,strlen($str));
for($i = 0; $i < 2; $i ++){
$str = base64_decode(base64_decode($str));
}
return $str;
}
?>
| 123gosaigon | trunk/ 123gosaigon/site/helpers/str_helper.php | PHP | asf20 | 4,810 |
<?php
function send_mail($name,$from,$to,$subject,$message)
{
$mess =$message;
$headers = "From: ".$name." <".$from.">\n";
$headers .= "Reply-To: ".$name." <".$from.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=\"utf-8\"\n";
return @mail( $to, $subject, $mess, $headers );
}
function send($to,$subject,$message)
{
$CI = get_instance();
$mess =$message;
$contact_name = "=?UTF-8?B?".base64_encode($CI->config->item('contact_name')).'?=';
$headers = "From: ".$contact_name." <".$CI->config->item('contact_email').">\n";
$headers .= "Reply-To: ".$contact_name." <".$CI->config->item('contact_email').">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
return @mail( $to, "=?UTF-8?B?".base64_encode($subject).'?=', $mess, $headers );
}
function sendshare($nguoigui,$emailnguoigui,$emailnguoinhan,$subject,$message)
{
$CI = get_instance();
$mess =$message;
$nguoigui = "=?UTF-8?B?".base64_encode($nguoigui).'?=';
$headers = "From: ".$nguoigui." <".$emailnguoigui.">\n";
$headers .= "Reply-To: ".$nguoigui." <".$emailnguoigui.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
return @mail( $emailnguoinhan, "=?UTF-8?B?".base64_encode($subject).'?=', $mess, $headers );
}
function info_send_mail()
{
$CI = get_instance();
$CI->load->config('config_contact');
$mess = '<div>----------------------------</div>';
$mess .='<div><b>'.$CI->config->item('contact_name').'</b></div>';
$mess .='<div><b>Địa chỉ:</b> '.$CI->config->item('contact_address').'</div>';
$mess .='<div><b>Điện thoại:</b> '.$CI->config->item('contact_phone').' - '.$CI->config->item('contact_mobile').'</div>';
$mess .='<div><b>Email:</b> '.$CI->config->item('contact_email').'</div>';
$mess .='<div><b>Fax:</b> '.$CI->config->item('contact_fax').'</div>';
return $mess;
}
function sendmail($mailto, $nameto, $subject, $content, $frommail='', $fromname='')
{
date_default_timezone_set(date_default_timezone_get());
require_once APPPATH."libraries/class.smtp.php";
require_once APPPATH."libraries/class.phpmailer.php";
//Thông tin xac thực
$mail = new PHPMailer();
//$mail->Mailer = "smtp";
/*$mail->Host = "mail.quagiare.com";
$mail->SMTPAuth = true;
$mail->Username = "info@quagiare.com";
$mail->Password = "yRGXL3qB";
$mail->IsHTML(true) ;
$mail->From = "info@quagiare.com"; //$frommail ;
$mail->FromName = "www.quagiare.com"; //$fromname ;*/
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "wwworgsvn@gmail.com"; //"quagiare02@gmail.com";
$mail->Password = "w4016216"; //"quagiare1986";
//$mail->AddReplyTo("quagiare@gmail.com", "www.quagiare.com");
//$mail->SetFrom("quagiare@gmail.com", "www.quagiare.com");
$mail->IsHTML(true) ;
//send to email
$mail->AddAddress($mailto, $nameto);
$mail->Subject = $subject ;
$mail->MsgHTML($content);
return $mail->Send() ;
}
//su dung send mail trong codeigniter voi libaray eamil
function Sendemail($to,$subject,$message){
$CI = get_instance();
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => '465',
'smtp_user' => 'demo123vn@gmail.com',//nguyenhaiduong41@gmail.com
'smtp_pass' => 'gocong012345',//Nhớ đánh đúng user và pass nhé
'mailtype' => 'html'
);
$CI->load->library('email',$config);
$CI->email->set_newline("\r\n");
$CI->email->from('demo123vn@gmail.com', 'Sunny Hot');
$CI->email->to($to); //'thanhtunggc@gmail.com'
$CI->email->subject($subject);//'Email Test'
$CI->email->message($message); // 'Kiểm tra thư này đi có virus ak!!!'
/**
//Các dòng được thêm vao dùng để attcak file
$path = ROOT_DIR;//Test đường dẫn thì echo nó ra,rùi dùng die(); nếu hiện ra đường dẫn thì ok xóa bỏ nó
$file = $path . '/uploads/text.txt';
$this->email->attach($file);*/
return $CI->email->send();
}
?>
| 123gosaigon | trunk/ 123gosaigon/site/helpers/mail_helper.php | PHP | asf20 | 4,545 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/helpers/index.html | HTML | asf20 | 114 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Database Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/errors/error_db.php | PHP | asf20 | 1,156 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>404 Page Not Found</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/errors/error_404.php | PHP | asf20 | 1,160 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/errors/error_general.php | PHP | asf20 | 1,147 |
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
</div> | 123gosaigon | trunk/ 123gosaigon/site/errors/error_php.php | PHP | asf20 | 288 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/errors/index.html | HTML | asf20 | 114 |
<?php
class CI_Upload {
// thu muc upload goc
private $_root_upload_dir;
// thu muc upload theo Nam/Thang/Ngay
private $_current_upload_dir;
// duong dan upload
private $_upload_path;
// loai file cho phep
private $_allow_type = array('video/mp4','audio/mp4','audio/ogg', 'video/ogg','audio/webm', 'video/webm','audio/mpeg','video/3gpp ','audio/wave', 'audio/wav', 'audio/x-wav' );
// dung luong cho phep
private $_allow_size = SIZE_VIDEO ;//100M
// chua thong tin loi
private $_error_message = '';
public function __construct($folder) {
// kiem tra thu muc ton tai
$this->_root_upload_dir = $folder;
//$this->_current_upload_dir = date('Y/m/d/');
$folderUpload = $this->_root_upload_dir ; //.'/'. $this->_current_upload_dir
if( !file_exists ($folderUpload) ) {
// tao thu muc
self::mkDirectory($folderUpload);
}
$this->_upload_path = $folderUpload;
}
public function do_upload( $oFile ){
//Kiem tra form submit
if ( ! isset($oFile) ) {
$this->_error_message = 'No file upload.';
return null;
}
// neu co loi
if( $oFile['error'] > 0 ){
$this->_error_message = 'file error';
return null;
}
// kiem tra kieu file
if( ! in_array($oFile['type'], $this->_allow_type ) ) {
$this->_error_message = 'File type disallow';
return null;
}
// kiem tra dung luong
if( $oFile['size'] > $this->_allow_size ) {
$this->_error_message = 'Max file size allow';
return null;
}
// thuc hien upload
if(is_uploaded_file($oFile['tmp_name']))
{
$filename = stripslashes($oFile['name']);
$path_info = pathinfo($filename);
$extension = strtolower($path_info['extension']) ;
$name= md5($oFile['name']).'_'.date("dmYHis").'.'.$extension;
$filename = $this->_root_upload_dir.'/'.$name ;
if(move_uploaded_file($oFile['tmp_name'],$filename)){
return $name;
}else{
return false;
}
}else{
return false;
}
}
public static function mkDirectory($strTarget) {
// from php.net/mkdir user contributed notes
if (file_exists ( $strTarget )) {
if (! @ is_dir ( $strTarget ))
return false;
else
return true;
}
// Attempting to create the directory may clutter up our display.
if (@ mkdir ( $strTarget )) {
$stat = @ stat ( dirname ( $strTarget ) );
$dir_perms = $stat ['mode'] & 0007777; // Get the permission bits.
@ chmod ( $strTarget, $dir_perms );
return true;
} else {
if (is_dir ( dirname ( $strTarget ) ))
return false;
}
// If the above failed, attempt to create the parent node, then try again.
if (self::mkDirectory ( dirname ( $strTarget ) ))
return mkDir ( $strTarget );
return false;
}
/**
** options: exact, portrait, landscape, auto, crop
**
**/
public function resize($source,$save,$option='auto',$width=100,$height=100){
/*include 'thumbnail.php';
$thumb=new CI_Thumbnail($source);
switch($option){
case 'width':
$thumb->size_width($width);
break;
case 'height':
$thumb->size_height($height);
break;
case 'auto':
$thumb->size_auto($width);
break;
case 'size':
$thumb->size($width,$height);
break;
}
$thumb->process();
$thumb->show();
$thumb->save($save);*/
include 'resize.php';
// create folder
if( !file_exists ($this->_root_upload_dir.'/small') ) {
// tao thu muc
self::mkDirectory($this->_root_upload_dir.'/small');
}
$resizeObj=new Resize($source);
$resizeObj -> resizeImage($width, $height, $option);
$resizeObj -> saveImage($save, 100);
}
public function getName($source){
$arr=pathinfo($source);
return $arr['filename'].'.'.$arr['extension'];
}
public function getDirImage($dir){
$arrdir=explode('/',$dir);
$arrdir= end($arrdir);
return $arrdir;
}
}
/* ****************************** End of upload class ************************** */ | 123gosaigon | trunk/ 123gosaigon/site/libraries/Upload.php | PHP | asf20 | 4,152 |
<?php
/*~ class.phpmailer.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.worxware.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.worxware.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP email transport class
* NOTE: Requires PHP version 5 or later
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @version $Id: class.phpmailer.php 447 2009-05-25 01:36:38Z codeworxtech $
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
*/
if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
class PHPMailer {
/////////////////////////////////////////////////
// PROPERTIES, PUBLIC
/////////////////////////////////////////////////
/**
* Email priority (1 = High, 3 = Normal, 5 = low).
* @var int
*/
public $Priority = 3;
/**
* Sets the CharSet of the message.
* @var string
*/
public $CharSet = 'utf-8';
/**
* Sets the Content-type of the message.
* @var string
*/
public $ContentType = 'text/plain';
/**
* Sets the Encoding of the message. Options for this are
* "8bit", "7bit", "binary", "base64", and "quoted-printable".
* @var string
*/
public $Encoding = '8bit';
/**
* Holds the most recent mailer error message.
* @var string
*/
public $ErrorInfo = '';
/**
* Sets the From email address for the message.
* @var string
*/
public $From = 'root@localhost';
/**
* Sets the From name of the message.
* @var string
*/
public $FromName = 'Root User';
/**
* Sets the Sender email (Return-Path) of the message. If not empty,
* will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
* @var string
*/
public $Sender = '';
/**
* Sets the Subject of the message.
* @var string
*/
public $Subject = '';
/**
* Sets the Body of the message. This can be either an HTML or text body.
* If HTML then run IsHTML(true).
* @var string
*/
public $Body = '';
/**
* Sets the text-only body of the message. This automatically sets the
* email to multipart/alternative. This body can be read by mail
* clients that do not have HTML email capability such as mutt. Clients
* that can read HTML will view the normal Body.
* @var string
*/
public $AltBody = '';
/**
* Sets word wrapping on the body of the message to a given number of
* characters.
* @var int
*/
public $WordWrap = 0;
/**
* Method to send mail: ("mail", "sendmail", or "smtp").
* @var string
*/
public $Mailer = 'mail';
/**
* Sets the path of the sendmail program.
* @var string
*/
public $Sendmail = '/usr/sbin/sendmail';
/**
* Path to PHPMailer plugins. Useful if the SMTP class
* is in a different directory than the PHP include path.
* @var string
*/
public $PluginDir = '';
/**
* Sets the email address that a reading confirmation will be sent.
* @var string
*/
public $ConfirmReadingTo = '';
/**
* Sets the hostname to use in Message-Id and Received headers
* and as default HELO string. If empty, the value returned
* by SERVER_NAME is used or 'localhost.localdomain'.
* @var string
*/
public $Hostname = '';
/**
* Sets the message ID to be used in the Message-Id header.
* If empty, a unique id will be generated.
* @var string
*/
public $MessageID = '';
/////////////////////////////////////////////////
// PROPERTIES FOR SMTP
/////////////////////////////////////////////////
/**
* Sets the SMTP hosts. All hosts must be separated by a
* semicolon. You can also specify a different port
* for each host by using this format: [hostname:port]
* (e.g. "smtp1.example.com:25;smtp2.example.com").
* Hosts will be tried in order.
* @var string
*/
public $Host = 'localhost';
/**
* Sets the default SMTP server port.
* @var int
*/
public $Port = 25;
/**
* Sets the SMTP HELO of the message (Default is $Hostname).
* @var string
*/
public $Helo = '';
/**
* Sets connection prefix.
* Options are "", "ssl" or "tls"
* @var string
*/
public $SMTPSecure = '';
/**
* Sets SMTP authentication. Utilizes the Username and Password variables.
* @var bool
*/
public $SMTPAuth = false;
/**
* Sets SMTP username.
* @var string
*/
public $Username = '';
/**
* Sets SMTP password.
* @var string
*/
public $Password = '';
/**
* Sets the SMTP server timeout in seconds.
* This function will not work with the win32 version.
* @var int
*/
public $Timeout = 10;
/**
* Sets SMTP class debugging on or off.
* @var bool
*/
public $SMTPDebug = false;
/**
* Prevents the SMTP connection from being closed after each mail
* sending. If this is set to true then to close the connection
* requires an explicit call to SmtpClose().
* @var bool
*/
public $SMTPKeepAlive = false;
/**
* Provides the ability to have the TO field process individual
* emails, instead of sending to entire TO addresses
* @var bool
*/
public $SingleTo = false;
/**
* If SingleTo is true, this provides the array to hold the email addresses
* @var bool
*/
public $SingleToArray = array();
/**
* Provides the ability to change the line ending
* @var string
*/
public $LE = "\n";
/**
* Used with DKIM DNS Resource Record
* @var string
*/
public $DKIM_selector = 'phpmailer';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_identity = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_domain = '';
/**
* Used with DKIM DNS Resource Record
* optional, in format of email address 'you@yourdomain.com'
* @var string
*/
public $DKIM_private = '';
/**
* Callback Action function name
* the function that handles the result of the send email action. Parameters:
* bool $result result of the send action
* string $to email address of the recipient
* string $cc cc email addresses
* string $bcc bcc email addresses
* string $subject the subject
* string $body the email body
* @var string
*/
public $action_function = ''; //'callbackAction';
/**
* Sets the PHPMailer Version number
* @var string
*/
public $Version = '5.1';
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $smtp = NULL;
private $to = array();
private $cc = array();
private $bcc = array();
private $ReplyTo = array();
private $all_recipients = array();
private $attachment = array();
private $CustomHeader = array();
private $message_type = '';
private $boundary = array();
protected $language = array();
private $error_count = 0;
private $sign_cert_file = "";
private $sign_key_file = "";
private $sign_key_pass = "";
private $exceptions = false;
/////////////////////////////////////////////////
// CONSTANTS
/////////////////////////////////////////////////
const STOP_MESSAGE = 0; // message only, continue processing
const STOP_CONTINUE = 1; // message?, likely ok to continue processing
const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
/////////////////////////////////////////////////
// METHODS, VARIABLES
/////////////////////////////////////////////////
/**
* Constructor
* @param boolean $exceptions Should we throw external exceptions?
*/
public function __construct($exceptions = false) {
$this->exceptions = ($exceptions == true);
}
/**
* Sets message type to HTML.
* @param bool $ishtml
* @return void
*/
public function IsHTML($ishtml = true) {
if ($ishtml) {
$this->ContentType = 'text/html';
} else {
$this->ContentType = 'text/plain';
}
}
/**
* Sets Mailer to send message using SMTP.
* @return void
*/
public function IsSMTP() {
$this->Mailer = 'smtp';
}
/**
* Sets Mailer to send message using PHP mail() function.
* @return void
*/
public function IsMail() {
$this->Mailer = 'mail';
}
/**
* Sets Mailer to send message using the $Sendmail program.
* @return void
*/
public function IsSendmail() {
if (!stristr(ini_get('sendmail_path'), 'sendmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
$this->Mailer = 'sendmail';
}
/**
* Sets Mailer to send message using the qmail MTA.
* @return void
*/
public function IsQmail() {
if (stristr(ini_get('sendmail_path'), 'qmail')) {
$this->Sendmail = '/var/qmail/bin/sendmail';
}
$this->Mailer = 'sendmail';
}
/////////////////////////////////////////////////
// METHODS, RECIPIENTS
/////////////////////////////////////////////////
/**
* Adds a "To" address.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddAddress($address, $name = '') {
return $this->AddAnAddress('to', $address, $name);
}
/**
* Adds a "Cc" address.
* Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddCC($address, $name = '') {
return $this->AddAnAddress('cc', $address, $name);
}
/**
* Adds a "Bcc" address.
* Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $name
* @return boolean true on success, false if address already used
*/
public function AddBCC($address, $name = '') {
return $this->AddAnAddress('bcc', $address, $name);
}
/**
* Adds a "Reply-to" address.
* @param string $address
* @param string $name
* @return boolean
*/
public function AddReplyTo($address, $name = '') {
return $this->AddAnAddress('ReplyTo', $address, $name);
}
/**
* Adds an address to one of the recipient arrays
* Addresses that have been added already return false, but do not throw exceptions
* @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
* @param string $address The email address to send to
* @param string $name
* @return boolean true on success, false if address already used or invalid in some way
* @access private
*/
private function AddAnAddress($kind, $address, $name = '') {
if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) {
echo 'Invalid recipient array: ' . kind;
return false;
}
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!self::ValidateAddress($address)) {
$this->SetError($this->Lang('invalid_address').': '. $address);
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
echo $this->Lang('invalid_address').': '.$address;
return false;
}
if ($kind != 'ReplyTo') {
if (!isset($this->all_recipients[strtolower($address)])) {
array_push($this->$kind, array($address, $name));
$this->all_recipients[strtolower($address)] = true;
return true;
}
} else {
if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
$this->ReplyTo[strtolower($address)] = array($address, $name);
return true;
}
}
return false;
}
/**
* Set the From and FromName properties
* @param string $address
* @param string $name
* @return boolean
*/
public function SetFrom($address, $name = '',$auto=1) {
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!self::ValidateAddress($address)) {
$this->SetError($this->Lang('invalid_address').': '. $address);
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
echo $this->Lang('invalid_address').': '.$address;
return false;
}
$this->From = $address;
$this->FromName = $name;
if ($auto) {
if (empty($this->ReplyTo)) {
$this->AddAnAddress('ReplyTo', $address, $name);
}
if (empty($this->Sender)) {
$this->Sender = $address;
}
}
return true;
}
/**
* Check that a string looks roughly like an email address should
* Static so it can be used without instantiation
* Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator
* Conforms approximately to RFC2822
* @link http://www.hexillion.com/samples/#Regex Original pattern found here
* @param string $address The email address to check
* @return boolean
* @static
* @access public
*/
public static function ValidateAddress($address) {
if (function_exists('filter_var')) { //Introduced in PHP 5.2
if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
return false;
} else {
return true;
}
} else {
return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
}
}
/////////////////////////////////////////////////
// METHODS, MAIL SENDING
/////////////////////////////////////////////////
/**
* Creates message and assigns Mailer. If the message is
* not sent successfully then it returns false. Use the ErrorInfo
* variable to view description of the error.
* @return bool
*/
public function Send() {
try {
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is multipart/alternative
if(!empty($this->AltBody)) {
$this->ContentType = 'multipart/alternative';
}
$this->error_count = 0; // reset errors
$this->SetMessageType();
$header = $this->CreateHeader();
$body = $this->CreateBody();
if (empty($this->Body)) {
throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL);
}
// digitally sign with DKIM if enabled
if ($this->DKIM_domain && $this->DKIM_private) {
$header_dkim = $this->DKIM_Add($header,$this->Subject,$body);
$header = str_replace("\r\n","\n",$header_dkim) . $header;
}
// Choose the mailer and send through it
switch($this->Mailer) {
case 'sendmail':
return $this->SendmailSend($header, $body);
case 'smtp':
return $this->SmtpSend($header, $body);
default:
return $this->MailSend($header, $body);
}
} catch (phpmailerException $e) {
$this->SetError($e->getMessage());
if ($this->exceptions) {
throw $e;
}
echo $e->getMessage()."\n";
return false;
}
}
/**
* Sends mail using the $Sendmail program.
* @param string $header The message headers
* @param string $body The message body
* @access protected
* @return bool
*/
protected function SendmailSend($header, $body) {
if ($this->Sender != '') {
$sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
} else {
$sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
}
if ($this->SingleTo === true) {
foreach ($this->SingleToArray as $key => $val) {
if(!@$mail = popen($sendmail, 'w')) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, "To: " . $val . "\n");
fputs($mail, $header);
fputs($mail, $body);
$result = pclose($mail);
// implement call back function if it exists
$isSent = ($result == 0) ? 1 : 0;
$this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
if($result != 0) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
} else {
if(!@$mail = popen($sendmail, 'w')) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
fputs($mail, $header);
fputs($mail, $body);
$result = pclose($mail);
// implement call back function if it exists
$isSent = ($result == 0) ? 1 : 0;
$this->doCallback($isSent,$this->to,$this->cc,$this->bcc,$this->Subject,$body);
if($result != 0) {
throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
}
return true;
}
/**
* Sends mail using the PHP mail() function.
* @param string $header The message headers
* @param string $body The message body
* @access protected
* @return bool
*/
protected function MailSend($header, $body) {
$toArr = array();
foreach($this->to as $t) {
$toArr[] = $this->AddrFormat($t);
}
$to = implode(', ', $toArr);
$params = sprintf("-oi -f %s", $this->Sender);
if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) {
$old_from = ini_get('sendmail_from');
ini_set('sendmail_from', $this->Sender);
if ($this->SingleTo === true && count($toArr) > 1) {
foreach ($toArr as $key => $val) {
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
// implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
}
} else {
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
// implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body);
}
} else {
if ($this->SingleTo === true && count($toArr) > 1) {
foreach ($toArr as $key => $val) {
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
// implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body);
}
} else {
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
// implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body);
}
}
if (isset($old_from)) {
ini_set('sendmail_from', $old_from);
}
if(!$rt) {
throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL);
}
return true;
}
/**
* Sends mail via SMTP using PhpSMTP
* Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
* @param string $header The message headers
* @param string $body The message body
* @uses SMTP
* @access protected
* @return bool
*/
protected function SmtpSend($header, $body) {
require_once $this->PluginDir . 'class.smtp.php';
$bad_rcpt = array();
if(!$this->SmtpConnect()) {
throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL);
}
$smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
if(!$this->smtp->Mail($smtp_from)) {
throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL);
}
// Attempt to send attach all recipients
foreach($this->to as $to) {
if (!$this->smtp->Recipient($to[0])) {
$bad_rcpt[] = $to[0];
// implement call back function if it exists
$isSent = 0;
$this->doCallback($isSent,$to[0],'','',$this->Subject,$body);
} else {
// implement call back function if it exists
$isSent = 1;
$this->doCallback($isSent,$to[0],'','',$this->Subject,$body);
}
}
foreach($this->cc as $cc) {
if (!$this->smtp->Recipient($cc[0])) {
$bad_rcpt[] = $cc[0];
// implement call back function if it exists
$isSent = 0;
$this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body);
} else {
// implement call back function if it exists
$isSent = 1;
$this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body);
}
}
foreach($this->bcc as $bcc) {
if (!$this->smtp->Recipient($bcc[0])) {
$bad_rcpt[] = $bcc[0];
// implement call back function if it exists
$isSent = 0;
$this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body);
} else {
// implement call back function if it exists
$isSent = 1;
$this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body);
}
}
if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses
$badaddresses = implode(', ', $bad_rcpt);
throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses);
}
if(!$this->smtp->Data($header . $body)) {
throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL);
}
if($this->SMTPKeepAlive == true) {
$this->smtp->Reset();
}
return true;
}
/**
* Initiates a connection to an SMTP server.
* Returns false if the operation failed.
* @uses SMTP
* @access public
* @return bool
*/
public function SmtpConnect() {
if(is_null($this->smtp)) {
$this->smtp = new SMTP();
}
$this->smtp->do_debug = $this->SMTPDebug;
$hosts = explode(';', $this->Host);
$index = 0;
$connection = $this->smtp->Connected();
// Retry while there is no connection
try {
while($index < count($hosts) && !$connection) {
$hostinfo = array();
if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
$port = $hostinfo[2];
} else {
$host = $hosts[$index];
$port = $this->Port;
}
$tls = ($this->SMTPSecure == 'tls');
$ssl = ($this->SMTPSecure == 'ssl');
if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) {
$hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname());
$this->smtp->Hello($hello);
if ($tls) {
if (!$this->smtp->StartTLS()) {
throw new phpmailerException($this->Lang('tls'));
}
//We must resend HELO after tls negotiation
$this->smtp->Hello($hello);
}
$connection = true;
if ($this->SMTPAuth) {
if (!$this->smtp->Authenticate($this->Username, $this->Password)) {
throw new phpmailerException($this->Lang('authenticate'));
}
}
}
$index++;
if (!$connection) {
throw new phpmailerException($this->Lang('connect_host'));
}
}
} catch (phpmailerException $e) {
$this->smtp->Reset();
throw $e;
}
return true;
}
/**
* Closes the active SMTP session if one exists.
* @return void
*/
public function SmtpClose() {
if(!is_null($this->smtp)) {
if($this->smtp->Connected()) {
$this->smtp->Quit();
$this->smtp->Close();
}
}
}
/**
* Sets the language for all class error messages.
* Returns false if it cannot load the language file. The default language is English.
* @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br")
* @param string $lang_path Path to the language file directory
* @access public
*/
function SetLanguage($langcode = 'en', $lang_path = 'language/') {
//Define full set of translatable strings
$PHPMAILER_LANG = array(
'provide_address' => 'You must provide at least one recipient email address.',
'mailer_not_supported' => ' mailer is not supported.',
'execute' => 'Could not execute: ',
'instantiate' => 'Could not instantiate mail function.',
'authenticate' => 'SMTP Error: Could not authenticate.',
'from_failed' => 'The following From address failed: ',
'recipients_failed' => 'SMTP Error: The following recipients failed: ',
'data_not_accepted' => 'SMTP Error: Data not accepted.',
'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
'file_access' => 'Could not access file: ',
'file_open' => 'File Error: Could not open file: ',
'encoding' => 'Unknown encoding: ',
'signing' => 'Signing Error: ',
'smtp_error' => 'SMTP server error: ',
'empty_message' => 'Message body empty',
'invalid_address' => 'Invalid address',
'variable_set' => 'Cannot set or reset variable: '
);
//Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"!
$l = true;
if ($langcode != 'en') { //There is no English translation file
$l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php';
}
$this->language = $PHPMAILER_LANG;
return ($l == true); //Returns false if language not found
}
/**
* Return the current array of language strings
* @return array
*/
public function GetTranslations() {
return $this->language;
}
/////////////////////////////////////////////////
// METHODS, MESSAGE CREATION
/////////////////////////////////////////////////
/**
* Creates recipient headers.
* @access public
* @return string
*/
public function AddrAppend($type, $addr) {
$addr_str = $type . ': ';
$addresses = array();
foreach ($addr as $a) {
$addresses[] = $this->AddrFormat($a);
}
$addr_str .= implode(', ', $addresses);
$addr_str .= $this->LE;
return $addr_str;
}
/**
* Formats an address correctly.
* @access public
* @return string
*/
public function AddrFormat($addr) {
if (empty($addr[1])) {
return $this->SecureHeader($addr[0]);
} else {
return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">";
}
}
/**
* Wraps message for use with mailers that do not
* automatically perform wrapping and for quoted-printable.
* Original written by philippe.
* @param string $message The message to wrap
* @param integer $length The line length to wrap to
* @param boolean $qp_mode Whether to run in Quoted-Printable mode
* @access public
* @return string
*/
public function WrapText($message, $length, $qp_mode = false) {
$soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE;
// If utf-8 encoding is used, we will need to make sure we don't
// split multibyte characters when we wrap
$is_utf8 = (strtolower($this->CharSet) == "utf-8");
$message = $this->FixEOL($message);
if (substr($message, -1) == $this->LE) {
$message = substr($message, 0, -1);
}
$line = explode($this->LE, $message);
$message = '';
for ($i=0 ;$i < count($line); $i++) {
$line_part = explode(' ', $line[$i]);
$buf = '';
for ($e = 0; $e<count($line_part); $e++) {
$word = $line_part[$e];
if ($qp_mode and (strlen($word) > $length)) {
$space_left = $length - strlen($buf) - 1;
if ($e != 0) {
if ($space_left > 20) {
$len = $space_left;
if ($is_utf8) {
$len = $this->UTF8CharBoundary($word, $len);
} elseif (substr($word, $len - 1, 1) == "=") {
$len--;
} elseif (substr($word, $len - 2, 1) == "=") {
$len -= 2;
}
$part = substr($word, 0, $len);
$word = substr($word, $len);
$buf .= ' ' . $part;
$message .= $buf . sprintf("=%s", $this->LE);
} else {
$message .= $buf . $soft_break;
}
$buf = '';
}
while (strlen($word) > 0) {
$len = $length;
if ($is_utf8) {
$len = $this->UTF8CharBoundary($word, $len);
} elseif (substr($word, $len - 1, 1) == "=") {
$len--;
} elseif (substr($word, $len - 2, 1) == "=") {
$len -= 2;
}
$part = substr($word, 0, $len);
$word = substr($word, $len);
if (strlen($word) > 0) {
$message .= $part . sprintf("=%s", $this->LE);
} else {
$buf = $part;
}
}
} else {
$buf_o = $buf;
$buf .= ($e == 0) ? $word : (' ' . $word);
if (strlen($buf) > $length and $buf_o != '') {
$message .= $buf_o . $soft_break;
$buf = $word;
}
}
}
$message .= $buf . $this->LE;
}
return $message;
}
/**
* Finds last character boundary prior to maxLength in a utf-8
* quoted (printable) encoded string.
* Original written by Colin Brown.
* @access public
* @param string $encodedText utf-8 QP text
* @param int $maxLength find last character boundary prior to this length
* @return int
*/
public function UTF8CharBoundary($encodedText, $maxLength) {
$foundSplitPos = false;
$lookBack = 3;
while (!$foundSplitPos) {
$lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
$encodedCharPos = strpos($lastChunk, "=");
if ($encodedCharPos !== false) {
// Found start of encoded character byte within $lookBack block.
// Check the encoded byte value (the 2 chars after the '=')
$hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
$dec = hexdec($hex);
if ($dec < 128) { // Single byte character.
// If the encoded char was found at pos 0, it will fit
// otherwise reduce maxLength to start of the encoded char
$maxLength = ($encodedCharPos == 0) ? $maxLength :
$maxLength - ($lookBack - $encodedCharPos);
$foundSplitPos = true;
} elseif ($dec >= 192) { // First byte of a multi byte character
// Reduce maxLength to split at start of character
$maxLength = $maxLength - ($lookBack - $encodedCharPos);
$foundSplitPos = true;
} elseif ($dec < 192) { // Middle byte of a multi byte character, look further back
$lookBack += 3;
}
} else {
// No encoded character found
$foundSplitPos = true;
}
}
return $maxLength;
}
/**
* Set the body wrapping.
* @access public
* @return void
*/
public function SetWordWrap() {
if($this->WordWrap < 1) {
return;
}
switch($this->message_type) {
case 'alt':
case 'alt_attachments':
$this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
break;
default:
$this->Body = $this->WrapText($this->Body, $this->WordWrap);
break;
}
}
/**
* Assembles message header.
* @access public
* @return string The assembled header
*/
public function CreateHeader() {
$result = '';
// Set the boundaries
$uniq_id = md5(uniqid(time()));
$this->boundary[1] = 'b1_' . $uniq_id;
$this->boundary[2] = 'b2_' . $uniq_id;
$result .= $this->HeaderLine('Date', self::RFCDate());
if($this->Sender == '') {
$result .= $this->HeaderLine('Return-Path', trim($this->From));
} else {
$result .= $this->HeaderLine('Return-Path', trim($this->Sender));
}
// To be created automatically by mail()
if($this->Mailer != 'mail') {
if ($this->SingleTo === true) {
foreach($this->to as $t) {
$this->SingleToArray[] = $this->AddrFormat($t);
}
} else {
if(count($this->to) > 0) {
$result .= $this->AddrAppend('To', $this->to);
} elseif (count($this->cc) == 0) {
$result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
}
}
}
$from = array();
$from[0][0] = trim($this->From);
$from[0][1] = $this->FromName;
$result .= $this->AddrAppend('From', $from);
// sendmail and mail() extract Cc from the header before sending
if(count($this->cc) > 0) {
$result .= $this->AddrAppend('Cc', $this->cc);
}
// sendmail and mail() extract Bcc from the header before sending
if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) {
$result .= $this->AddrAppend('Bcc', $this->bcc);
}
if(count($this->ReplyTo) > 0) {
$result .= $this->AddrAppend('Reply-to', $this->ReplyTo);
}
// mail() sets the subject itself
if($this->Mailer != 'mail') {
$result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
}
if($this->MessageID != '') {
$result .= $this->HeaderLine('Message-ID',$this->MessageID);
} else {
$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
}
$result .= $this->HeaderLine('X-Priority', $this->Priority);
$result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (phpmailer.sourceforge.net)');
if($this->ConfirmReadingTo != '') {
$result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
}
// Add custom headers
for($index = 0; $index < count($this->CustomHeader); $index++) {
$result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
}
if (!$this->sign_key_file) {
$result .= $this->HeaderLine('MIME-Version', '1.0');
$result .= $this->GetMailMIME();
}
return $result;
}
/**
* Returns the message MIME.
* @access public
* @return string
*/
public function GetMailMIME() {
$result = '';
switch($this->message_type) {
case 'plain':
$result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
$result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet);
break;
case 'attachments':
case 'alt_attachments':
if($this->InlineImageExists()){
$result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE);
} else {
$result .= $this->HeaderLine('Content-Type', 'multipart/mixed;');
$result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
}
break;
case 'alt':
$result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
$result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
break;
}
if($this->Mailer != 'mail') {
$result .= $this->LE.$this->LE;
}
return $result;
}
/**
* Assembles the message body. Returns an empty string on failure.
* @access public
* @return string The assembled message body
*/
public function CreateBody() {
$body = '';
if ($this->sign_key_file) {
$body .= $this->GetMailMIME();
}
$this->SetWordWrap();
switch($this->message_type) {
case 'alt':
$body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
$body .= $this->EncodeString($this->AltBody, $this->Encoding);
$body .= $this->LE.$this->LE;
$body .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
$body .= $this->EncodeString($this->Body, $this->Encoding);
$body .= $this->LE.$this->LE;
$body .= $this->EndBoundary($this->boundary[1]);
break;
case 'plain':
$body .= $this->EncodeString($this->Body, $this->Encoding);
break;
case 'attachments':
$body .= $this->GetBoundary($this->boundary[1], '', '', '');
$body .= $this->EncodeString($this->Body, $this->Encoding);
$body .= $this->LE;
$body .= $this->AttachAll();
break;
case 'alt_attachments':
$body .= sprintf("--%s%s", $this->boundary[1], $this->LE);
$body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
$body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
$body .= $this->EncodeString($this->AltBody, $this->Encoding);
$body .= $this->LE.$this->LE;
$body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
$body .= $this->EncodeString($this->Body, $this->Encoding);
$body .= $this->LE.$this->LE;
$body .= $this->EndBoundary($this->boundary[2]);
$body .= $this->AttachAll();
break;
}
if ($this->IsError()) {
$body = '';
} elseif ($this->sign_key_file) {
try {
$file = tempnam('', 'mail');
file_put_contents($file, $body); //TODO check this worked
$signed = tempnam("", "signed");
if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) {
@unlink($file);
@unlink($signed);
$body = file_get_contents($signed);
} else {
@unlink($file);
@unlink($signed);
throw new phpmailerException($this->Lang("signing").openssl_error_string());
}
} catch (phpmailerException $e) {
$body = '';
if ($this->exceptions) {
throw $e;
}
}
}
return $body;
}
/**
* Returns the start of a message boundary.
* @access private
*/
private function GetBoundary($boundary, $charSet, $contentType, $encoding) {
$result = '';
if($charSet == '') {
$charSet = $this->CharSet;
}
if($contentType == '') {
$contentType = $this->ContentType;
}
if($encoding == '') {
$encoding = $this->Encoding;
}
$result .= $this->TextLine('--' . $boundary);
$result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet);
$result .= $this->LE;
$result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
$result .= $this->LE;
return $result;
}
/**
* Returns the end of a message boundary.
* @access private
*/
private function EndBoundary($boundary) {
return $this->LE . '--' . $boundary . '--' . $this->LE;
}
/**
* Sets the message type.
* @access private
* @return void
*/
private function SetMessageType() {
if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {
$this->message_type = 'plain';
} else {
if(count($this->attachment) > 0) {
$this->message_type = 'attachments';
}
if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {
$this->message_type = 'alt';
}
if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {
$this->message_type = 'alt_attachments';
}
}
}
/**
* Returns a formatted header line.
* @access public
* @return string
*/
public function HeaderLine($name, $value) {
return $name . ': ' . $value . $this->LE;
}
/**
* Returns a formatted mail line.
* @access public
* @return string
*/
public function TextLine($value) {
return $value . $this->LE;
}
/////////////////////////////////////////////////
// CLASS METHODS, ATTACHMENTS
/////////////////////////////////////////////////
/**
* Adds an attachment from a path on the filesystem.
* Returns false if the file could not be found
* or accessed.
* @param string $path Path to the attachment.
* @param string $name Overrides the attachment name.
* @param string $encoding File encoding (see $Encoding).
* @param string $type File extension (MIME) type.
* @return bool
*/
public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
try {
if ( !@is_file($path) ) {
throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE);
}
$filename = basename($path);
if ( $name == '' ) {
$name = $filename;
}
$this->attachment[] = array(
0 => $path,
1 => $filename,
2 => $name,
3 => $encoding,
4 => $type,
5 => false, // isStringAttachment
6 => 'attachment',
7 => 0
);
} catch (phpmailerException $e) {
$this->SetError($e->getMessage());
if ($this->exceptions) {
throw $e;
}
echo $e->getMessage()."\n";
if ( $e->getCode() == self::STOP_CRITICAL ) {
return false;
}
}
return true;
}
/**
* Return the current array of attachments
* @return array
*/
public function GetAttachments() {
return $this->attachment;
}
/**
* Attaches all fs, string, and binary attachments to the message.
* Returns an empty string on failure.
* @access private
* @return string
*/
private function AttachAll() {
// Return text of body
$mime = array();
$cidUniq = array();
$incl = array();
// Add all attachments
foreach ($this->attachment as $attachment) {
// Check for string attachment
$bString = $attachment[5];
if ($bString) {
$string = $attachment[0];
} else {
$path = $attachment[0];
}
if (in_array($attachment[0], $incl)) { continue; }
$filename = $attachment[1];
$name = $attachment[2];
$encoding = $attachment[3];
$type = $attachment[4];
$disposition = $attachment[6];
$cid = $attachment[7];
$incl[] = $attachment[0];
if ( $disposition == 'inline' && isset($cidUniq[$cid]) ) { continue; }
$cidUniq[$cid] = true;
$mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
$mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
$mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
if($disposition == 'inline') {
$mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
}
$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
// Encode as string attachment
if($bString) {
$mime[] = $this->EncodeString($string, $encoding);
if($this->IsError()) {
return '';
}
$mime[] = $this->LE.$this->LE;
} else {
$mime[] = $this->EncodeFile($path, $encoding);
if($this->IsError()) {
return '';
}
$mime[] = $this->LE.$this->LE;
}
}
$mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
return join('', $mime);
}
/**
* Encodes attachment in requested format.
* Returns an empty string on failure.
* @param string $path The full path to the file
* @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
* @see EncodeFile()
* @access private
* @return string
*/
private function EncodeFile($path, $encoding = 'base64') {
try {
if (!is_readable($path)) {
throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
}
if (function_exists('get_magic_quotes')) {
function get_magic_quotes() {
return false;
}
}
if (PHP_VERSION < 6) {
$magic_quotes = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
}
$file_buffer = file_get_contents($path);
$file_buffer = $this->EncodeString($file_buffer, $encoding);
if (PHP_VERSION < 6) { set_magic_quotes_runtime($magic_quotes); }
return $file_buffer;
} catch (Exception $e) {
$this->SetError($e->getMessage());
return '';
}
}
/**
* Encodes string to requested format.
* Returns an empty string on failure.
* @param string $str The text to encode
* @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
* @access public
* @return string
*/
public function EncodeString ($str, $encoding = 'base64') {
$encoded = '';
switch(strtolower($encoding)) {
case 'base64':
$encoded = chunk_split(base64_encode($str), 76, $this->LE);
break;
case '7bit':
case '8bit':
$encoded = $this->FixEOL($str);
//Make sure it ends with a line break
if (substr($encoded, -(strlen($this->LE))) != $this->LE)
$encoded .= $this->LE;
break;
case 'binary':
$encoded = $str;
break;
case 'quoted-printable':
$encoded = $this->EncodeQP($str);
break;
default:
$this->SetError($this->Lang('encoding') . $encoding);
break;
}
return $encoded;
}
/**
* Encode a header string to best (shortest) of Q, B, quoted or none.
* @access public
* @return string
*/
public function EncodeHeader($str, $position = 'text') {
$x = 0;
switch (strtolower($position)) {
case 'phrase':
if (!preg_match('/[\200-\377]/', $str)) {
// Can't use addslashes as we don't know what value has magic_quotes_sybase
$encoded = addcslashes($str, "\0..\37\177\\\"");
if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
return ($encoded);
} else {
return ("\"$encoded\"");
}
}
$x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
break;
case 'comment':
$x = preg_match_all('/[()"]/', $str, $matches);
// Fall-through
case 'text':
default:
$x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
break;
}
if ($x == 0) {
return ($str);
}
$maxlen = 75 - 7 - strlen($this->CharSet);
// Try to select the encoding which should produce the shortest output
if (strlen($str)/3 < $x) {
$encoding = 'B';
if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
// Use a custom function which correctly encodes and wraps long
// multibyte strings without breaking lines within a character
$encoded = $this->Base64EncodeWrapMB($str);
} else {
$encoded = base64_encode($str);
$maxlen -= $maxlen % 4;
$encoded = trim(chunk_split($encoded, $maxlen, "\n"));
}
} else {
$encoding = 'Q';
$encoded = $this->EncodeQ($str, $position);
$encoded = $this->WrapText($encoded, $maxlen, true);
$encoded = str_replace('='.$this->LE, "\n", trim($encoded));
}
$encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
$encoded = trim(str_replace("\n", $this->LE, $encoded));
return $encoded;
}
/**
* Checks if a string contains multibyte characters.
* @access public
* @param string $str multi-byte text to wrap encode
* @return bool
*/
public function HasMultiBytes($str) {
if (function_exists('mb_strlen')) {
return (strlen($str) > mb_strlen($str, $this->CharSet));
} else { // Assume no multibytes (we can't handle without mbstring functions anyway)
return false;
}
}
/**
* Correctly encodes and wraps long multibyte strings for mail headers
* without breaking lines within a character.
* Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
* @access public
* @param string $str multi-byte text to wrap encode
* @return string
*/
public function Base64EncodeWrapMB($str) {
$start = "=?".$this->CharSet."?B?";
$end = "?=";
$encoded = "";
$mb_length = mb_strlen($str, $this->CharSet);
// Each line must have length <= 75, including $start and $end
$length = 75 - strlen($start) - strlen($end);
// Average multi-byte ratio
$ratio = $mb_length / strlen($str);
// Base64 has a 4:3 ratio
$offset = $avgLength = floor($length * $ratio * .75);
for ($i = 0; $i < $mb_length; $i += $offset) {
$lookBack = 0;
do {
$offset = $avgLength - $lookBack;
$chunk = mb_substr($str, $i, $offset, $this->CharSet);
$chunk = base64_encode($chunk);
$lookBack++;
}
while (strlen($chunk) > $length);
$encoded .= $chunk . $this->LE;
}
// Chomp the last linefeed
$encoded = substr($encoded, 0, -strlen($this->LE));
return $encoded;
}
/**
* Encode string to quoted-printable.
* Only uses standard PHP, slow, but will always work
* @access public
* @param string $string the text to encode
* @param integer $line_max Number of chars allowed on a line before wrapping
* @return string
*/
public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
$eol = "\r\n";
$escape = '=';
$output = '';
while( list(, $line) = each($lines) ) {
$linlen = strlen($line);
$newline = '';
for($i = 0; $i < $linlen; $i++) {
$c = substr( $line, $i, 1 );
$dec = ord( $c );
if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E
$c = '=2E';
}
if ( $dec == 32 ) {
if ( $i == ( $linlen - 1 ) ) { // convert space at eol only
$c = '=20';
} else if ( $space_conv ) {
$c = '=20';
}
} elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
$h2 = floor($dec/16);
$h1 = floor($dec%16);
$c = $escape.$hex[$h2].$hex[$h1];
}
if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
$output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
$newline = '';
// check if newline first character will be point or not
if ( $dec == 46 ) {
$c = '=2E';
}
}
$newline .= $c;
} // end of for
$output .= $newline.$eol;
} // end of while
return $output;
}
/**
* Encode string to RFC2045 (6.7) quoted-printable format
* Uses a PHP5 stream filter to do the encoding about 64x faster than the old version
* Also results in same content as you started with after decoding
* @see EncodeQPphp()
* @access public
* @param string $string the text to encode
* @param integer $line_max Number of chars allowed on a line before wrapping
* @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function
* @return string
* @author Marcus Bointon
*/
public function EncodeQP($string, $line_max = 76, $space_conv = false) {
if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3)
return quoted_printable_encode($string);
}
$filters = stream_get_filters();
if (!in_array('convert.*', $filters)) { //Got convert stream filter?
return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation
}
$fp = fopen('php://temp/', 'r+');
$string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks
$params = array('line-length' => $line_max, 'line-break-chars' => $this->LE);
$s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params);
fputs($fp, $string);
rewind($fp);
$out = stream_get_contents($fp);
stream_filter_remove($s);
$out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange
fclose($fp);
return $out;
}
/**
* Encode string to q encoding.
* @link http://tools.ietf.org/html/rfc2047
* @param string $str the text to encode
* @param string $position Where the text is going to be used, see the RFC for what that means
* @access public
* @return string
*/
public function EncodeQ ($str, $position = 'text') {
// There should not be any EOL in the string
$encoded = preg_replace('/[\r\n]*/', '', $str);
switch (strtolower($position)) {
case 'phrase':
$encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
break;
case 'comment':
$encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
case 'text':
default:
// Replace every high ascii, control =, ? and _ characters
//TODO using /e (equivalent to eval()) is probably not a good idea
$encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
"'='.sprintf('%02X', ord('\\1'))", $encoded);
break;
}
// Replace every spaces to _ (more readable than =20)
$encoded = str_replace(' ', '_', $encoded);
return $encoded;
}
/**
* Adds a string or binary attachment (non-filesystem) to the list.
* This method can be used to attach ascii or binary data,
* such as a BLOB record from a database.
* @param string $string String attachment data.
* @param string $filename Name of the attachment.
* @param string $encoding File encoding (see $Encoding).
* @param string $type File extension (MIME) type.
* @return void
*/
public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') {
// Append to $attachment array
$this->attachment[] = array(
0 => $string,
1 => $filename,
2 => basename($filename),
3 => $encoding,
4 => $type,
5 => true, // isStringAttachment
6 => 'attachment',
7 => 0
);
}
/**
* Adds an embedded attachment. This can include images, sounds, and
* just about any other document. Make sure to set the $type to an
* image type. For JPEG images use "image/jpeg" and for GIF images
* use "image/gif".
* @param string $path Path to the attachment.
* @param string $cid Content ID of the attachment. Use this to identify
* the Id for accessing the image in an HTML form.
* @param string $name Overrides the attachment name.
* @param string $encoding File encoding (see $Encoding).
* @param string $type File extension (MIME) type.
* @return bool
*/
public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
if ( !@is_file($path) ) {
$this->SetError($this->Lang('file_access') . $path);
return false;
}
$filename = basename($path);
if ( $name == '' ) {
$name = $filename;
}
// Append to $attachment array
$this->attachment[] = array(
0 => $path,
1 => $filename,
2 => $name,
3 => $encoding,
4 => $type,
5 => false, // isStringAttachment
6 => 'inline',
7 => $cid
);
return true;
}
/**
* Returns true if an inline attachment is present.
* @access public
* @return bool
*/
public function InlineImageExists() {
foreach($this->attachment as $attachment) {
if ($attachment[6] == 'inline') {
return true;
}
}
return false;
}
/////////////////////////////////////////////////
// CLASS METHODS, MESSAGE RESET
/////////////////////////////////////////////////
/**
* Clears all recipients assigned in the TO array. Returns void.
* @return void
*/
public function ClearAddresses() {
foreach($this->to as $to) {
unset($this->all_recipients[strtolower($to[0])]);
}
$this->to = array();
}
/**
* Clears all recipients assigned in the CC array. Returns void.
* @return void
*/
public function ClearCCs() {
foreach($this->cc as $cc) {
unset($this->all_recipients[strtolower($cc[0])]);
}
$this->cc = array();
}
/**
* Clears all recipients assigned in the BCC array. Returns void.
* @return void
*/
public function ClearBCCs() {
foreach($this->bcc as $bcc) {
unset($this->all_recipients[strtolower($bcc[0])]);
}
$this->bcc = array();
}
/**
* Clears all recipients assigned in the ReplyTo array. Returns void.
* @return void
*/
public function ClearReplyTos() {
$this->ReplyTo = array();
}
/**
* Clears all recipients assigned in the TO, CC and BCC
* array. Returns void.
* @return void
*/
public function ClearAllRecipients() {
$this->to = array();
$this->cc = array();
$this->bcc = array();
$this->all_recipients = array();
}
/**
* Clears all previously set filesystem, string, and binary
* attachments. Returns void.
* @return void
*/
public function ClearAttachments() {
$this->attachment = array();
}
/**
* Clears all custom headers. Returns void.
* @return void
*/
public function ClearCustomHeaders() {
$this->CustomHeader = array();
}
/////////////////////////////////////////////////
// CLASS METHODS, MISCELLANEOUS
/////////////////////////////////////////////////
/**
* Adds the error message to the error container.
* @access protected
* @return void
*/
protected function SetError($msg) {
$this->error_count++;
if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
$lasterror = $this->smtp->getError();
if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) {
$msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n";
}
}
$this->ErrorInfo = $msg;
}
/**
* Returns the proper RFC 822 formatted date.
* @access public
* @return string
* @static
*/
public static function RFCDate() {
$tz = date('Z');
$tzs = ($tz < 0) ? '-' : '+';
$tz = abs($tz);
$tz = (int)($tz/3600)*100 + ($tz%3600)/60;
$result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz);
return $result;
}
/**
* Returns the server hostname or 'localhost.localdomain' if unknown.
* @access private
* @return string
*/
private function ServerHostname() {
if (!empty($this->Hostname)) {
$result = $this->Hostname;
} elseif (isset($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} else {
$result = 'localhost.localdomain';
}
return $result;
}
/**
* Returns a message in the appropriate language.
* @access private
* @return string
*/
private function Lang($key) {
if(count($this->language) < 1) {
$this->SetLanguage('en'); // set the default language
}
if(isset($this->language[$key])) {
return $this->language[$key];
} else {
return 'Language string failed to load: ' . $key;
}
}
/**
* Returns true if an error occurred.
* @access public
* @return bool
*/
public function IsError() {
return ($this->error_count > 0);
}
/**
* Changes every end of line from CR or LF to CRLF.
* @access private
* @return string
*/
private function FixEOL($str) {
$str = str_replace("\r\n", "\n", $str);
$str = str_replace("\r", "\n", $str);
$str = str_replace("\n", $this->LE, $str);
return $str;
}
/**
* Adds a custom header.
* @access public
* @return void
*/
public function AddCustomHeader($custom_header) {
$this->CustomHeader[] = explode(':', $custom_header, 2);
}
/**
* Evaluates the message and returns modifications for inline images and backgrounds
* @access public
* @return $message
*/
public function MsgHTML($message, $basedir = '') {
preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images);
if(isset($images[2])) {
foreach($images[2] as $i => $url) {
// do not change urls for absolute images (thanks to corvuscorax)
if (!preg_match('#^[A-z]+://#',$url)) {
$filename = basename($url);
$directory = dirname($url);
($directory == '.')?$directory='':'';
$cid = 'cid:' . md5($filename);
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$mimeType = self::_mime_types($ext);
if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
$message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
}
}
}
}
$this->IsHTML(true);
$this->Body = $message;
$textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
if (!empty($textMsg) && empty($this->AltBody)) {
$this->AltBody = html_entity_decode($textMsg);
}
if (empty($this->AltBody)) {
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n";
}
}
/**
* Gets the MIME type of the embedded or inline image
* @param string File extension
* @access public
* @return string MIME type of ext
* @static
*/
public static function _mime_types($ext = '') {
$mimes = array(
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'doc' => 'application/msword',
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'class' => 'application/octet-stream',
'psd' => 'application/octet-stream',
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => 'application/pdf',
'ai' => 'application/postscript',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
'wbxml' => 'application/vnd.wap.wbxml',
'wmlc' => 'application/vnd.wap.wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => 'application/x-javascript',
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => 'application/x-tar',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => 'application/zip',
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => 'audio/mpeg',
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => 'audio/x-wav',
'bmp' => 'image/bmp',
'gif' => 'image/gif',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'jpe' => 'image/jpeg',
'png' => 'image/png',
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'css' => 'text/css',
'html' => 'text/html',
'htm' => 'text/html',
'shtml' => 'text/html',
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => 'text/plain',
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => 'text/xml',
'xsl' => 'text/xml',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'word' => 'application/msword',
'xl' => 'application/excel',
'eml' => 'message/rfc822'
);
return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
}
/**
* Set (or reset) Class Objects (variables)
*
* Usage Example:
* $page->set('X-Priority', '3');
*
* @access public
* @param string $name Parameter Name
* @param mixed $value Parameter Value
* NOTE: will not work with arrays, there are no arrays to set/reset
* @todo Should this not be using __set() magic function?
*/
public function set($name, $value = '') {
try {
if (isset($this->$name) ) {
$this->$name = $value;
} else {
throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL);
}
} catch (Exception $e) {
$this->SetError($e->getMessage());
if ($e->getCode() == self::STOP_CRITICAL) {
return false;
}
}
return true;
}
/**
* Strips newlines to prevent header injection.
* @access public
* @param string $str String
* @return string
*/
public function SecureHeader($str) {
$str = str_replace("\r", '', $str);
$str = str_replace("\n", '', $str);
return trim($str);
}
/**
* Set the private key file and password to sign the message.
*
* @access public
* @param string $key_filename Parameter File Name
* @param string $key_pass Password for private key
*/
public function Sign($cert_filename, $key_filename, $key_pass) {
$this->sign_cert_file = $cert_filename;
$this->sign_key_file = $key_filename;
$this->sign_key_pass = $key_pass;
}
/**
* Set the private key file and password to sign the message.
*
* @access public
* @param string $key_filename Parameter File Name
* @param string $key_pass Password for private key
*/
public function DKIM_QP($txt) {
$tmp="";
$line="";
for ($i=0;$i<strlen($txt);$i++) {
$ord=ord($txt[$i]);
if ( ((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E)) ) {
$line.=$txt[$i];
} else {
$line.="=".sprintf("%02X",$ord);
}
}
return $line;
}
/**
* Generate DKIM signature
*
* @access public
* @param string $s Header
*/
public function DKIM_Sign($s) {
$privKeyStr = file_get_contents($this->DKIM_private);
if ($this->DKIM_passphrase!='') {
$privKey = openssl_pkey_get_private($privKeyStr,$this->DKIM_passphrase);
} else {
$privKey = $privKeyStr;
}
if (openssl_sign($s, $signature, $privKey)) {
return base64_encode($signature);
}
}
/**
* Generate DKIM Canonicalization Header
*
* @access public
* @param string $s Header
*/
public function DKIM_HeaderC($s) {
$s=preg_replace("/\r\n\s+/"," ",$s);
$lines=explode("\r\n",$s);
foreach ($lines as $key=>$line) {
list($heading,$value)=explode(":",$line,2);
$heading=strtolower($heading);
$value=preg_replace("/\s+/"," ",$value) ; // Compress useless spaces
$lines[$key]=$heading.":".trim($value) ; // Don't forget to remove WSP around the value
}
$s=implode("\r\n",$lines);
return $s;
}
/**
* Generate DKIM Canonicalization Body
*
* @access public
* @param string $body Message Body
*/
public function DKIM_BodyC($body) {
if ($body == '') return "\r\n";
// stabilize line endings
$body=str_replace("\r\n","\n",$body);
$body=str_replace("\n","\r\n",$body);
// END stabilize line endings
while (substr($body,strlen($body)-4,4) == "\r\n\r\n") {
$body=substr($body,0,strlen($body)-2);
}
return $body;
}
/**
* Create the DKIM header, body, as new header
*
* @access public
* @param string $headers_line Header lines
* @param string $subject Subject
* @param string $body Body
*/
public function DKIM_Add($headers_line,$subject,$body) {
$DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
$DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
$DKIMquery = 'dns/txt'; // Query method
$DKIMtime = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
$subject_header = "Subject: $subject";
$headers = explode("\r\n",$headers_line);
foreach($headers as $header) {
if (strpos($header,'From:') === 0) {
$from_header=$header;
} elseif (strpos($header,'To:') === 0) {
$to_header=$header;
}
}
$from = str_replace('|','=7C',$this->DKIM_QP($from_header));
$to = str_replace('|','=7C',$this->DKIM_QP($to_header));
$subject = str_replace('|','=7C',$this->DKIM_QP($subject_header)) ; // Copied header fields (dkim-quoted-printable
$body = $this->DKIM_BodyC($body);
$DKIMlen = strlen($body) ; // Length of body
$DKIMb64 = base64_encode(pack("H*", sha1($body))) ; // Base64 of packed binary SHA-1 hash of body
$ident = ($this->DKIM_identity == '')? '' : " i=" . $this->DKIM_identity . ";";
$dkimhdrs = "DKIM-Signature: v=1; a=" . $DKIMsignatureType . "; q=" . $DKIMquery . "; l=" . $DKIMlen . "; s=" . $this->DKIM_selector . ";\r\n".
"\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n".
"\th=From:To:Subject;\r\n".
"\td=" . $this->DKIM_domain . ";" . $ident . "\r\n".
"\tz=$from\r\n".
"\t|$to\r\n".
"\t|$subject;\r\n".
"\tbh=" . $DKIMb64 . ";\r\n".
"\tb=";
$toSign = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs);
$signed = $this->DKIM_Sign($toSign);
return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n";
}
protected function doCallback($isSent,$to,$cc,$bcc,$subject,$body) {
if (!empty($this->action_function) && function_exists($this->action_function)) {
$params = array($isSent,$to,$cc,$bcc,$subject,$body);
call_user_func_array($this->action_function,$params);
}
}
}
class phpmailerException extends Exception {
public function errorMessage() {
$errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
return $errorMsg;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/libraries/class.phpmailer.php | PHP | asf20 | 76,840 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
/**
* Pagination Class
*
* @package CodeIgniter
* @subpackage Libraries
* @category Pagination
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/libraries/pagination.html
*/
class MY_Pagination {
var $base_url = ''; // The page we are linking to
var $prefix = ''; // A custom prefix added to the path.
var $suffix = ''; // A custom suffix added to the path.
var $total_rows = 0; // Total number of items (database results)
var $per_page = 10; // Max number of items you want shown per page
var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
var $cur_page = 0; // The current page being viewed
var $use_page_numbers = FALSE; // Use page number for segment instead of offset
var $first_link = '‹ First';
var $next_link = '>';
var $prev_link = '<';
var $last_link = 'Last ›';
var $uri_segment = 3;
var $full_tag_open = '';
var $full_tag_close = '';
var $first_tag_open = '';
var $first_tag_close = ' ';
var $last_tag_open = ' ';
var $last_tag_close = '';
var $first_url = ''; // Alternative URL for the First Page.
var $cur_tag_open = ' <strong>';
var $cur_tag_close = '</strong>';
var $next_tag_open = ' ';
var $next_tag_close = ' ';
var $prev_tag_open = ' ';
var $prev_tag_close = '';
var $num_tag_open = ' ';
var $num_tag_close = '';
var $page_query_string = FALSE;
var $query_string_segment = 'per_page';
var $display_pages = TRUE;
var $anchor_class = '';
var $alias = 'ASA';
/**
* Constructor
*
* @access public
* @param array initialization parameters
*/
public function __construct($params = array())
{
if (count($params) > 0)
{
$this->initialize($params);
}
if ($this->anchor_class != '')
{
$this->anchor_class = 'class="'.$this->anchor_class.'" ';
}
log_message('debug', "Pagination Class Initialized");
}
// --------------------------------------------------------------------
/**
* Initialize Preferences
*
* @access public
* @param array initialization parameters
* @return void
*/
function initialize($params = array())
{
if (count($params) > 0)
{
foreach ($params as $key => $val)
{
if (isset($this->$key))
{
$this->$key = $val;
}
}
}
}
// --------------------------------------------------------------------
/**
* Generate the pagination links
*
* @access public
* @return string
*/
function create_links()
{
// If our item count or per-page total is zero there is no need to continue.
if ($this->total_rows == 0 OR $this->per_page == 0)
{
return '';
}
// Calculate the total number of pages
$num_pages = ceil($this->total_rows / $this->per_page);
// Is there only one page? Hm... nothing more to do here then.
if ($num_pages == 1)
{
return '';
}
// Set the base page index for starting page number
if ($this->use_page_numbers)
{
$base_page = 1;
}
else
{
$base_page = 0;
}
// Determine the current page number.
$CI =& get_instance();
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
if ($CI->input->get($this->query_string_segment) != $base_page)
{
$this->cur_page = $CI->input->get($this->query_string_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
else
{
if ($CI->uri->segment($this->uri_segment) != $base_page)
{
$this->cur_page = $CI->uri->segment($this->uri_segment);
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
// Set current page to 1 if using page numbers instead of offset
if ($this->use_page_numbers AND $this->cur_page == 0)
{
$this->cur_page = $base_page;
}
$this->num_links = (int)$this->num_links;
if ($this->num_links < 1)
{
show_error('Your number of links must be a positive number.');
}
if ( ! is_numeric($this->cur_page))
{
$this->cur_page = $base_page;
}
// Is the page number beyond the result range?
// If so we show the last page
if ($this->use_page_numbers)
{
if ($this->cur_page > $num_pages)
{
$this->cur_page = $num_pages;
}
}
else
{
if ($this->cur_page > $this->total_rows)
{
$this->cur_page = ($num_pages - 1) * $this->per_page;
}
}
$uri_page_number = $this->cur_page;
if ( ! $this->use_page_numbers)
{
$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
}
// Calculate the start and end numbers. These determine
// which number to start and end the digit links with
$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;
$end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;
// Is pagination being used over GET or POST? If get, add a per_page query
// string. If post, add a trailing slash to the base URL if needed
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
$this->base_url = rtrim($this->base_url).'&'.$this->query_string_segment.'=';
}
else
{
$this->base_url = rtrim($this->base_url, '/') .'/';
}
// And here we go...
$output = '';
// Render the "First" link
if ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))
{
$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;
$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
}
// Render the "previous" link
if ($this->prev_link !== FALSE AND $this->cur_page != 1)
{
if ($this->use_page_numbers)
{
$i = $uri_page_number - 1;
}
else
{
$i = $uri_page_number - $this->per_page;
}
if ($i == 0 && $this->first_url != '')
{
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
else
{
$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
}
}
// Render the pages
if ($this->display_pages !== FALSE)
{
// Write the digit links
for ($loop = $start -1; $loop <= $end; $loop++)
{
if ($this->use_page_numbers)
{
$i = $loop;
}
else
{
$i = ($loop * $this->per_page) - $this->per_page;
}
if ($i >= $base_page)
{
if ($this->cur_page == $loop)
{
$output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page
}
else
{
$n = ($i == $base_page) ? '' : $i;
if ($n == '' && $this->first_url != '')
{
$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
}
else
{
$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;
$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$n.'/'.$this->alias.'">'.$loop.'</a>'.$this->num_tag_close;
}
}
}
}
}
// Render the "next" link
if ($this->next_link !== FALSE AND $this->cur_page < $num_pages)
{
if ($this->use_page_numbers)
{
$i = $this->cur_page + 1;
}
else
{
$i = ($this->cur_page * $this->per_page);
}
$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
}
// Render the "Last" link
if ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)
{
if ($this->use_page_numbers)
{
$i = $num_pages;
}
else
{
$i = (($num_pages * $this->per_page) - $this->per_page);
}
$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
}
// Kill double slashes. Note: Sometimes we can end up with a double slash
// in the penultimate link so we'll kill all double slashes.
$output = preg_replace("#([^:])//+#", "\\1/", $output);
// Add the wrapper HTML if exists
$output = $this->full_tag_open.$output.$this->full_tag_close;
return $output;
}
}
// END Pagination Class
/* End of file Pagination.php */
/* Location: ./system/libraries/Pagination.php */ | 123gosaigon | trunk/ 123gosaigon/site/libraries/MY_Pagination.php | PHP | asf20 | 9,434 |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Google
{
private $google_client_id;
private $google_client_secret;
private $google_redirect_url;
private $google_developer_key;
private $google_app_name;
public function __construct()
{
/*if (!isset($this->CI))
{
$this->CI =& get_instance();
}*/
$this->google_client_id=CLIENT_ID;
$this->google_client_secret=CLIENT_SECRET;
$this->google_redirect_url=REDIRECT_URL;
$this->google_developer_key=DEV_KEY;
$this->google_app_name=SET_APP_NAME;
}
// thiet lap cac giatri cho app
public function setGoClent(){
//include google api files
require_once APPPATH.'libraries/libgoogle/Google_Client.php';
require_once APPPATH.'libraries/libgoogle/contrib/Google_Oauth2Service.php';
$gClient = new Google_Client();
$gClient->setApplicationName($this->google_app_name);
$gClient->setClientId($this->google_client_id);
$gClient->setClientSecret($this->google_client_secret);
$gClient->setRedirectUri($this->google_redirect_url);
$gClient->setDeveloperKey($this->google_developer_key);
return $gClient;
}
// xu ly login
public function OauthService(){
$gClient=$this->setGoClent();
$google_oauthV2 = new Google_Oauth2Service($gClient);
//If code is empty, redirect user to google authentication page for code.
// get param code from button login
if (isset($_GET['code']))
{
$gClient->authenticate($_GET['code']);
$_SESSION['token'] = $gClient->getAccessToken();
header('Location: ' . filter_var($this->google_redirect_url, FILTER_SANITIZE_URL));
return;
}
//Code is required to aquire Access Token from google
//Once we have access token, assign token to session variable
//and we can redirect user back to page and login.
if ($gClient->getAccessToken())
{
$arrUser=array();
//For logged in user, get details from google using access token
$user = $google_oauthV2->userinfo->get();
$arrUser['id'] = $user['id'];
$arrUser['name'] = filter_var($user['name'], FILTER_SANITIZE_SPECIAL_CHARS);
$arrUser['email'] = filter_var($user['email'], FILTER_SANITIZE_EMAIL);
$arrUser['url'] = filter_var($user['link'], FILTER_VALIDATE_URL);
$arrUser['image'] = filter_var($user['picture'], FILTER_VALIDATE_URL);
$arrUser['personMarkup'] = "$email<div><img src='$profile_image_url?sz=50'></div>";
$_SESSION['token'] = $gClient->getAccessToken();
return $arrUser;
}
}
public function createAuthUrl(){
//For Guest user, get google login url
$gClient=$this->setGoClent();
$authUrl = $gClient->createAuthUrl();
return $authUrl;
}
public function Logout(){
$gClient = new Google_Client();
//If user wish to log out, we just unset Session variable
if (isset($_REQUEST['reset']))
{
unset($_SESSION['token']);
$gClient->revokeToken();
header('Location: ' . filter_var($this->google_redirect_url, FILTER_SANITIZE_URL)); //redirect user back to page
}
}
//
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/Google.php | PHP | asf20 | 3,140 |
<?php
/*~ class.smtp.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
| ------------------------------------------------------------------------- |
| Admin: Andy Prevost (project admininistrator) |
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
| Founder: Brent R. Matzelle (original founder) |
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
| Copyright (c) 2001-2003, Brent R. Matzelle |
| ------------------------------------------------------------------------- |
| License: Distributed under the Lesser General Public License (LGPL) |
| http://www.gnu.org/copyleft/lesser.html |
| This program is distributed in the hope that it will be useful - WITHOUT |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| FITNESS FOR A PARTICULAR PURPOSE. |
| ------------------------------------------------------------------------- |
| We offer a number of paid services (www.codeworxtech.com): |
| - Web Hosting on highly optimized fast and secure servers |
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP SMTP email transport class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2008 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $
*/
/**
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
* commands except TURN which will always return a not implemented
* error. SMTP also provides some utility methods for sending mail
* to an SMTP server.
* original author: Chris Ryan
*/
class SMTP {
/**
* SMTP server port
* @var int
*/
public $SMTP_PORT = 25;
/**
* SMTP reply line ending
* @var string
*/
public $CRLF = "\r\n";
/**
* Sets whether debugging is turned on
* @var bool
*/
public $do_debug; // the level of debug to perform
/**
* Sets VERP use on/off (default is off)
* @var bool
*/
public $do_verp = false;
/////////////////////////////////////////////////
// PROPERTIES, PRIVATE AND PROTECTED
/////////////////////////////////////////////////
private $smtp_conn; // the socket to the server
private $error; // error if any on the last call
private $helo_rply; // the reply the server sent to us for HELO
/**
* Initialize the class so that the data is in a known state.
* @access public
* @return void
*/
public function __construct() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;
$this->do_debug = 0;
}
/////////////////////////////////////////////////
// CONNECTION FUNCTIONS
/////////////////////////////////////////////////
/**
* Connect to the server specified on the port specified.
* If the port is not specified use the default SMTP_PORT.
* If tval is specified then a connection will try and be
* established with the server for that number of seconds.
* If tval is not specified the default is 30 seconds to
* try on the connection.
*
* SMTP CODE SUCCESS: 220
* SMTP CODE FAILURE: 421
* @access public
* @return bool
*/
public function Connect($host, $port = 0, $tval = 30) {
// set the error val to null so there is no confusion
$this->error = null;
// make sure we are __not__ connected
if($this->connected()) {
// already connected, generate error
$this->error = array("error" => "Already connected to a server");
return false;
}
if(empty($port)) {
$port = $this->SMTP_PORT;
}
// connect to the smtp server
$this->smtp_conn = @fsockopen($host, // the host of the server
$port, // the port to use
$errno, // error number if any
$errstr, // error message if any
$tval); // give up after ? secs
// verify we connected properly
if(empty($this->smtp_conn)) {
$this->error = array("error" => "Failed to connect to server",
"errno" => $errno,
"errstr" => $errstr);
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
}
return false;
}
// SMTP server can take longer to respond, give longer timeout for first read
// Windows does not have support for this timeout function
if(substr(PHP_OS, 0, 3) != "WIN")
socket_set_timeout($this->smtp_conn, $tval, 0);
// get any announcement
$announce = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
}
return true;
}
/**
* Initiate a TLS communication with the server.
*
* SMTP CODE 220 Ready to start TLS
* SMTP CODE 501 Syntax error (no parameters allowed)
* SMTP CODE 454 TLS not available due to temporary reason
* @access public
* @return bool success
*/
public function StartTLS() {
$this->error = null; # to avoid confusion
if(!$this->connected()) {
$this->error = array("error" => "Called StartTLS() without being connected");
return false;
}
fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 220) {
$this->error =
array("error" => "STARTTLS not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Begin encrypted connection
if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
return false;
}
return true;
}
/**
* Performs SMTP authentication. Must be run after running the
* Hello() method. Returns true if successfully authenticated.
* @access public
* @return bool
*/
public function Authenticate($username, $password) {
// Start authentication
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "AUTH not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded username
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 334) {
$this->error =
array("error" => "Username not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
// Send encoded password
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($code != 235) {
$this->error =
array("error" => "Password not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Returns true if connected to a server otherwise false
* @access public
* @return bool
*/
public function Connected() {
if(!empty($this->smtp_conn)) {
$sock_status = socket_get_status($this->smtp_conn);
if($sock_status["eof"]) {
// the socket is valid but we are not connected
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
}
$this->Close();
return false;
}
return true; // everything looks good
}
return false;
}
/**
* Closes the socket and cleans up the state of the class.
* It is not considered good to use this function without
* first trying to use QUIT.
* @access public
* @return void
*/
public function Close() {
$this->error = null; // so there is no confusion
$this->helo_rply = null;
if(!empty($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
$this->smtp_conn = 0;
}
}
/////////////////////////////////////////////////
// SMTP COMMANDS
/////////////////////////////////////////////////
/**
* Issues a data command and sends the msg_data to the server
* finializing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being seperated by and additional <CRLF>.
*
* Implements rfc 821: DATA <CRLF>
*
* SMTP CODE INTERMEDIATE: 354
* [data]
* <CRLF>.<CRLF>
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 552,554,451,452
* SMTP CODE FAILURE: 451,554
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Data($msg_data) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Data() without being connected");
return false;
}
fputs($this->smtp_conn,"DATA" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 354) {
$this->error =
array("error" => "DATA command not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
/* the server is ready to accept data!
* according to rfc 821 we should not send more than 1000
* including the CRLF
* characters on a single line so we will break the data up
* into lines by \r and/or \n then if needed we will break
* each of those into smaller lines to fit within the limit.
* in addition we will be looking for lines that start with
* a period '.' and append and additional period '.' to that
* line. NOTE: this does not count towards limit.
*/
// normalize the line breaks so we know the explode works
$msg_data = str_replace("\r\n","\n",$msg_data);
$msg_data = str_replace("\r","\n",$msg_data);
$lines = explode("\n",$msg_data);
/* we need to find a good way to determine is headers are
* in the msg_data or if it is a straight msg body
* currently I am assuming rfc 822 definitions of msg headers
* and if the first field of the first line (':' sperated)
* does not contain a space then it _should_ be a header
* and we can process all lines before a blank "" line as
* headers.
*/
$field = substr($lines[0],0,strpos($lines[0],":"));
$in_headers = false;
if(!empty($field) && !strstr($field," ")) {
$in_headers = true;
}
$max_line_length = 998; // used below; set here for ease in change
while(list(,$line) = @each($lines)) {
$lines_out = null;
if($line == "" && $in_headers) {
$in_headers = false;
}
// ok we need to break this line up into several smaller lines
while(strlen($line) > $max_line_length) {
$pos = strrpos(substr($line,0,$max_line_length)," ");
// Patch to fix DOS attack
if(!$pos) {
$pos = $max_line_length - 1;
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos);
} else {
$lines_out[] = substr($line,0,$pos);
$line = substr($line,$pos + 1);
}
/* if processing headers add a LWSP-char to the front of new line
* rfc 822 on long msg headers
*/
if($in_headers) {
$line = "\t" . $line;
}
}
$lines_out[] = $line;
// send the lines to the server
while(list(,$line_out) = @each($lines_out)) {
if(strlen($line_out) > 0)
{
if(substr($line_out, 0, 1) == ".") {
$line_out = "." . $line_out;
}
}
fputs($this->smtp_conn,$line_out . $this->CRLF);
}
}
// message data has been sent
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "DATA not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the HELO command to the smtp server.
* This makes sure that we and the server are in
* the same known state.
*
* Implements from rfc 821: HELO <SP> <domain> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500, 501, 504, 421
* @access public
* @return bool
*/
public function Hello($host = '') {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
return false;
}
// if hostname for HELO was not specified send default
if(empty($host)) {
// determine appropriate default to send to server
$host = "localhost";
}
// Send extended hello first (RFC 2821)
if(!$this->SendHello("EHLO", $host)) {
if(!$this->SendHello("HELO", $host)) {
return false;
}
}
return true;
}
/**
* Sends a HELO/EHLO command.
* @access private
* @return bool
*/
private function SendHello($hello, $host) {
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => $hello . " not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
$this->helo_rply = $rply;
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command.
*
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,421
* @access public
* @return bool
*/
public function Mail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Mail() without being connected");
return false;
}
$useVerp = ($this->do_verp ? "XVERP" : "");
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "MAIL not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the quit command to the server and then closes the socket
* if there is no error or the $close_on_error argument is true.
*
* Implements from rfc 821: QUIT <CRLF>
*
* SMTP CODE SUCCESS: 221
* SMTP CODE ERROR : 500
* @access public
* @return bool
*/
public function Quit($close_on_error = true) {
$this->error = null; // so there is no confusion
if(!$this->connected()) {
$this->error = array(
"error" => "Called Quit() without being connected");
return false;
}
// send the quit command to the server
fputs($this->smtp_conn,"quit" . $this->CRLF);
// get any good-bye messages
$byemsg = $this->get_lines();
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
}
$rval = true;
$e = null;
$code = substr($byemsg,0,3);
if($code != 221) {
// use e as a tmp var cause Close will overwrite $this->error
$e = array("error" => "SMTP server rejected quit command",
"smtp_code" => $code,
"smtp_rply" => substr($byemsg,4));
$rval = false;
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
}
}
if(empty($e) || $close_on_error) {
$this->Close();
}
return $rval;
}
/**
* Sends the command RCPT to the SMTP server with the TO: argument of $to.
* Returns true if the recipient was accepted false if it was rejected.
*
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
*
* SMTP CODE SUCCESS: 250,251
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
* SMTP CODE ERROR : 500,501,503,421
* @access public
* @return bool
*/
public function Recipient($to) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Recipient() without being connected");
return false;
}
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250 && $code != 251) {
$this->error =
array("error" => "RCPT not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Sends the RSET command to abort and transaction that is
* currently in progress. Returns true if successful false
* otherwise.
*
* Implements rfc 821: RSET <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE ERROR : 500,501,504,421
* @access public
* @return bool
*/
public function Reset() {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
return false;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "RSET failed",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more Recipient
* commands may be called followed by a Data command. This command
* will send the message to the users terminal if they are logged
* in and send them an email.
*
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE SUCCESS: 552,451,452
* SMTP CODE SUCCESS: 500,501,502,421
* @access public
* @return bool
*/
public function SendAndMail($from) {
$this->error = null; // so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called SendAndMail() without being connected");
return false;
}
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
$rply = $this->get_lines();
$code = substr($rply,0,3);
if($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
}
if($code != 250) {
$this->error =
array("error" => "SAML not accepted from server",
"smtp_code" => $code,
"smtp_msg" => substr($rply,4));
if($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
}
return false;
}
return true;
}
/**
* This is an optional command for SMTP that this class does not
* support. This method is here to make the RFC821 Definition
* complete for this class and __may__ be implimented in the future
*
* Implements from rfc 821: TURN <CRLF>
*
* SMTP CODE SUCCESS: 250
* SMTP CODE FAILURE: 502
* SMTP CODE ERROR : 500, 503
* @access public
* @return bool
*/
public function Turn() {
$this->error = array("error" => "This method, TURN, of the SMTP ".
"is not implemented");
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
}
return false;
}
/**
* Get the current error
* @access public
* @return array
*/
public function getError() {
return $this->error;
}
/////////////////////////////////////////////////
// INTERNAL FUNCTIONS
/////////////////////////////////////////////////
/**
* Read in as many lines as possible
* either before eof or socket timeout occurs on the operation.
* With SMTP we can tell if we have more lines to read if the
* 4th character is '-' symbol. If it is a space then we don't
* need to read anything else.
* @access private
* @return string
*/
private function get_lines() {
$data = "";
while($str = @fgets($this->smtp_conn,515)) {
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
}
$data .= $str;
if($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
}
// if 4th character is a space, we are done reading, break the loop
if(substr($str,3,1) == " ") { break; }
}
return $data;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/libraries/class.smtp.php | PHP | asf20 | 25,613 |
<?php
/**
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once 'io/Google_HttpRequest.php';
require_once 'io/Google_CurlIO.php';
require_once 'io/Google_REST.php';
/**
* Abstract IO class
*
* @author Chris Chabot <chabotc@google.com>
*/
interface Google_IO {
/**
* 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_HttpRequest $request
* @return Google_HttpRequest $request
*/
public function authenticatedRequest(Google_HttpRequest $request);
/**
* Executes a apIHttpRequest and returns the resulting populated httpRequest
* @param Google_HttpRequest $request
* @return Google_HttpRequest $request
*/
public function makeRequest(Google_HttpRequest $request);
/**
* Set options that update the transport implementation's behavior.
* @param $options
*/
public function setOptions($options);
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/io/Google_IO.php | PHP | asf20 | 1,538 |
<?php
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Implement the caching directives specified in rfc2616. This
* implementation is guided by the guidance offered in rfc2616-sec13.
* @author Chirag Shah <chirags@google.com>
*/
class Google_CacheParser {
public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD');
public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301');
private function __construct() {}
/**
* Check if an HTTP request can be cached by a private local cache.
*
* @static
* @param Google_HttpRequest $resp
* @return bool True if the request is cacheable.
* False if the request is uncacheable.
*/
public static function isRequestCacheable (Google_HttpRequest $resp) {
$method = $resp->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_HttpRequest $resp
* @return bool True if the response is cacheable.
* False if the response is un-cacheable.
*/
public static function isResponseCacheable (Google_HttpRequest $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_HttpRequest $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_HttpRequest $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) {
$parsedDate = time();
}
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_HttpRequest $response
* @return bool True if the entry is expired, else return false.
*/
public static function mustRevalidate(Google_HttpRequest $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);
}
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/io/Google_CacheParser.php | PHP | asf20 | 5,901 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Curl based implementation of apiIO.
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
require_once 'Google_CacheParser.php';
class Google_CurlIO implements Google_IO {
const CONNECTION_ESTABLISHED = "HTTP/1.0 200 Connection established\r\n\r\n";
const FORM_URLENCODED = 'application/x-www-form-urlencoded';
private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null);
private static $HOP_BY_HOP = array(
'connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization',
'te', 'trailers', 'transfer-encoding', 'upgrade');
private $curlParams = array (
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => 0,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_HEADER => true,
CURLOPT_VERBOSE => false,
);
/**
* 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_HttpRequest $request
* @return Google_HttpRequest The resulting HTTP response including the
* responseHttpCode, responseHeaders and responseBody.
*/
public function authenticatedRequest(Google_HttpRequest $request) {
$request = Google_Client::$auth->sign($request);
return $this->makeRequest($request);
}
/**
* Execute a apiHttpRequest
*
* @param Google_HttpRequest $request the http request to be executed
* @return Google_HttpRequest http request with the response http code, response
* headers and response body filled in
* @throws Google_IOException on curl or IO error
*/
public function makeRequest(Google_HttpRequest $request) {
// First, check to see if we have a valid cached version.
$cached = $this->getCachedRequest($request);
if ($cached !== false) {
if (Google_CacheParser::mustRevalidate($cached)) {
$addHeaders = array();
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);
} else {
// No need to revalidate the request, return it directly
return $cached;
}
}
if (array_key_exists($request->getRequestMethod(),
self::$ENTITY_HTTP_METHODS)) {
$request = $this->processEntityRequest($request);
}
$ch = curl_init();
curl_setopt_array($ch, $this->curlParams);
curl_setopt($ch, CURLOPT_URL, $request->getUrl());
if ($request->getPostBody()) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getPostBody());
}
$requestHeaders = $request->getRequestHeaders();
if ($requestHeaders && is_array($requestHeaders)) {
$parsed = array();
foreach ($requestHeaders as $k => $v) {
$parsed[] = "$k: $v";
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $parsed);
}
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->getRequestMethod());
curl_setopt($ch, CURLOPT_USERAGENT, $request->getUserAgent());
$respData = curl_exec($ch);
// Retry if certificates are missing.
if (curl_errno($ch) == CURLE_SSL_CACERT) {
error_log('SSL certificate problem, verify that the CA cert is OK.'
. ' Retrying with the CA cert bundle from google-api-php-client.');
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem');
$respData = curl_exec($ch);
}
$respHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$respHttpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlErrorNum = curl_errno($ch);
$curlError = curl_error($ch);
curl_close($ch);
if ($curlErrorNum != CURLE_OK) {
throw new Google_IOException("HTTP Error: ($respHttpCode) $curlError");
}
// Parse out the raw response into usable bits
list($responseHeaders, $responseBody) =
self::parseHttpResponse($respData, $respHeaderSize);
if ($respHttpCode == 304 && $cached) {
// If the server responded NOT_MODIFIED, return the cached request.
if (isset($responseHeaders['connection'])) {
$hopByHop = array_merge(
self::$HOP_BY_HOP,
explode(',', $responseHeaders['connection'])
);
$endToEnd = array();
foreach($hopByHop as $key) {
if (isset($responseHeaders[$key])) {
$endToEnd[$key] = $responseHeaders[$key];
}
}
$cached->setResponseHeaders($endToEnd);
}
return $cached;
}
// Fill in the apiHttpRequest with the response values
$request->setResponseHttpCode($respHttpCode);
$request->setResponseHeaders($responseHeaders);
$request->setResponseBody($responseBody);
// Store the request in cache (the function checks to see if the request
// can actually be cached)
$this->setCachedRequest($request);
// And finally return it
return $request;
}
/**
* @visible for testing.
* Cache the response to an HTTP request if it is cacheable.
* @param Google_HttpRequest $request
* @return bool Returns true if the insertion was successful.
* Otherwise, return false.
*/
public function setCachedRequest(Google_HttpRequest $request) {
// Determine if the request is cacheable.
if (Google_CacheParser::isResponseCacheable($request)) {
Google_Client::$cache->set($request->getCacheKey(), $request);
return true;
}
return false;
}
/**
* @visible for testing.
* @param Google_HttpRequest $request
* @return Google_HttpRequest|bool Returns the cached object or
* false if the operation was unsuccessful.
*/
public function getCachedRequest(Google_HttpRequest $request) {
if (false == Google_CacheParser::isRequestCacheable($request)) {
false;
}
return Google_Client::$cache->get($request->getCacheKey());
}
/**
* @param $respData
* @param $headerSize
* @return array
*/
public static function parseHttpResponse($respData, $headerSize) {
if (stripos($respData, self::CONNECTION_ESTABLISHED) !== false) {
$respData = str_ireplace(self::CONNECTION_ESTABLISHED, '', $respData);
}
if ($headerSize) {
$responseBody = substr($respData, $headerSize);
$responseHeaders = substr($respData, 0, $headerSize);
} else {
list($responseHeaders, $responseBody) = explode("\r\n\r\n", $respData, 2);
}
$responseHeaders = self::parseResponseHeaders($responseHeaders);
return array($responseHeaders, $responseBody);
}
public static function parseResponseHeaders($rawHeaders) {
$responseHeaders = array();
$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($responseHeaders[$header])) {
$responseHeaders[$header] .= "\n" . $value;
} else {
$responseHeaders[$header] = $value;
}
}
}
return $responseHeaders;
}
/**
* @visible for testing
* Process an http request that contains an enclosed entity.
* @param Google_HttpRequest $request
* @return Google_HttpRequest Processed request with the enclosed entity.
*/
public function processEntityRequest(Google_HttpRequest $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;
}
/**
* Set options that update cURL's default behavior.
* The list of accepted options are:
* {@link http://php.net/manual/en/function.curl-setopt.php]
*
* @param array $optCurlParams Multiple options used by a cURL session.
*/
public function setOptions($optCurlParams) {
foreach ($optCurlParams as $key => $val) {
$this->curlParams[$key] = $val;
}
}
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/io/Google_CurlIO.php | PHP | asf20 | 9,667 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class implements the RESTful transport of apiServiceRequest()'s
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_REST {
/**
* Executes a apiServiceRequest using a RESTful call by transforming it into
* an apiHttpRequest, and executed via apiIO::authenticatedRequest().
*
* @param Google_HttpRequest $req
* @return array decoded result
* @throws Google_ServiceException on server side error (ie: not authenticated,
* invalid or malformed post body, invalid url)
*/
static public function execute(Google_HttpRequest $req) {
$httpRequest = Google_Client::$io->makeRequest($req);
$decodedResponse = self::decodeHttpResponse($httpRequest);
$ret = isset($decodedResponse['data'])
? $decodedResponse['data'] : $decodedResponse;
return $ret;
}
/**
* Decode an HTTP Response.
* @static
* @throws Google_ServiceException
* @param Google_HttpRequest $response The http response to be decoded.
* @return mixed|null
*/
public static function decodeHttpResponse($response) {
$code = $response->getResponseHttpCode();
$body = $response->getResponseBody();
$decoded = null;
if ($code != '200' && $code != '201' && $code != '204') {
$decoded = json_decode($body, true);
$err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl();
if ($decoded != null && 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";
}
throw new Google_ServiceException($err, $code, null, $decoded['error']['errors']);
}
// Only attempt to decode the response, if the response code wasn't (204) 'no content'
if ($code != '204') {
$decoded = json_decode($body, true);
if ($decoded === null || $decoded === "") {
throw new Google_ServiceException("Invalid json in service response: $body");
}
}
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
*/
static function createRequestUri($servicePath, $restPath, $params) {
$requestUrl = $servicePath . $restPath;
$uriTemplateVars = array();
$queryVars = array();
foreach ($params as $paramName => $paramSpec) {
// Discovery v1.0 puts the canonical location under the 'location' field.
if (! isset($paramSpec['location'])) {
$paramSpec['location'] = $paramSpec['restParameterType'];
}
if ($paramSpec['type'] == 'boolean') {
$paramSpec['value'] = ($paramSpec['value']) ? 'true' : 'false';
}
if ($paramSpec['location'] == 'path') {
$uriTemplateVars[$paramName] = $paramSpec['value'];
} else {
if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) {
foreach ($paramSpec['value'] as $value) {
$queryVars[] = $paramName . '=' . rawurlencode($value);
}
} else {
$queryVars[] = $paramName . '=' . rawurlencode($paramSpec['value']);
}
}
}
if (count($uriTemplateVars)) {
$uriTemplateParser = new URI_Template_Parser($requestUrl);
$requestUrl = $uriTemplateParser->expand($uriTemplateVars);
}
//FIXME work around for the the uri template lib which url encodes
// the @'s & confuses our servers.
$requestUrl = str_replace('%40', '@', $requestUrl);
if (count($queryVars)) {
$requestUrl .= '?' . implode($queryVars, '&');
}
return $requestUrl;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/io/Google_REST.php | PHP | asf20 | 4,536 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* HTTP Request to be executed by apiIO classes. Upon execution, the
* responseHttpCode, responseHeaders and responseBody will be filled in.
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_HttpRequest {
const USER_AGENT_SUFFIX = "google-api-php-client/0.6.0";
private $batchHeaders = array(
'Content-Type' => 'application/http',
'Content-Transfer-Encoding' => 'binary',
'MIME-Version' => '1.0',
'Content-Length' => ''
);
protected $url;
protected $requestMethod;
protected $requestHeaders;
protected $postBody;
protected $userAgent;
protected $responseHttpCode;
protected $responseHeaders;
protected $responseBody;
public $accessKey;
public function __construct($url, $method = 'GET', $headers = array(), $postBody = null) {
$this->setUrl($url);
$this->setRequestMethod($method);
$this->setRequestHeaders($headers);
$this->setPostBody($postBody);
global $apiConfig;
if (empty($apiConfig['application_name'])) {
$this->userAgent = self::USER_AGENT_SUFFIX;
} else {
$this->userAgent = $apiConfig['application_name'] . " " . self::USER_AGENT_SUFFIX;
}
}
/**
* 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.
* @see http://oauth.net/core/1.0a/#anchor13
*/
public function getBaseUrl() {
if ($pos = strpos($this->url, '?')) {
return substr($this->url, 0, $pos);
}
return $this->url;
}
/**
* 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() {
if ($pos = strpos($this->url, '?')) {
$queryStr = substr($this->url, $pos + 1);
$params = array();
parse_str($queryStr, $params);
return $params;
}
return array();
}
/**
* @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;
}
/**
* @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->url;
}
/**
* @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') {
$this->url = $url;
} else {
// Force the path become relative.
if (substr($url, 0, 1) !== '/') {
$url = '/' . $url;
}
global $apiConfig;
$this->url = $apiConfig['basePath'] . $url;
}
}
/**
* @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;
}
/**
* @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 = array();
$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 = '';
foreach($this->batchHeaders as $key => $val) {
$str .= $key . ': ' . $val . "\n";
}
$str .= "Content-ID: $id\n";
$str .= "\n";
$path = parse_url($this->getUrl(), PHP_URL_PATH);
$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();
}
return $str;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/io/Google_HttpRequest.php | PHP | asf20 | 7,746 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Check for the required json and curl extensions, the Google APIs PHP Client
// won't function without them.
/*if (! function_exists('curl_init')) {
throw new Exception('Google PHP API Client requires the CURL PHP extension');
}*/
if (! function_exists('json_decode')) {
throw new Exception('Google PHP API Client requires the JSON PHP extension');
}
if (! function_exists('http_build_query')) {
throw new Exception('Google PHP API Client requires http_build_query()');
}
if (! ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
// hack around with the include paths a bit so the library 'just works'
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
require_once "config.php";
// If a local configuration file is found, merge it's values with the default configuration
if (file_exists(dirname(__FILE__) . '/local_config.php')) {
$defaultConfig = $apiConfig;
require_once (dirname(__FILE__) . '/local_config.php');
$apiConfig = array_merge($defaultConfig, $apiConfig);
}
// Include the top level classes, they each include their own dependencies
require_once 'service/Google_Model.php';
require_once 'service/Google_Service.php';
require_once 'service/Google_ServiceResource.php';
require_once 'auth/Google_AssertionCredentials.php';
require_once 'auth/Google_Signer.php';
require_once 'auth/Google_P12Signer.php';
require_once 'service/Google_BatchRequest.php';
require_once 'external/URITemplateParser.php';
require_once 'auth/Google_Auth.php';
require_once 'cache/Google_Cache.php';
require_once 'io/Google_IO.php';
require_once('service/Google_MediaFileUpload.php');
/**
* The Google API Client
* http://code.google.com/p/google-api-php-client/
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_Client {
/**
* @static
* @var Google_Auth $auth
*/
static $auth;
/**
* @static
* @var Google_IO $io
*/
static $io;
/**
* @static
* @var Google_Cache $cache
*/
static $cache;
/**
* @static
* @var boolean $useBatch
*/
static $useBatch = false;
/** @var array $scopes */
protected $scopes = array();
/** @var bool $useObjects */
protected $useObjects = false;
// definitions of services that are discovered.
protected $services = array();
// Used to track authenticated state, can't discover services after doing authenticate()
private $authenticated = false;
public function __construct($config = array()) {
global $apiConfig;
$apiConfig = array_merge($apiConfig, $config);
self::$cache = new $apiConfig['cacheClass']();
self::$auth = new $apiConfig['authClass']();
self::$io = new $apiConfig['ioClass']();
}
/**
* Add a service
*/
public function addService($service, $version = false) {
global $apiConfig;
if ($this->authenticated) {
throw new Google_Exception('Cant add services after having authenticated');
}
$this->services[$service] = array();
if (isset($apiConfig['services'][$service])) {
// Merge the service descriptor with the default values
$this->services[$service] = array_merge($this->services[$service], $apiConfig['services'][$service]);
}
}
public function authenticate($code = null) {
$service = $this->prepareService();
$this->authenticated = true;
return self::$auth->authenticate($service, $code);
}
/**
* @return array
* @visible For Testing
*/
public function prepareService() {
$service = array();
$scopes = array();
if ($this->scopes) {
$scopes = $this->scopes;
} else {
foreach ($this->services as $key => $val) {
if (isset($val['scope'])) {
if (is_array($val['scope'])) {
$scopes = array_merge($val['scope'], $scopes);
} else {
$scopes[] = $val['scope'];
}
} else {
$scopes[] = 'https://www.googleapis.com/auth/' . $key;
}
unset($val['discoveryURI']);
unset($val['scope']);
$service = array_merge($service, $val);
}
}
$service['scope'] = implode(' ', $scopes);
return $service;
}
/**
* Set the OAuth 2.0 access token using the string that resulted from calling authenticate()
* 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 || 'null' == $accessToken) {
$accessToken = null;
}
self::$auth->setAccessToken($accessToken);
}
/**
* Set the type of Auth class the client should use.
* @param string $authClassName
*/
public function setAuthClass($authClassName) {
self::$auth = new $authClassName();
}
/**
* Construct the OAuth 2.0 authorization request URI.
* @return string
*/
public function createAuthUrl() {
$service = $this->prepareService();
return self::$auth->createAuthUrl($service['scope']);
}
/**
* 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 = self::$auth->getAccessToken();
return (null == $token || 'null' == $token) ? null : $token;
}
/**
* Returns if the access_token is expired.
* @return bool Returns True if the access_token is expired.
*/
public function isAccessTokenExpired() {
return self::$auth->isAccessTokenExpired();
}
/**
* 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) {
self::$auth->setDeveloperKey($developerKey);
}
/**
* 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) {
self::$auth->setState($state);
}
/**
* @param string $accessType Possible values for access_type include:
* {@code "offline"} to request offline access from the user. (This is the default value)
* {@code "online"} to request online access from the user.
*/
public function setAccessType($accessType) {
self::$auth->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) {
self::$auth->setApprovalPrompt($approvalPrompt);
}
/**
* Set the application name, this is included in the User-Agent HTTP header.
* @param string $applicationName
*/
public function setApplicationName($applicationName) {
global $apiConfig;
$apiConfig['application_name'] = $applicationName;
}
/**
* Set the OAuth 2.0 Client ID.
* @param string $clientId
*/
public function setClientId($clientId) {
global $apiConfig;
$apiConfig['oauth2_client_id'] = $clientId;
self::$auth->clientId = $clientId;
}
/**
* Get the OAuth 2.0 Client ID.
*/
public function getClientId() {
return self::$auth->clientId;
}
/**
* Set the OAuth 2.0 Client Secret.
* @param string $clientSecret
*/
public function setClientSecret($clientSecret) {
global $apiConfig;
$apiConfig['oauth2_client_secret'] = $clientSecret;
self::$auth->clientSecret = $clientSecret;
}
/**
* Get the OAuth 2.0 Client Secret.
*/
public function getClientSecret() {
return self::$auth->clientSecret;
}
/**
* Set the OAuth 2.0 Redirect URI.
* @param string $redirectUri
*/
public function setRedirectUri($redirectUri) {
global $apiConfig;
$apiConfig['oauth2_redirect_uri'] = $redirectUri;
self::$auth->redirectUri = $redirectUri;
}
/**
* Get the OAuth 2.0 Redirect URI.
*/
public function getRedirectUri() {
return self::$auth->redirectUri;
}
/**
* Fetches a fresh OAuth 2.0 access token with the given refresh token.
* @param string $refreshToken
* @return void
*/
public function refreshToken($refreshToken) {
self::$auth->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_AuthException
* @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) {
self::$auth->revokeToken($token);
}
/**
* Verify an id_token. This method will verify the current id_token, if one
* isn't provided.
* @throws Google_AuthException
* @param string|null $token The token (id_token) that should be verified.
* @return Google_LoginTicket Returns an apiLoginTicket if the verification was
* successful.
*/
public function verifyIdToken($token = null) {
return self::$auth->verifyIdToken($token);
}
/**
* @param Google_AssertionCredentials $creds
* @return void
*/
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
self::$auth->setAssertionCredentials($creds);
}
/**
* This function allows you to overrule the automatically generated scopes,
* so that you can ask for more or less permission in the auth flow
* Set this before you call authenticate() though!
* @param array $scopes, ie: array('https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/moderator')
*/
public function setScopes($scopes) {
$this->scopes = is_string($scopes) ? explode(" ", $scopes) : $scopes;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useObjects True if objects should be returned by the service classes.
* False if associative arrays should be returned (default behavior).
* @experimental
*/
public function setUseObjects($useObjects) {
global $apiConfig;
$apiConfig['use_objects'] = $useObjects;
}
/**
* Declare if objects should be returned by the api service classes.
*
* @param boolean $useBatch True if the experimental batch support should
* be enabled. Defaults to False.
* @experimental
*/
public function setUseBatch($useBatch) {
self::$useBatch = $useBatch;
}
/**
* @static
* @return Google_Auth the implementation of apiAuth.
*/
public static function getAuth() {
return Google_Client::$auth;
}
/**
* @static
* @return Google_IO the implementation of apiIo.
*/
public static function getIo() {
return Google_Client::$io;
}
/**
* @return Google_Cache the implementation of apiCache.
*/
public function getCache() {
return Google_Client::$cache;
}
}
// Exceptions that the Google PHP API Library can throw
class Google_Exception extends Exception {}
class Google_AuthException extends Google_Exception {}
class Google_CacheException extends Google_Exception {}
class Google_IOException extends Google_Exception {}
class Google_ServiceException extends Google_Exception {
/**
* Optional list of errors returned in a JSON body of an HTTP error response.
*/
protected $errors = array();
/**
* Override default constructor to add ability to set $errors.
*
* @param string $message
* @param int $code
* @param Exception|null $previous
* @param [{string, string}] errors List of errors returned in an HTTP
* response. Defaults to [].
*/
public function __construct($message, $code = 0, Exception $previous = null,
$errors = array()) {
if(version_compare(PHP_VERSION, '5.3.0') >= 0) {
parent::__construct($message, $code, $previous);
} else {
parent::__construct($message, $code);
}
$this->errors = $errors;
}
/**
* 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;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/Google_Client.php | PHP | asf20 | 13,941 |
<?php
/**
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Implements the actual methods/resources of the discovered Google API using magic function
* calling overloading (__call()), which on call will see if the method name (plus.activities.list)
* is available in this service, and if so construct an apiHttpRequest representing it.
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_ServiceResource {
// Valid query parameters that work, but don't appear in discovery.
private $stackParameters = array(
'alt' => array('type' => 'string', 'location' => 'query'),
'boundary' => array('type' => 'string', 'location' => 'query'),
'fields' => array('type' => 'string', 'location' => 'query'),
'trace' => array('type' => 'string', 'location' => 'query'),
'userIp' => array('type' => 'string', 'location' => 'query'),
'userip' => array('type' => 'string', 'location' => 'query'),
'file' => array('type' => 'complex', 'location' => 'body'),
'data' => array('type' => 'string', 'location' => 'body'),
'mimeType' => array('type' => 'string', 'location' => 'header'),
'uploadType' => array('type' => 'string', 'location' => 'query'),
'mediaUpload' => array('type' => 'complex', 'location' => 'query'),
);
/** @var Google_Service $service */
private $service;
/** @var string $serviceName */
private $serviceName;
/** @var string $resourceName */
private $resourceName;
/** @var array $methods */
private $methods;
public function __construct($service, $serviceName, $resourceName, $resource) {
$this->service = $service;
$this->serviceName = $serviceName;
$this->resourceName = $resourceName;
$this->methods = isset($resource['methods']) ? $resource['methods'] : array($resourceName => $resource);
}
/**
* @param $name
* @param $arguments
* @return Google_HttpRequest|array
* @throws Google_Exception
*/
public function __call($name, $arguments) {
if (! isset($this->methods[$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 (is_object($parameters['postBody'])) {
$this->stripNull($parameters['postBody']);
}
// Some APIs require the postBody to be set under the data key.
if (is_array($parameters['postBody']) && 'latitude' == $this->serviceName) {
if (!isset($parameters['postBody']['data'])) {
$rawBody = $parameters['postBody'];
unset($parameters['postBody']);
$parameters['postBody']['data'] = $rawBody;
}
}
$postBody = is_array($parameters['postBody']) || is_object($parameters['postBody'])
? json_encode($parameters['postBody'])
: $parameters['postBody'];
unset($parameters['postBody']);
if (isset($parameters['optParams'])) {
$optParams = $parameters['optParams'];
unset($parameters['optParams']);
$parameters = array_merge($parameters, $optParams);
}
}
if (!isset($method['parameters'])) {
$method['parameters'] = array();
}
$method['parameters'] = array_merge($method['parameters'], $this->stackParameters);
foreach ($parameters as $key => $val) {
if ($key != 'postBody' && ! isset($method['parameters'][$key])) {
throw new Google_Exception("($name) unknown parameter: '$key'");
}
}
if (isset($method['parameters'])) {
foreach ($method['parameters'] as $paramName => $paramSpec) {
if (isset($paramSpec['required']) && $paramSpec['required'] && ! isset($parameters[$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 {
unset($parameters[$paramName]);
}
}
}
// Discovery v1.0 puts the canonical method id under the 'id' field.
if (! isset($method['id'])) {
$method['id'] = $method['rpcMethod'];
}
// Discovery v1.0 puts the canonical path under the 'path' field.
if (! isset($method['path'])) {
$method['path'] = $method['restPath'];
}
$servicePath = $this->service->servicePath;
// Process Media Request
$contentType = false;
if (isset($method['mediaUpload'])) {
$media = Google_MediaFileUpload::process($postBody, $parameters);
if ($media) {
$contentType = isset($media['content-type']) ? $media['content-type']: null;
$postBody = isset($media['postBody']) ? $media['postBody'] : null;
$servicePath = $method['mediaUpload']['protocols']['simple']['path'];
$method['path'] = '';
}
}
$url = Google_REST::createRequestUri($servicePath, $method['path'], $parameters);
$httpRequest = new Google_HttpRequest($url, $method['httpMethod'], null, $postBody);
if ($postBody) {
$contentTypeHeader = array();
if (isset($contentType) && $contentType) {
$contentTypeHeader['content-type'] = $contentType;
} else {
$contentTypeHeader['content-type'] = 'application/json; charset=UTF-8';
$contentTypeHeader['content-length'] = Google_Utils::getStrLen($postBody);
}
$httpRequest->setRequestHeaders($contentTypeHeader);
}
$httpRequest = Google_Client::$auth->sign($httpRequest);
if (Google_Client::$useBatch) {
return $httpRequest;
}
// Terminate immediatly if this is a resumable request.
if (isset($parameters['uploadType']['value'])
&& 'resumable' == $parameters['uploadType']['value']) {
return $httpRequest;
}
return Google_REST::execute($httpRequest);
}
public function useObjects() {
global $apiConfig;
return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']);
}
protected function stripNull(&$o) {
$o = (array) $o;
foreach ($o as $k => $v) {
if ($v === null || strstr($k, "\0*\0__")) {
unset($o[$k]);
}
elseif (is_object($v) || is_array($v)) {
$this->stripNull($o[$k]);
}
}
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_ServiceResource.php | PHP | asf20 | 7,172 |
<?php
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Chirag Shah <chirags@google.com>
*/
class Google_BatchRequest {
/** @var string Multipart Boundary. */
private $boundary;
/** @var array service requests to be executed. */
private $requests = array();
public function __construct($boundary = false) {
$boundary = (false == $boundary) ? mt_rand() : $boundary;
$this->boundary = str_replace('"', '', $boundary);
}
public function add(Google_HttpRequest $request, $key = false) {
if (false == $key) {
$key = mt_rand();
}
$this->requests[$key] = $request;
}
public function execute() {
$body = '';
/** @var Google_HttpRequest $req */
foreach($this->requests as $key => $req) {
$body .= "--{$this->boundary}\n";
$body .= $req->toBatchString($key) . "\n";
}
$body = rtrim($body);
$body .= "\n--{$this->boundary}--";
global $apiConfig;
$url = $apiConfig['basePath'] . '/batch';
$httpRequest = new Google_HttpRequest($url, 'POST');
$httpRequest->setRequestHeaders(array(
'Content-Type' => 'multipart/mixed; boundary=' . $this->boundary));
$httpRequest->setPostBody($body);
$response = Google_Client::$io->makeRequest($httpRequest);
$response = $this->parseResponse($response);
return $response;
}
public function parseResponse(Google_HttpRequest $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 = array();
foreach($parts as $part) {
$part = trim($part);
if (!empty($part)) {
list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2);
$metaHeaders = Google_CurlIO::parseResponseHeaders($metaHeaders);
$status = substr($part, 0, strpos($part, "\n"));
$status = explode(" ", $status);
$status = $status[1];
list($partHeaders, $partBody) = Google_CurlIO::parseHttpResponse($part, false);
$response = new Google_HttpRequest("");
$response->setResponseHttpCode($status);
$response->setResponseHeaders($partHeaders);
$response->setResponseBody($partBody);
$response = Google_REST::decodeHttpResponse($response);
// Need content id.
$responses[$metaHeaders['content-id']] = $response;
}
}
return $responses;
}
return null;
}
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_BatchRequest.php | PHP | asf20 | 3,371 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This class defines attributes, valid values, and usage which is generated from
* a given json schema. http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5
*
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_Model {
public function __construct( /* polymorphic */ ) {
if (func_num_args() == 1 && is_array(func_get_arg(0))) {
// Initialize the model with the array's contents.
$array = func_get_arg(0);
$this->mapTypes($array);
}
}
/**
* Initialize this object's properties from an array.
*
* @param array $array Used to seed this object's properties.
* @return void
*/
protected function mapTypes($array) {
foreach ($array as $key => $val) {
$this->$key = $val;
$keyTypeName = "__$key" . 'Type';
$keyDataType = "__$key" . 'DataType';
if ($this->useObjects() && property_exists($this, $keyTypeName)) {
if ($this->isAssociativeArray($val)) {
if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) {
foreach($val as $arrayKey => $arrayItem) {
$val[$arrayKey] = $this->createObjectFromName($keyTypeName, $arrayItem);
}
$this->$key = $val;
} else {
$this->$key = $this->createObjectFromName($keyTypeName, $val);
}
} else if (is_array($val)) {
$arrayObject = array();
foreach ($val as $arrayIndex => $arrayItem) {
$arrayObject[$arrayIndex] = $this->createObjectFromName($keyTypeName, $arrayItem);
}
$this->$key = $arrayObject;
}
}
}
}
/**
* 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);
}
protected function useObjects() {
global $apiConfig;
return (isset($apiConfig['use_objects']) && $apiConfig['use_objects']);
}
/**
* 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 $type Array items should be of this type.
* @param string $method Method expecting an array as an argument.
*/
public function assertIsArray($obj, $type, $method) {
if ($obj && !is_array($obj)) {
throw new Google_Exception("Incorrect parameter type passed to $method(), expected an"
. " array containing items of type $type.");
}
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_Model.php | PHP | asf20 | 3,569 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Collection of static utility methods used for convenience across
* the client library.
*
* @author Chirag Shah <chirags@google.com>
*/
class Google_Utils {
public static function urlSafeB64Encode($data) {
$b64 = base64_encode($data);
$b64 = str_replace(array('+', '/', '\r', '\n', '='),
array('-', '_'),
$b64);
return $b64;
}
public static function urlSafeB64Decode($b64) {
$b64 = str_replace(array('-', '_'),
array('+', '/'),
$b64);
return base64_decode($b64);
}
/**
* Misc function used to count the number of bytes in a post body, in the world of multi-byte chars
* and the unpredictability of strlen/mb_strlen/sizeof, this is the only way to do that in a sane
* manner at the moment.
*
* This algorithm was originally developed for the
* Solar Framework by Paul M. Jones
*
* @link http://solarphp.com/
* @link http://svn.solarphp.com/core/trunk/Solar/Json.php
* @link http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Json/Decoder.php
* @param string $str
* @return int The number of bytes in a string.
*/
static public function getStrLen($str) {
$strlenVar = strlen($str);
$d = $ret = 0;
for ($count = 0; $count < $strlenVar; ++ $count) {
$ordinalValue = ord($str{$ret});
switch (true) {
case (($ordinalValue >= 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 array();
}
$normalized = array();
foreach ($arr as $key => $val) {
$normalized[strtolower($key)] = $val;
}
return $normalized;
}
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_Utils.php | PHP | asf20 | 3,704 |
<?php
/**
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_MediaFileUpload {
const UPLOAD_MEDIA_TYPE = 'media';
const UPLOAD_MULTIPART_TYPE = 'multipart';
const UPLOAD_RESUMABLE_TYPE = 'resumable';
/** @var string $mimeType */
public $mimeType;
/** @var string $data */
public $data;
/** @var bool $resumable */
public $resumable;
/** @var int $chunkSize */
public $chunkSize;
/** @var int $size */
public $size;
/** @var string $resumeUri */
public $resumeUri;
/** @var int $progress */
public $progress;
/**
* @param $mimeType string
* @param $data string The bytes you want to upload.
* @param $resumable bool
* @param bool $chunkSize File will be uploaded in chunks of this many bytes.
* only used if resumable=True
*/
public function __construct($mimeType, $data, $resumable=false, $chunkSize=false) {
$this->mimeType = $mimeType;
$this->data = $data;
$this->size = strlen($this->data);
$this->resumable = $resumable;
if(!$chunkSize) {
$this->chunkSize = 256 * 1024;
}
$this->progress = 0;
}
/**
* @static
* @param $meta
* @param $params
* @return array|bool
*/
public static function process($meta, &$params) {
$payload = array();
$meta = is_string($meta) ? json_decode($meta, true) : $meta;
$uploadType = self::getUploadType($meta, $payload, $params);
if (!$uploadType) {
// Process as a normal API request.
return false;
}
// Process as a media upload request.
$params['uploadType'] = array(
'type' => 'string',
'location' => 'query',
'value' => $uploadType,
);
if (isset($params['file'])) {
// This is a standard file upload with curl.
$file = $params['file']['value'];
unset($params['file']);
return self::processFileUpload($file);
}
$mimeType = isset($params['mimeType'])
? $params['mimeType']['value']
: false;
unset($params['mimeType']);
$data = isset($params['data'])
? $params['data']['value']
: false;
unset($params['data']);
if (self::UPLOAD_RESUMABLE_TYPE == $uploadType) {
$payload['content-type'] = $mimeType;
} elseif (self::UPLOAD_MEDIA_TYPE == $uploadType) {
// This is a simple media upload.
$payload['content-type'] = $mimeType;
$payload['postBody'] = $data;
}
elseif (self::UPLOAD_MULTIPART_TYPE == $uploadType) {
// This is a multipart/related upload.
$boundary = isset($params['boundary']['value']) ? $params['boundary']['value'] : mt_rand();
$boundary = str_replace('"', '', $boundary);
$payload['content-type'] = '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($data) . "\r\n";
$related .= "--$boundary--";
$payload['postBody'] = $related;
}
return $payload;
}
/**
* Process standard file uploads.
* @param $file
* @internal param $fileName
* @return array Inclues the processed file name.
* @visible For testing.
*/
public static function processFileUpload($file) {
if (!$file) return array();
if (substr($file, 0, 1) != '@') {
$file = '@' . $file;
}
// This is a standard file upload with curl.
return array('postBody' => array('file' => $file));
}
/**
* Valid upload types:
* - resumable (UPLOAD_RESUMABLE_TYPE)
* - media (UPLOAD_MEDIA_TYPE)
* - multipart (UPLOAD_MULTIPART_TYPE)
* - none (false)
* @param $meta
* @param $payload
* @param $params
* @return bool|string
*/
public static function getUploadType($meta, &$payload, &$params) {
if (isset($params['mediaUpload'])
&& get_class($params['mediaUpload']['value']) == 'Google_MediaFileUpload') {
$upload = $params['mediaUpload']['value'];
unset($params['mediaUpload']);
$payload['content-type'] = $upload->mimeType;
if (isset($upload->resumable) && $upload->resumable) {
return self::UPLOAD_RESUMABLE_TYPE;
}
}
// Allow the developer to override the upload type.
if (isset($params['uploadType'])) {
return $params['uploadType']['value'];
}
$data = isset($params['data']['value'])
? $params['data']['value'] : false;
if (false == $data && false == isset($params['file'])) {
// No upload data available.
return false;
}
if (isset($params['file'])) {
return self::UPLOAD_MEDIA_TYPE;
}
if (false == $meta) {
return self::UPLOAD_MEDIA_TYPE;
}
return self::UPLOAD_MULTIPART_TYPE;
}
public function nextChunk(Google_HttpRequest $req) {
if (false == $this->resumeUri) {
$this->resumeUri = $this->getResumeUri($req);
}
$data = substr($this->data, $this->progress, $this->chunkSize);
$lastBytePos = $this->progress + strlen($data) - 1;
$headers = array(
'content-range' => "bytes $this->progress-$lastBytePos/$this->size",
'content-type' => $req->getRequestHeader('content-type'),
'content-length' => $this->chunkSize,
'expect' => '',
);
$httpRequest = new Google_HttpRequest($this->resumeUri, 'PUT', $headers, $data);
$response = Google_Client::$io->authenticatedRequest($httpRequest);
$code = $response->getResponseHttpCode();
if (308 == $code) {
$range = explode('-', $response->getResponseHeader('range'));
$this->progress = $range[1] + 1;
return false;
} else {
return Google_REST::decodeHttpResponse($response);
}
}
private function getResumeUri(Google_HttpRequest $httpRequest) {
$result = null;
$body = $httpRequest->getPostBody();
if ($body) {
$httpRequest->setRequestHeaders(array(
'content-type' => 'application/json; charset=UTF-8',
'content-length' => Google_Utils::getStrLen($body),
'x-upload-content-type' => $this->mimeType,
'expect' => '',
));
}
$response = Google_Client::$io->makeRequest($httpRequest);
$location = $response->getResponseHeader('location');
$code = $response->getResponseHttpCode();
if (200 == $code && true == $location) {
return $location;
}
throw new Google_Exception("Failed to start the resumable upload");
}
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_MediaFileUpload.php | PHP | asf20 | 7,184 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class Google_Service {
public $version;
public $servicePath;
public $resource;
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/service/Google_Service.php | PHP | asf20 | 689 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once "Google_PemVerifier.php";
/**
* Verifies signatures.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Verifier {
/**
* Checks a signature, returns true if the signature is correct,
* false otherwise.
*/
abstract public function verify($data, $signature);
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_Verifier.php | PHP | asf20 | 910 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once "Google_AuthNone.php";
require_once "Google_OAuth2.php";
/**
* Abstract class for the Authentication in the API client
* @author Chris Chabot <chabotc@google.com>
*
*/
abstract class Google_Auth {
abstract public function authenticate($service);
abstract public function sign(Google_HttpRequest $request);
abstract public function createAuthUrl($scope);
abstract public function getAccessToken();
abstract public function setAccessToken($accessToken);
abstract public function setDeveloperKey($developerKey);
abstract public function refreshToken($refreshToken);
abstract public function revokeToken();
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_Auth.php | PHP | asf20 | 1,242 |
<?php
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Credentials object used for OAuth 2.0 Signed JWT assertion grants.
*
* @author Chirag Shah <chirags@google.com>
*/
class Google_AssertionCredentials {
const MAX_TOKEN_LIFETIME_SECS = 3600;
public $serviceAccountName;
public $scopes;
public $privateKey;
public $privateKeyPassword;
public $assertionType;
public $prn;
/**
* @param $serviceAccountName
* @param $scopes array List of scopes
* @param $privateKey
* @param string $privateKeyPassword
* @param string $assertionType
* @param bool|string $prn The email address of the user for which the
* application is requesting delegated access.
*/
public function __construct(
$serviceAccountName,
$scopes,
$privateKey,
$privateKeyPassword = 'notasecret',
$assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
$prn = false) {
$this->serviceAccountName = $serviceAccountName;
$this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
$this->privateKey = $privateKey;
$this->privateKeyPassword = $privateKeyPassword;
$this->assertionType = $assertionType;
$this->prn = $prn;
}
public function generateAssertion() {
$now = time();
$jwtParams = array(
'aud' => Google_OAuth2::OAUTH2_TOKEN_URI,
'scope' => $this->scopes,
'iat' => $now,
'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS,
'iss' => $this->serviceAccountName,
);
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');
$segments = array(
Google_Utils::urlSafeB64Encode(json_encode($header)),
Google_Utils::urlSafeB64Encode(json_encode($payload))
);
$signingInput = implode('.', $segments);
$signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
$signature = $signer->sign($signingInput);
$segments[] = Google_Utils::urlSafeB64Encode($signature);
return implode(".", $segments);
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_AssertionCredentials.php | PHP | asf20 | 2,844 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Signs data.
*
* Only used for testing.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_P12Signer extends Google_Signer {
// OpenSSL private key resource
private $privateKey;
// Creates a new signer from a .p12 file.
function __construct($p12, $password) {
if (!function_exists('openssl_x509_read')) {
throw new Exception(
'The Google PHP API library needs the openssl PHP extension');
}
// This throws on error
$certs = array();
if (!openssl_pkcs12_read($p12, $certs, $password)) {
throw new Google_AuthException("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_AuthException("No private key found in p12 file.");
}
$this->privateKey = openssl_pkey_get_private($certs["pkey"]);
if (!$this->privateKey) {
throw new Google_AuthException("Unable to load private key in ");
}
}
function __destruct() {
if ($this->privateKey) {
openssl_pkey_free($this->privateKey);
}
}
function sign($data) {
if(version_compare(PHP_VERSION, '5.3.0') < 0) {
throw new Google_AuthException(
"PHP 5.3.0 or higher is required to use service accounts.");
}
if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
throw new Google_AuthException("Unable to sign data");
}
return $signature;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_P12Signer.php | PHP | asf20 | 2,295 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Verifies signatures using PEM encoded certificates.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_PemVerifier extends Google_Verifier {
private $publicKey;
/**
* Constructs a verifier from the supplied PEM-encoded certificate.
*
* $pem: a PEM encoded certificate (not a file).
* @param $pem
* @throws Google_AuthException
* @throws Google_Exception
*/
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_AuthException("Unable to parse PEM: $pem");
}
}
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_AuthException
* @return bool
*/
function verify($data, $signature) {
$status = openssl_verify($data, $signature, $this->publicKey, "sha256");
if ($status === -1) {
throw new Google_AuthException('Signature verification error: ' . openssl_error_string());
}
return $status === 1;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_PemVerifier.php | PHP | asf20 | 1,930 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Class to hold information about an authenticated login.
*
* @author Brian Eaton <beaton@google.com>
*/
class Google_LoginTicket {
const USER_ATTR = "id";
// 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_AuthException
* @return
*/
public function getUserId() {
if (array_key_exists(self::USER_ATTR, $this->payload)) {
return $this->payload[self::USER_ATTR];
}
throw new Google_AuthException("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);
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_LoginTicket.php | PHP | asf20 | 1,816 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Do-nothing authentication implementation, use this if you want to make un-authenticated calls
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*/
class Google_AuthNone extends Google_Auth {
public $key = null;
public function __construct() {
global $apiConfig;
if (!empty($apiConfig['developer_key'])) {
$this->setDeveloperKey($apiConfig['developer_key']);
}
}
public function setDeveloperKey($key) {$this->key = $key;}
public function authenticate($service) {/*noop*/}
public function setAccessToken($accessToken) {/* noop*/}
public function getAccessToken() {return null;}
public function createAuthUrl($scope) {return null;}
public function refreshToken($refreshToken) {/* noop*/}
public function revokeToken() {/* noop*/}
public function sign(Google_HttpRequest $request) {
if ($this->key) {
$request->setUrl($request->getUrl() . ((strpos($request->getUrl(), '?') === false) ? '?' : '&')
. 'key='.urlencode($this->key));
}
return $request;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_AuthNone.php | PHP | asf20 | 1,671 |
<?php
/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once "Google_Verifier.php";
require_once "Google_LoginTicket.php";
require_once "service/Google_Utils.php";
/**
* Authentication class that deals with the OAuth 2 web-server authentication flow
*
* @author Chris Chabot <chabotc@google.com>
* @author Chirag Shah <chirags@google.com>
*
*/
class Google_OAuth2 extends Google_Auth {
public $clientId;
public $clientSecret;
public $developerKey;
public $token;
public $redirectUri;
public $state;
public $accessType = 'offline';
public $approvalPrompt = 'force';
/** @var Google_AssertionCredentials $assertionCredentials */
public $assertionCredentials;
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
const OAUTH2_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token';
const OAUTH2_AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
const OAUTH2_FEDERATED_SIGNON_CERTS_URL = 'https://www.googleapis.com/oauth2/v1/certs';
const CLOCK_SKEW_SECS = 300; // five minutes in seconds
const AUTH_TOKEN_LIFETIME_SECS = 300; // five minutes in seconds
const MAX_TOKEN_LIFETIME_SECS = 86400; // one day in seconds
/**
* Instantiates the class, but does not initiate the login flow, leaving it
* to the discretion of the caller (which is done by calling authenticate()).
*/
public function __construct() {
global $apiConfig;
if (! empty($apiConfig['developer_key'])) {
$this->developerKey = $apiConfig['developer_key'];
}
if (! empty($apiConfig['oauth2_client_id'])) {
$this->clientId = $apiConfig['oauth2_client_id'];
}
if (! empty($apiConfig['oauth2_client_secret'])) {
$this->clientSecret = $apiConfig['oauth2_client_secret'];
}
if (! empty($apiConfig['oauth2_redirect_uri'])) {
$this->redirectUri = $apiConfig['oauth2_redirect_uri'];
}
if (! empty($apiConfig['oauth2_access_type'])) {
$this->accessType = $apiConfig['oauth2_access_type'];
}
if (! empty($apiConfig['oauth2_approval_prompt'])) {
$this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];
}
}
/**
* @param $service
* @param string|null $code
* @throws Google_AuthException
* @return string
*/
public function authenticate($service, $code = null) {
if (!$code && isset($_GET['code'])) {
$code = $_GET['code'];
}
if ($code) {
// We got here from the redirect from a successful authorization grant, fetch the access token
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), array(
'code' => $code,
'grant_type' => 'authorization_code',
'redirect_uri' => $this->redirectUri,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret
)));
if ($request->getResponseHttpCode() == 200) {
$this->setAccessToken($request->getResponseBody());
$this->token['created'] = time();
return $this->getAccessToken();
} else {
$response = $request->getResponseBody();
$decodedResponse = json_decode($response, true);
if ($decodedResponse != null && $decodedResponse['error']) {
$response = $decodedResponse['error'];
}
throw new Google_AuthException("Error fetching OAuth2 access token, message: '$response'", $request->getResponseHttpCode());
}
}
$authUrl = $this->createAuthUrl($service['scope']);
header('Location: ' . $authUrl);
return true;
}
/**
* 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=' . urlencode($this->redirectUri),
'client_id=' . urlencode($this->clientId),
'scope=' . urlencode($scope),
'access_type=' . urlencode($this->accessType),
'approval_prompt=' . urlencode($this->approvalPrompt)
);
if (isset($this->state)) {
$params[] = 'state=' . urlencode($this->state);
}
$params = implode('&', $params);
return self::OAUTH2_AUTH_URL . "?$params";
}
/**
* @param string $token
* @throws Google_AuthException
*/
public function setAccessToken($token) {
$token = json_decode($token, true);
if ($token == null) {
throw new Google_AuthException('Could not json decode the token');
}
if (! isset($token['access_token'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token = $token;
}
public function getAccessToken() {
return json_encode($this->token);
}
public function setDeveloperKey($developerKey) {
$this->developerKey = $developerKey;
}
public function setState($state) {
$this->state = $state;
}
public function setAccessType($accessType) {
$this->accessType = $accessType;
}
public function setApprovalPrompt($approvalPrompt) {
$this->approvalPrompt = $approvalPrompt;
}
public function setAssertionCredentials(Google_AssertionCredentials $creds) {
$this->assertionCredentials = $creds;
}
/**
* Include an accessToken in a given apiHttpRequest.
* @param Google_HttpRequest $request
* @return Google_HttpRequest
* @throws Google_AuthException
*/
public function sign(Google_HttpRequest $request) {
// add the developer key to the request before signing it
if ($this->developerKey) {
$requestUrl = $request->getUrl();
$requestUrl .= (strpos($request->getUrl(), '?') === false) ? '?' : '&';
$requestUrl .= 'key=' . urlencode($this->developerKey);
$request->setUrl($requestUrl);
}
// 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 {
if (! array_key_exists('refresh_token', $this->token)) {
throw new Google_AuthException("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->refreshToken($this->token['refresh_token']);
}
}
// 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->clientId,
'client_secret' => $this->clientSecret,
'refresh_token' => $refreshToken,
'grant_type' => 'refresh_token'
));
}
/**
* Fetches a fresh access token with a given assertion token.
* @param Google_AssertionCredentials $assertionCredentials optional.
* @return void
*/
public function refreshTokenWithAssertion($assertionCredentials = null) {
if (!$assertionCredentials) {
$assertionCredentials = $this->assertionCredentials;
}
$this->refreshTokenRequest(array(
'grant_type' => 'assertion',
'assertion_type' => $assertionCredentials->assertionType,
'assertion' => $assertionCredentials->generateAssertion(),
));
}
private function refreshTokenRequest($params) {
$http = new Google_HttpRequest(self::OAUTH2_TOKEN_URI, 'POST', array(), $params);
$request = Google_Client::$io->makeRequest($http);
$code = $request->getResponseHttpCode();
$body = $request->getResponseBody();
if (200 == $code) {
$token = json_decode($body, true);
if ($token == null) {
throw new Google_AuthException("Could not json decode the access token");
}
if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
throw new Google_AuthException("Invalid token format");
}
$this->token['access_token'] = $token['access_token'];
$this->token['expires_in'] = $token['expires_in'];
$this->token['created'] = time();
} else {
throw new Google_AuthException("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_AuthException
* @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) {
$token = $this->token['access_token'];
}
$request = new Google_HttpRequest(self::OAUTH2_REVOKE_URI, 'POST', array(), "token=$token");
$response = Google_Client::$io->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 (null == $this->token) {
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() {
// This relies on makeRequest caching certificate responses.
$request = Google_Client::$io->makeRequest(new Google_HttpRequest(
self::OAUTH2_FEDERATED_SIGNON_CERTS_URL));
if ($request->getResponseHttpCode() == 200) {
$certs = json_decode($request->getResponseBody(), true);
if ($certs) {
return $certs;
}
}
throw new Google_AuthException(
"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_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->clientId;
}
return $this->verifySignedJwtWithCerts($id_token, $certs, $audience);
}
// Verifies the id token, returns the verified token contents.
// Visible for testing.
function verifySignedJwtWithCerts($jwt, $certs, $required_audience) {
$segments = explode(".", $jwt);
if (count($segments) != 3) {
throw new Google_AuthException("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_AuthException("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_AuthException("Can't parse token payload: " . $segments[1]);
}
// Check signature
$verified = false;
foreach ($certs as $keyName => $pem) {
$public_key = new Google_PemVerifier($pem);
if ($public_key->verify($signed, $signature)) {
$verified = true;
break;
}
}
if (!$verified) {
throw new Google_AuthException("Invalid token signature: $jwt");
}
// Check issued-at timestamp
$iat = 0;
if (array_key_exists("iat", $payload)) {
$iat = $payload["iat"];
}
if (!$iat) {
throw new Google_AuthException("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_AuthException("No expiration time in token: $json_body");
}
if ($exp >= $now + self::MAX_TOKEN_LIFETIME_SECS) {
throw new Google_AuthException(
"Expiration time too far in future: $json_body");
}
$latest = $exp + self::CLOCK_SKEW_SECS;
if ($now < $earliest) {
throw new Google_AuthException(
"Token used too early, $now < $earliest: $json_body");
}
if ($now > $latest) {
throw new Google_AuthException(
"Token used too late, $now > $latest: $json_body");
}
// TODO(beaton): check issuer field?
// Check audience
$aud = $payload["aud"];
if ($aud != $required_audience) {
throw new Google_AuthException("Wrong recipient, $aud != $required_audience: $json_body");
}
// All good.
return new Google_LoginTicket($envelope, $payload);
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_OAuth2.php | PHP | asf20 | 14,548 |
<?php
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once "Google_P12Signer.php";
/**
* Signs data.
*
* @author Brian Eaton <beaton@google.com>
*/
abstract class Google_Signer {
/**
* Signs data, returns the signature as binary data.
*/
abstract public function sign($data);
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/auth/Google_Signer.php | PHP | asf20 | 849 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "cse" collection of methods.
* Typical usage is:
* <code>
* $customsearchService = new Google_CustomsearchService(...);
* $cse = $customsearchService->cse;
* </code>
*/
class Google_CseServiceResource extends Google_ServiceResource {
/**
* Returns metadata about the search performed, metadata about the custom search engine used for the
* search, and the search results. (cse.list)
*
* @param string $q Query
* @param array $optParams Optional parameters.
*
* @opt_param string sort The sort expression to apply to the results
* @opt_param string orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms
* @opt_param string highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string num Number of search results to return
* @opt_param string cr Country restrict(s).
* @opt_param string imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo.
* @opt_param string gl Geolocation of end user.
* @opt_param string relatedSite Specifies that all search results should be pages that are related to the specified URL
* @opt_param string searchType Specifies the search type: image.
* @opt_param string fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ...
* @opt_param string start The index of the first result to return
* @opt_param string imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown.
* @opt_param string lr The language restriction for the search results
* @opt_param string siteSearch Specifies all search results should be pages from a given site
* @opt_param string cref The URL of a linked custom search engine
* @opt_param string dateRestrict Specifies all search results are from a time period
* @opt_param string safe Search safety level
* @opt_param string c2coff Turns off the translation between zh-CN and zh-TW.
* @opt_param string googlehost The local Google domain to use to perform the search.
* @opt_param string hq Appends the extra query terms to the query.
* @opt_param string exactTerms Identifies a phrase that all documents in the search results must contain
* @opt_param string hl Sets the user interface language.
* @opt_param string lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query
* @opt_param string imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge.
* @opt_param string imgColorType Returns black and white, grayscale, or color images: mono, gray, and color.
* @opt_param string rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these.
* @opt_param string excludeTerms Identifies a word or phrase that should not appear in any documents in the search results
* @opt_param string filter Controls turning on or off the duplicate content filter.
* @opt_param string linkSite Specifies that all search results should contain a link to a particular URL
* @opt_param string cx The custom search engine ID to scope this search query
* @opt_param string siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter
* @return Google_Search
*/
public function listCse($q, $optParams = array()) {
$params = array('q' => $q);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Search($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Customsearch (v1).
*
* <p>
* Lets you search over a website or collection of websites
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/customsearch/v1/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_CustomsearchService extends Google_Service {
public $cse;
/**
* Constructs the internal representation of the Customsearch service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'customsearch/';
$this->version = 'v1';
$this->serviceName = 'customsearch';
$client->addService($this->serviceName, $this->version);
$this->cse = new Google_CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "Search"}, "id": "search.cse.list", "parameters": {"sort": {"type": "string", "location": "query"}, "orTerms": {"type": "string", "location": "query"}, "highRange": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "integer", "location": "query", "format": "uint32"}, "cr": {"type": "string", "location": "query"}, "imgType": {"enum": ["clipart", "face", "lineart", "news", "photo"], "type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "q": {"required": true, "type": "string", "location": "query"}, "relatedSite": {"type": "string", "location": "query"}, "searchType": {"enum": ["image"], "type": "string", "location": "query"}, "fileType": {"type": "string", "location": "query"}, "start": {"type": "integer", "location": "query", "format": "uint32"}, "imgDominantColor": {"enum": ["black", "blue", "brown", "gray", "green", "pink", "purple", "teal", "white", "yellow"], "type": "string", "location": "query"}, "lr": {"enum": ["lang_ar", "lang_bg", "lang_ca", "lang_cs", "lang_da", "lang_de", "lang_el", "lang_en", "lang_es", "lang_et", "lang_fi", "lang_fr", "lang_hr", "lang_hu", "lang_id", "lang_is", "lang_it", "lang_iw", "lang_ja", "lang_ko", "lang_lt", "lang_lv", "lang_nl", "lang_no", "lang_pl", "lang_pt", "lang_ro", "lang_ru", "lang_sk", "lang_sl", "lang_sr", "lang_sv", "lang_tr", "lang_zh-CN", "lang_zh-TW"], "type": "string", "location": "query"}, "siteSearch": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}, "dateRestrict": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "type": "string", "location": "query"}, "c2coff": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "hq": {"type": "string", "location": "query"}, "exactTerms": {"type": "string", "location": "query"}, "hl": {"type": "string", "location": "query"}, "lowRange": {"type": "string", "location": "query"}, "imgSize": {"enum": ["huge", "icon", "large", "medium", "small", "xlarge", "xxlarge"], "type": "string", "location": "query"}, "imgColorType": {"enum": ["color", "gray", "mono"], "type": "string", "location": "query"}, "rights": {"type": "string", "location": "query"}, "excludeTerms": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "linkSite": {"type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "siteSearchFilter": {"enum": ["e", "i"], "type": "string", "location": "query"}}, "path": "v1"}}}', true));
}
}
class Google_Context extends Google_Model {
protected $__facetsType = 'Google_ContextFacets';
protected $__facetsDataType = 'array';
public $facets;
public $title;
public function setFacets(/* array(Google_ContextFacets) */ $facets) {
$this->assertIsArray($facets, 'Google_ContextFacets', __METHOD__);
$this->facets = $facets;
}
public function getFacets() {
return $this->facets;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_ContextFacets extends Google_Model {
public $anchor;
public $label;
public function setAnchor($anchor) {
$this->anchor = $anchor;
}
public function getAnchor() {
return $this->anchor;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}
class Google_Promotion extends Google_Model {
public $title;
public $displayLink;
public $htmlTitle;
public $link;
protected $__bodyLinesType = 'Google_PromotionBodyLines';
protected $__bodyLinesDataType = 'array';
public $bodyLines;
protected $__imageType = 'Google_PromotionImage';
protected $__imageDataType = '';
public $image;
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDisplayLink($displayLink) {
$this->displayLink = $displayLink;
}
public function getDisplayLink() {
return $this->displayLink;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setBodyLines(/* array(Google_PromotionBodyLines) */ $bodyLines) {
$this->assertIsArray($bodyLines, 'Google_PromotionBodyLines', __METHOD__);
$this->bodyLines = $bodyLines;
}
public function getBodyLines() {
return $this->bodyLines;
}
public function setImage(Google_PromotionImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
}
class Google_PromotionBodyLines extends Google_Model {
public $url;
public $htmlTitle;
public $link;
public $title;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_PromotionImage extends Google_Model {
public $source;
public $width;
public $height;
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_Query extends Google_Model {
public $sort;
public $inputEncoding;
public $orTerms;
public $highRange;
public $cx;
public $startPage;
public $disableCnTwTranslation;
public $cr;
public $imgType;
public $gl;
public $relatedSite;
public $searchType;
public $title;
public $googleHost;
public $fileType;
public $imgDominantColor;
public $siteSearch;
public $cref;
public $dateRestrict;
public $safe;
public $outputEncoding;
public $hq;
public $searchTerms;
public $exactTerms;
public $language;
public $hl;
public $totalResults;
public $lowRange;
public $count;
public $imgSize;
public $imgColorType;
public $rights;
public $startIndex;
public $excludeTerms;
public $filter;
public $linkSite;
public $siteSearchFilter;
public function setSort($sort) {
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setInputEncoding($inputEncoding) {
$this->inputEncoding = $inputEncoding;
}
public function getInputEncoding() {
return $this->inputEncoding;
}
public function setOrTerms($orTerms) {
$this->orTerms = $orTerms;
}
public function getOrTerms() {
return $this->orTerms;
}
public function setHighRange($highRange) {
$this->highRange = $highRange;
}
public function getHighRange() {
return $this->highRange;
}
public function setCx($cx) {
$this->cx = $cx;
}
public function getCx() {
return $this->cx;
}
public function setStartPage($startPage) {
$this->startPage = $startPage;
}
public function getStartPage() {
return $this->startPage;
}
public function setDisableCnTwTranslation($disableCnTwTranslation) {
$this->disableCnTwTranslation = $disableCnTwTranslation;
}
public function getDisableCnTwTranslation() {
return $this->disableCnTwTranslation;
}
public function setCr($cr) {
$this->cr = $cr;
}
public function getCr() {
return $this->cr;
}
public function setImgType($imgType) {
$this->imgType = $imgType;
}
public function getImgType() {
return $this->imgType;
}
public function setGl($gl) {
$this->gl = $gl;
}
public function getGl() {
return $this->gl;
}
public function setRelatedSite($relatedSite) {
$this->relatedSite = $relatedSite;
}
public function getRelatedSite() {
return $this->relatedSite;
}
public function setSearchType($searchType) {
$this->searchType = $searchType;
}
public function getSearchType() {
return $this->searchType;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setGoogleHost($googleHost) {
$this->googleHost = $googleHost;
}
public function getGoogleHost() {
return $this->googleHost;
}
public function setFileType($fileType) {
$this->fileType = $fileType;
}
public function getFileType() {
return $this->fileType;
}
public function setImgDominantColor($imgDominantColor) {
$this->imgDominantColor = $imgDominantColor;
}
public function getImgDominantColor() {
return $this->imgDominantColor;
}
public function setSiteSearch($siteSearch) {
$this->siteSearch = $siteSearch;
}
public function getSiteSearch() {
return $this->siteSearch;
}
public function setCref($cref) {
$this->cref = $cref;
}
public function getCref() {
return $this->cref;
}
public function setDateRestrict($dateRestrict) {
$this->dateRestrict = $dateRestrict;
}
public function getDateRestrict() {
return $this->dateRestrict;
}
public function setSafe($safe) {
$this->safe = $safe;
}
public function getSafe() {
return $this->safe;
}
public function setOutputEncoding($outputEncoding) {
$this->outputEncoding = $outputEncoding;
}
public function getOutputEncoding() {
return $this->outputEncoding;
}
public function setHq($hq) {
$this->hq = $hq;
}
public function getHq() {
return $this->hq;
}
public function setSearchTerms($searchTerms) {
$this->searchTerms = $searchTerms;
}
public function getSearchTerms() {
return $this->searchTerms;
}
public function setExactTerms($exactTerms) {
$this->exactTerms = $exactTerms;
}
public function getExactTerms() {
return $this->exactTerms;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setHl($hl) {
$this->hl = $hl;
}
public function getHl() {
return $this->hl;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setLowRange($lowRange) {
$this->lowRange = $lowRange;
}
public function getLowRange() {
return $this->lowRange;
}
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setImgSize($imgSize) {
$this->imgSize = $imgSize;
}
public function getImgSize() {
return $this->imgSize;
}
public function setImgColorType($imgColorType) {
$this->imgColorType = $imgColorType;
}
public function getImgColorType() {
return $this->imgColorType;
}
public function setRights($rights) {
$this->rights = $rights;
}
public function getRights() {
return $this->rights;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setExcludeTerms($excludeTerms) {
$this->excludeTerms = $excludeTerms;
}
public function getExcludeTerms() {
return $this->excludeTerms;
}
public function setFilter($filter) {
$this->filter = $filter;
}
public function getFilter() {
return $this->filter;
}
public function setLinkSite($linkSite) {
$this->linkSite = $linkSite;
}
public function getLinkSite() {
return $this->linkSite;
}
public function setSiteSearchFilter($siteSearchFilter) {
$this->siteSearchFilter = $siteSearchFilter;
}
public function getSiteSearchFilter() {
return $this->siteSearchFilter;
}
}
class Google_Result extends Google_Model {
public $snippet;
public $kind;
protected $__labelsType = 'Google_ResultLabels';
protected $__labelsDataType = 'array';
public $labels;
public $title;
public $displayLink;
public $cacheId;
public $formattedUrl;
public $htmlFormattedUrl;
public $pagemap;
public $htmlTitle;
public $htmlSnippet;
public $link;
protected $__imageType = 'Google_ResultImage';
protected $__imageDataType = '';
public $image;
public $mime;
public $fileFormat;
public function setSnippet($snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLabels(/* array(Google_ResultLabels) */ $labels) {
$this->assertIsArray($labels, 'Google_ResultLabels', __METHOD__);
$this->labels = $labels;
}
public function getLabels() {
return $this->labels;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDisplayLink($displayLink) {
$this->displayLink = $displayLink;
}
public function getDisplayLink() {
return $this->displayLink;
}
public function setCacheId($cacheId) {
$this->cacheId = $cacheId;
}
public function getCacheId() {
return $this->cacheId;
}
public function setFormattedUrl($formattedUrl) {
$this->formattedUrl = $formattedUrl;
}
public function getFormattedUrl() {
return $this->formattedUrl;
}
public function setHtmlFormattedUrl($htmlFormattedUrl) {
$this->htmlFormattedUrl = $htmlFormattedUrl;
}
public function getHtmlFormattedUrl() {
return $this->htmlFormattedUrl;
}
public function setPagemap($pagemap) {
$this->pagemap = $pagemap;
}
public function getPagemap() {
return $this->pagemap;
}
public function setHtmlTitle($htmlTitle) {
$this->htmlTitle = $htmlTitle;
}
public function getHtmlTitle() {
return $this->htmlTitle;
}
public function setHtmlSnippet($htmlSnippet) {
$this->htmlSnippet = $htmlSnippet;
}
public function getHtmlSnippet() {
return $this->htmlSnippet;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setImage(Google_ResultImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setMime($mime) {
$this->mime = $mime;
}
public function getMime() {
return $this->mime;
}
public function setFileFormat($fileFormat) {
$this->fileFormat = $fileFormat;
}
public function getFileFormat() {
return $this->fileFormat;
}
}
class Google_ResultImage extends Google_Model {
public $thumbnailWidth;
public $byteSize;
public $height;
public $width;
public $contextLink;
public $thumbnailLink;
public $thumbnailHeight;
public function setThumbnailWidth($thumbnailWidth) {
$this->thumbnailWidth = $thumbnailWidth;
}
public function getThumbnailWidth() {
return $this->thumbnailWidth;
}
public function setByteSize($byteSize) {
$this->byteSize = $byteSize;
}
public function getByteSize() {
return $this->byteSize;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setContextLink($contextLink) {
$this->contextLink = $contextLink;
}
public function getContextLink() {
return $this->contextLink;
}
public function setThumbnailLink($thumbnailLink) {
$this->thumbnailLink = $thumbnailLink;
}
public function getThumbnailLink() {
return $this->thumbnailLink;
}
public function setThumbnailHeight($thumbnailHeight) {
$this->thumbnailHeight = $thumbnailHeight;
}
public function getThumbnailHeight() {
return $this->thumbnailHeight;
}
}
class Google_ResultLabels extends Google_Model {
public $displayName;
public $name;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Search extends Google_Model {
protected $__promotionsType = 'Google_Promotion';
protected $__promotionsDataType = 'array';
public $promotions;
public $kind;
protected $__urlType = 'Google_SearchUrl';
protected $__urlDataType = '';
public $url;
protected $__itemsType = 'Google_Result';
protected $__itemsDataType = 'array';
public $items;
protected $__contextType = 'Google_Context';
protected $__contextDataType = '';
public $context;
protected $__queriesType = 'Google_Query';
protected $__queriesDataType = 'map';
public $queries;
protected $__spellingType = 'Google_SearchSpelling';
protected $__spellingDataType = '';
public $spelling;
protected $__searchInformationType = 'Google_SearchSearchInformation';
protected $__searchInformationDataType = '';
public $searchInformation;
public function setPromotions(/* array(Google_Promotion) */ $promotions) {
$this->assertIsArray($promotions, 'Google_Promotion', __METHOD__);
$this->promotions = $promotions;
}
public function getPromotions() {
return $this->promotions;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUrl(Google_SearchUrl $url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setItems(/* array(Google_Result) */ $items) {
$this->assertIsArray($items, 'Google_Result', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setContext(Google_Context $context) {
$this->context = $context;
}
public function getContext() {
return $this->context;
}
public function setQueries(Google_Query $queries) {
$this->queries = $queries;
}
public function getQueries() {
return $this->queries;
}
public function setSpelling(Google_SearchSpelling $spelling) {
$this->spelling = $spelling;
}
public function getSpelling() {
return $this->spelling;
}
public function setSearchInformation(Google_SearchSearchInformation $searchInformation) {
$this->searchInformation = $searchInformation;
}
public function getSearchInformation() {
return $this->searchInformation;
}
}
class Google_SearchSearchInformation extends Google_Model {
public $formattedSearchTime;
public $formattedTotalResults;
public $totalResults;
public $searchTime;
public function setFormattedSearchTime($formattedSearchTime) {
$this->formattedSearchTime = $formattedSearchTime;
}
public function getFormattedSearchTime() {
return $this->formattedSearchTime;
}
public function setFormattedTotalResults($formattedTotalResults) {
$this->formattedTotalResults = $formattedTotalResults;
}
public function getFormattedTotalResults() {
return $this->formattedTotalResults;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setSearchTime($searchTime) {
$this->searchTime = $searchTime;
}
public function getSearchTime() {
return $this->searchTime;
}
}
class Google_SearchSpelling extends Google_Model {
public $correctedQuery;
public $htmlCorrectedQuery;
public function setCorrectedQuery($correctedQuery) {
$this->correctedQuery = $correctedQuery;
}
public function getCorrectedQuery() {
return $this->correctedQuery;
}
public function setHtmlCorrectedQuery($htmlCorrectedQuery) {
$this->htmlCorrectedQuery = $htmlCorrectedQuery;
}
public function getHtmlCorrectedQuery() {
return $this->htmlCorrectedQuery;
}
}
class Google_SearchUrl extends Google_Model {
public $type;
public $template;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setTemplate($template) {
$this->template = $template;
}
public function getTemplate() {
return $this->template;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_CustomsearchService.php | PHP | asf20 | 26,458 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "directDeals" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $directDeals = $adexchangebuyerService->directDeals;
* </code>
*/
class Google_DirectDealsServiceResource extends Google_ServiceResource {
/**
* Retrieves the authenticated user's list of direct deals. (directDeals.list)
*
* @param array $optParams Optional parameters.
* @return Google_DirectDealsList
*/
public function listDirectDeals($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DirectDealsList($data);
} else {
return $data;
}
}
/**
* Gets one direct deal by ID. (directDeals.get)
*
* @param string $id The direct deal id
* @param array $optParams Optional parameters.
* @return Google_DirectDeal
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_DirectDeal($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $accounts = $adexchangebuyerService->accounts;
* </code>
*/
class Google_AccountsServiceResource extends Google_ServiceResource {
/**
* Updates an existing account. This method supports patch semantics. (accounts.patch)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function patch($id, Google_Account $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Account($data);
} else {
return $data;
}
}
/**
* Retrieves the authenticated user's list of accounts. (accounts.list)
*
* @param array $optParams Optional parameters.
* @return Google_AccountsList
*/
public function listAccounts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AccountsList($data);
} else {
return $data;
}
}
/**
* Updates an existing account. (accounts.update)
*
* @param int $id The account id
* @param Google_Account $postBody
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function update($id, Google_Account $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Account($data);
} else {
return $data;
}
}
/**
* Gets one account by ID. (accounts.get)
*
* @param int $id The account id
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Account($data);
} else {
return $data;
}
}
}
/**
* The "creatives" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyerService = new Google_AdexchangebuyerService(...);
* $creatives = $adexchangebuyerService->creatives;
* </code>
*/
class Google_CreativesServiceResource extends Google_ServiceResource {
/**
* Submit a new creative. (creatives.insert)
*
* @param Google_Creative $postBody
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function insert(Google_Creative $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
/**
* Retrieves a list of the authenticated user's active creatives. (creatives.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional.
* @opt_param string maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional.
* @return Google_CreativesList
*/
public function listCreatives($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CreativesList($data);
} else {
return $data;
}
}
/**
* Gets the status for a single creative. (creatives.get)
*
* @param int $accountId The id for the account that will serve this creative.
* @param string $buyerCreativeId The buyer-specific id for this creative.
* @param string $adgroupId The adgroup this creative belongs to.
* @param array $optParams Optional parameters.
* @return Google_Creative
*/
public function get($accountId, $buyerCreativeId, $adgroupId, $optParams = array()) {
$params = array('accountId' => $accountId, 'buyerCreativeId' => $buyerCreativeId, 'adgroupId' => $adgroupId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Creative($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Adexchangebuyer (v1).
*
* <p>
* Lets you manage your Ad Exchange Buyer account.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/ad-exchange/buyer-rest" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AdexchangebuyerService extends Google_Service {
public $directDeals;
public $accounts;
public $creatives;
/**
* Constructs the internal representation of the Adexchangebuyer service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'adexchangebuyer/v1/';
$this->version = 'v1';
$this->serviceName = 'adexchangebuyer';
$client->addService($this->serviceName, $this->version);
$this->directDeals = new Google_DirectDealsServiceResource($this, $this->serviceName, 'directDeals', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "directdeals", "response": {"$ref": "DirectDealsList"}, "id": "adexchangebuyer.directDeals.list", "httpMethod": "GET"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "id": "adexchangebuyer.directDeals.get", "httpMethod": "GET", "path": "directdeals/{id}", "response": {"$ref": "DirectDeal"}}}}', true));
$this->accounts = new Google_AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PATCH", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.patch"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "path": "accounts", "response": {"$ref": "AccountsList"}, "id": "adexchangebuyer.accounts.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Account"}, "response": {"$ref": "Account"}, "httpMethod": "PUT", "path": "accounts/{id}", "id": "adexchangebuyer.accounts.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"id": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.accounts.get", "httpMethod": "GET", "path": "accounts/{id}", "response": {"$ref": "Account"}}}}', true));
$this->creatives = new Google_CreativesServiceResource($this, $this->serviceName, 'creatives', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "request": {"$ref": "Creative"}, "response": {"$ref": "Creative"}, "httpMethod": "POST", "path": "creatives", "id": "adexchangebuyer.creatives.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "1000", "format": "uint32"}}, "response": {"$ref": "CreativesList"}, "httpMethod": "GET", "path": "creatives", "id": "adexchangebuyer.creatives.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/adexchange.buyer"], "parameters": {"adgroupId": {"required": true, "type": "string", "location": "query", "format": "int64"}, "buyerCreativeId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "adexchangebuyer.creatives.get", "httpMethod": "GET", "path": "creatives/{accountId}/{buyerCreativeId}", "response": {"$ref": "Creative"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $kind;
public $maximumTotalQps;
protected $__bidderLocationType = 'Google_AccountBidderLocation';
protected $__bidderLocationDataType = 'array';
public $bidderLocation;
public $cookieMatchingNid;
public $id;
public $cookieMatchingUrl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setMaximumTotalQps($maximumTotalQps) {
$this->maximumTotalQps = $maximumTotalQps;
}
public function getMaximumTotalQps() {
return $this->maximumTotalQps;
}
public function setBidderLocation($bidderLocation) {
$this->assertIsArray($bidderLocation, 'Google_AccountBidderLocation', __METHOD__);
$this->bidderLocation = $bidderLocation;
}
public function getBidderLocation() {
return $this->bidderLocation;
}
public function setCookieMatchingNid($cookieMatchingNid) {
$this->cookieMatchingNid = $cookieMatchingNid;
}
public function getCookieMatchingNid() {
return $this->cookieMatchingNid;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCookieMatchingUrl($cookieMatchingUrl) {
$this->cookieMatchingUrl = $cookieMatchingUrl;
}
public function getCookieMatchingUrl() {
return $this->cookieMatchingUrl;
}
}
class Google_AccountBidderLocation extends Google_Model {
public $url;
public $maximumQps;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setMaximumQps($maximumQps) {
$this->maximumQps = $maximumQps;
}
public function getMaximumQps() {
return $this->maximumQps;
}
}
class Google_AccountsList extends Google_Model {
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems($items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Creative extends Google_Model {
public $productCategories;
public $advertiserName;
public $adgroupId;
public $videoURL;
public $width;
public $attribute;
public $kind;
public $height;
public $advertiserId;
public $HTMLSnippet;
public $status;
public $buyerCreativeId;
public $clickThroughUrl;
public $vendorType;
public $disapprovalReasons;
public $sensitiveCategories;
public $accountId;
public function setProductCategories($productCategories) {
$this->productCategories = $productCategories;
}
public function getProductCategories() {
return $this->productCategories;
}
public function setAdvertiserName($advertiserName) {
$this->advertiserName = $advertiserName;
}
public function getAdvertiserName() {
return $this->advertiserName;
}
public function setAdgroupId($adgroupId) {
$this->adgroupId = $adgroupId;
}
public function getAdgroupId() {
return $this->adgroupId;
}
public function setVideoURL($videoURL) {
$this->videoURL = $videoURL;
}
public function getVideoURL() {
return $this->videoURL;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setAttribute($attribute) {
$this->attribute = $attribute;
}
public function getAttribute() {
return $this->attribute;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setAdvertiserId($advertiserId) {
$this->advertiserId = $advertiserId;
}
public function getAdvertiserId() {
return $this->advertiserId;
}
public function setHTMLSnippet($HTMLSnippet) {
$this->HTMLSnippet = $HTMLSnippet;
}
public function getHTMLSnippet() {
return $this->HTMLSnippet;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setBuyerCreativeId($buyerCreativeId) {
$this->buyerCreativeId = $buyerCreativeId;
}
public function getBuyerCreativeId() {
return $this->buyerCreativeId;
}
public function setClickThroughUrl($clickThroughUrl) {
$this->clickThroughUrl = $clickThroughUrl;
}
public function getClickThroughUrl() {
return $this->clickThroughUrl;
}
public function setVendorType($vendorType) {
$this->vendorType = $vendorType;
}
public function getVendorType() {
return $this->vendorType;
}
public function setDisapprovalReasons($disapprovalReasons) {
$this->disapprovalReasons = $disapprovalReasons;
}
public function getDisapprovalReasons() {
return $this->disapprovalReasons;
}
public function setSensitiveCategories($sensitiveCategories) {
$this->sensitiveCategories = $sensitiveCategories;
}
public function getSensitiveCategories() {
return $this->sensitiveCategories;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_CreativesList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Creative';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Creative', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_DirectDeal extends Google_Model {
public $advertiser;
public $kind;
public $currencyCode;
public $fixedCpm;
public $startTime;
public $endTime;
public $sellerNetwork;
public $id;
public $accountId;
public function setAdvertiser($advertiser) {
$this->advertiser = $advertiser;
}
public function getAdvertiser() {
return $this->advertiser;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
public function setFixedCpm($fixedCpm) {
$this->fixedCpm = $fixedCpm;
}
public function getFixedCpm() {
return $this->fixedCpm;
}
public function setStartTime($startTime) {
$this->startTime = $startTime;
}
public function getStartTime() {
return $this->startTime;
}
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setSellerNetwork($sellerNetwork) {
$this->sellerNetwork = $sellerNetwork;
}
public function getSellerNetwork() {
return $this->sellerNetwork;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_DirectDealsList extends Google_Model {
public $kind;
protected $__directDealsType = 'Google_DirectDeal';
protected $__directDealsDataType = 'array';
public $directDeals;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDirectDeals($directDeals) {
$this->assertIsArray($directDeals, 'Google_DirectDeal', __METHOD__);
$this->directDeals = $directDeals;
}
public function getDirectDeals() {
return $this->directDeals;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_AdexchangebuyerService.php | PHP | asf20 | 19,317 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "freebusy" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $freebusy = $calendarService->freebusy;
* </code>
*/
class Google_FreebusyServiceResource extends Google_ServiceResource {
/**
* Returns free/busy information for a set of calendars. (freebusy.query)
*
* @param Google_FreeBusyRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_FreeBusyResponse
*/
public function query(Google_FreeBusyRequest $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('query', array($params));
if ($this->useObjects()) {
return new Google_FreeBusyResponse($data);
} else {
return $data;
}
}
}
/**
* The "settings" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $settings = $calendarService->settings;
* </code>
*/
class Google_SettingsServiceResource extends Google_ServiceResource {
/**
* Returns all user settings for the authenticated user. (settings.list)
*
* @param array $optParams Optional parameters.
* @return Google_Settings
*/
public function listSettings($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Settings($data);
} else {
return $data;
}
}
/**
* Returns a single user setting. (settings.get)
*
* @param string $setting Name of the user setting.
* @param array $optParams Optional parameters.
* @return Google_Setting
*/
public function get($setting, $optParams = array()) {
$params = array('setting' => $setting);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Setting($data);
} else {
return $data;
}
}
}
/**
* The "calendarList" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $calendarList = $calendarService->calendarList;
* </code>
*/
class Google_CalendarListServiceResource extends Google_ServiceResource {
/**
* 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 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'color' field will be set to the best matching option automatically. Optional. The default is False.
* @return Google_CalendarListEntry
*/
public function insert(Google_CalendarListEntry $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CalendarListEntry($data);
} else {
return $data;
}
}
/**
* Returns an entry on the user's calendar list. (calendarList.get)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
* @return Google_CalendarListEntry
*/
public function get($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CalendarListEntry($data);
} else {
return $data;
}
}
/**
* Returns entries on the user's calendar list. (calendarList.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token specifying which result page to return. Optional.
* @opt_param bool showHidden Whether to show hidden entries. Optional. The default is False.
* @opt_param int maxResults Maximum number of entries returned on one result page. Optional.
* @opt_param string minAccessRole The minimum access role for the user in the returned entires. Optional. The default is no restriction.
* @return Google_CalendarList
*/
public function listCalendarList($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CalendarList($data);
} else {
return $data;
}
}
/**
* Updates an entry on the user's calendar list. (calendarList.update)
*
* @param string $calendarId Calendar identifier.
* @param Google_CalendarListEntry $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool colorRgbFormat Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'color' field will be set to the best matching option automatically. Optional. The default is False.
* @return Google_CalendarListEntry
*/
public function update($calendarId, Google_CalendarListEntry $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_CalendarListEntry($data);
} else {
return $data;
}
}
/**
* Updates an entry on the user's calendar list. This method supports patch semantics.
* (calendarList.patch)
*
* @param string $calendarId Calendar identifier.
* @param Google_CalendarListEntry $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool colorRgbFormat Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB). If this feature is used, the index-based 'color' field will be set to the best matching option automatically. Optional. The default is False.
* @return Google_CalendarListEntry
*/
public function patch($calendarId, Google_CalendarListEntry $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_CalendarListEntry($data);
} else {
return $data;
}
}
/**
* Deletes an entry on the user's calendar list. (calendarList.delete)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
*/
public function delete($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "calendars" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $calendars = $calendarService->calendars;
* </code>
*/
class Google_CalendarsServiceResource extends Google_ServiceResource {
/**
* Creates a secondary calendar. (calendars.insert)
*
* @param Google_Calendar $postBody
* @param array $optParams Optional parameters.
* @return Google_Calendar
*/
public function insert(Google_Calendar $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Calendar($data);
} else {
return $data;
}
}
/**
* Returns metadata for a calendar. (calendars.get)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
* @return Google_Calendar
*/
public function get($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Calendar($data);
} else {
return $data;
}
}
/**
* Clears a primary calendar. This operation deletes all data associated with the primary calendar
* of an account and cannot be undone. (calendars.clear)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
*/
public function clear($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('clear', array($params));
return $data;
}
/**
* Updates metadata for a calendar. (calendars.update)
*
* @param string $calendarId Calendar identifier.
* @param Google_Calendar $postBody
* @param array $optParams Optional parameters.
* @return Google_Calendar
*/
public function update($calendarId, Google_Calendar $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Calendar($data);
} else {
return $data;
}
}
/**
* Updates metadata for a calendar. This method supports patch semantics. (calendars.patch)
*
* @param string $calendarId Calendar identifier.
* @param Google_Calendar $postBody
* @param array $optParams Optional parameters.
* @return Google_Calendar
*/
public function patch($calendarId, Google_Calendar $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Calendar($data);
} else {
return $data;
}
}
/**
* Deletes a secondary calendar. (calendars.delete)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
*/
public function delete($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "acl" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $acl = $calendarService->acl;
* </code>
*/
class Google_AclServiceResource extends Google_ServiceResource {
/**
* Creates an access control rule. (acl.insert)
*
* @param string $calendarId Calendar identifier.
* @param Google_AclRule $postBody
* @param array $optParams Optional parameters.
* @return Google_AclRule
*/
public function insert($calendarId, Google_AclRule $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_AclRule($data);
} else {
return $data;
}
}
/**
* Returns an access control rule. (acl.get)
*
* @param string $calendarId Calendar identifier.
* @param string $ruleId ACL rule identifier.
* @param array $optParams Optional parameters.
* @return Google_AclRule
*/
public function get($calendarId, $ruleId, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'ruleId' => $ruleId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AclRule($data);
} else {
return $data;
}
}
/**
* Returns the rules in the access control list for the calendar. (acl.list)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
* @return Google_Acl
*/
public function listAcl($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Acl($data);
} else {
return $data;
}
}
/**
* Updates an access control rule. (acl.update)
*
* @param string $calendarId Calendar identifier.
* @param string $ruleId ACL rule identifier.
* @param Google_AclRule $postBody
* @param array $optParams Optional parameters.
* @return Google_AclRule
*/
public function update($calendarId, $ruleId, Google_AclRule $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_AclRule($data);
} else {
return $data;
}
}
/**
* Updates an access control rule. This method supports patch semantics. (acl.patch)
*
* @param string $calendarId Calendar identifier.
* @param string $ruleId ACL rule identifier.
* @param Google_AclRule $postBody
* @param array $optParams Optional parameters.
* @return Google_AclRule
*/
public function patch($calendarId, $ruleId, Google_AclRule $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_AclRule($data);
} else {
return $data;
}
}
/**
* Deletes an access control rule. (acl.delete)
*
* @param string $calendarId Calendar identifier.
* @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);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "colors" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $colors = $calendarService->colors;
* </code>
*/
class Google_ColorsServiceResource extends Google_ServiceResource {
/**
* Returns the color definitions for calendars and events. (colors.get)
*
* @param array $optParams Optional parameters.
* @return Google_Colors
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Colors($data);
} else {
return $data;
}
}
}
/**
* The "events" collection of methods.
* Typical usage is:
* <code>
* $calendarService = new Google_CalendarService(...);
* $events = $calendarService->events;
* </code>
*/
class Google_EventsServiceResource extends Google_ServiceResource {
/**
* Creates an event. (events.insert)
*
* @param string $calendarId Calendar identifier.
* @param Google_Event $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool sendNotifications Whether to send notifications about the creation of the new event. Optional. The default is False.
* @return Google_Event
*/
public function insert($calendarId, Google_Event $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Returns an event. (events.get)
*
* @param string $calendarId Calendar identifier.
* @param string $eventId Event identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string timeZone Time zone used in the response. Optional. The default is the time zone of the calendar.
* @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.
* @return Google_Event
*/
public function get($calendarId, $eventId, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'eventId' => $eventId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* 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_Event
*/
public function move($calendarId, $eventId, $destination, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'destination' => $destination);
$params = array_merge($params, $optParams);
$data = $this->__call('move', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Returns events on the specified calendar. (events.list)
*
* @param string $calendarId Calendar identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string orderBy The order of the events returned in the result. Optional. The default is an unspecified, stable order.
* @opt_param bool showHiddenInvitations Whether to include hidden invitations in the result. Optional. The default is False.
* @opt_param bool showDeleted Whether to include deleted events (with 'eventStatus' equals 'cancelled') in the result. Optional. The default is False.
* @opt_param string iCalUID Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.
* @opt_param string updatedMin Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.
* @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 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 maxResults Maximum number of events returned on one result page. Optional.
* @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 pageToken Token specifying which result page to return. Optional.
* @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.
* @opt_param string timeZone Time zone used in the response. Optional. The default is the time zone of the calendar.
* @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.
* @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.
* @return Google_Events
*/
public function listEvents($calendarId, $optParams = array()) {
$params = array('calendarId' => $calendarId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Events($data);
} else {
return $data;
}
}
/**
* Updates an event. (events.update)
*
* @param string $calendarId Calendar identifier.
* @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 bool sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.
* @return Google_Event
*/
public function update($calendarId, $eventId, Google_Event $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Updates an event. This method supports patch semantics. (events.patch)
*
* @param string $calendarId Calendar identifier.
* @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 bool sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.
* @return Google_Event
*/
public function patch($calendarId, $eventId, Google_Event $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Returns instances of the specified recurring event. (events.instances)
*
* @param string $calendarId Calendar identifier.
* @param string $eventId Recurring event identifier.
* @param array $optParams Optional parameters.
*
* @opt_param bool showDeleted Whether to include deleted events (with 'eventStatus' equals 'cancelled') in the result. Optional. The default is False.
* @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 maxResults Maximum number of events returned on one result page. Optional.
* @opt_param string pageToken Token specifying which result page to return. Optional.
* @opt_param string timeZone Time zone used in the response. Optional. The default is the time zone of the calendar.
* @opt_param string originalStart The original start time of the instance in the result. 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.
* @return Google_Events
*/
public function instances($calendarId, $eventId, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'eventId' => $eventId);
$params = array_merge($params, $optParams);
$data = $this->__call('instances', array($params));
if ($this->useObjects()) {
return new Google_Events($data);
} else {
return $data;
}
}
/**
* Imports an event. (events.import)
*
* @param string $calendarId Calendar identifier.
* @param Google_Event $postBody
* @param array $optParams Optional parameters.
* @return Google_Event
*/
public function import($calendarId, Google_Event $postBody, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('import', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Creates an event based on a simple text string. (events.quickAdd)
*
* @param string $calendarId Calendar identifier.
* @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_Event
*/
public function quickAdd($calendarId, $text, $optParams = array()) {
$params = array('calendarId' => $calendarId, 'text' => $text);
$params = array_merge($params, $optParams);
$data = $this->__call('quickAdd', array($params));
if ($this->useObjects()) {
return new Google_Event($data);
} else {
return $data;
}
}
/**
* Deletes an event. (events.delete)
*
* @param string $calendarId Calendar identifier.
* @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);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Calendar (v3).
*
* <p>
* Lets you manipulate events and other calendar data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/calendar/v3/using.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_CalendarService extends Google_Service {
public $freebusy;
public $settings;
public $calendarList;
public $calendars;
public $acl;
public $colors;
public $events;
/**
* Constructs the internal representation of the Calendar service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'calendar/v3/';
$this->version = 'v3';
$this->serviceName = 'calendar';
$client->addService($this->serviceName, $this->version);
$this->freebusy = new Google_FreebusyServiceResource($this, $this->serviceName, 'freebusy', json_decode('{"methods": {"query": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "request": {"$ref": "FreeBusyRequest"}, "response": {"$ref": "FreeBusyResponse"}, "httpMethod": "POST", "path": "freeBusy", "id": "calendar.freebusy.query"}}}', true));
$this->settings = new Google_SettingsServiceResource($this, $this->serviceName, 'settings', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "path": "users/me/settings", "response": {"$ref": "Settings"}, "id": "calendar.settings.list", "httpMethod": "GET"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"setting": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.settings.get", "httpMethod": "GET", "path": "users/me/settings/{setting}", "response": {"$ref": "Setting"}}}}', true));
$this->calendarList = new Google_CalendarListServiceResource($this, $this->serviceName, 'calendarList', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"colorRgbFormat": {"type": "boolean", "location": "query"}}, "request": {"$ref": "CalendarListEntry"}, "response": {"$ref": "CalendarListEntry"}, "httpMethod": "POST", "path": "users/me/calendarList", "id": "calendar.calendarList.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.calendarList.get", "httpMethod": "GET", "path": "users/me/calendarList/{calendarId}", "response": {"$ref": "CalendarListEntry"}}, "list": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "minAccessRole": {"enum": ["freeBusyReader", "owner", "reader", "writer"], "type": "string", "location": "query"}}, "response": {"$ref": "CalendarList"}, "httpMethod": "GET", "path": "users/me/calendarList", "id": "calendar.calendarList.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"colorRgbFormat": {"type": "boolean", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CalendarListEntry"}, "response": {"$ref": "CalendarListEntry"}, "httpMethod": "PUT", "path": "users/me/calendarList/{calendarId}", "id": "calendar.calendarList.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"colorRgbFormat": {"type": "boolean", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CalendarListEntry"}, "response": {"$ref": "CalendarListEntry"}, "httpMethod": "PATCH", "path": "users/me/calendarList/{calendarId}", "id": "calendar.calendarList.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/calendar"], "path": "users/me/calendarList/{calendarId}", "id": "calendar.calendarList.delete", "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->calendars = new Google_CalendarsServiceResource($this, $this->serviceName, 'calendars', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/calendar"], "request": {"$ref": "Calendar"}, "response": {"$ref": "Calendar"}, "httpMethod": "POST", "path": "calendars", "id": "calendar.calendars.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.calendars.get", "httpMethod": "GET", "path": "calendars/{calendarId}", "response": {"$ref": "Calendar"}}, "clear": {"scopes": ["https://www.googleapis.com/auth/calendar"], "path": "calendars/{calendarId}/clear", "id": "calendar.calendars.clear", "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST"}, "update": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Calendar"}, "response": {"$ref": "Calendar"}, "httpMethod": "PUT", "path": "calendars/{calendarId}", "id": "calendar.calendars.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Calendar"}, "response": {"$ref": "Calendar"}, "httpMethod": "PATCH", "path": "calendars/{calendarId}", "id": "calendar.calendars.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/calendar"], "path": "calendars/{calendarId}", "id": "calendar.calendars.delete", "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->acl = new Google_AclServiceResource($this, $this->serviceName, 'acl', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AclRule"}, "response": {"$ref": "AclRule"}, "httpMethod": "POST", "path": "calendars/{calendarId}/acl", "id": "calendar.acl.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}, "ruleId": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.acl.get", "httpMethod": "GET", "path": "calendars/{calendarId}/acl/{ruleId}", "response": {"$ref": "AclRule"}}, "list": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "id": "calendar.acl.list", "httpMethod": "GET", "path": "calendars/{calendarId}/acl", "response": {"$ref": "Acl"}}, "update": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}, "ruleId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AclRule"}, "response": {"$ref": "AclRule"}, "httpMethod": "PUT", "path": "calendars/{calendarId}/acl/{ruleId}", "id": "calendar.acl.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}, "ruleId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AclRule"}, "response": {"$ref": "AclRule"}, "httpMethod": "PATCH", "path": "calendars/{calendarId}/acl/{ruleId}", "id": "calendar.acl.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/calendar"], "path": "calendars/{calendarId}/acl/{ruleId}", "id": "calendar.acl.delete", "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}, "ruleId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->colors = new Google_ColorsServiceResource($this, $this->serviceName, 'colors', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "path": "colors", "response": {"$ref": "Colors"}, "id": "calendar.colors.get", "httpMethod": "GET"}}}', true));
$this->events = new Google_EventsServiceResource($this, $this->serviceName, 'events', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "request": {"$ref": "Event"}, "response": {"$ref": "Event"}, "httpMethod": "POST", "path": "calendars/{calendarId}/events", "id": "calendar.events.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "timeZone": {"type": "string", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "alwaysIncludeEmail": {"type": "boolean", "location": "query"}, "maxAttendees": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}}, "id": "calendar.events.get", "httpMethod": "GET", "path": "calendars/{calendarId}/events/{eventId}", "response": {"$ref": "Event"}}, "move": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "destination": {"required": true, "type": "string", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "id": "calendar.events.move", "httpMethod": "POST", "path": "calendars/{calendarId}/events/{eventId}/move", "response": {"$ref": "Event"}}, "list": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"orderBy": {"enum": ["startTime", "updated"], "type": "string", "location": "query"}, "showHiddenInvitations": {"type": "boolean", "location": "query"}, "showDeleted": {"type": "boolean", "location": "query"}, "iCalUID": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query", "format": "date-time"}, "singleEvents": {"type": "boolean", "location": "query"}, "alwaysIncludeEmail": {"type": "boolean", "location": "query"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "q": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "timeMin": {"type": "string", "location": "query", "format": "date-time"}, "timeZone": {"type": "string", "location": "query"}, "timeMax": {"type": "string", "location": "query", "format": "date-time"}, "maxAttendees": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}}, "id": "calendar.events.list", "httpMethod": "GET", "path": "calendars/{calendarId}/events", "response": {"$ref": "Events"}}, "update": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "alwaysIncludeEmail": {"type": "boolean", "location": "query"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "request": {"$ref": "Event"}, "response": {"$ref": "Event"}, "httpMethod": "PUT", "path": "calendars/{calendarId}/events/{eventId}", "id": "calendar.events.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "alwaysIncludeEmail": {"type": "boolean", "location": "query"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "request": {"$ref": "Event"}, "response": {"$ref": "Event"}, "httpMethod": "PATCH", "path": "calendars/{calendarId}/events/{eventId}", "id": "calendar.events.patch"}, "instances": {"scopes": ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.readonly"], "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "showDeleted": {"type": "boolean", "location": "query"}, "alwaysIncludeEmail": {"type": "boolean", "location": "query"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "pageToken": {"type": "string", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "timeZone": {"type": "string", "location": "query"}, "originalStart": {"type": "string", "location": "query"}, "maxAttendees": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}}, "id": "calendar.events.instances", "httpMethod": "GET", "path": "calendars/{calendarId}/events/{eventId}/instances", "response": {"$ref": "Events"}}, "import": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"calendarId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Event"}, "response": {"$ref": "Event"}, "httpMethod": "POST", "path": "calendars/{calendarId}/events/import", "id": "calendar.events.import"}, "quickAdd": {"scopes": ["https://www.googleapis.com/auth/calendar"], "parameters": {"text": {"required": true, "type": "string", "location": "query"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "id": "calendar.events.quickAdd", "httpMethod": "POST", "path": "calendars/{calendarId}/events/quickAdd", "response": {"$ref": "Event"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/calendar"], "path": "calendars/{calendarId}/events/{eventId}", "id": "calendar.events.delete", "parameters": {"eventId": {"required": true, "type": "string", "location": "path"}, "calendarId": {"required": true, "type": "string", "location": "path"}, "sendNotifications": {"type": "boolean", "location": "query"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Acl extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_AclRule';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_AclRule) */ $items) {
$this->assertIsArray($items, 'Google_AclRule', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AclRule extends Google_Model {
protected $__scopeType = 'Google_AclRuleScope';
protected $__scopeDataType = '';
public $scope;
public $kind;
public $etag;
public $role;
public $id;
public function setScope(Google_AclRuleScope $scope) {
$this->scope = $scope;
}
public function getScope() {
return $this->scope;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setRole($role) {
$this->role = $role;
}
public function getRole() {
return $this->role;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_AclRuleScope extends Google_Model {
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_Calendar extends Google_Model {
public $kind;
public $description;
public $summary;
public $etag;
public $location;
public $timeZone;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setSummary($summary) {
$this->summary = $summary;
}
public function getSummary() {
return $this->summary;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setTimeZone($timeZone) {
$this->timeZone = $timeZone;
}
public function getTimeZone() {
return $this->timeZone;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CalendarList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_CalendarListEntry';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_CalendarListEntry) */ $items) {
$this->assertIsArray($items, 'Google_CalendarListEntry', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_CalendarListEntry extends Google_Model {
public $kind;
public $foregroundColor;
protected $__defaultRemindersType = 'Google_EventReminder';
protected $__defaultRemindersDataType = 'array';
public $defaultReminders;
public $description;
public $colorId;
public $selected;
public $summary;
public $etag;
public $location;
public $backgroundColor;
public $summaryOverride;
public $timeZone;
public $hidden;
public $accessRole;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setForegroundColor($foregroundColor) {
$this->foregroundColor = $foregroundColor;
}
public function getForegroundColor() {
return $this->foregroundColor;
}
public function setDefaultReminders(/* array(Google_EventReminder) */ $defaultReminders) {
$this->assertIsArray($defaultReminders, 'Google_EventReminder', __METHOD__);
$this->defaultReminders = $defaultReminders;
}
public function getDefaultReminders() {
return $this->defaultReminders;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setColorId($colorId) {
$this->colorId = $colorId;
}
public function getColorId() {
return $this->colorId;
}
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 setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setBackgroundColor($backgroundColor) {
$this->backgroundColor = $backgroundColor;
}
public function getBackgroundColor() {
return $this->backgroundColor;
}
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;
}
public function setHidden($hidden) {
$this->hidden = $hidden;
}
public function getHidden() {
return $this->hidden;
}
public function setAccessRole($accessRole) {
$this->accessRole = $accessRole;
}
public function getAccessRole() {
return $this->accessRole;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ColorDefinition extends Google_Model {
public $foreground;
public $background;
public function setForeground($foreground) {
$this->foreground = $foreground;
}
public function getForeground() {
return $this->foreground;
}
public function setBackground($background) {
$this->background = $background;
}
public function getBackground() {
return $this->background;
}
}
class Google_Colors extends Google_Model {
protected $__calendarType = 'Google_ColorDefinition';
protected $__calendarDataType = 'map';
public $calendar;
public $updated;
protected $__eventType = 'Google_ColorDefinition';
protected $__eventDataType = 'map';
public $event;
public $kind;
public function setCalendar(Google_ColorDefinition $calendar) {
$this->calendar = $calendar;
}
public function getCalendar() {
return $this->calendar;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setEvent(Google_ColorDefinition $event) {
$this->event = $event;
}
public function getEvent() {
return $this->event;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Error extends Google_Model {
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_Event extends Google_Model {
protected $__creatorType = 'Google_EventCreator';
protected $__creatorDataType = '';
public $creator;
protected $__organizerType = 'Google_EventOrganizer';
protected $__organizerDataType = '';
public $organizer;
public $summary;
public $id;
protected $__attendeesType = 'Google_EventAttendee';
protected $__attendeesDataType = 'array';
public $attendees;
public $htmlLink;
public $recurrence;
protected $__startType = 'Google_EventDateTime';
protected $__startDataType = '';
public $start;
public $etag;
public $location;
public $recurringEventId;
protected $__gadgetType = 'Google_EventGadget';
protected $__gadgetDataType = '';
public $gadget;
public $status;
public $updated;
public $description;
public $iCalUID;
protected $__extendedPropertiesType = 'Google_EventExtendedProperties';
protected $__extendedPropertiesDataType = '';
public $extendedProperties;
public $endTimeUnspecified;
public $sequence;
public $visibility;
public $guestsCanModify;
protected $__endType = 'Google_EventDateTime';
protected $__endDataType = '';
public $end;
public $attendeesOmitted;
public $kind;
public $locked;
public $created;
public $colorId;
public $anyoneCanAddSelf;
protected $__remindersType = 'Google_EventReminders';
protected $__remindersDataType = '';
public $reminders;
public $guestsCanSeeOtherGuests;
protected $__originalStartTimeType = 'Google_EventDateTime';
protected $__originalStartTimeDataType = '';
public $originalStartTime;
public $guestsCanInviteOthers;
public $transparency;
public $privateCopy;
public function setCreator(Google_EventCreator $creator) {
$this->creator = $creator;
}
public function getCreator() {
return $this->creator;
}
public function setOrganizer(Google_EventOrganizer $organizer) {
$this->organizer = $organizer;
}
public function getOrganizer() {
return $this->organizer;
}
public function setSummary($summary) {
$this->summary = $summary;
}
public function getSummary() {
return $this->summary;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAttendees(/* array(Google_EventAttendee) */ $attendees) {
$this->assertIsArray($attendees, 'Google_EventAttendee', __METHOD__);
$this->attendees = $attendees;
}
public function getAttendees() {
return $this->attendees;
}
public function setHtmlLink($htmlLink) {
$this->htmlLink = $htmlLink;
}
public function getHtmlLink() {
return $this->htmlLink;
}
public function setRecurrence(/* array(Google_string) */ $recurrence) {
$this->assertIsArray($recurrence, 'Google_string', __METHOD__);
$this->recurrence = $recurrence;
}
public function getRecurrence() {
return $this->recurrence;
}
public function setStart(Google_EventDateTime $start) {
$this->start = $start;
}
public function getStart() {
return $this->start;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setRecurringEventId($recurringEventId) {
$this->recurringEventId = $recurringEventId;
}
public function getRecurringEventId() {
return $this->recurringEventId;
}
public function setGadget(Google_EventGadget $gadget) {
$this->gadget = $gadget;
}
public function getGadget() {
return $this->gadget;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setICalUID($iCalUID) {
$this->iCalUID = $iCalUID;
}
public function getICalUID() {
return $this->iCalUID;
}
public function setExtendedProperties(Google_EventExtendedProperties $extendedProperties) {
$this->extendedProperties = $extendedProperties;
}
public function getExtendedProperties() {
return $this->extendedProperties;
}
public function setEndTimeUnspecified($endTimeUnspecified) {
$this->endTimeUnspecified = $endTimeUnspecified;
}
public function getEndTimeUnspecified() {
return $this->endTimeUnspecified;
}
public function setSequence($sequence) {
$this->sequence = $sequence;
}
public function getSequence() {
return $this->sequence;
}
public function setVisibility($visibility) {
$this->visibility = $visibility;
}
public function getVisibility() {
return $this->visibility;
}
public function setGuestsCanModify($guestsCanModify) {
$this->guestsCanModify = $guestsCanModify;
}
public function getGuestsCanModify() {
return $this->guestsCanModify;
}
public function setEnd(Google_EventDateTime $end) {
$this->end = $end;
}
public function getEnd() {
return $this->end;
}
public function setAttendeesOmitted($attendeesOmitted) {
$this->attendeesOmitted = $attendeesOmitted;
}
public function getAttendeesOmitted() {
return $this->attendeesOmitted;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLocked($locked) {
$this->locked = $locked;
}
public function getLocked() {
return $this->locked;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setColorId($colorId) {
$this->colorId = $colorId;
}
public function getColorId() {
return $this->colorId;
}
public function setAnyoneCanAddSelf($anyoneCanAddSelf) {
$this->anyoneCanAddSelf = $anyoneCanAddSelf;
}
public function getAnyoneCanAddSelf() {
return $this->anyoneCanAddSelf;
}
public function setReminders(Google_EventReminders $reminders) {
$this->reminders = $reminders;
}
public function getReminders() {
return $this->reminders;
}
public function setGuestsCanSeeOtherGuests($guestsCanSeeOtherGuests) {
$this->guestsCanSeeOtherGuests = $guestsCanSeeOtherGuests;
}
public function getGuestsCanSeeOtherGuests() {
return $this->guestsCanSeeOtherGuests;
}
public function setOriginalStartTime(Google_EventDateTime $originalStartTime) {
$this->originalStartTime = $originalStartTime;
}
public function getOriginalStartTime() {
return $this->originalStartTime;
}
public function setGuestsCanInviteOthers($guestsCanInviteOthers) {
$this->guestsCanInviteOthers = $guestsCanInviteOthers;
}
public function getGuestsCanInviteOthers() {
return $this->guestsCanInviteOthers;
}
public function setTransparency($transparency) {
$this->transparency = $transparency;
}
public function getTransparency() {
return $this->transparency;
}
public function setPrivateCopy($privateCopy) {
$this->privateCopy = $privateCopy;
}
public function getPrivateCopy() {
return $this->privateCopy;
}
}
class Google_EventAttendee extends Google_Model {
public $comment;
public $displayName;
public $responseStatus;
public $self;
public $id;
public $additionalGuests;
public $resource;
public $organizer;
public $optional;
public $email;
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 setResponseStatus($responseStatus) {
$this->responseStatus = $responseStatus;
}
public function getResponseStatus() {
return $this->responseStatus;
}
public function setSelf($self) {
$this->self = $self;
}
public function getSelf() {
return $this->self;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAdditionalGuests($additionalGuests) {
$this->additionalGuests = $additionalGuests;
}
public function getAdditionalGuests() {
return $this->additionalGuests;
}
public function setResource($resource) {
$this->resource = $resource;
}
public function getResource() {
return $this->resource;
}
public function setOrganizer($organizer) {
$this->organizer = $organizer;
}
public function getOrganizer() {
return $this->organizer;
}
public function setOptional($optional) {
$this->optional = $optional;
}
public function getOptional() {
return $this->optional;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
}
class Google_EventCreator extends Google_Model {
public $self;
public $displayName;
public $email;
public $id;
public function setSelf($self) {
$this->self = $self;
}
public function getSelf() {
return $this->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;
}
}
class Google_EventDateTime extends Google_Model {
public $date;
public $timeZone;
public $dateTime;
public function setDate($date) {
$this->date = $date;
}
public function getDate() {
return $this->date;
}
public function setTimeZone($timeZone) {
$this->timeZone = $timeZone;
}
public function getTimeZone() {
return $this->timeZone;
}
public function setDateTime($dateTime) {
$this->dateTime = $dateTime;
}
public function getDateTime() {
return $this->dateTime;
}
}
class Google_EventExtendedProperties extends Google_Model {
public $shared;
public $private;
public function setShared($shared) {
$this->shared = $shared;
}
public function getShared() {
return $this->shared;
}
public function setPrivate($private) {
$this->private = $private;
}
public function getPrivate() {
return $this->private;
}
}
class Google_EventGadget extends Google_Model {
public $preferences;
public $title;
public $height;
public $width;
public $link;
public $type;
public $display;
public $iconLink;
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 setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setDisplay($display) {
$this->display = $display;
}
public function getDisplay() {
return $this->display;
}
public function setIconLink($iconLink) {
$this->iconLink = $iconLink;
}
public function getIconLink() {
return $this->iconLink;
}
}
class Google_EventOrganizer extends Google_Model {
public $self;
public $displayName;
public $email;
public $id;
public function setSelf($self) {
$this->self = $self;
}
public function getSelf() {
return $this->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;
}
}
class Google_EventReminder extends Google_Model {
public $minutes;
public $method;
public function setMinutes($minutes) {
$this->minutes = $minutes;
}
public function getMinutes() {
return $this->minutes;
}
public function setMethod($method) {
$this->method = $method;
}
public function getMethod() {
return $this->method;
}
}
class Google_EventReminders extends Google_Model {
protected $__overridesType = 'Google_EventReminder';
protected $__overridesDataType = 'array';
public $overrides;
public $useDefault;
public function setOverrides(/* array(Google_EventReminder) */ $overrides) {
$this->assertIsArray($overrides, 'Google_EventReminder', __METHOD__);
$this->overrides = $overrides;
}
public function getOverrides() {
return $this->overrides;
}
public function setUseDefault($useDefault) {
$this->useDefault = $useDefault;
}
public function getUseDefault() {
return $this->useDefault;
}
}
class Google_Events extends Google_Model {
public $nextPageToken;
public $kind;
protected $__defaultRemindersType = 'Google_EventReminder';
protected $__defaultRemindersDataType = 'array';
public $defaultReminders;
public $description;
protected $__itemsType = 'Google_Event';
protected $__itemsDataType = 'array';
public $items;
public $updated;
public $summary;
public $etag;
public $timeZone;
public $accessRole;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDefaultReminders(/* array(Google_EventReminder) */ $defaultReminders) {
$this->assertIsArray($defaultReminders, 'Google_EventReminder', __METHOD__);
$this->defaultReminders = $defaultReminders;
}
public function getDefaultReminders() {
return $this->defaultReminders;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setItems(/* array(Google_Event) */ $items) {
$this->assertIsArray($items, 'Google_Event', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setSummary($summary) {
$this->summary = $summary;
}
public function getSummary() {
return $this->summary;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setTimeZone($timeZone) {
$this->timeZone = $timeZone;
}
public function getTimeZone() {
return $this->timeZone;
}
public function setAccessRole($accessRole) {
$this->accessRole = $accessRole;
}
public function getAccessRole() {
return $this->accessRole;
}
}
class Google_FreeBusyCalendar extends Google_Model {
protected $__busyType = 'Google_TimePeriod';
protected $__busyDataType = 'array';
public $busy;
protected $__errorsType = 'Google_Error';
protected $__errorsDataType = 'array';
public $errors;
public function setBusy(/* array(Google_TimePeriod) */ $busy) {
$this->assertIsArray($busy, 'Google_TimePeriod', __METHOD__);
$this->busy = $busy;
}
public function getBusy() {
return $this->busy;
}
public function setErrors(/* array(Google_Error) */ $errors) {
$this->assertIsArray($errors, 'Google_Error', __METHOD__);
$this->errors = $errors;
}
public function getErrors() {
return $this->errors;
}
}
class Google_FreeBusyGroup extends Google_Model {
protected $__errorsType = 'Google_Error';
protected $__errorsDataType = 'array';
public $errors;
public $calendars;
public function setErrors(/* array(Google_Error) */ $errors) {
$this->assertIsArray($errors, 'Google_Error', __METHOD__);
$this->errors = $errors;
}
public function getErrors() {
return $this->errors;
}
public function setCalendars(/* array(Google_string) */ $calendars) {
$this->assertIsArray($calendars, 'Google_string', __METHOD__);
$this->calendars = $calendars;
}
public function getCalendars() {
return $this->calendars;
}
}
class Google_FreeBusyRequest extends Google_Model {
public $calendarExpansionMax;
public $groupExpansionMax;
public $timeMax;
protected $__itemsType = 'Google_FreeBusyRequestItem';
protected $__itemsDataType = 'array';
public $items;
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 setTimeMax($timeMax) {
$this->timeMax = $timeMax;
}
public function getTimeMax() {
return $this->timeMax;
}
public function setItems(/* array(Google_FreeBusyRequestItem) */ $items) {
$this->assertIsArray($items, 'Google_FreeBusyRequestItem', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
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_FreeBusyRequestItem extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_FreeBusyResponse extends Google_Model {
public $timeMax;
public $kind;
protected $__calendarsType = 'Google_FreeBusyCalendar';
protected $__calendarsDataType = 'map';
public $calendars;
public $timeMin;
protected $__groupsType = 'Google_FreeBusyGroup';
protected $__groupsDataType = 'map';
public $groups;
public function setTimeMax($timeMax) {
$this->timeMax = $timeMax;
}
public function getTimeMax() {
return $this->timeMax;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCalendars(Google_FreeBusyCalendar $calendars) {
$this->calendars = $calendars;
}
public function getCalendars() {
return $this->calendars;
}
public function setTimeMin($timeMin) {
$this->timeMin = $timeMin;
}
public function getTimeMin() {
return $this->timeMin;
}
public function setGroups(Google_FreeBusyGroup $groups) {
$this->groups = $groups;
}
public function getGroups() {
return $this->groups;
}
}
class Google_Setting extends Google_Model {
public $kind;
public $etag;
public $id;
public $value;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
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 setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class Google_Settings extends Google_Model {
protected $__itemsType = 'Google_Setting';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setItems(/* array(Google_Setting) */ $items) {
$this->assertIsArray($items, 'Google_Setting', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_TimePeriod extends Google_Model {
public $start;
public $end;
public function setStart($start) {
$this->start = $start;
}
public function getStart() {
return $this->start;
}
public function setEnd($end) {
$this->end = $end;
}
public function getEnd() {
return $this->end;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_CalendarService.php | PHP | asf20 | 74,251 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "currentLocation" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new Google_LatitudeService(...);
* $currentLocation = $latitudeService->currentLocation;
* </code>
*/
class Google_CurrentLocationServiceResource extends Google_ServiceResource {
/**
* Updates or creates the user's current location. (currentLocation.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's current location. (currentLocation.get)
*
* @param array $optParams Optional parameters.
*
* @opt_param string granularity Granularity of the requested location.
* @return Google_Location
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's current location. (currentLocation.delete)
*
* @param array $optParams Optional parameters.
*/
public function delete($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "location" collection of methods.
* Typical usage is:
* <code>
* $latitudeService = new Google_LatitudeService(...);
* $location = $latitudeService->location;
* </code>
*/
class Google_LocationServiceResource extends Google_ServiceResource {
/**
* Inserts or updates a location in the user's location history. (location.insert)
*
* @param Google_Location $postBody
* @param array $optParams Optional parameters.
* @return Google_Location
*/
public function insert(Google_Location $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Reads a location from the user's location history. (location.get)
*
* @param string $locationId Timestamp of the location to read (ms since epoch).
* @param array $optParams Optional parameters.
*
* @opt_param string granularity Granularity of the location to return.
* @return Google_Location
*/
public function get($locationId, $optParams = array()) {
$params = array('locationId' => $locationId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Location($data);
} else {
return $data;
}
}
/**
* Lists the user's location history. (location.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of locations to return.
* @opt_param string max-time Maximum timestamp of locations to return (ms since epoch).
* @opt_param string min-time Minimum timestamp of locations to return (ms since epoch).
* @opt_param string granularity Granularity of the requested locations.
* @return Google_LocationFeed
*/
public function listLocation($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_LocationFeed($data);
} else {
return $data;
}
}
/**
* Deletes a location from the user's location history. (location.delete)
*
* @param string $locationId Timestamp of the location to delete (ms since epoch).
* @param array $optParams Optional parameters.
*/
public function delete($locationId, $optParams = array()) {
$params = array('locationId' => $locationId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Latitude (v1).
*
* <p>
* Lets you read and update your current location and work with your location history
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/latitude/v1/using" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LatitudeService extends Google_Service {
public $currentLocation;
public $location;
/**
* Constructs the internal representation of the Latitude service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'latitude/v1/';
$this->version = 'v1';
$this->serviceName = 'latitude';
$client->addService($this->serviceName, $this->version);
$this->currentLocation = new Google_CurrentLocationServiceResource($this, $this->serviceName, 'currentLocation', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "request": {"$ref": "LatitudeCurrentlocationResourceJson"}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "POST", "path": "currentLocation", "id": "latitude.currentLocation.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "parameters": {"granularity": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LatitudeCurrentlocationResourceJson"}, "httpMethod": "GET", "path": "currentLocation", "id": "latitude.currentLocation.get"}, "delete": {"path": "currentLocation", "scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city", "https://www.googleapis.com/auth/latitude.current.best", "https://www.googleapis.com/auth/latitude.current.city"], "id": "latitude.currentLocation.delete", "httpMethod": "DELETE"}}}', true));
$this->location = new Google_LocationServiceResource($this, $this->serviceName, 'location', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "request": {"$ref": "Location"}, "response": {"$ref": "Location"}, "httpMethod": "POST", "path": "location", "id": "latitude.location.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}, "granularity": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "id": "latitude.location.get", "httpMethod": "GET", "path": "location/{locationId}", "response": {"$ref": "Location"}}, "list": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "parameters": {"max-results": {"type": "string", "location": "query"}, "max-time": {"type": "string", "location": "query"}, "min-time": {"type": "string", "location": "query"}, "granularity": {"default": "city", "enum": ["best", "city"], "type": "string", "location": "query"}}, "response": {"$ref": "LocationFeed"}, "httpMethod": "GET", "path": "location", "id": "latitude.location.list"}, "delete": {"scopes": ["https://www.googleapis.com/auth/latitude.all.best", "https://www.googleapis.com/auth/latitude.all.city"], "path": "location/{locationId}", "id": "latitude.location.delete", "parameters": {"locationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Location extends Google_Model {
public $kind;
public $altitude;
public $longitude;
public $activityId;
public $latitude;
public $altitudeAccuracy;
public $timestampMs;
public $speed;
public $heading;
public $accuracy;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAltitude($altitude) {
$this->altitude = $altitude;
}
public function getAltitude() {
return $this->altitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setActivityId($activityId) {
$this->activityId = $activityId;
}
public function getActivityId() {
return $this->activityId;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setAltitudeAccuracy($altitudeAccuracy) {
$this->altitudeAccuracy = $altitudeAccuracy;
}
public function getAltitudeAccuracy() {
return $this->altitudeAccuracy;
}
public function setTimestampMs($timestampMs) {
$this->timestampMs = $timestampMs;
}
public function getTimestampMs() {
return $this->timestampMs;
}
public function setSpeed($speed) {
$this->speed = $speed;
}
public function getSpeed() {
return $this->speed;
}
public function setHeading($heading) {
$this->heading = $heading;
}
public function getHeading() {
return $this->heading;
}
public function setAccuracy($accuracy) {
$this->accuracy = $accuracy;
}
public function getAccuracy() {
return $this->accuracy;
}
}
class Google_LocationFeed extends Google_Model {
protected $__itemsType = 'Google_Location';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Location) */ $items) {
$this->assertIsArray($items, 'Google_Location', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_LatitudeService.php | PHP | asf20 | 11,480 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "activities" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusService(...);
* $activities = $plusService->activities;
* </code>
*/
class Google_ActivitiesServiceResource extends Google_ServiceResource {
/**
* Search public activities. (activities.search)
*
* @param string $query Full-text search query string.
* @param array $optParams Optional parameters.
*
* @opt_param string orderBy Specifies how to order search results.
* @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token may be of any length.
* @opt_param string maxResults The maximum number of activities to include in the response, used for paging. For any response, the actual number returned may be less than the specified maxResults.
* @opt_param string language Specify the preferred language to search with. See search language codes for available values.
* @return Google_ActivityFeed
*/
public function search($query, $optParams = array()) {
$params = array('query' => $query);
$params = array_merge($params, $optParams);
$data = $this->__call('search', array($params));
if ($this->useObjects()) {
return new Google_ActivityFeed($data);
} else {
return $data;
}
}
/**
* List all of the activities in the specified collection for a particular user. (activities.list)
*
* @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
* @param string $collection The collection of activities to list.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of activities to include in the response, used for paging. For any response, the actual number returned may be less than the specified maxResults.
* @return Google_ActivityFeed
*/
public function listActivities($userId, $collection, $optParams = array()) {
$params = array('userId' => $userId, 'collection' => $collection);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ActivityFeed($data);
} else {
return $data;
}
}
/**
* Get an activity. (activities.get)
*
* @param string $activityId The ID of the activity to get.
* @param array $optParams Optional parameters.
* @return Google_Activity
*/
public function get($activityId, $optParams = array()) {
$params = array('activityId' => $activityId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Activity($data);
} else {
return $data;
}
}
}
/**
* The "comments" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusService(...);
* $comments = $plusService->comments;
* </code>
*/
class Google_CommentsServiceResource extends Google_ServiceResource {
/**
* List all of the comments for an activity. (comments.list)
*
* @param string $activityId The ID of the activity to get comments for.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of comments to include in the response, used for paging. For any response, the actual number returned may be less than the specified maxResults.
* @opt_param string sortOrder The order in which to sort the list of comments.
* @return Google_CommentFeed
*/
public function listComments($activityId, $optParams = array()) {
$params = array('activityId' => $activityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommentFeed($data);
} else {
return $data;
}
}
/**
* Get a comment. (comments.get)
*
* @param string $commentId The ID of the comment to get.
* @param array $optParams Optional parameters.
* @return Google_Comment
*/
public function get($commentId, $optParams = array()) {
$params = array('commentId' => $commentId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Comment($data);
} else {
return $data;
}
}
}
/**
* The "people" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusService(...);
* $people = $plusService->people;
* </code>
*/
class Google_PeopleServiceResource extends Google_ServiceResource {
/**
* List all of the people in the specified collection for a particular activity.
* (people.listByActivity)
*
* @param string $activityId The ID of the activity to get the list of people for.
* @param string $collection The collection of people to list.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of people to include in the response, used for paging. For any response, the actual number returned may be less than the specified maxResults.
* @return Google_PeopleFeed
*/
public function listByActivity($activityId, $collection, $optParams = array()) {
$params = array('activityId' => $activityId, 'collection' => $collection);
$params = array_merge($params, $optParams);
$data = $this->__call('listByActivity', array($params));
if ($this->useObjects()) {
return new Google_PeopleFeed($data);
} else {
return $data;
}
}
/**
* Search all public profiles. (people.search)
*
* @param string $query Specify a query string for full text search of public text in all profiles.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token may be of any length.
* @opt_param string maxResults The maximum number of people to include in the response, used for paging. For any response, the actual number returned may be less than the specified maxResults.
* @opt_param string language Specify the preferred language to search with. See search language codes for available values.
* @return Google_PeopleFeed
*/
public function search($query, $optParams = array()) {
$params = array('query' => $query);
$params = array_merge($params, $optParams);
$data = $this->__call('search', array($params));
if ($this->useObjects()) {
return new Google_PeopleFeed($data);
} else {
return $data;
}
}
/**
* Get a person's profile. (people.get)
*
* @param string $userId The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user.
* @param array $optParams Optional parameters.
* @return Google_Person
*/
public function get($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Person($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Plus (v1).
*
* <p>
* The Google+ API enables developers to build on top of the Google+ platform.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/+/api/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PlusService extends Google_Service {
public $activities;
public $comments;
public $people;
/**
* Constructs the internal representation of the Plus service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'plus/v1/';
$this->version = 'v1';
$this->serviceName = 'plus';
$client->addService($this->serviceName, $this->version);
$this->activities = new Google_ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"search": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"orderBy": {"default": "recent", "enum": ["best", "recent"], "type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "10", "maximum": "20", "minimum": "1", "location": "query", "type": "integer"}, "language": {"default": "", "type": "string", "location": "query"}, "query": {"required": true, "type": "string", "location": "query"}}, "id": "plus.activities.search", "httpMethod": "GET", "path": "activities", "response": {"$ref": "ActivityFeed"}}, "list": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "alt": {"default": "json", "enum": ["json"], "type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "1", "location": "query", "type": "integer"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["public"]}}, "id": "plus.activities.list", "httpMethod": "GET", "path": "people/{userId}/activities/{collection}", "response": {"$ref": "ActivityFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}, "alt": {"default": "json", "enum": ["json"], "type": "string", "location": "query"}}, "id": "plus.activities.get", "httpMethod": "GET", "path": "activities/{activityId}", "response": {"$ref": "Activity"}}}}', true));
$this->comments = new Google_CommentsServiceResource($this, $this->serviceName, 'comments', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "activityId": {"required": true, "type": "string", "location": "path"}, "alt": {"default": "json", "enum": ["json"], "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}, "sortOrder": {"default": "ascending", "enum": ["ascending", "descending"], "type": "string", "location": "query"}}, "id": "plus.comments.list", "httpMethod": "GET", "path": "activities/{activityId}/comments", "response": {"$ref": "CommentFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"commentId": {"required": true, "type": "string", "location": "path"}}, "id": "plus.comments.get", "httpMethod": "GET", "path": "comments/{commentId}", "response": {"$ref": "Comment"}}}}', true));
$this->people = new Google_PeopleServiceResource($this, $this->serviceName, 'people', json_decode('{"methods": {"listByActivity": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "activityId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "20", "maximum": "100", "minimum": "1", "location": "query", "type": "integer"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["plusoners", "resharers"]}}, "id": "plus.people.listByActivity", "httpMethod": "GET", "path": "activities/{activityId}/people/{collection}", "response": {"$ref": "PeopleFeed"}}, "search": {"scopes": ["https://www.googleapis.com/auth/plus.me"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "10", "maximum": "20", "minimum": "1", "location": "query", "type": "integer"}, "language": {"default": "", "type": "string", "location": "query"}, "query": {"required": true, "type": "string", "location": "query"}}, "id": "plus.people.search", "httpMethod": "GET", "path": "people", "response": {"$ref": "PeopleFeed"}}, "get": {"scopes": ["https://www.googleapis.com/auth/plus.me", "https://www.googleapis.com/auth/userinfo.email"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "plus.people.get", "httpMethod": "GET", "path": "people/{userId}", "response": {"$ref": "Person"}}}}', true));
}
}
class Google_Acl extends Google_Model {
protected $__itemsType = 'Google_PlusAclentryResource';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $description;
public function setItems($items) {
$this->assertIsArray($items, 'Google_PlusAclentryResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class Google_Activity extends Google_Model {
public $placeName;
public $kind;
public $updated;
protected $__providerType = 'Google_ActivityProvider';
protected $__providerDataType = '';
public $provider;
public $title;
public $url;
public $geocode;
protected $__objectType = 'Google_ActivityObject';
protected $__objectDataType = '';
public $object;
public $placeId;
protected $__actorType = 'Google_ActivityActor';
protected $__actorDataType = '';
public $actor;
public $id;
protected $__accessType = 'Google_Acl';
protected $__accessDataType = '';
public $access;
public $verb;
public $etag;
public $radius;
public $address;
public $crosspostSource;
public $annotation;
public $published;
public function setPlaceName($placeName) {
$this->placeName = $placeName;
}
public function getPlaceName() {
return $this->placeName;
}
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;
}
public function setProvider(Google_ActivityProvider $provider) {
$this->provider = $provider;
}
public function getProvider() {
return $this->provider;
}
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;
}
public function setGeocode($geocode) {
$this->geocode = $geocode;
}
public function getGeocode() {
return $this->geocode;
}
public function setObject(Google_ActivityObject $object) {
$this->object = $object;
}
public function getObject() {
return $this->object;
}
public function setPlaceId($placeId) {
$this->placeId = $placeId;
}
public function getPlaceId() {
return $this->placeId;
}
public function setActor(Google_ActivityActor $actor) {
$this->actor = $actor;
}
public function getActor() {
return $this->actor;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAccess(Google_Acl $access) {
$this->access = $access;
}
public function getAccess() {
return $this->access;
}
public function setVerb($verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setRadius($radius) {
$this->radius = $radius;
}
public function getRadius() {
return $this->radius;
}
public function setAddress($address) {
$this->address = $address;
}
public function getAddress() {
return $this->address;
}
public function setCrosspostSource($crosspostSource) {
$this->crosspostSource = $crosspostSource;
}
public function getCrosspostSource() {
return $this->crosspostSource;
}
public function setAnnotation($annotation) {
$this->annotation = $annotation;
}
public function getAnnotation() {
return $this->annotation;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
}
class Google_ActivityActor extends Google_Model {
public $url;
protected $__imageType = 'Google_ActivityActorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
protected $__nameType = 'Google_ActivityActorName';
protected $__nameDataType = '';
public $name;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_ActivityActorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName(Google_ActivityActorName $name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_ActivityActorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_ActivityActorName extends Google_Model {
public $givenName;
public $familyName;
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
}
class Google_ActivityFeed extends Google_Model {
public $nextPageToken;
public $kind;
public $title;
protected $__itemsType = 'Google_Activity';
protected $__itemsDataType = 'array';
public $items;
public $updated;
public $nextLink;
public $etag;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Activity', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
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 setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ActivityObject extends Google_Model {
protected $__resharersType = 'Google_ActivityObjectResharers';
protected $__resharersDataType = '';
public $resharers;
protected $__attachmentsType = 'Google_ActivityObjectAttachments';
protected $__attachmentsDataType = 'array';
public $attachments;
public $originalContent;
protected $__plusonersType = 'Google_ActivityObjectPlusoners';
protected $__plusonersDataType = '';
public $plusoners;
protected $__actorType = 'Google_ActivityObjectActor';
protected $__actorDataType = '';
public $actor;
public $content;
public $url;
protected $__repliesType = 'Google_ActivityObjectReplies';
protected $__repliesDataType = '';
public $replies;
public $id;
public $objectType;
public function setResharers(Google_ActivityObjectResharers $resharers) {
$this->resharers = $resharers;
}
public function getResharers() {
return $this->resharers;
}
public function setAttachments($attachments) {
$this->assertIsArray($attachments, 'Google_ActivityObjectAttachments', __METHOD__);
$this->attachments = $attachments;
}
public function getAttachments() {
return $this->attachments;
}
public function setOriginalContent($originalContent) {
$this->originalContent = $originalContent;
}
public function getOriginalContent() {
return $this->originalContent;
}
public function setPlusoners(Google_ActivityObjectPlusoners $plusoners) {
$this->plusoners = $plusoners;
}
public function getPlusoners() {
return $this->plusoners;
}
public function setActor(Google_ActivityObjectActor $actor) {
$this->actor = $actor;
}
public function getActor() {
return $this->actor;
}
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setReplies(Google_ActivityObjectReplies $replies) {
$this->replies = $replies;
}
public function getReplies() {
return $this->replies;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_ActivityObjectActor extends Google_Model {
public $url;
protected $__imageType = 'Google_ActivityObjectActorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_ActivityObjectActorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ActivityObjectActorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_ActivityObjectAttachments extends Google_Model {
public $displayName;
protected $__fullImageType = 'Google_ActivityObjectAttachmentsFullImage';
protected $__fullImageDataType = '';
public $fullImage;
public $url;
protected $__imageType = 'Google_ActivityObjectAttachmentsImage';
protected $__imageDataType = '';
public $image;
public $content;
protected $__embedType = 'Google_ActivityObjectAttachmentsEmbed';
protected $__embedDataType = '';
public $embed;
public $id;
public $objectType;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setFullImage(Google_ActivityObjectAttachmentsFullImage $fullImage) {
$this->fullImage = $fullImage;
}
public function getFullImage() {
return $this->fullImage;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_ActivityObjectAttachmentsImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setEmbed(Google_ActivityObjectAttachmentsEmbed $embed) {
$this->embed = $embed;
}
public function getEmbed() {
return $this->embed;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_ActivityObjectAttachmentsEmbed extends Google_Model {
public $url;
public $type;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_ActivityObjectAttachmentsFullImage extends Google_Model {
public $url;
public $width;
public $type;
public $height;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_ActivityObjectAttachmentsImage extends Google_Model {
public $url;
public $width;
public $type;
public $height;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_ActivityObjectPlusoners extends Google_Model {
public $totalItems;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ActivityObjectReplies extends Google_Model {
public $totalItems;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ActivityObjectResharers extends Google_Model {
public $totalItems;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ActivityProvider extends Google_Model {
public $title;
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_Comment extends Google_Model {
protected $__inReplyToType = 'Google_CommentInReplyTo';
protected $__inReplyToDataType = 'array';
public $inReplyTo;
public $kind;
protected $__objectType = 'Google_CommentObject';
protected $__objectDataType = '';
public $object;
public $updated;
protected $__actorType = 'Google_CommentActor';
protected $__actorDataType = '';
public $actor;
public $verb;
public $etag;
public $published;
public $id;
public $selfLink;
public function setInReplyTo($inReplyTo) {
$this->assertIsArray($inReplyTo, 'Google_CommentInReplyTo', __METHOD__);
$this->inReplyTo = $inReplyTo;
}
public function getInReplyTo() {
return $this->inReplyTo;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setObject(Google_CommentObject $object) {
$this->object = $object;
}
public function getObject() {
return $this->object;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setActor(Google_CommentActor $actor) {
$this->actor = $actor;
}
public function getActor() {
return $this->actor;
}
public function setVerb($verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_CommentActor extends Google_Model {
public $url;
protected $__imageType = 'Google_CommentActorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_CommentActorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentActorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_CommentFeed extends Google_Model {
public $nextPageToken;
public $kind;
public $title;
protected $__itemsType = 'Google_Comment';
protected $__itemsDataType = 'array';
public $items;
public $updated;
public $nextLink;
public $etag;
public $id;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Comment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
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;
}
}
class Google_CommentInReplyTo extends Google_Model {
public $url;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentObject extends Google_Model {
public $content;
public $objectType;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_PeopleFeed extends Google_Model {
public $nextPageToken;
public $kind;
public $title;
protected $__itemsType = 'Google_Person';
protected $__itemsDataType = 'array';
public $items;
public $etag;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Person', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Person extends Google_Model {
public $relationshipStatus;
protected $__organizationsType = 'Google_PersonOrganizations';
protected $__organizationsDataType = 'array';
public $organizations;
public $kind;
public $displayName;
protected $__nameType = 'Google_PersonName';
protected $__nameDataType = '';
public $name;
public $url;
public $gender;
public $aboutMe;
public $tagline;
protected $__urlsType = 'Google_PersonUrls';
protected $__urlsDataType = 'array';
public $urls;
protected $__placesLivedType = 'Google_PersonPlacesLived';
protected $__placesLivedDataType = 'array';
public $placesLived;
protected $__emailsType = 'Google_PersonEmails';
protected $__emailsDataType = 'array';
public $emails;
public $nickname;
public $birthday;
public $etag;
protected $__imageType = 'Google_PersonImage';
protected $__imageDataType = '';
public $image;
public $hasApp;
public $id;
public $languagesSpoken;
public $currentLocation;
public $objectType;
public function setRelationshipStatus($relationshipStatus) {
$this->relationshipStatus = $relationshipStatus;
}
public function getRelationshipStatus() {
return $this->relationshipStatus;
}
public function setOrganizations($organizations) {
$this->assertIsArray($organizations, 'Google_PersonOrganizations', __METHOD__);
$this->organizations = $organizations;
}
public function getOrganizations() {
return $this->organizations;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName(Google_PersonName $name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setAboutMe($aboutMe) {
$this->aboutMe = $aboutMe;
}
public function getAboutMe() {
return $this->aboutMe;
}
public function setTagline($tagline) {
$this->tagline = $tagline;
}
public function getTagline() {
return $this->tagline;
}
public function setUrls($urls) {
$this->assertIsArray($urls, 'Google_PersonUrls', __METHOD__);
$this->urls = $urls;
}
public function getUrls() {
return $this->urls;
}
public function setPlacesLived($placesLived) {
$this->assertIsArray($placesLived, 'Google_PersonPlacesLived', __METHOD__);
$this->placesLived = $placesLived;
}
public function getPlacesLived() {
return $this->placesLived;
}
public function setEmails($emails) {
$this->assertIsArray($emails, 'Google_PersonEmails', __METHOD__);
$this->emails = $emails;
}
public function getEmails() {
return $this->emails;
}
public function setNickname($nickname) {
$this->nickname = $nickname;
}
public function getNickname() {
return $this->nickname;
}
public function setBirthday($birthday) {
$this->birthday = $birthday;
}
public function getBirthday() {
return $this->birthday;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setImage(Google_PersonImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setHasApp($hasApp) {
$this->hasApp = $hasApp;
}
public function getHasApp() {
return $this->hasApp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setLanguagesSpoken($languagesSpoken) {
$this->languagesSpoken = $languagesSpoken;
}
public function getLanguagesSpoken() {
return $this->languagesSpoken;
}
public function setCurrentLocation($currentLocation) {
$this->currentLocation = $currentLocation;
}
public function getCurrentLocation() {
return $this->currentLocation;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_PersonEmails extends Google_Model {
public $type;
public $primary;
public $value;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setPrimary($primary) {
$this->primary = $primary;
}
public function getPrimary() {
return $this->primary;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class Google_PersonImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_PersonName extends Google_Model {
public $honorificPrefix;
public $middleName;
public $familyName;
public $formatted;
public $givenName;
public $honorificSuffix;
public function setHonorificPrefix($honorificPrefix) {
$this->honorificPrefix = $honorificPrefix;
}
public function getHonorificPrefix() {
return $this->honorificPrefix;
}
public function setMiddleName($middleName) {
$this->middleName = $middleName;
}
public function getMiddleName() {
return $this->middleName;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
public function setFormatted($formatted) {
$this->formatted = $formatted;
}
public function getFormatted() {
return $this->formatted;
}
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setHonorificSuffix($honorificSuffix) {
$this->honorificSuffix = $honorificSuffix;
}
public function getHonorificSuffix() {
return $this->honorificSuffix;
}
}
class Google_PersonOrganizations extends Google_Model {
public $startDate;
public $endDate;
public $description;
public $title;
public $primary;
public $location;
public $department;
public $type;
public $name;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
public function getEndDate() {
return $this->endDate;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setPrimary($primary) {
$this->primary = $primary;
}
public function getPrimary() {
return $this->primary;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setDepartment($department) {
$this->department = $department;
}
public function getDepartment() {
return $this->department;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_PersonPlacesLived extends Google_Model {
public $primary;
public $value;
public function setPrimary($primary) {
$this->primary = $primary;
}
public function getPrimary() {
return $this->primary;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class Google_PersonUrls extends Google_Model {
public $type;
public $primary;
public $value;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setPrimary($primary) {
$this->primary = $primary;
}
public function getPrimary() {
return $this->primary;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class Google_PlusAclentryResource extends Google_Model {
public $type;
public $id;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_PlusService.php | PHP | asf20 | 44,771 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "languages" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $languages = $translateService->languages;
* </code>
*/
class Google_LanguagesServiceResource extends Google_ServiceResource {
/**
* List the source/target languages supported by the API (languages.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string target the language and collation in which the localized results should be returned
* @return Google_LanguagesListResponse
*/
public function listLanguages($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_LanguagesListResponse($data);
} else {
return $data;
}
}
}
/**
* The "detections" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $detections = $translateService->detections;
* </code>
*/
class Google_DetectionsServiceResource extends Google_ServiceResource {
/**
* Detect the language of text. (detections.list)
*
* @param string $q The text to detect
* @param array $optParams Optional parameters.
* @return Google_DetectionsListResponse
*/
public function listDetections($q, $optParams = array()) {
$params = array('q' => $q);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DetectionsListResponse($data);
} else {
return $data;
}
}
}
/**
* The "translations" collection of methods.
* Typical usage is:
* <code>
* $translateService = new Google_TranslateService(...);
* $translations = $translateService->translations;
* </code>
*/
class Google_TranslationsServiceResource extends Google_ServiceResource {
/**
* Returns text translations from one language to another. (translations.list)
*
* @param string $q The text to translate
* @param string $target The target language into which the text should be translated
* @param array $optParams Optional parameters.
*
* @opt_param string source The source language of the text
* @opt_param string format The format of the text
* @opt_param string cid The customization id for translate
* @return Google_TranslationsListResponse
*/
public function listTranslations($q, $target, $optParams = array()) {
$params = array('q' => $q, 'target' => $target);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TranslationsListResponse($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Translate (v2).
*
* <p>
* Lets you translate text from one language to another
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/language/translate/v2/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_TranslateService extends Google_Service {
public $languages;
public $detections;
public $translations;
/**
* Constructs the internal representation of the Translate service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'language/translate/';
$this->version = 'v2';
$this->serviceName = 'translate';
$client->addService($this->serviceName, $this->version);
$this->languages = new Google_LanguagesServiceResource($this, $this->serviceName, 'languages', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "LanguagesListResponse"}, "id": "language.languages.list", "parameters": {"target": {"type": "string", "location": "query"}}, "path": "v2/languages"}}}', true));
$this->detections = new Google_DetectionsServiceResource($this, $this->serviceName, 'detections', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "DetectionsListResponse"}, "id": "language.detections.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "path": "v2/detect"}}}', true));
$this->translations = new Google_TranslationsServiceResource($this, $this->serviceName, 'translations', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "TranslationsListResponse"}, "id": "language.translations.list", "parameters": {"q": {"repeated": true, "required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "format": {"enum": ["html", "text"], "type": "string", "location": "query"}, "target": {"required": true, "type": "string", "location": "query"}, "cid": {"repeated": true, "type": "string", "location": "query"}}, "path": "v2"}}}', true));
}
}
class Google_DetectionsListResponse extends Google_Model {
protected $__detectionsType = 'Google_DetectionsResourceItems';
protected $__detectionsDataType = 'array';
public $detections;
public function setDetections(/* array(Google_DetectionsResourceItems) */ $detections) {
$this->assertIsArray($detections, 'Google_DetectionsResourceItems', __METHOD__);
$this->detections = $detections;
}
public function getDetections() {
return $this->detections;
}
}
class Google_DetectionsResourceItems extends Google_Model {
public $isReliable;
public $confidence;
public $language;
public function setIsReliable($isReliable) {
$this->isReliable = $isReliable;
}
public function getIsReliable() {
return $this->isReliable;
}
public function setConfidence($confidence) {
$this->confidence = $confidence;
}
public function getConfidence() {
return $this->confidence;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
class Google_LanguagesListResponse extends Google_Model {
protected $__languagesType = 'Google_LanguagesResource';
protected $__languagesDataType = 'array';
public $languages;
public function setLanguages(/* array(Google_LanguagesResource) */ $languages) {
$this->assertIsArray($languages, 'Google_LanguagesResource', __METHOD__);
$this->languages = $languages;
}
public function getLanguages() {
return $this->languages;
}
}
class Google_LanguagesResource extends Google_Model {
public $name;
public $language;
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
class Google_TranslationsListResponse extends Google_Model {
protected $__translationsType = 'Google_TranslationsResource';
protected $__translationsDataType = 'array';
public $translations;
public function setTranslations(/* array(Google_TranslationsResource) */ $translations) {
$this->assertIsArray($translations, 'Google_TranslationsResource', __METHOD__);
$this->translations = $translations;
}
public function getTranslations() {
return $this->translations;
}
}
class Google_TranslationsResource extends Google_Model {
public $detectedSourceLanguage;
public $translatedText;
public function setDetectedSourceLanguage($detectedSourceLanguage) {
$this->detectedSourceLanguage = $detectedSourceLanguage;
}
public function getDetectedSourceLanguage() {
return $this->detectedSourceLanguage;
}
public function setTranslatedText($translatedText) {
$this->translatedText = $translatedText;
}
public function getTranslatedText() {
return $this->translatedText;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_TranslateService.php | PHP | asf20 | 8,659 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "votes" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $votes = $moderatorService->votes;
* </code>
*/
class Google_VotesServiceResource extends Google_ServiceResource {
/**
* Inserts a new vote by the authenticated user for the specified submission within the specified
* series. (votes.insert)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param Google_Vote $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @return Google_Vote
*/
public function insert($seriesId, $submissionId, Google_Vote $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Vote($data);
} else {
return $data;
}
}
/**
* Updates the votes by the authenticated user for the specified submission within the specified
* series. This method supports patch semantics. (votes.patch)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param Google_Vote $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userId
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @return Google_Vote
*/
public function patch($seriesId, $submissionId, Google_Vote $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Vote($data);
} else {
return $data;
}
}
/**
* Lists the votes by the authenticated user for the given series. (votes.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string start-index Index of the first result to be retrieved.
* @return Google_VoteList
*/
public function listVotes($seriesId, $optParams = array()) {
$params = array('seriesId' => $seriesId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_VoteList($data);
} else {
return $data;
}
}
/**
* Updates the votes by the authenticated user for the specified submission within the specified
* series. (votes.update)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param Google_Vote $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userId
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @return Google_Vote
*/
public function update($seriesId, $submissionId, Google_Vote $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Vote($data);
} else {
return $data;
}
}
/**
* Returns the votes by the authenticated user for the specified submission within the specified
* series. (votes.get)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string userId
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @return Google_Vote
*/
public function get($seriesId, $submissionId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Vote($data);
} else {
return $data;
}
}
}
/**
* The "responses" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $responses = $moderatorService->responses;
* </code>
*/
class Google_ResponsesServiceResource extends Google_ServiceResource {
/**
* Inserts a response for the specified submission in the specified topic within the specified
* series. (responses.insert)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $topicId The decimal ID of the Topic within the Series.
* @param string $parentSubmissionId The decimal ID of the parent Submission within the Series.
* @param Google_Submission $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @opt_param bool anonymous Set to true to mark the new submission as anonymous.
* @return Google_Submission
*/
public function insert($seriesId, $topicId, $parentSubmissionId, Google_Submission $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'topicId' => $topicId, 'parentSubmissionId' => $parentSubmissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Submission($data);
} else {
return $data;
}
}
/**
* Lists or searches the responses for the specified submission within the specified series and
* returns the search results. (responses.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string sort Sort order.
* @opt_param string author Restricts the results to submissions by a specific author.
* @opt_param string start-index Index of the first result to be retrieved.
* @opt_param string q Search query.
* @opt_param bool hasAttachedVideo Specifies whether to restrict to submissions that have videos attached.
* @return Google_SubmissionList
*/
public function listResponses($seriesId, $submissionId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SubmissionList($data);
} else {
return $data;
}
}
}
/**
* The "tags" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $tags = $moderatorService->tags;
* </code>
*/
class Google_TagsServiceResource extends Google_ServiceResource {
/**
* Inserts a new tag for the specified submission within the specified series. (tags.insert)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param Google_Tag $postBody
* @param array $optParams Optional parameters.
* @return Google_Tag
*/
public function insert($seriesId, $submissionId, Google_Tag $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Tag($data);
} else {
return $data;
}
}
/**
* Lists all tags for the specified submission within the specified series. (tags.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param array $optParams Optional parameters.
* @return Google_TagList
*/
public function listTags($seriesId, $submissionId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TagList($data);
} else {
return $data;
}
}
/**
* Deletes the specified tag from the specified submission within the specified series.
* (tags.delete)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param string $tagId
* @param array $optParams Optional parameters.
*/
public function delete($seriesId, $submissionId, $tagId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId, 'tagId' => $tagId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "series" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $series = $moderatorService->series;
* </code>
*/
class Google_SeriesServiceResource extends Google_ServiceResource {
/**
* Inserts a new series. (series.insert)
*
* @param Google_Series $postBody
* @param array $optParams Optional parameters.
* @return Google_Series
*/
public function insert(Google_Series $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Series($data);
} else {
return $data;
}
}
/**
* Updates the specified series. This method supports patch semantics. (series.patch)
*
* @param string $seriesId The decimal ID of the Series.
* @param Google_Series $postBody
* @param array $optParams Optional parameters.
* @return Google_Series
*/
public function patch($seriesId, Google_Series $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Series($data);
} else {
return $data;
}
}
/**
* Searches the series and returns the search results. (series.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string q Search query.
* @opt_param string start-index Index of the first result to be retrieved.
* @return Google_SeriesList
*/
public function listSeries($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
/**
* Updates the specified series. (series.update)
*
* @param string $seriesId The decimal ID of the Series.
* @param Google_Series $postBody
* @param array $optParams Optional parameters.
* @return Google_Series
*/
public function update($seriesId, Google_Series $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Series($data);
} else {
return $data;
}
}
/**
* Returns the specified series. (series.get)
*
* @param string $seriesId The decimal ID of the Series.
* @param array $optParams Optional parameters.
* @return Google_Series
*/
public function get($seriesId, $optParams = array()) {
$params = array('seriesId' => $seriesId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Series($data);
} else {
return $data;
}
}
}
/**
* The "submissions" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $submissions = $moderatorService->submissions;
* </code>
*/
class Google_SeriesSubmissionsServiceResource extends Google_ServiceResource {
/**
* Searches the submissions for the specified series and returns the search results.
* (submissions.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string lang The language code for the language the client prefers resuls in.
* @opt_param string max-results Maximum number of results to return.
* @opt_param bool includeVotes Specifies whether to include the current user's vote
* @opt_param string start-index Index of the first result to be retrieved.
* @opt_param string author Restricts the results to submissions by a specific author.
* @opt_param string sort Sort order.
* @opt_param string q Search query.
* @opt_param bool hasAttachedVideo Specifies whether to restrict to submissions that have videos attached.
* @return Google_SubmissionList
*/
public function listSeriesSubmissions($seriesId, $optParams = array()) {
$params = array('seriesId' => $seriesId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SubmissionList($data);
} else {
return $data;
}
}
}
/**
* The "responses" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $responses = $moderatorService->responses;
* </code>
*/
class Google_SeriesResponsesServiceResource extends Google_ServiceResource {
/**
* Searches the responses for the specified series and returns the search results. (responses.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string sort Sort order.
* @opt_param string author Restricts the results to submissions by a specific author.
* @opt_param string start-index Index of the first result to be retrieved.
* @opt_param string q Search query.
* @opt_param bool hasAttachedVideo Specifies whether to restrict to submissions that have videos attached.
* @return Google_SeriesList
*/
public function listSeriesResponses($seriesId, $optParams = array()) {
$params = array('seriesId' => $seriesId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
}
/**
* The "topics" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $topics = $moderatorService->topics;
* </code>
*/
class Google_TopicsServiceResource extends Google_ServiceResource {
/**
* Inserts a new topic into the specified series. (topics.insert)
*
* @param string $seriesId The decimal ID of the Series.
* @param Google_Topic $postBody
* @param array $optParams Optional parameters.
* @return Google_Topic
*/
public function insert($seriesId, Google_Topic $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Topic($data);
} else {
return $data;
}
}
/**
* Searches the topics within the specified series and returns the search results. (topics.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string q Search query.
* @opt_param string start-index Index of the first result to be retrieved.
* @opt_param string mode
* @return Google_TopicList
*/
public function listTopics($seriesId, $optParams = array()) {
$params = array('seriesId' => $seriesId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TopicList($data);
} else {
return $data;
}
}
/**
* Updates the specified topic within the specified series. (topics.update)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $topicId The decimal ID of the Topic within the Series.
* @param Google_Topic $postBody
* @param array $optParams Optional parameters.
* @return Google_Topic
*/
public function update($seriesId, $topicId, Google_Topic $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'topicId' => $topicId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Topic($data);
} else {
return $data;
}
}
/**
* Returns the specified topic from the specified series. (topics.get)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $topicId The decimal ID of the Topic within the Series.
* @param array $optParams Optional parameters.
* @return Google_Topic
*/
public function get($seriesId, $topicId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'topicId' => $topicId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Topic($data);
} else {
return $data;
}
}
}
/**
* The "submissions" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $submissions = $moderatorService->submissions;
* </code>
*/
class Google_TopicsSubmissionsServiceResource extends Google_ServiceResource {
/**
* Searches the submissions for the specified topic within the specified series and returns the
* search results. (submissions.list)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $topicId The decimal ID of the Topic within the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param bool includeVotes Specifies whether to include the current user's vote
* @opt_param string start-index Index of the first result to be retrieved.
* @opt_param string author Restricts the results to submissions by a specific author.
* @opt_param string sort Sort order.
* @opt_param string q Search query.
* @opt_param bool hasAttachedVideo Specifies whether to restrict to submissions that have videos attached.
* @return Google_SubmissionList
*/
public function listTopicsSubmissions($seriesId, $topicId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'topicId' => $topicId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SubmissionList($data);
} else {
return $data;
}
}
}
/**
* The "global" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $global = $moderatorService->global;
* </code>
*/
class Google_ModeratorGlobalServiceResource extends Google_ServiceResource {
}
/**
* The "series" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $series = $moderatorService->series;
* </code>
*/
class Google_ModeratorGlobalSeriesServiceResource extends Google_ServiceResource {
/**
* Searches the public series and returns the search results. (series.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of results to return.
* @opt_param string q Search query.
* @opt_param string start-index Index of the first result to be retrieved.
* @return Google_SeriesList
*/
public function listModeratorGlobalSeries($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
}
/**
* The "profiles" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $profiles = $moderatorService->profiles;
* </code>
*/
class Google_ProfilesServiceResource extends Google_ServiceResource {
/**
* Updates the profile information for the authenticated user. This method supports patch semantics.
* (profiles.patch)
*
* @param Google_Profile $postBody
* @param array $optParams Optional parameters.
* @return Google_Profile
*/
public function patch(Google_Profile $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Profile($data);
} else {
return $data;
}
}
/**
* Updates the profile information for the authenticated user. (profiles.update)
*
* @param Google_Profile $postBody
* @param array $optParams Optional parameters.
* @return Google_Profile
*/
public function update(Google_Profile $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Profile($data);
} else {
return $data;
}
}
/**
* Returns the profile information for the authenticated user. (profiles.get)
*
* @param array $optParams Optional parameters.
* @return Google_Profile
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Profile($data);
} else {
return $data;
}
}
}
/**
* The "featured" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $featured = $moderatorService->featured;
* </code>
*/
class Google_FeaturedServiceResource extends Google_ServiceResource {
}
/**
* The "series" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $series = $moderatorService->series;
* </code>
*/
class Google_FeaturedSeriesServiceResource extends Google_ServiceResource {
/**
* Lists the featured series. (series.list)
*
* @param array $optParams Optional parameters.
* @return Google_SeriesList
*/
public function listFeaturedSeries($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
}
/**
* The "myrecent" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $myrecent = $moderatorService->myrecent;
* </code>
*/
class Google_MyrecentServiceResource extends Google_ServiceResource {
}
/**
* The "series" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $series = $moderatorService->series;
* </code>
*/
class Google_MyrecentSeriesServiceResource extends Google_ServiceResource {
/**
* Lists the series the authenticated user has visited. (series.list)
*
* @param array $optParams Optional parameters.
* @return Google_SeriesList
*/
public function listMyrecentSeries($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
}
/**
* The "my" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $my = $moderatorService->my;
* </code>
*/
class Google_MyServiceResource extends Google_ServiceResource {
}
/**
* The "series" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $series = $moderatorService->series;
* </code>
*/
class Google_MySeriesServiceResource extends Google_ServiceResource {
/**
* Lists all series created by the authenticated user. (series.list)
*
* @param array $optParams Optional parameters.
* @return Google_SeriesList
*/
public function listMySeries($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SeriesList($data);
} else {
return $data;
}
}
}
/**
* The "submissions" collection of methods.
* Typical usage is:
* <code>
* $moderatorService = new Google_ModeratorService(...);
* $submissions = $moderatorService->submissions;
* </code>
*/
class Google_SubmissionsServiceResource extends Google_ServiceResource {
/**
* Inserts a new submission in the specified topic within the specified series. (submissions.insert)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $topicId The decimal ID of the Topic within the Series.
* @param Google_Submission $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string unauthToken User identifier for unauthenticated usage mode
* @opt_param bool anonymous Set to true to mark the new submission as anonymous.
* @return Google_Submission
*/
public function insert($seriesId, $topicId, Google_Submission $postBody, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'topicId' => $topicId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Submission($data);
} else {
return $data;
}
}
/**
* Returns the specified submission within the specified series. (submissions.get)
*
* @param string $seriesId The decimal ID of the Series.
* @param string $submissionId The decimal ID of the Submission within the Series.
* @param array $optParams Optional parameters.
*
* @opt_param string lang The language code for the language the client prefers resuls in.
* @opt_param bool includeVotes Specifies whether to include the current user's vote
* @return Google_Submission
*/
public function get($seriesId, $submissionId, $optParams = array()) {
$params = array('seriesId' => $seriesId, 'submissionId' => $submissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Submission($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Moderator (v1).
*
* <p>
* Moderator API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/moderator/v1/using_rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_ModeratorService extends Google_Service {
public $votes;
public $responses;
public $tags;
public $series;
public $series_submissions;
public $series_responses;
public $topics;
public $topics_submissions;
public $global_series;
public $profiles;
public $featured_series;
public $myrecent_series;
public $my_series;
public $submissions;
/**
* Constructs the internal representation of the Moderator service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'moderator/v1/';
$this->version = 'v1';
$this->serviceName = 'moderator';
$client->addService($this->serviceName, $this->version);
$this->votes = new Google_VotesServiceResource($this, $this->serviceName, 'votes', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Vote"}, "response": {"$ref": "Vote"}, "httpMethod": "POST", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "id": "moderator.votes.insert"}, "patch": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Vote"}, "response": {"$ref": "Vote"}, "httpMethod": "PATCH", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "id": "moderator.votes.patch"}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "moderator.votes.list", "httpMethod": "GET", "path": "series/{seriesId}/votes/@me", "response": {"$ref": "VoteList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Vote"}, "response": {"$ref": "Vote"}, "httpMethod": "PUT", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "id": "moderator.votes.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "userId": {"type": "string", "location": "query"}, "unauthToken": {"type": "string", "location": "query"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "moderator.votes.get", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/votes/@me", "response": {"$ref": "Vote"}}}}', true));
$this->responses = new Google_ResponsesServiceResource($this, $this->serviceName, 'responses', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "parentSubmissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "unauthToken": {"type": "string", "location": "query"}, "anonymous": {"type": "boolean", "location": "query"}, "topicId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Submission"}, "response": {"$ref": "Submission"}, "httpMethod": "POST", "path": "series/{seriesId}/topics/{topicId}/submissions/{parentSubmissionId}/responses", "id": "moderator.responses.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "sort": {"type": "string", "location": "query"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "author": {"type": "string", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "hasAttachedVideo": {"type": "boolean", "location": "query"}}, "id": "moderator.responses.list", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/responses", "response": {"$ref": "SubmissionList"}}}}', true));
$this->tags = new Google_TagsServiceResource($this, $this->serviceName, 'tags', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Tag"}, "response": {"$ref": "Tag"}, "httpMethod": "POST", "path": "series/{seriesId}/submissions/{submissionId}/tags", "id": "moderator.tags.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "moderator.tags.list", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}/tags", "response": {"$ref": "TagList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/moderator"], "path": "series/{seriesId}/submissions/{submissionId}/tags/{tagId}", "id": "moderator.tags.delete", "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "tagId": {"required": true, "type": "string", "location": "path"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "httpMethod": "DELETE"}}}', true));
$this->series = new Google_SeriesServiceResource($this, $this->serviceName, 'series', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "request": {"$ref": "Series"}, "response": {"$ref": "Series"}, "httpMethod": "POST", "path": "series", "id": "moderator.series.insert"}, "patch": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Series"}, "response": {"$ref": "Series"}, "httpMethod": "PATCH", "path": "series/{seriesId}", "id": "moderator.series.patch"}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}}, "response": {"$ref": "SeriesList"}, "httpMethod": "GET", "path": "series", "id": "moderator.series.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Series"}, "response": {"$ref": "Series"}, "httpMethod": "PUT", "path": "series/{seriesId}", "id": "moderator.series.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "moderator.series.get", "httpMethod": "GET", "path": "series/{seriesId}", "response": {"$ref": "Series"}}}}', true));
$this->series_submissions = new Google_SeriesSubmissionsServiceResource($this, $this->serviceName, 'submissions', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"lang": {"type": "string", "location": "query"}, "max-results": {"type": "integer", "location": "query", "format": "uint32"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "includeVotes": {"type": "boolean", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}, "author": {"type": "string", "location": "query"}, "sort": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "hasAttachedVideo": {"type": "boolean", "location": "query"}}, "id": "moderator.series.submissions.list", "httpMethod": "GET", "path": "series/{seriesId}/submissions", "response": {"$ref": "SubmissionList"}}}}', true));
$this->series_responses = new Google_SeriesResponsesServiceResource($this, $this->serviceName, 'responses', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "sort": {"type": "string", "location": "query"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "author": {"type": "string", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "hasAttachedVideo": {"type": "boolean", "location": "query"}}, "id": "moderator.series.responses.list", "httpMethod": "GET", "path": "series/{seriesId}/responses", "response": {"$ref": "SeriesList"}}}}', true));
$this->topics = new Google_TopicsServiceResource($this, $this->serviceName, 'topics', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Topic"}, "response": {"$ref": "Topic"}, "httpMethod": "POST", "path": "series/{seriesId}/topics", "id": "moderator.topics.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}, "mode": {"type": "string", "location": "query"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "moderator.topics.list", "httpMethod": "GET", "path": "series/{seriesId}/topics", "response": {"$ref": "TopicList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "topicId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "request": {"$ref": "Topic"}, "response": {"$ref": "Topic"}, "httpMethod": "PUT", "path": "series/{seriesId}/topics/{topicId}", "id": "moderator.topics.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "topicId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "moderator.topics.get", "httpMethod": "GET", "path": "series/{seriesId}/topics/{topicId}", "response": {"$ref": "Topic"}}}}', true));
$this->topics_submissions = new Google_TopicsSubmissionsServiceResource($this, $this->serviceName, 'submissions', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "includeVotes": {"type": "boolean", "location": "query"}, "topicId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}, "author": {"type": "string", "location": "query"}, "sort": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "hasAttachedVideo": {"type": "boolean", "location": "query"}}, "id": "moderator.topics.submissions.list", "httpMethod": "GET", "path": "series/{seriesId}/topics/{topicId}/submissions", "response": {"$ref": "SubmissionList"}}}}', true));
$this->global_series = new Google_ModeratorGlobalSeriesServiceResource($this, $this->serviceName, 'series', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "start-index": {"type": "integer", "location": "query", "format": "uint32"}}, "response": {"$ref": "SeriesList"}, "httpMethod": "GET", "path": "search", "id": "moderator.global.series.list"}}}', true));
$this->profiles = new Google_ProfilesServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/moderator"], "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "httpMethod": "PATCH", "path": "profiles/@me", "id": "moderator.profiles.patch"}, "update": {"scopes": ["https://www.googleapis.com/auth/moderator"], "request": {"$ref": "Profile"}, "response": {"$ref": "Profile"}, "httpMethod": "PUT", "path": "profiles/@me", "id": "moderator.profiles.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "path": "profiles/@me", "response": {"$ref": "Profile"}, "id": "moderator.profiles.get", "httpMethod": "GET"}}}', true));
$this->featured_series = new Google_FeaturedSeriesServiceResource($this, $this->serviceName, 'series', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "path": "series/featured", "response": {"$ref": "SeriesList"}, "id": "moderator.featured.series.list", "httpMethod": "GET"}}}', true));
$this->myrecent_series = new Google_MyrecentSeriesServiceResource($this, $this->serviceName, 'series', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "path": "series/@me/recent", "response": {"$ref": "SeriesList"}, "id": "moderator.myrecent.series.list", "httpMethod": "GET"}}}', true));
$this->my_series = new Google_MySeriesServiceResource($this, $this->serviceName, 'series', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/moderator"], "path": "series/@me/mine", "response": {"$ref": "SeriesList"}, "id": "moderator.my.series.list", "httpMethod": "GET"}}}', true));
$this->submissions = new Google_SubmissionsServiceResource($this, $this->serviceName, 'submissions', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "topicId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "unauthToken": {"type": "string", "location": "query"}, "anonymous": {"type": "boolean", "location": "query"}}, "request": {"$ref": "Submission"}, "response": {"$ref": "Submission"}, "httpMethod": "POST", "path": "series/{seriesId}/topics/{topicId}/submissions", "id": "moderator.submissions.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/moderator"], "parameters": {"lang": {"type": "string", "location": "query"}, "seriesId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "submissionId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}, "includeVotes": {"type": "boolean", "location": "query"}}, "id": "moderator.submissions.get", "httpMethod": "GET", "path": "series/{seriesId}/submissions/{submissionId}", "response": {"$ref": "Submission"}}}}', true));
}
}
class Google_ModeratorTopicsResourcePartial extends Google_Model {
protected $__idType = 'Google_ModeratorTopicsResourcePartialId';
protected $__idDataType = '';
public $id;
public function setId(Google_ModeratorTopicsResourcePartialId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ModeratorTopicsResourcePartialId extends Google_Model {
public $seriesId;
public $topicId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setTopicId($topicId) {
$this->topicId = $topicId;
}
public function getTopicId() {
return $this->topicId;
}
}
class Google_ModeratorVotesResourcePartial extends Google_Model {
public $vote;
public $flag;
public function setVote($vote) {
$this->vote = $vote;
}
public function getVote() {
return $this->vote;
}
public function setFlag($flag) {
$this->flag = $flag;
}
public function getFlag() {
return $this->flag;
}
}
class Google_Profile extends Google_Model {
public $kind;
protected $__attributionType = 'Google_ProfileAttribution';
protected $__attributionDataType = '';
public $attribution;
protected $__idType = 'Google_ProfileId';
protected $__idDataType = '';
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAttribution(Google_ProfileAttribution $attribution) {
$this->attribution = $attribution;
}
public function getAttribution() {
return $this->attribution;
}
public function setId(Google_ProfileId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ProfileAttribution extends Google_Model {
protected $__geoType = 'Google_ProfileAttributionGeo';
protected $__geoDataType = '';
public $geo;
public $displayName;
public $location;
public $avatarUrl;
public function setGeo(Google_ProfileAttributionGeo $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setAvatarUrl($avatarUrl) {
$this->avatarUrl = $avatarUrl;
}
public function getAvatarUrl() {
return $this->avatarUrl;
}
}
class Google_ProfileAttributionGeo extends Google_Model {
public $latitude;
public $location;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_ProfileId extends Google_Model {
public $user;
public function setUser($user) {
$this->user = $user;
}
public function getUser() {
return $this->user;
}
}
class Google_Series extends Google_Model {
public $kind;
public $description;
protected $__rulesType = 'Google_SeriesRules';
protected $__rulesDataType = '';
public $rules;
public $unauthVotingAllowed;
public $videoSubmissionAllowed;
public $name;
public $numTopics;
public $anonymousSubmissionAllowed;
public $unauthSubmissionAllowed;
protected $__idType = 'Google_SeriesId';
protected $__idDataType = '';
public $id;
protected $__countersType = 'Google_SeriesCounters';
protected $__countersDataType = '';
public $counters;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setRules(Google_SeriesRules $rules) {
$this->rules = $rules;
}
public function getRules() {
return $this->rules;
}
public function setUnauthVotingAllowed($unauthVotingAllowed) {
$this->unauthVotingAllowed = $unauthVotingAllowed;
}
public function getUnauthVotingAllowed() {
return $this->unauthVotingAllowed;
}
public function setVideoSubmissionAllowed($videoSubmissionAllowed) {
$this->videoSubmissionAllowed = $videoSubmissionAllowed;
}
public function getVideoSubmissionAllowed() {
return $this->videoSubmissionAllowed;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setNumTopics($numTopics) {
$this->numTopics = $numTopics;
}
public function getNumTopics() {
return $this->numTopics;
}
public function setAnonymousSubmissionAllowed($anonymousSubmissionAllowed) {
$this->anonymousSubmissionAllowed = $anonymousSubmissionAllowed;
}
public function getAnonymousSubmissionAllowed() {
return $this->anonymousSubmissionAllowed;
}
public function setUnauthSubmissionAllowed($unauthSubmissionAllowed) {
$this->unauthSubmissionAllowed = $unauthSubmissionAllowed;
}
public function getUnauthSubmissionAllowed() {
return $this->unauthSubmissionAllowed;
}
public function setId(Google_SeriesId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCounters(Google_SeriesCounters $counters) {
$this->counters = $counters;
}
public function getCounters() {
return $this->counters;
}
}
class Google_SeriesCounters extends Google_Model {
public $users;
public $noneVotes;
public $videoSubmissions;
public $minusVotes;
public $anonymousSubmissions;
public $submissions;
public $plusVotes;
public function setUsers($users) {
$this->users = $users;
}
public function getUsers() {
return $this->users;
}
public function setNoneVotes($noneVotes) {
$this->noneVotes = $noneVotes;
}
public function getNoneVotes() {
return $this->noneVotes;
}
public function setVideoSubmissions($videoSubmissions) {
$this->videoSubmissions = $videoSubmissions;
}
public function getVideoSubmissions() {
return $this->videoSubmissions;
}
public function setMinusVotes($minusVotes) {
$this->minusVotes = $minusVotes;
}
public function getMinusVotes() {
return $this->minusVotes;
}
public function setAnonymousSubmissions($anonymousSubmissions) {
$this->anonymousSubmissions = $anonymousSubmissions;
}
public function getAnonymousSubmissions() {
return $this->anonymousSubmissions;
}
public function setSubmissions($submissions) {
$this->submissions = $submissions;
}
public function getSubmissions() {
return $this->submissions;
}
public function setPlusVotes($plusVotes) {
$this->plusVotes = $plusVotes;
}
public function getPlusVotes() {
return $this->plusVotes;
}
}
class Google_SeriesId extends Google_Model {
public $seriesId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
}
class Google_SeriesList extends Google_Model {
protected $__itemsType = 'Google_Series';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Series) */ $items) {
$this->assertIsArray($items, 'Google_Series', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_SeriesRules extends Google_Model {
protected $__votesType = 'Google_SeriesRulesVotes';
protected $__votesDataType = '';
public $votes;
protected $__submissionsType = 'Google_SeriesRulesSubmissions';
protected $__submissionsDataType = '';
public $submissions;
public function setVotes(Google_SeriesRulesVotes $votes) {
$this->votes = $votes;
}
public function getVotes() {
return $this->votes;
}
public function setSubmissions(Google_SeriesRulesSubmissions $submissions) {
$this->submissions = $submissions;
}
public function getSubmissions() {
return $this->submissions;
}
}
class Google_SeriesRulesSubmissions extends Google_Model {
public $close;
public $open;
public function setClose($close) {
$this->close = $close;
}
public function getClose() {
return $this->close;
}
public function setOpen($open) {
$this->open = $open;
}
public function getOpen() {
return $this->open;
}
}
class Google_SeriesRulesVotes extends Google_Model {
public $close;
public $open;
public function setClose($close) {
$this->close = $close;
}
public function getClose() {
return $this->close;
}
public function setOpen($open) {
$this->open = $open;
}
public function getOpen() {
return $this->open;
}
}
class Google_Submission extends Google_Model {
public $kind;
protected $__attributionType = 'Google_SubmissionAttribution';
protected $__attributionDataType = '';
public $attribution;
public $created;
public $text;
protected $__topicsType = 'Google_ModeratorTopicsResourcePartial';
protected $__topicsDataType = 'array';
public $topics;
public $author;
protected $__translationsType = 'Google_SubmissionTranslations';
protected $__translationsDataType = 'array';
public $translations;
protected $__parentSubmissionIdType = 'Google_SubmissionParentSubmissionId';
protected $__parentSubmissionIdDataType = '';
public $parentSubmissionId;
protected $__voteType = 'Google_ModeratorVotesResourcePartial';
protected $__voteDataType = '';
public $vote;
public $attachmentUrl;
protected $__geoType = 'Google_SubmissionGeo';
protected $__geoDataType = '';
public $geo;
protected $__idType = 'Google_SubmissionId';
protected $__idDataType = '';
public $id;
protected $__countersType = 'Google_SubmissionCounters';
protected $__countersDataType = '';
public $counters;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAttribution(Google_SubmissionAttribution $attribution) {
$this->attribution = $attribution;
}
public function getAttribution() {
return $this->attribution;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setTopics(/* array(Google_ModeratorTopicsResourcePartial) */ $topics) {
$this->assertIsArray($topics, 'Google_ModeratorTopicsResourcePartial', __METHOD__);
$this->topics = $topics;
}
public function getTopics() {
return $this->topics;
}
public function setAuthor($author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setTranslations(/* array(Google_SubmissionTranslations) */ $translations) {
$this->assertIsArray($translations, 'Google_SubmissionTranslations', __METHOD__);
$this->translations = $translations;
}
public function getTranslations() {
return $this->translations;
}
public function setParentSubmissionId(Google_SubmissionParentSubmissionId $parentSubmissionId) {
$this->parentSubmissionId = $parentSubmissionId;
}
public function getParentSubmissionId() {
return $this->parentSubmissionId;
}
public function setVote(Google_ModeratorVotesResourcePartial $vote) {
$this->vote = $vote;
}
public function getVote() {
return $this->vote;
}
public function setAttachmentUrl($attachmentUrl) {
$this->attachmentUrl = $attachmentUrl;
}
public function getAttachmentUrl() {
return $this->attachmentUrl;
}
public function setGeo(Google_SubmissionGeo $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setId(Google_SubmissionId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCounters(Google_SubmissionCounters $counters) {
$this->counters = $counters;
}
public function getCounters() {
return $this->counters;
}
}
class Google_SubmissionAttribution extends Google_Model {
public $displayName;
public $location;
public $avatarUrl;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setAvatarUrl($avatarUrl) {
$this->avatarUrl = $avatarUrl;
}
public function getAvatarUrl() {
return $this->avatarUrl;
}
}
class Google_SubmissionCounters extends Google_Model {
public $noneVotes;
public $minusVotes;
public $plusVotes;
public function setNoneVotes($noneVotes) {
$this->noneVotes = $noneVotes;
}
public function getNoneVotes() {
return $this->noneVotes;
}
public function setMinusVotes($minusVotes) {
$this->minusVotes = $minusVotes;
}
public function getMinusVotes() {
return $this->minusVotes;
}
public function setPlusVotes($plusVotes) {
$this->plusVotes = $plusVotes;
}
public function getPlusVotes() {
return $this->plusVotes;
}
}
class Google_SubmissionGeo extends Google_Model {
public $latitude;
public $location;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_SubmissionId extends Google_Model {
public $seriesId;
public $submissionId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setSubmissionId($submissionId) {
$this->submissionId = $submissionId;
}
public function getSubmissionId() {
return $this->submissionId;
}
}
class Google_SubmissionList extends Google_Model {
protected $__itemsType = 'Google_Submission';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Submission) */ $items) {
$this->assertIsArray($items, 'Google_Submission', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_SubmissionParentSubmissionId extends Google_Model {
public $seriesId;
public $submissionId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setSubmissionId($submissionId) {
$this->submissionId = $submissionId;
}
public function getSubmissionId() {
return $this->submissionId;
}
}
class Google_SubmissionTranslations extends Google_Model {
public $lang;
public $text;
public function setLang($lang) {
$this->lang = $lang;
}
public function getLang() {
return $this->lang;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
}
class Google_Tag extends Google_Model {
public $text;
public $kind;
protected $__idType = 'Google_TagId';
protected $__idDataType = '';
public $id;
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId(Google_TagId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_TagId extends Google_Model {
public $seriesId;
public $tagId;
public $submissionId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setTagId($tagId) {
$this->tagId = $tagId;
}
public function getTagId() {
return $this->tagId;
}
public function setSubmissionId($submissionId) {
$this->submissionId = $submissionId;
}
public function getSubmissionId() {
return $this->submissionId;
}
}
class Google_TagList extends Google_Model {
protected $__itemsType = 'Google_Tag';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Tag) */ $items) {
$this->assertIsArray($items, 'Google_Tag', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Topic extends Google_Model {
public $kind;
public $description;
protected $__rulesType = 'Google_TopicRules';
protected $__rulesDataType = '';
public $rules;
protected $__featuredSubmissionType = 'Google_Submission';
protected $__featuredSubmissionDataType = '';
public $featuredSubmission;
public $presenter;
protected $__countersType = 'Google_TopicCounters';
protected $__countersDataType = '';
public $counters;
protected $__idType = 'Google_TopicId';
protected $__idDataType = '';
public $id;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setRules(Google_TopicRules $rules) {
$this->rules = $rules;
}
public function getRules() {
return $this->rules;
}
public function setFeaturedSubmission(Google_Submission $featuredSubmission) {
$this->featuredSubmission = $featuredSubmission;
}
public function getFeaturedSubmission() {
return $this->featuredSubmission;
}
public function setPresenter($presenter) {
$this->presenter = $presenter;
}
public function getPresenter() {
return $this->presenter;
}
public function setCounters(Google_TopicCounters $counters) {
$this->counters = $counters;
}
public function getCounters() {
return $this->counters;
}
public function setId(Google_TopicId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_TopicCounters extends Google_Model {
public $users;
public $noneVotes;
public $videoSubmissions;
public $minusVotes;
public $submissions;
public $plusVotes;
public function setUsers($users) {
$this->users = $users;
}
public function getUsers() {
return $this->users;
}
public function setNoneVotes($noneVotes) {
$this->noneVotes = $noneVotes;
}
public function getNoneVotes() {
return $this->noneVotes;
}
public function setVideoSubmissions($videoSubmissions) {
$this->videoSubmissions = $videoSubmissions;
}
public function getVideoSubmissions() {
return $this->videoSubmissions;
}
public function setMinusVotes($minusVotes) {
$this->minusVotes = $minusVotes;
}
public function getMinusVotes() {
return $this->minusVotes;
}
public function setSubmissions($submissions) {
$this->submissions = $submissions;
}
public function getSubmissions() {
return $this->submissions;
}
public function setPlusVotes($plusVotes) {
$this->plusVotes = $plusVotes;
}
public function getPlusVotes() {
return $this->plusVotes;
}
}
class Google_TopicId extends Google_Model {
public $seriesId;
public $topicId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setTopicId($topicId) {
$this->topicId = $topicId;
}
public function getTopicId() {
return $this->topicId;
}
}
class Google_TopicList extends Google_Model {
protected $__itemsType = 'Google_Topic';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Topic) */ $items) {
$this->assertIsArray($items, 'Google_Topic', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_TopicRules extends Google_Model {
protected $__votesType = 'Google_TopicRulesVotes';
protected $__votesDataType = '';
public $votes;
protected $__submissionsType = 'Google_TopicRulesSubmissions';
protected $__submissionsDataType = '';
public $submissions;
public function setVotes(Google_TopicRulesVotes $votes) {
$this->votes = $votes;
}
public function getVotes() {
return $this->votes;
}
public function setSubmissions(Google_TopicRulesSubmissions $submissions) {
$this->submissions = $submissions;
}
public function getSubmissions() {
return $this->submissions;
}
}
class Google_TopicRulesSubmissions extends Google_Model {
public $close;
public $open;
public function setClose($close) {
$this->close = $close;
}
public function getClose() {
return $this->close;
}
public function setOpen($open) {
$this->open = $open;
}
public function getOpen() {
return $this->open;
}
}
class Google_TopicRulesVotes extends Google_Model {
public $close;
public $open;
public function setClose($close) {
$this->close = $close;
}
public function getClose() {
return $this->close;
}
public function setOpen($open) {
$this->open = $open;
}
public function getOpen() {
return $this->open;
}
}
class Google_Vote extends Google_Model {
public $vote;
public $flag;
protected $__idType = 'Google_VoteId';
protected $__idDataType = '';
public $id;
public $kind;
public function setVote($vote) {
$this->vote = $vote;
}
public function getVote() {
return $this->vote;
}
public function setFlag($flag) {
$this->flag = $flag;
}
public function getFlag() {
return $this->flag;
}
public function setId(Google_VoteId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_VoteId extends Google_Model {
public $seriesId;
public $submissionId;
public function setSeriesId($seriesId) {
$this->seriesId = $seriesId;
}
public function getSeriesId() {
return $this->seriesId;
}
public function setSubmissionId($submissionId) {
$this->submissionId = $submissionId;
}
public function getSubmissionId() {
return $this->submissionId;
}
}
class Google_VoteList extends Google_Model {
protected $__itemsType = 'Google_Vote';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Vote) */ $items) {
$this->assertIsArray($items, 'Google_Vote', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_ModeratorService.php | PHP | asf20 | 71,577 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "communityMembers" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityMembers = $orkutService->communityMembers;
* </code>
*/
class Google_CommunityMembersServiceResource extends Google_ServiceResource {
/**
* Makes the user join a community. (communityMembers.insert)
*
* @param int $communityId ID of the community.
* @param string $userId ID of the user.
* @param array $optParams Optional parameters.
* @return Google_CommunityMembers
*/
public function insert($communityId, $userId, $optParams = array()) {
$params = array('communityId' => $communityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityMembers($data);
} else {
return $data;
}
}
/**
* Retrieves the relationship between a user and a community. (communityMembers.get)
*
* @param int $communityId ID of the community.
* @param string $userId ID of the user.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityMembers
*/
public function get($communityId, $userId, $optParams = array()) {
$params = array('communityId' => $communityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CommunityMembers($data);
} else {
return $data;
}
}
/**
* Lists members of a community. Use the pagination tokens to retrieve the full list; do not rely on
* the member count available in the community profile information to know when to stop iterating,
* as that count may be approximate. (communityMembers.list)
*
* @param int $communityId The ID of the community whose members will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param bool friendsOnly Whether to list only community members who are friends of the user.
* @opt_param string maxResults The maximum number of members to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityMembersList
*/
public function listCommunityMembers($communityId, $optParams = array()) {
$params = array('communityId' => $communityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityMembersList($data);
} else {
return $data;
}
}
/**
* Makes the user leave a community. (communityMembers.delete)
*
* @param int $communityId ID of the community.
* @param string $userId ID of the user.
* @param array $optParams Optional parameters.
*/
public function delete($communityId, $userId, $optParams = array()) {
$params = array('communityId' => $communityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "activities" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $activities = $orkutService->activities;
* </code>
*/
class Google_ActivitiesServiceResource extends Google_ServiceResource {
/**
* Retrieves a list of activities. (activities.list)
*
* @param string $userId The ID of the user whose activities will be listed. Can be me to refer to the viewer (i.e. the authenticated user).
* @param string $collection The collection of activities to list.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of activities to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_ActivityList
*/
public function listActivities($userId, $collection, $optParams = array()) {
$params = array('userId' => $userId, 'collection' => $collection);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ActivityList($data);
} else {
return $data;
}
}
/**
* Deletes an existing activity, if the access controls allow it. (activities.delete)
*
* @param string $activityId ID of the activity to remove.
* @param array $optParams Optional parameters.
*/
public function delete($activityId, $optParams = array()) {
$params = array('activityId' => $activityId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "communityPollComments" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityPollComments = $orkutService->communityPollComments;
* </code>
*/
class Google_CommunityPollCommentsServiceResource extends Google_ServiceResource {
/**
* Adds a comment on a community poll. (communityPollComments.insert)
*
* @param int $communityId The ID of the community whose poll is being commented.
* @param string $pollId The ID of the poll being commented.
* @param Google_CommunityPollComment $postBody
* @param array $optParams Optional parameters.
* @return Google_CommunityPollComment
*/
public function insert($communityId, $pollId, Google_CommunityPollComment $postBody, $optParams = array()) {
$params = array('communityId' => $communityId, 'pollId' => $pollId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityPollComment($data);
} else {
return $data;
}
}
/**
* Retrieves the comments of a community poll. (communityPollComments.list)
*
* @param int $communityId The ID of the community whose poll is having its comments listed.
* @param string $pollId The ID of the community whose polls will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of comments to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityPollCommentList
*/
public function listCommunityPollComments($communityId, $pollId, $optParams = array()) {
$params = array('communityId' => $communityId, 'pollId' => $pollId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityPollCommentList($data);
} else {
return $data;
}
}
}
/**
* The "communityPolls" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityPolls = $orkutService->communityPolls;
* </code>
*/
class Google_CommunityPollsServiceResource extends Google_ServiceResource {
/**
* Retrieves the polls of a community. (communityPolls.list)
*
* @param int $communityId The ID of the community which polls will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of polls to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityPollList
*/
public function listCommunityPolls($communityId, $optParams = array()) {
$params = array('communityId' => $communityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityPollList($data);
} else {
return $data;
}
}
/**
* Retrieves one specific poll of a community. (communityPolls.get)
*
* @param int $communityId The ID of the community for whose poll will be retrieved.
* @param string $pollId The ID of the poll to get.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityPoll
*/
public function get($communityId, $pollId, $optParams = array()) {
$params = array('communityId' => $communityId, 'pollId' => $pollId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CommunityPoll($data);
} else {
return $data;
}
}
}
/**
* The "communityMessages" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityMessages = $orkutService->communityMessages;
* </code>
*/
class Google_CommunityMessagesServiceResource extends Google_ServiceResource {
/**
* Adds a message to a given community topic. (communityMessages.insert)
*
* @param int $communityId The ID of the community the message should be added to.
* @param string $topicId The ID of the topic the message should be added to.
* @param Google_CommunityMessage $postBody
* @param array $optParams Optional parameters.
* @return Google_CommunityMessage
*/
public function insert($communityId, $topicId, Google_CommunityMessage $postBody, $optParams = array()) {
$params = array('communityId' => $communityId, 'topicId' => $topicId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityMessage($data);
} else {
return $data;
}
}
/**
* Retrieves the messages of a topic of a community. (communityMessages.list)
*
* @param int $communityId The ID of the community which messages will be listed.
* @param string $topicId The ID of the topic which messages will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of messages to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityMessageList
*/
public function listCommunityMessages($communityId, $topicId, $optParams = array()) {
$params = array('communityId' => $communityId, 'topicId' => $topicId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityMessageList($data);
} else {
return $data;
}
}
/**
* Moves a message of the community to the trash folder. (communityMessages.delete)
*
* @param int $communityId The ID of the community whose message will be moved to the trash folder.
* @param string $topicId The ID of the topic whose message will be moved to the trash folder.
* @param string $messageId The ID of the message to be moved to the trash folder.
* @param array $optParams Optional parameters.
*/
public function delete($communityId, $topicId, $messageId, $optParams = array()) {
$params = array('communityId' => $communityId, 'topicId' => $topicId, 'messageId' => $messageId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "communityTopics" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityTopics = $orkutService->communityTopics;
* </code>
*/
class Google_CommunityTopicsServiceResource extends Google_ServiceResource {
/**
* Adds a topic to a given community. (communityTopics.insert)
*
* @param int $communityId The ID of the community the topic should be added to.
* @param Google_CommunityTopic $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool isShout Whether this topic is a shout.
* @return Google_CommunityTopic
*/
public function insert($communityId, Google_CommunityTopic $postBody, $optParams = array()) {
$params = array('communityId' => $communityId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityTopic($data);
} else {
return $data;
}
}
/**
* Retrieves a topic of a community. (communityTopics.get)
*
* @param int $communityId The ID of the community whose topic will be retrieved.
* @param string $topicId The ID of the topic to get.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityTopic
*/
public function get($communityId, $topicId, $optParams = array()) {
$params = array('communityId' => $communityId, 'topicId' => $topicId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CommunityTopic($data);
} else {
return $data;
}
}
/**
* Retrieves the topics of a community. (communityTopics.list)
*
* @param int $communityId The ID of the community which topics will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of topics to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityTopicList
*/
public function listCommunityTopics($communityId, $optParams = array()) {
$params = array('communityId' => $communityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityTopicList($data);
} else {
return $data;
}
}
/**
* Moves a topic of the community to the trash folder. (communityTopics.delete)
*
* @param int $communityId The ID of the community whose topic will be moved to the trash folder.
* @param string $topicId The ID of the topic to be moved to the trash folder.
* @param array $optParams Optional parameters.
*/
public function delete($communityId, $topicId, $optParams = array()) {
$params = array('communityId' => $communityId, 'topicId' => $topicId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "comments" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $comments = $orkutService->comments;
* </code>
*/
class Google_CommentsServiceResource extends Google_ServiceResource {
/**
* Inserts a new comment to an activity. (comments.insert)
*
* @param string $activityId The ID of the activity to contain the new comment.
* @param Google_Comment $postBody
* @param array $optParams Optional parameters.
* @return Google_Comment
*/
public function insert($activityId, Google_Comment $postBody, $optParams = array()) {
$params = array('activityId' => $activityId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Comment($data);
} else {
return $data;
}
}
/**
* Retrieves an existing comment. (comments.get)
*
* @param string $commentId ID of the comment to get.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_Comment
*/
public function get($commentId, $optParams = array()) {
$params = array('commentId' => $commentId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Comment($data);
} else {
return $data;
}
}
/**
* Retrieves a list of comments, possibly filtered. (comments.list)
*
* @param string $activityId The ID of the activity containing the comments.
* @param array $optParams Optional parameters.
*
* @opt_param string orderBy Sort search results.
* @opt_param string pageToken A continuation token that allows pagination.
* @opt_param string maxResults The maximum number of activities to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommentList
*/
public function listComments($activityId, $optParams = array()) {
$params = array('activityId' => $activityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommentList($data);
} else {
return $data;
}
}
/**
* Deletes an existing comment. (comments.delete)
*
* @param string $commentId ID of the comment to remove.
* @param array $optParams Optional parameters.
*/
public function delete($commentId, $optParams = array()) {
$params = array('commentId' => $commentId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "acl" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $acl = $orkutService->acl;
* </code>
*/
class Google_AclServiceResource extends Google_ServiceResource {
/**
* Excludes an element from the ACL of the activity. (acl.delete)
*
* @param string $activityId ID of the activity.
* @param string $userId ID of the user to be removed from the activity.
* @param array $optParams Optional parameters.
*/
public function delete($activityId, $userId, $optParams = array()) {
$params = array('activityId' => $activityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "communityRelated" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityRelated = $orkutService->communityRelated;
* </code>
*/
class Google_CommunityRelatedServiceResource extends Google_ServiceResource {
/**
* Retrieves the communities related to another one. (communityRelated.list)
*
* @param int $communityId The ID of the community whose related communities will be listed.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityList
*/
public function listCommunityRelated($communityId, $optParams = array()) {
$params = array('communityId' => $communityId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityList($data);
} else {
return $data;
}
}
}
/**
* The "scraps" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $scraps = $orkutService->scraps;
* </code>
*/
class Google_ScrapsServiceResource extends Google_ServiceResource {
/**
* Creates a new scrap. (scraps.insert)
*
* @param Google_Activity $postBody
* @param array $optParams Optional parameters.
* @return Google_Activity
*/
public function insert(Google_Activity $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Activity($data);
} else {
return $data;
}
}
}
/**
* The "communityPollVotes" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityPollVotes = $orkutService->communityPollVotes;
* </code>
*/
class Google_CommunityPollVotesServiceResource extends Google_ServiceResource {
/**
* Votes on a community poll. (communityPollVotes.insert)
*
* @param int $communityId The ID of the community whose poll is being voted.
* @param string $pollId The ID of the poll being voted.
* @param Google_CommunityPollVote $postBody
* @param array $optParams Optional parameters.
* @return Google_CommunityPollVote
*/
public function insert($communityId, $pollId, Google_CommunityPollVote $postBody, $optParams = array()) {
$params = array('communityId' => $communityId, 'pollId' => $pollId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityPollVote($data);
} else {
return $data;
}
}
}
/**
* The "communities" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communities = $orkutService->communities;
* </code>
*/
class Google_CommunitiesServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of communities the current user is a member of. (communities.list)
*
* @param string $userId The ID of the user whose communities will be listed. Can be me to refer to caller.
* @param array $optParams Optional parameters.
*
* @opt_param string orderBy How to order the communities by.
* @opt_param string maxResults The maximum number of communities to include in the response.
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_CommunityList
*/
public function listCommunities($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommunityList($data);
} else {
return $data;
}
}
/**
* Retrieves the basic information (aka. profile) of a community. (communities.get)
*
* @param int $communityId The ID of the community to get.
* @param array $optParams Optional parameters.
*
* @opt_param string hl Specifies the interface language (host language) of your user interface.
* @return Google_Community
*/
public function get($communityId, $optParams = array()) {
$params = array('communityId' => $communityId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Community($data);
} else {
return $data;
}
}
}
/**
* The "communityFollow" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $communityFollow = $orkutService->communityFollow;
* </code>
*/
class Google_CommunityFollowServiceResource extends Google_ServiceResource {
/**
* Adds a user as a follower of a community. (communityFollow.insert)
*
* @param int $communityId ID of the community.
* @param string $userId ID of the user.
* @param array $optParams Optional parameters.
* @return Google_CommunityMembers
*/
public function insert($communityId, $userId, $optParams = array()) {
$params = array('communityId' => $communityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CommunityMembers($data);
} else {
return $data;
}
}
/**
* Removes a user from the followers of a community. (communityFollow.delete)
*
* @param int $communityId ID of the community.
* @param string $userId ID of the user.
* @param array $optParams Optional parameters.
*/
public function delete($communityId, $userId, $optParams = array()) {
$params = array('communityId' => $communityId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "activityVisibility" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $activityVisibility = $orkutService->activityVisibility;
* </code>
*/
class Google_ActivityVisibilityServiceResource extends Google_ServiceResource {
/**
* Updates the visibility of an existing activity. This method supports patch semantics.
* (activityVisibility.patch)
*
* @param string $activityId ID of the activity.
* @param Google_Visibility $postBody
* @param array $optParams Optional parameters.
* @return Google_Visibility
*/
public function patch($activityId, Google_Visibility $postBody, $optParams = array()) {
$params = array('activityId' => $activityId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Visibility($data);
} else {
return $data;
}
}
/**
* Updates the visibility of an existing activity. (activityVisibility.update)
*
* @param string $activityId ID of the activity.
* @param Google_Visibility $postBody
* @param array $optParams Optional parameters.
* @return Google_Visibility
*/
public function update($activityId, Google_Visibility $postBody, $optParams = array()) {
$params = array('activityId' => $activityId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Visibility($data);
} else {
return $data;
}
}
/**
* Gets the visibility of an existing activity. (activityVisibility.get)
*
* @param string $activityId ID of the activity to get the visibility.
* @param array $optParams Optional parameters.
* @return Google_Visibility
*/
public function get($activityId, $optParams = array()) {
$params = array('activityId' => $activityId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Visibility($data);
} else {
return $data;
}
}
}
/**
* The "badges" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $badges = $orkutService->badges;
* </code>
*/
class Google_BadgesServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of visible badges of a user. (badges.list)
*
* @param string $userId The id of the user whose badges will be listed. Can be me to refer to caller.
* @param array $optParams Optional parameters.
* @return Google_BadgeList
*/
public function listBadges($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_BadgeList($data);
} else {
return $data;
}
}
/**
* Retrieves a badge from a user. (badges.get)
*
* @param string $userId The ID of the user whose badges will be listed. Can be me to refer to caller.
* @param string $badgeId The ID of the badge that will be retrieved.
* @param array $optParams Optional parameters.
* @return Google_Badge
*/
public function get($userId, $badgeId, $optParams = array()) {
$params = array('userId' => $userId, 'badgeId' => $badgeId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Badge($data);
} else {
return $data;
}
}
}
/**
* The "counters" collection of methods.
* Typical usage is:
* <code>
* $orkutService = new Google_OrkutService(...);
* $counters = $orkutService->counters;
* </code>
*/
class Google_CountersServiceResource extends Google_ServiceResource {
/**
* Retrieves the counters of a user. (counters.list)
*
* @param string $userId The ID of the user whose counters will be listed. Can be me to refer to caller.
* @param array $optParams Optional parameters.
* @return Google_Counters
*/
public function listCounters($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Counters($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Orkut (v2).
*
* <p>
* Lets you manage activities, comments and badges in Orkut. More stuff coming in time.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/orkut/v2/reference.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_OrkutService extends Google_Service {
public $communityMembers;
public $activities;
public $communityPollComments;
public $communityPolls;
public $communityMessages;
public $communityTopics;
public $comments;
public $acl;
public $communityRelated;
public $scraps;
public $communityPollVotes;
public $communities;
public $communityFollow;
public $activityVisibility;
public $badges;
public $counters;
/**
* Constructs the internal representation of the Orkut service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'orkut/v2/';
$this->version = 'v2';
$this->serviceName = 'orkut';
$client->addService($this->serviceName, $this->version);
$this->communityMembers = new Google_CommunityMembersServiceResource($this, $this->serviceName, 'communityMembers', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.communityMembers.insert", "httpMethod": "POST", "path": "communities/{communityId}/members/{userId}", "response": {"$ref": "CommunityMembers"}}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityMembers.get", "httpMethod": "GET", "path": "communities/{communityId}/members/{userId}", "response": {"$ref": "CommunityMembers"}}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "friendsOnly": {"type": "boolean", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityMembers.list", "httpMethod": "GET", "path": "communities/{communityId}/members", "response": {"$ref": "CommunityMembersList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "communities/{communityId}/members/{userId}", "id": "orkut.communityMembers.delete", "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "userId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->activities = new Google_ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "100", "format": "uint32"}, "userId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["all", "scraps", "stream"]}}, "id": "orkut.activities.list", "httpMethod": "GET", "path": "people/{userId}/activities/{collection}", "response": {"$ref": "ActivityList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "activities/{activityId}", "id": "orkut.activities.delete", "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->communityPollComments = new Google_CommunityPollCommentsServiceResource($this, $this->serviceName, 'communityPollComments', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "pollId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CommunityPollComment"}, "response": {"$ref": "CommunityPollComment"}, "httpMethod": "POST", "path": "communities/{communityId}/polls/{pollId}/comments", "id": "orkut.communityPollComments.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pollId": {"required": true, "type": "string", "location": "path"}, "pageToken": {"type": "string", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityPollComments.list", "httpMethod": "GET", "path": "communities/{communityId}/polls/{pollId}/comments", "response": {"$ref": "CommunityPollCommentList"}}}}', true));
$this->communityPolls = new Google_CommunityPollsServiceResource($this, $this->serviceName, 'communityPolls', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityPolls.list", "httpMethod": "GET", "path": "communities/{communityId}/polls", "response": {"$ref": "CommunityPollList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "pollId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityPolls.get", "httpMethod": "GET", "path": "communities/{communityId}/polls/{pollId}", "response": {"$ref": "CommunityPoll"}}}}', true));
$this->communityMessages = new Google_CommunityMessagesServiceResource($this, $this->serviceName, 'communityMessages', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"topicId": {"required": true, "type": "string", "location": "path", "format": "int64"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "CommunityMessage"}, "response": {"$ref": "CommunityMessage"}, "httpMethod": "POST", "path": "communities/{communityId}/topics/{topicId}/messages", "id": "orkut.communityMessages.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "100", "format": "uint32"}, "hl": {"type": "string", "location": "query"}, "topicId": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "id": "orkut.communityMessages.list", "httpMethod": "GET", "path": "communities/{communityId}/topics/{topicId}/messages", "response": {"$ref": "CommunityMessageList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "communities/{communityId}/topics/{topicId}/messages/{messageId}", "id": "orkut.communityMessages.delete", "parameters": {"topicId": {"required": true, "type": "string", "location": "path", "format": "int64"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "messageId": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "httpMethod": "DELETE"}}}', true));
$this->communityTopics = new Google_CommunityTopicsServiceResource($this, $this->serviceName, 'communityTopics', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"isShout": {"type": "boolean", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "CommunityTopic"}, "response": {"$ref": "CommunityTopic"}, "httpMethod": "POST", "path": "communities/{communityId}/topics", "id": "orkut.communityTopics.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"topicId": {"required": true, "type": "string", "location": "path", "format": "int64"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityTopics.get", "httpMethod": "GET", "path": "communities/{communityId}/topics/{topicId}", "response": {"$ref": "CommunityTopic"}}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "maxResults": {"location": "query", "minimum": "1", "type": "integer", "maximum": "100", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityTopics.list", "httpMethod": "GET", "path": "communities/{communityId}/topics", "response": {"$ref": "CommunityTopicList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "communities/{communityId}/topics/{topicId}", "id": "orkut.communityTopics.delete", "parameters": {"topicId": {"required": true, "type": "string", "location": "path", "format": "int64"}, "communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "httpMethod": "DELETE"}}}', true));
$this->comments = new Google_CommentsServiceResource($this, $this->serviceName, 'comments', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Comment"}, "response": {"$ref": "Comment"}, "httpMethod": "POST", "path": "activities/{activityId}/comments", "id": "orkut.comments.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"commentId": {"required": true, "type": "string", "location": "path"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.comments.get", "httpMethod": "GET", "path": "comments/{commentId}", "response": {"$ref": "Comment"}}, "list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"orderBy": {"default": "DESCENDING_SORT", "enum": ["ascending", "descending"], "type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "activityId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.comments.list", "httpMethod": "GET", "path": "activities/{activityId}/comments", "response": {"$ref": "CommentList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "comments/{commentId}", "id": "orkut.comments.delete", "parameters": {"commentId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->acl = new Google_AclServiceResource($this, $this->serviceName, 'acl', json_decode('{"methods": {"delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "activities/{activityId}/acl/{userId}", "id": "orkut.acl.delete", "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->communityRelated = new Google_CommunityRelatedServiceResource($this, $this->serviceName, 'communityRelated', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communityRelated.list", "httpMethod": "GET", "path": "communities/{communityId}/related", "response": {"$ref": "CommunityList"}}}}', true));
$this->scraps = new Google_ScrapsServiceResource($this, $this->serviceName, 'scraps', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "request": {"$ref": "Activity"}, "response": {"$ref": "Activity"}, "httpMethod": "POST", "path": "activities/scraps", "id": "orkut.scraps.insert"}}}', true));
$this->communityPollVotes = new Google_CommunityPollVotesServiceResource($this, $this->serviceName, 'communityPollVotes', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "pollId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CommunityPollVote"}, "response": {"$ref": "CommunityPollVote"}, "httpMethod": "POST", "path": "communities/{communityId}/polls/{pollId}/votes", "id": "orkut.communityPollVotes.insert"}}}', true));
$this->communities = new Google_CommunitiesServiceResource($this, $this->serviceName, 'communities', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"orderBy": {"enum": ["id", "ranked"], "type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"minimum": "1", "type": "integer", "location": "query", "format": "uint32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communities.list", "httpMethod": "GET", "path": "people/{userId}/communities", "response": {"$ref": "CommunityList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "hl": {"type": "string", "location": "query"}}, "id": "orkut.communities.get", "httpMethod": "GET", "path": "communities/{communityId}", "response": {"$ref": "Community"}}}}', true));
$this->communityFollow = new Google_CommunityFollowServiceResource($this, $this->serviceName, 'communityFollow', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.communityFollow.insert", "httpMethod": "POST", "path": "communities/{communityId}/followers/{userId}", "response": {"$ref": "CommunityMembers"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/orkut"], "path": "communities/{communityId}/followers/{userId}", "id": "orkut.communityFollow.delete", "parameters": {"communityId": {"required": true, "type": "integer", "location": "path", "format": "int32"}, "userId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->activityVisibility = new Google_ActivityVisibilityServiceResource($this, $this->serviceName, 'activityVisibility', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Visibility"}, "response": {"$ref": "Visibility"}, "httpMethod": "PATCH", "path": "activities/{activityId}/visibility", "id": "orkut.activityVisibility.patch"}, "update": {"scopes": ["https://www.googleapis.com/auth/orkut"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Visibility"}, "response": {"$ref": "Visibility"}, "httpMethod": "PUT", "path": "activities/{activityId}/visibility", "id": "orkut.activityVisibility.update"}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"activityId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.activityVisibility.get", "httpMethod": "GET", "path": "activities/{activityId}/visibility", "response": {"$ref": "Visibility"}}}}', true));
$this->badges = new Google_BadgesServiceResource($this, $this->serviceName, 'badges', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.badges.list", "httpMethod": "GET", "path": "people/{userId}/badges", "response": {"$ref": "BadgeList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}, "badgeId": {"required": true, "type": "string", "location": "path", "format": "int64"}}, "id": "orkut.badges.get", "httpMethod": "GET", "path": "people/{userId}/badges/{badgeId}", "response": {"$ref": "Badge"}}}}', true));
$this->counters = new Google_CountersServiceResource($this, $this->serviceName, 'counters', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/orkut", "https://www.googleapis.com/auth/orkut.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "orkut.counters.list", "httpMethod": "GET", "path": "people/{userId}/counters", "response": {"$ref": "Counters"}}}}', true));
}
}
class Google_Acl extends Google_Model {
protected $__itemsType = 'Google_AclItems';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $description;
public $totalParticipants;
public function setItems(/* array(Google_AclItems) */ $items) {
$this->assertIsArray($items, 'Google_AclItems', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setTotalParticipants($totalParticipants) {
$this->totalParticipants = $totalParticipants;
}
public function getTotalParticipants() {
return $this->totalParticipants;
}
}
class Google_AclItems extends Google_Model {
public $type;
public $id;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_Activity extends Google_Model {
public $kind;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
public $title;
protected $__objectType = 'Google_ActivityObject';
protected $__objectDataType = '';
public $object;
public $updated;
protected $__actorType = 'Google_OrkutAuthorResource';
protected $__actorDataType = '';
public $actor;
protected $__accessType = 'Google_Acl';
protected $__accessDataType = '';
public $access;
public $verb;
public $published;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setObject(Google_ActivityObject $object) {
$this->object = $object;
}
public function getObject() {
return $this->object;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setActor(Google_OrkutAuthorResource $actor) {
$this->actor = $actor;
}
public function getActor() {
return $this->actor;
}
public function setAccess(Google_Acl $access) {
$this->access = $access;
}
public function getAccess() {
return $this->access;
}
public function setVerb($verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ActivityList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Activity';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Activity) */ $items) {
$this->assertIsArray($items, 'Google_Activity', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_ActivityObject extends Google_Model {
public $content;
protected $__itemsType = 'Google_OrkutActivityobjectsResource';
protected $__itemsDataType = 'array';
public $items;
protected $__repliesType = 'Google_ActivityObjectReplies';
protected $__repliesDataType = '';
public $replies;
public $objectType;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setItems(/* array(Google_OrkutActivityobjectsResource) */ $items) {
$this->assertIsArray($items, 'Google_OrkutActivityobjectsResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setReplies(Google_ActivityObjectReplies $replies) {
$this->replies = $replies;
}
public function getReplies() {
return $this->replies;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_ActivityObjectReplies extends Google_Model {
public $totalItems;
protected $__itemsType = 'Google_Comment';
protected $__itemsDataType = 'array';
public $items;
public $url;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setItems(/* array(Google_Comment) */ $items) {
$this->assertIsArray($items, 'Google_Comment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_Badge extends Google_Model {
public $badgeSmallLogo;
public $kind;
public $description;
public $sponsorLogo;
public $sponsorName;
public $badgeLargeLogo;
public $caption;
public $sponsorUrl;
public $id;
public function setBadgeSmallLogo($badgeSmallLogo) {
$this->badgeSmallLogo = $badgeSmallLogo;
}
public function getBadgeSmallLogo() {
return $this->badgeSmallLogo;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setSponsorLogo($sponsorLogo) {
$this->sponsorLogo = $sponsorLogo;
}
public function getSponsorLogo() {
return $this->sponsorLogo;
}
public function setSponsorName($sponsorName) {
$this->sponsorName = $sponsorName;
}
public function getSponsorName() {
return $this->sponsorName;
}
public function setBadgeLargeLogo($badgeLargeLogo) {
$this->badgeLargeLogo = $badgeLargeLogo;
}
public function getBadgeLargeLogo() {
return $this->badgeLargeLogo;
}
public function setCaption($caption) {
$this->caption = $caption;
}
public function getCaption() {
return $this->caption;
}
public function setSponsorUrl($sponsorUrl) {
$this->sponsorUrl = $sponsorUrl;
}
public function getSponsorUrl() {
return $this->sponsorUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_BadgeList extends Google_Model {
protected $__itemsType = 'Google_Badge';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Badge) */ $items) {
$this->assertIsArray($items, 'Google_Badge', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Comment extends Google_Model {
protected $__inReplyToType = 'Google_CommentInReplyTo';
protected $__inReplyToDataType = '';
public $inReplyTo;
public $kind;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
protected $__actorType = 'Google_OrkutAuthorResource';
protected $__actorDataType = '';
public $actor;
public $content;
public $published;
public $id;
public function setInReplyTo(Google_CommentInReplyTo $inReplyTo) {
$this->inReplyTo = $inReplyTo;
}
public function getInReplyTo() {
return $this->inReplyTo;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setActor(Google_OrkutAuthorResource $actor) {
$this->actor = $actor;
}
public function getActor() {
return $this->actor;
}
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentInReplyTo extends Google_Model {
public $type;
public $href;
public $ref;
public $rel;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setRef($ref) {
$this->ref = $ref;
}
public function getRef() {
return $this->ref;
}
public function setRel($rel) {
$this->rel = $rel;
}
public function getRel() {
return $this->rel;
}
}
class Google_CommentList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Comment';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $previousPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Comment) */ $items) {
$this->assertIsArray($items, 'Google_Comment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPreviousPageToken($previousPageToken) {
$this->previousPageToken = $previousPageToken;
}
public function getPreviousPageToken() {
return $this->previousPageToken;
}
}
class Google_Community extends Google_Model {
public $category;
public $kind;
public $member_count;
public $description;
public $language;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
public $creation_date;
protected $__ownerType = 'Google_OrkutAuthorResource';
protected $__ownerDataType = '';
public $owner;
protected $__moderatorsType = 'Google_OrkutAuthorResource';
protected $__moderatorsDataType = 'array';
public $moderators;
public $location;
protected $__co_ownersType = 'Google_OrkutAuthorResource';
protected $__co_ownersDataType = 'array';
public $co_owners;
public $photo_url;
public $id;
public $name;
public function setCategory($category) {
$this->category = $category;
}
public function getCategory() {
return $this->category;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setMember_count($member_count) {
$this->member_count = $member_count;
}
public function getMember_count() {
return $this->member_count;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setCreation_date($creation_date) {
$this->creation_date = $creation_date;
}
public function getCreation_date() {
return $this->creation_date;
}
public function setOwner(Google_OrkutAuthorResource $owner) {
$this->owner = $owner;
}
public function getOwner() {
return $this->owner;
}
public function setModerators(/* array(Google_OrkutAuthorResource) */ $moderators) {
$this->assertIsArray($moderators, 'Google_OrkutAuthorResource', __METHOD__);
$this->moderators = $moderators;
}
public function getModerators() {
return $this->moderators;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setCo_owners(/* array(Google_OrkutAuthorResource) */ $co_owners) {
$this->assertIsArray($co_owners, 'Google_OrkutAuthorResource', __METHOD__);
$this->co_owners = $co_owners;
}
public function getCo_owners() {
return $this->co_owners;
}
public function setPhoto_url($photo_url) {
$this->photo_url = $photo_url;
}
public function getPhoto_url() {
return $this->photo_url;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_CommunityList extends Google_Model {
protected $__itemsType = 'Google_Community';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Community) */ $items) {
$this->assertIsArray($items, 'Google_Community', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_CommunityMembers extends Google_Model {
protected $__communityMembershipStatusType = 'Google_CommunityMembershipStatus';
protected $__communityMembershipStatusDataType = '';
public $communityMembershipStatus;
protected $__personType = 'Google_OrkutActivitypersonResource';
protected $__personDataType = '';
public $person;
public $kind;
public function setCommunityMembershipStatus(Google_CommunityMembershipStatus $communityMembershipStatus) {
$this->communityMembershipStatus = $communityMembershipStatus;
}
public function getCommunityMembershipStatus() {
return $this->communityMembershipStatus;
}
public function setPerson(Google_OrkutActivitypersonResource $person) {
$this->person = $person;
}
public function getPerson() {
return $this->person;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_CommunityMembersList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_CommunityMembers';
protected $__itemsDataType = 'array';
public $items;
public $prevPageToken;
public $lastPageToken;
public $firstPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_CommunityMembers) */ $items) {
$this->assertIsArray($items, 'Google_CommunityMembers', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
public function setLastPageToken($lastPageToken) {
$this->lastPageToken = $lastPageToken;
}
public function getLastPageToken() {
return $this->lastPageToken;
}
public function setFirstPageToken($firstPageToken) {
$this->firstPageToken = $firstPageToken;
}
public function getFirstPageToken() {
return $this->firstPageToken;
}
}
class Google_CommunityMembershipStatus extends Google_Model {
public $status;
public $isFollowing;
public $isRestoreAvailable;
public $isModerator;
public $kind;
public $isCoOwner;
public $canCreatePoll;
public $canShout;
public $isOwner;
public $canCreateTopic;
public $isTakebackAvailable;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setIsFollowing($isFollowing) {
$this->isFollowing = $isFollowing;
}
public function getIsFollowing() {
return $this->isFollowing;
}
public function setIsRestoreAvailable($isRestoreAvailable) {
$this->isRestoreAvailable = $isRestoreAvailable;
}
public function getIsRestoreAvailable() {
return $this->isRestoreAvailable;
}
public function setIsModerator($isModerator) {
$this->isModerator = $isModerator;
}
public function getIsModerator() {
return $this->isModerator;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setIsCoOwner($isCoOwner) {
$this->isCoOwner = $isCoOwner;
}
public function getIsCoOwner() {
return $this->isCoOwner;
}
public function setCanCreatePoll($canCreatePoll) {
$this->canCreatePoll = $canCreatePoll;
}
public function getCanCreatePoll() {
return $this->canCreatePoll;
}
public function setCanShout($canShout) {
$this->canShout = $canShout;
}
public function getCanShout() {
return $this->canShout;
}
public function setIsOwner($isOwner) {
$this->isOwner = $isOwner;
}
public function getIsOwner() {
return $this->isOwner;
}
public function setCanCreateTopic($canCreateTopic) {
$this->canCreateTopic = $canCreateTopic;
}
public function getCanCreateTopic() {
return $this->canCreateTopic;
}
public function setIsTakebackAvailable($isTakebackAvailable) {
$this->isTakebackAvailable = $isTakebackAvailable;
}
public function getIsTakebackAvailable() {
return $this->isTakebackAvailable;
}
}
class Google_CommunityMessage extends Google_Model {
public $body;
public $kind;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
protected $__authorType = 'Google_OrkutAuthorResource';
protected $__authorDataType = '';
public $author;
public $id;
public $addedDate;
public $isSpam;
public $subject;
public function setBody($body) {
$this->body = $body;
}
public function getBody() {
return $this->body;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setAuthor(Google_OrkutAuthorResource $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAddedDate($addedDate) {
$this->addedDate = $addedDate;
}
public function getAddedDate() {
return $this->addedDate;
}
public function setIsSpam($isSpam) {
$this->isSpam = $isSpam;
}
public function getIsSpam() {
return $this->isSpam;
}
public function setSubject($subject) {
$this->subject = $subject;
}
public function getSubject() {
return $this->subject;
}
}
class Google_CommunityMessageList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_CommunityMessage';
protected $__itemsDataType = 'array';
public $items;
public $prevPageToken;
public $lastPageToken;
public $firstPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_CommunityMessage) */ $items) {
$this->assertIsArray($items, 'Google_CommunityMessage', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
public function setLastPageToken($lastPageToken) {
$this->lastPageToken = $lastPageToken;
}
public function getLastPageToken() {
return $this->lastPageToken;
}
public function setFirstPageToken($firstPageToken) {
$this->firstPageToken = $firstPageToken;
}
public function getFirstPageToken() {
return $this->firstPageToken;
}
}
class Google_CommunityPoll extends Google_Model {
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
public $isMultipleAnswers;
protected $__imageType = 'Google_CommunityPollImage';
protected $__imageDataType = '';
public $image;
public $endingTime;
public $isVotingAllowedForNonMembers;
public $isSpam;
public $totalNumberOfVotes;
protected $__authorType = 'Google_OrkutAuthorResource';
protected $__authorDataType = '';
public $author;
public $question;
public $id;
public $isRestricted;
public $communityId;
public $isUsersVotePublic;
public $lastUpdate;
public $description;
public $votedOptions;
public $isOpenForVoting;
public $isClosed;
public $hasVoted;
public $kind;
public $creationTime;
protected $__optionsType = 'Google_OrkutCommunitypolloptionResource';
protected $__optionsDataType = 'array';
public $options;
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setIsMultipleAnswers($isMultipleAnswers) {
$this->isMultipleAnswers = $isMultipleAnswers;
}
public function getIsMultipleAnswers() {
return $this->isMultipleAnswers;
}
public function setImage(Google_CommunityPollImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setEndingTime($endingTime) {
$this->endingTime = $endingTime;
}
public function getEndingTime() {
return $this->endingTime;
}
public function setIsVotingAllowedForNonMembers($isVotingAllowedForNonMembers) {
$this->isVotingAllowedForNonMembers = $isVotingAllowedForNonMembers;
}
public function getIsVotingAllowedForNonMembers() {
return $this->isVotingAllowedForNonMembers;
}
public function setIsSpam($isSpam) {
$this->isSpam = $isSpam;
}
public function getIsSpam() {
return $this->isSpam;
}
public function setTotalNumberOfVotes($totalNumberOfVotes) {
$this->totalNumberOfVotes = $totalNumberOfVotes;
}
public function getTotalNumberOfVotes() {
return $this->totalNumberOfVotes;
}
public function setAuthor(Google_OrkutAuthorResource $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setQuestion($question) {
$this->question = $question;
}
public function getQuestion() {
return $this->question;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setIsRestricted($isRestricted) {
$this->isRestricted = $isRestricted;
}
public function getIsRestricted() {
return $this->isRestricted;
}
public function setCommunityId($communityId) {
$this->communityId = $communityId;
}
public function getCommunityId() {
return $this->communityId;
}
public function setIsUsersVotePublic($isUsersVotePublic) {
$this->isUsersVotePublic = $isUsersVotePublic;
}
public function getIsUsersVotePublic() {
return $this->isUsersVotePublic;
}
public function setLastUpdate($lastUpdate) {
$this->lastUpdate = $lastUpdate;
}
public function getLastUpdate() {
return $this->lastUpdate;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setVotedOptions(/* array(Google_int) */ $votedOptions) {
$this->assertIsArray($votedOptions, 'Google_int', __METHOD__);
$this->votedOptions = $votedOptions;
}
public function getVotedOptions() {
return $this->votedOptions;
}
public function setIsOpenForVoting($isOpenForVoting) {
$this->isOpenForVoting = $isOpenForVoting;
}
public function getIsOpenForVoting() {
return $this->isOpenForVoting;
}
public function setIsClosed($isClosed) {
$this->isClosed = $isClosed;
}
public function getIsClosed() {
return $this->isClosed;
}
public function setHasVoted($hasVoted) {
$this->hasVoted = $hasVoted;
}
public function getHasVoted() {
return $this->hasVoted;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCreationTime($creationTime) {
$this->creationTime = $creationTime;
}
public function getCreationTime() {
return $this->creationTime;
}
public function setOptions(/* array(Google_OrkutCommunitypolloptionResource) */ $options) {
$this->assertIsArray($options, 'Google_OrkutCommunitypolloptionResource', __METHOD__);
$this->options = $options;
}
public function getOptions() {
return $this->options;
}
}
class Google_CommunityPollComment extends Google_Model {
public $body;
public $kind;
public $addedDate;
public $id;
protected $__authorType = 'Google_OrkutAuthorResource';
protected $__authorDataType = '';
public $author;
public function setBody($body) {
$this->body = $body;
}
public function getBody() {
return $this->body;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAddedDate($addedDate) {
$this->addedDate = $addedDate;
}
public function getAddedDate() {
return $this->addedDate;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAuthor(Google_OrkutAuthorResource $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
}
class Google_CommunityPollCommentList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_CommunityPollComment';
protected $__itemsDataType = 'array';
public $items;
public $prevPageToken;
public $lastPageToken;
public $firstPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_CommunityPollComment) */ $items) {
$this->assertIsArray($items, 'Google_CommunityPollComment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
public function setLastPageToken($lastPageToken) {
$this->lastPageToken = $lastPageToken;
}
public function getLastPageToken() {
return $this->lastPageToken;
}
public function setFirstPageToken($firstPageToken) {
$this->firstPageToken = $firstPageToken;
}
public function getFirstPageToken() {
return $this->firstPageToken;
}
}
class Google_CommunityPollImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_CommunityPollList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_CommunityPoll';
protected $__itemsDataType = 'array';
public $items;
public $prevPageToken;
public $lastPageToken;
public $firstPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_CommunityPoll) */ $items) {
$this->assertIsArray($items, 'Google_CommunityPoll', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
public function setLastPageToken($lastPageToken) {
$this->lastPageToken = $lastPageToken;
}
public function getLastPageToken() {
return $this->lastPageToken;
}
public function setFirstPageToken($firstPageToken) {
$this->firstPageToken = $firstPageToken;
}
public function getFirstPageToken() {
return $this->firstPageToken;
}
}
class Google_CommunityPollVote extends Google_Model {
public $kind;
public $optionIds;
public $isVotevisible;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setOptionIds(/* array(Google_int) */ $optionIds) {
$this->assertIsArray($optionIds, 'Google_int', __METHOD__);
$this->optionIds = $optionIds;
}
public function getOptionIds() {
return $this->optionIds;
}
public function setIsVotevisible($isVotevisible) {
$this->isVotevisible = $isVotevisible;
}
public function getIsVotevisible() {
return $this->isVotevisible;
}
}
class Google_CommunityTopic extends Google_Model {
public $body;
public $lastUpdate;
public $kind;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
protected $__authorType = 'Google_OrkutAuthorResource';
protected $__authorDataType = '';
public $author;
public $title;
protected $__messagesType = 'Google_CommunityMessage';
protected $__messagesDataType = 'array';
public $messages;
public $latestMessageSnippet;
public $isClosed;
public $numberOfReplies;
public $id;
public function setBody($body) {
$this->body = $body;
}
public function getBody() {
return $this->body;
}
public function setLastUpdate($lastUpdate) {
$this->lastUpdate = $lastUpdate;
}
public function getLastUpdate() {
return $this->lastUpdate;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setAuthor(Google_OrkutAuthorResource $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setMessages(/* array(Google_CommunityMessage) */ $messages) {
$this->assertIsArray($messages, 'Google_CommunityMessage', __METHOD__);
$this->messages = $messages;
}
public function getMessages() {
return $this->messages;
}
public function setLatestMessageSnippet($latestMessageSnippet) {
$this->latestMessageSnippet = $latestMessageSnippet;
}
public function getLatestMessageSnippet() {
return $this->latestMessageSnippet;
}
public function setIsClosed($isClosed) {
$this->isClosed = $isClosed;
}
public function getIsClosed() {
return $this->isClosed;
}
public function setNumberOfReplies($numberOfReplies) {
$this->numberOfReplies = $numberOfReplies;
}
public function getNumberOfReplies() {
return $this->numberOfReplies;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommunityTopicList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_CommunityTopic';
protected $__itemsDataType = 'array';
public $items;
public $prevPageToken;
public $lastPageToken;
public $firstPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_CommunityTopic) */ $items) {
$this->assertIsArray($items, 'Google_CommunityTopic', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
public function setLastPageToken($lastPageToken) {
$this->lastPageToken = $lastPageToken;
}
public function getLastPageToken() {
return $this->lastPageToken;
}
public function setFirstPageToken($firstPageToken) {
$this->firstPageToken = $firstPageToken;
}
public function getFirstPageToken() {
return $this->firstPageToken;
}
}
class Google_Counters extends Google_Model {
protected $__itemsType = 'Google_OrkutCounterResource';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_OrkutCounterResource) */ $items) {
$this->assertIsArray($items, 'Google_OrkutCounterResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_OrkutActivityobjectsResource extends Google_Model {
public $displayName;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
protected $__communityType = 'Google_Community';
protected $__communityDataType = '';
public $community;
public $content;
protected $__personType = 'Google_OrkutActivitypersonResource';
protected $__personDataType = '';
public $person;
public $id;
public $objectType;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setCommunity(Google_Community $community) {
$this->community = $community;
}
public function getCommunity() {
return $this->community;
}
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setPerson(Google_OrkutActivitypersonResource $person) {
$this->person = $person;
}
public function getPerson() {
return $this->person;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_OrkutActivitypersonResource extends Google_Model {
protected $__nameType = 'Google_OrkutActivitypersonResourceName';
protected $__nameDataType = '';
public $name;
public $url;
public $gender;
protected $__imageType = 'Google_OrkutActivitypersonResourceImage';
protected $__imageDataType = '';
public $image;
public $birthday;
public $id;
public function setName(Google_OrkutActivitypersonResourceName $name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setImage(Google_OrkutActivitypersonResourceImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setBirthday($birthday) {
$this->birthday = $birthday;
}
public function getBirthday() {
return $this->birthday;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_OrkutActivitypersonResourceImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_OrkutActivitypersonResourceName extends Google_Model {
public $givenName;
public $familyName;
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
}
class Google_OrkutAuthorResource extends Google_Model {
public $url;
protected $__imageType = 'Google_OrkutAuthorResourceImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_OrkutAuthorResourceImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_OrkutAuthorResourceImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_OrkutCommunitypolloptionResource extends Google_Model {
protected $__imageType = 'Google_OrkutCommunitypolloptionResourceImage';
protected $__imageDataType = '';
public $image;
public $optionId;
public $description;
public $numberOfVotes;
public function setImage(Google_OrkutCommunitypolloptionResourceImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setOptionId($optionId) {
$this->optionId = $optionId;
}
public function getOptionId() {
return $this->optionId;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setNumberOfVotes($numberOfVotes) {
$this->numberOfVotes = $numberOfVotes;
}
public function getNumberOfVotes() {
return $this->numberOfVotes;
}
}
class Google_OrkutCommunitypolloptionResourceImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_OrkutCounterResource extends Google_Model {
public $total;
protected $__linkType = 'Google_OrkutLinkResource';
protected $__linkDataType = '';
public $link;
public $name;
public function setTotal($total) {
$this->total = $total;
}
public function getTotal() {
return $this->total;
}
public function setLink(Google_OrkutLinkResource $link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_OrkutLinkResource extends Google_Model {
public $href;
public $type;
public $rel;
public $title;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setRel($rel) {
$this->rel = $rel;
}
public function getRel() {
return $this->rel;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_Visibility extends Google_Model {
public $kind;
public $visibility;
protected $__linksType = 'Google_OrkutLinkResource';
protected $__linksDataType = 'array';
public $links;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setVisibility($visibility) {
$this->visibility = $visibility;
}
public function getVisibility() {
return $this->visibility;
}
public function setLinks(/* array(Google_OrkutLinkResource) */ $links) {
$this->assertIsArray($links, 'Google_OrkutLinkResource', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_OrkutService.php | PHP | asf20 | 93,589 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "webResource" collection of methods.
* Typical usage is:
* <code>
* $siteVerificationService = new Google_SiteVerificationService(...);
* $webResource = $siteVerificationService->webResource;
* </code>
*/
class Google_WebResourceServiceResource extends Google_ServiceResource {
/**
* Attempt verification of a website or domain. (webResource.insert)
*
* @param string $verificationMethod The method to use for verifying a site or domain.
* @param Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function insert($verificationMethod, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('verificationMethod' => $verificationMethod, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the most current data for a website or domain. (webResource.get)
*
* @param string $id The id of a verified site or domain.
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get the list of your verified websites and domains. (webResource.list)
*
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceListResponse
*/
public function listWebResource($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceListResponse($data);
} else {
return $data;
}
}
/**
* Modify the list of owners for your website or domain. (webResource.update)
*
* @param string $id The id of a verified site or domain.
* @param Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function update($id, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Modify the list of owners for your website or domain. This method supports patch semantics.
* (webResource.patch)
*
* @param string $id The id of a verified site or domain.
* @param Google_SiteVerificationWebResourceResource $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceResource
*/
public function patch($id, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceResource($data);
} else {
return $data;
}
}
/**
* Get a verification token for placing on a website or domain. (webResource.getToken)
*
* @param Google_SiteVerificationWebResourceGettokenRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_SiteVerificationWebResourceGettokenResponse
*/
public function getToken(Google_SiteVerificationWebResourceGettokenRequest $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('getToken', array($params));
if ($this->useObjects()) {
return new Google_SiteVerificationWebResourceGettokenResponse($data);
} else {
return $data;
}
}
/**
* Relinquish ownership of a website or domain. (webResource.delete)
*
* @param string $id The id of a verified site or domain.
* @param array $optParams Optional parameters.
*/
public function delete($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_SiteVerification (v1).
*
* <p>
* Lets you programatically verify ownership of websites or domains with Google.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/siteverification/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_SiteVerificationService extends Google_Service {
public $webResource;
/**
* Constructs the internal representation of the SiteVerification service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'siteVerification/v1/';
$this->version = 'v1';
$this->serviceName = 'siteVerification';
$client->addService($this->serviceName, $this->version);
$this->webResource = new Google_WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "POST", "path": "webResource", "id": "siteVerification.webResource.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "siteVerification.webResource.get", "httpMethod": "GET", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "list": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}, "id": "siteVerification.webResource.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PUT", "path": "webResource/{id}", "id": "siteVerification.webResource.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PATCH", "path": "webResource/{id}", "id": "siteVerification.webResource.patch"}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "request": {"$ref": "SiteVerificationWebResourceGettokenRequest"}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "POST", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource/{id}", "id": "siteVerification.webResource.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_SiteVerificationWebResourceGettokenRequest extends Google_Model {
public $verificationMethod;
protected $__siteType = 'Google_SiteVerificationWebResourceGettokenRequestSite';
protected $__siteDataType = '';
public $site;
public function setVerificationMethod($verificationMethod) {
$this->verificationMethod = $verificationMethod;
}
public function getVerificationMethod() {
return $this->verificationMethod;
}
public function setSite(Google_SiteVerificationWebResourceGettokenRequestSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceGettokenRequestSite extends Google_Model {
public $identifier;
public $type;
public function setIdentifier($identifier) {
$this->identifier = $identifier;
}
public function getIdentifier() {
return $this->identifier;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_SiteVerificationWebResourceGettokenResponse extends Google_Model {
public $token;
public $method;
public function setToken($token) {
$this->token = $token;
}
public function getToken() {
return $this->token;
}
public function setMethod($method) {
$this->method = $method;
}
public function getMethod() {
return $this->method;
}
}
class Google_SiteVerificationWebResourceListResponse extends Google_Model {
protected $__itemsType = 'Google_SiteVerificationWebResourceResource';
protected $__itemsDataType = 'array';
public $items;
public function setItems(/* array(Google_SiteVerificationWebResourceResource) */ $items) {
$this->assertIsArray($items, 'Google_SiteVerificationWebResourceResource', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
}
class Google_SiteVerificationWebResourceResource extends Google_Model {
public $owners;
public $id;
protected $__siteType = 'Google_SiteVerificationWebResourceResourceSite';
protected $__siteDataType = '';
public $site;
public function setOwners(/* array(Google_string) */ $owners) {
$this->assertIsArray($owners, 'Google_string', __METHOD__);
$this->owners = $owners;
}
public function getOwners() {
return $this->owners;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSite(Google_SiteVerificationWebResourceResourceSite $site) {
$this->site = $site;
}
public function getSite() {
return $this->site;
}
}
class Google_SiteVerificationWebResourceResourceSite extends Google_Model {
public $identifier;
public $type;
public function setIdentifier($identifier) {
$this->identifier = $identifier;
}
public function getIdentifier() {
return $this->identifier;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_SiteVerificationService.php | PHP | asf20 | 11,996 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "trainedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new Google_PredictionService(...);
* $trainedmodels = $predictionService->trainedmodels;
* </code>
*/
class Google_TrainedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit model id and request a prediction (trainedmodels.predict)
*
* @param string $id The unique name for the predictive model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($id, Google_Input $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('predict', array($params));
if ($this->useObjects()) {
return new Google_Output($data);
} else {
return $data;
}
}
/**
* Begin training your model. (trainedmodels.insert)
*
* @param Google_Training $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function insert(Google_Training $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Training($data);
} else {
return $data;
}
}
/**
* Check training status of your model. (trainedmodels.get)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Training($data);
} else {
return $data;
}
}
/**
* Add new data to a trained model. (trainedmodels.update)
*
* @param string $id The unique name for the predictive model.
* @param Google_Update $postBody
* @param array $optParams Optional parameters.
* @return Google_Training
*/
public function update($id, Google_Update $postBody, $optParams = array()) {
$params = array('id' => $id, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Training($data);
} else {
return $data;
}
}
/**
* Delete a trained model. (trainedmodels.delete)
*
* @param string $id The unique name for the predictive model.
* @param array $optParams Optional parameters.
*/
public function delete($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "hostedmodels" collection of methods.
* Typical usage is:
* <code>
* $predictionService = new Google_PredictionService(...);
* $hostedmodels = $predictionService->hostedmodels;
* </code>
*/
class Google_HostedmodelsServiceResource extends Google_ServiceResource {
/**
* Submit input and request an output against a hosted model. (hostedmodels.predict)
*
* @param string $hostedModelName The name of a hosted model.
* @param Google_Input $postBody
* @param array $optParams Optional parameters.
* @return Google_Output
*/
public function predict($hostedModelName, Google_Input $postBody, $optParams = array()) {
$params = array('hostedModelName' => $hostedModelName, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('predict', array($params));
if ($this->useObjects()) {
return new Google_Output($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Prediction (v1.4).
*
* <p>
* Lets you access a cloud hosted machine learning service that makes it easy to build smart apps
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/predict/docs/developer-guide.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PredictionService extends Google_Service {
public $trainedmodels;
public $hostedmodels;
/**
* Constructs the internal representation of the Prediction service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'prediction/v1.4/';
$this->version = 'v1.4';
$this->serviceName = 'prediction';
$client->addService($this->serviceName, $this->version);
$this->trainedmodels = new Google_TrainedmodelsServiceResource($this, $this->serviceName, 'trainedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "trainedmodels/{id}/predict", "id": "prediction.trainedmodels.predict"}, "insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/prediction"], "request": {"$ref": "Training"}, "response": {"$ref": "Training"}, "httpMethod": "POST", "path": "trainedmodels", "id": "prediction.trainedmodels.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "prediction.trainedmodels.get", "httpMethod": "GET", "path": "trainedmodels/{id}", "response": {"$ref": "Training"}}, "update": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Update"}, "response": {"$ref": "Training"}, "httpMethod": "PUT", "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.update"}, "delete": {"scopes": ["https://www.googleapis.com/auth/prediction"], "path": "trainedmodels/{id}", "id": "prediction.trainedmodels.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->hostedmodels = new Google_HostedmodelsServiceResource($this, $this->serviceName, 'hostedmodels', json_decode('{"methods": {"predict": {"scopes": ["https://www.googleapis.com/auth/prediction"], "parameters": {"hostedModelName": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Input"}, "response": {"$ref": "Output"}, "httpMethod": "POST", "path": "hostedmodels/{hostedModelName}/predict", "id": "prediction.hostedmodels.predict"}}}', true));
}
}
class Google_Input extends Google_Model {
protected $__inputType = 'Google_InputInput';
protected $__inputDataType = '';
public $input;
public function setInput(Google_InputInput $input) {
$this->input = $input;
}
public function getInput() {
return $this->input;
}
}
class Google_InputInput extends Google_Model {
public $csvInstance;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
}
class Google_Output extends Google_Model {
public $kind;
public $outputLabel;
public $id;
protected $__outputMultiType = 'Google_OutputOutputMulti';
protected $__outputMultiDataType = 'array';
public $outputMulti;
public $outputValue;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setOutputLabel($outputLabel) {
$this->outputLabel = $outputLabel;
}
public function getOutputLabel() {
return $this->outputLabel;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setOutputMulti(/* array(Google_OutputOutputMulti) */ $outputMulti) {
$this->assertIsArray($outputMulti, 'Google_OutputOutputMulti', __METHOD__);
$this->outputMulti = $outputMulti;
}
public function getOutputMulti() {
return $this->outputMulti;
}
public function setOutputValue($outputValue) {
$this->outputValue = $outputValue;
}
public function getOutputValue() {
return $this->outputValue;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_OutputOutputMulti extends Google_Model {
public $score;
public $label;
public function setScore($score) {
$this->score = $score;
}
public function getScore() {
return $this->score;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}
class Google_Training extends Google_Model {
public $kind;
public $storageDataLocation;
public $storagePMMLModelLocation;
protected $__dataAnalysisType = 'Google_TrainingDataAnalysis';
protected $__dataAnalysisDataType = '';
public $dataAnalysis;
public $trainingStatus;
protected $__modelInfoType = 'Google_TrainingModelInfo';
protected $__modelInfoDataType = '';
public $modelInfo;
public $storagePMMLLocation;
public $id;
public $selfLink;
public $utility;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStorageDataLocation($storageDataLocation) {
$this->storageDataLocation = $storageDataLocation;
}
public function getStorageDataLocation() {
return $this->storageDataLocation;
}
public function setStoragePMMLModelLocation($storagePMMLModelLocation) {
$this->storagePMMLModelLocation = $storagePMMLModelLocation;
}
public function getStoragePMMLModelLocation() {
return $this->storagePMMLModelLocation;
}
public function setDataAnalysis(Google_TrainingDataAnalysis $dataAnalysis) {
$this->dataAnalysis = $dataAnalysis;
}
public function getDataAnalysis() {
return $this->dataAnalysis;
}
public function setTrainingStatus($trainingStatus) {
$this->trainingStatus = $trainingStatus;
}
public function getTrainingStatus() {
return $this->trainingStatus;
}
public function setModelInfo(Google_TrainingModelInfo $modelInfo) {
$this->modelInfo = $modelInfo;
}
public function getModelInfo() {
return $this->modelInfo;
}
public function setStoragePMMLLocation($storagePMMLLocation) {
$this->storagePMMLLocation = $storagePMMLLocation;
}
public function getStoragePMMLLocation() {
return $this->storagePMMLLocation;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setUtility(/* array(Google_double) */ $utility) {
$this->assertIsArray($utility, 'Google_double', __METHOD__);
$this->utility = $utility;
}
public function getUtility() {
return $this->utility;
}
}
class Google_TrainingDataAnalysis extends Google_Model {
public $warnings;
public function setWarnings(/* array(Google_string) */ $warnings) {
$this->assertIsArray($warnings, 'Google_string', __METHOD__);
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
}
class Google_TrainingModelInfo extends Google_Model {
public $confusionMatrixRowTotals;
public $numberLabels;
public $confusionMatrix;
public $meanSquaredError;
public $modelType;
public $numberInstances;
public $classWeightedAccuracy;
public $classificationAccuracy;
public function setConfusionMatrixRowTotals($confusionMatrixRowTotals) {
$this->confusionMatrixRowTotals = $confusionMatrixRowTotals;
}
public function getConfusionMatrixRowTotals() {
return $this->confusionMatrixRowTotals;
}
public function setNumberLabels($numberLabels) {
$this->numberLabels = $numberLabels;
}
public function getNumberLabels() {
return $this->numberLabels;
}
public function setConfusionMatrix($confusionMatrix) {
$this->confusionMatrix = $confusionMatrix;
}
public function getConfusionMatrix() {
return $this->confusionMatrix;
}
public function setMeanSquaredError($meanSquaredError) {
$this->meanSquaredError = $meanSquaredError;
}
public function getMeanSquaredError() {
return $this->meanSquaredError;
}
public function setModelType($modelType) {
$this->modelType = $modelType;
}
public function getModelType() {
return $this->modelType;
}
public function setNumberInstances($numberInstances) {
$this->numberInstances = $numberInstances;
}
public function getNumberInstances() {
return $this->numberInstances;
}
public function setClassWeightedAccuracy($classWeightedAccuracy) {
$this->classWeightedAccuracy = $classWeightedAccuracy;
}
public function getClassWeightedAccuracy() {
return $this->classWeightedAccuracy;
}
public function setClassificationAccuracy($classificationAccuracy) {
$this->classificationAccuracy = $classificationAccuracy;
}
public function getClassificationAccuracy() {
return $this->classificationAccuracy;
}
}
class Google_Update extends Google_Model {
public $csvInstance;
public $label;
public function setCsvInstance(/* array(Google_object) */ $csvInstance) {
$this->assertIsArray($csvInstance, 'Google_object', __METHOD__);
$this->csvInstance = $csvInstance;
}
public function getCsvInstance() {
return $this->csvInstance;
}
public function setLabel($label) {
$this->label = $label;
}
public function getLabel() {
return $this->label;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_PredictionService.php | PHP | asf20 | 14,861 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "column" collection of methods.
* Typical usage is:
* <code>
* $fusiontablesService = new Google_FusiontablesService(...);
* $column = $fusiontablesService->column;
* </code>
*/
class Google_ColumnServiceResource extends Google_ServiceResource {
/**
* Adds a new column to the table. (column.insert)
*
* @param string $tableId Table for which a new column is being added.
* @param Google_Column $postBody
* @param array $optParams Optional parameters.
* @return Google_Column
*/
public function insert($tableId, Google_Column $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Column($data);
} else {
return $data;
}
}
/**
* Retrieves a specific column by its id. (column.get)
*
* @param string $tableId Table to which the column belongs.
* @param string $columnId Name or identifier for the column that is being requested.
* @param array $optParams Optional parameters.
* @return Google_Column
*/
public function get($tableId, $columnId, $optParams = array()) {
$params = array('tableId' => $tableId, 'columnId' => $columnId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Column($data);
} else {
return $data;
}
}
/**
* Retrieves a list of columns. (column.list)
*
* @param string $tableId Table whose columns are being listed.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Continuation token specifying which result page to return. Optional.
* @opt_param string maxResults Maximum number of columns to return. Optional. Default is 5.
* @return Google_ColumnList
*/
public function listColumn($tableId, $optParams = array()) {
$params = array('tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ColumnList($data);
} else {
return $data;
}
}
/**
* Updates the name or type of an existing column. (column.update)
*
* @param string $tableId Table for which the column is being updated.
* @param string $columnId Name or identifier for the column that is being updated.
* @param Google_Column $postBody
* @param array $optParams Optional parameters.
* @return Google_Column
*/
public function update($tableId, $columnId, Google_Column $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'columnId' => $columnId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Column($data);
} else {
return $data;
}
}
/**
* Updates the name or type of an existing column. This method supports patch semantics.
* (column.patch)
*
* @param string $tableId Table for which the column is being updated.
* @param string $columnId Name or identifier for the column that is being updated.
* @param Google_Column $postBody
* @param array $optParams Optional parameters.
* @return Google_Column
*/
public function patch($tableId, $columnId, Google_Column $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'columnId' => $columnId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Column($data);
} else {
return $data;
}
}
/**
* Deletes the column. (column.delete)
*
* @param string $tableId Table from which the column is being deleted.
* @param string $columnId Name or identifier for the column being deleted.
* @param array $optParams Optional parameters.
*/
public function delete($tableId, $columnId, $optParams = array()) {
$params = array('tableId' => $tableId, 'columnId' => $columnId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "query" collection of methods.
* Typical usage is:
* <code>
* $fusiontablesService = new Google_FusiontablesService(...);
* $query = $fusiontablesService->query;
* </code>
*/
class Google_QueryServiceResource extends Google_ServiceResource {
/**
* Executes an SQL SELECT/SHOW/DESCRIBE statement. (query.sqlGet)
*
* @param string $sql An SQL SELECT/SHOW/DESCRIBE statement.
* @param array $optParams Optional parameters.
*
* @opt_param bool typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.
* @opt_param bool hdrs Should column names be included (in the first row)?. Default is true.
* @return Google_Sqlresponse
*/
public function sqlGet($sql, $optParams = array()) {
$params = array('sql' => $sql);
$params = array_merge($params, $optParams);
$data = $this->__call('sqlGet', array($params));
if ($this->useObjects()) {
return new Google_Sqlresponse($data);
} else {
return $data;
}
}
/**
* Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE statement. (query.sql)
*
* @param string $sql An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE statement.
* @param array $optParams Optional parameters.
*
* @opt_param bool typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.
* @opt_param bool hdrs Should column names be included (in the first row)?. Default is true.
* @return Google_Sqlresponse
*/
public function sql($sql, $optParams = array()) {
$params = array('sql' => $sql);
$params = array_merge($params, $optParams);
$data = $this->__call('sql', array($params));
if ($this->useObjects()) {
return new Google_Sqlresponse($data);
} else {
return $data;
}
}
}
/**
* The "style" collection of methods.
* Typical usage is:
* <code>
* $fusiontablesService = new Google_FusiontablesService(...);
* $style = $fusiontablesService->style;
* </code>
*/
class Google_StyleServiceResource extends Google_ServiceResource {
/**
* Adds a new style for the table. (style.insert)
*
* @param string $tableId Table for which a new style is being added
* @param Google_StyleSetting $postBody
* @param array $optParams Optional parameters.
* @return Google_StyleSetting
*/
public function insert($tableId, Google_StyleSetting $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_StyleSetting($data);
} else {
return $data;
}
}
/**
* Gets a specific style. (style.get)
*
* @param string $tableId Table to which the requested style belongs
* @param int $styleId Identifier (integer) for a specific style in a table
* @param array $optParams Optional parameters.
* @return Google_StyleSetting
*/
public function get($tableId, $styleId, $optParams = array()) {
$params = array('tableId' => $tableId, 'styleId' => $styleId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_StyleSetting($data);
} else {
return $data;
}
}
/**
* Retrieves a list of styles. (style.list)
*
* @param string $tableId Table whose styles are being listed
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Continuation token specifying which result page to return. Optional.
* @opt_param string maxResults Maximum number of styles to return. Optional. Default is 5.
* @return Google_StyleSettingList
*/
public function listStyle($tableId, $optParams = array()) {
$params = array('tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_StyleSettingList($data);
} else {
return $data;
}
}
/**
* Updates an existing style. (style.update)
*
* @param string $tableId Table whose style is being updated.
* @param int $styleId Identifier (within a table) for the style being updated.
* @param Google_StyleSetting $postBody
* @param array $optParams Optional parameters.
* @return Google_StyleSetting
*/
public function update($tableId, $styleId, Google_StyleSetting $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'styleId' => $styleId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_StyleSetting($data);
} else {
return $data;
}
}
/**
* Updates an existing style. This method supports patch semantics. (style.patch)
*
* @param string $tableId Table whose style is being updated.
* @param int $styleId Identifier (within a table) for the style being updated.
* @param Google_StyleSetting $postBody
* @param array $optParams Optional parameters.
* @return Google_StyleSetting
*/
public function patch($tableId, $styleId, Google_StyleSetting $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'styleId' => $styleId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_StyleSetting($data);
} else {
return $data;
}
}
/**
* Deletes a style. (style.delete)
*
* @param string $tableId Table from which the style is being deleted
* @param int $styleId Identifier (within a table) for the style being deleted
* @param array $optParams Optional parameters.
*/
public function delete($tableId, $styleId, $optParams = array()) {
$params = array('tableId' => $tableId, 'styleId' => $styleId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "template" collection of methods.
* Typical usage is:
* <code>
* $fusiontablesService = new Google_FusiontablesService(...);
* $template = $fusiontablesService->template;
* </code>
*/
class Google_TemplateServiceResource extends Google_ServiceResource {
/**
* Creates a new template for the table. (template.insert)
*
* @param string $tableId Table for which a new template is being created
* @param Google_Template $postBody
* @param array $optParams Optional parameters.
* @return Google_Template
*/
public function insert($tableId, Google_Template $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Template($data);
} else {
return $data;
}
}
/**
* Retrieves a specific template by its id (template.get)
*
* @param string $tableId Table to which the template belongs
* @param int $templateId Identifier for the template that is being requested
* @param array $optParams Optional parameters.
* @return Google_Template
*/
public function get($tableId, $templateId, $optParams = array()) {
$params = array('tableId' => $tableId, 'templateId' => $templateId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Template($data);
} else {
return $data;
}
}
/**
* Retrieves a list of templates. (template.list)
*
* @param string $tableId Identifier for the table whose templates are being requested
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Continuation token specifying which results page to return. Optional.
* @opt_param string maxResults Maximum number of templates to return. Optional. Default is 5.
* @return Google_TemplateList
*/
public function listTemplate($tableId, $optParams = array()) {
$params = array('tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TemplateList($data);
} else {
return $data;
}
}
/**
* Updates an existing template (template.update)
*
* @param string $tableId Table to which the updated template belongs
* @param int $templateId Identifier for the template that is being updated
* @param Google_Template $postBody
* @param array $optParams Optional parameters.
* @return Google_Template
*/
public function update($tableId, $templateId, Google_Template $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'templateId' => $templateId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Template($data);
} else {
return $data;
}
}
/**
* Updates an existing template. This method supports patch semantics. (template.patch)
*
* @param string $tableId Table to which the updated template belongs
* @param int $templateId Identifier for the template that is being updated
* @param Google_Template $postBody
* @param array $optParams Optional parameters.
* @return Google_Template
*/
public function patch($tableId, $templateId, Google_Template $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'templateId' => $templateId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Template($data);
} else {
return $data;
}
}
/**
* Deletes a template (template.delete)
*
* @param string $tableId Table from which the template is being deleted
* @param int $templateId Identifier for the template which is being deleted
* @param array $optParams Optional parameters.
*/
public function delete($tableId, $templateId, $optParams = array()) {
$params = array('tableId' => $tableId, 'templateId' => $templateId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "table" collection of methods.
* Typical usage is:
* <code>
* $fusiontablesService = new Google_FusiontablesService(...);
* $table = $fusiontablesService->table;
* </code>
*/
class Google_TableServiceResource extends Google_ServiceResource {
/**
* Creates a new table. (table.insert)
*
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function insert(Google_Table $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Retrieves a specific table by its id. (table.get)
*
* @param string $tableId Identifier(ID) for the table being requested.
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function get($tableId, $optParams = array()) {
$params = array('tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Retrieves a list of tables a user owns. (table.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Continuation token specifying which result page to return. Optional.
* @opt_param string maxResults Maximum number of styles to return. Optional. Default is 5.
* @return Google_TableList
*/
public function listTable($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TableList($data);
} else {
return $data;
}
}
/**
* Updates an existing table. Unless explicitly requested, only the name, description, and
* attribution will be updated. (table.update)
*
* @param string $tableId Id of the table that is being updated.
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.
* @return Google_Table
*/
public function update($tableId, Google_Table $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Updates an existing table. Unless explicitly requested, only the name, description, and
* attribution will be updated. This method supports patch semantics. (table.patch)
*
* @param string $tableId Id of the table that is being updated.
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.
* @return Google_Table
*/
public function patch($tableId, Google_Table $postBody, $optParams = array()) {
$params = array('tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Deletes a table. (table.delete)
*
* @param string $tableId Id of the table that is being deleted.
* @param array $optParams Optional parameters.
*/
public function delete($tableId, $optParams = array()) {
$params = array('tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Fusiontables (v1).
*
* <p>
* API for working with Fusion Tables data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/fusiontables" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_FusiontablesService extends Google_Service {
public $column;
public $query;
public $style;
public $template;
public $table;
/**
* Constructs the internal representation of the Fusiontables service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'fusiontables/v1/';
$this->version = 'v1';
$this->serviceName = 'fusiontables';
$client->addService($this->serviceName, $this->version);
$this->column = new Google_ColumnServiceResource($this, $this->serviceName, 'column', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Column"}, "response": {"$ref": "Column"}, "httpMethod": "POST", "path": "tables/{tableId}/columns", "id": "fusiontables.column.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "columnId": {"required": true, "type": "string", "location": "path"}}, "id": "fusiontables.column.get", "httpMethod": "GET", "path": "tables/{tableId}/columns/{columnId}", "response": {"$ref": "Column"}}, "list": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "tableId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}}, "id": "fusiontables.column.list", "httpMethod": "GET", "path": "tables/{tableId}/columns", "response": {"$ref": "ColumnList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "columnId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Column"}, "response": {"$ref": "Column"}, "httpMethod": "PUT", "path": "tables/{tableId}/columns/{columnId}", "id": "fusiontables.column.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "columnId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Column"}, "response": {"$ref": "Column"}, "httpMethod": "PATCH", "path": "tables/{tableId}/columns/{columnId}", "id": "fusiontables.column.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "path": "tables/{tableId}/columns/{columnId}", "id": "fusiontables.column.delete", "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "columnId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->query = new Google_QueryServiceResource($this, $this->serviceName, 'query', json_decode('{"methods": {"sqlGet": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"typed": {"type": "boolean", "location": "query"}, "hdrs": {"type": "boolean", "location": "query"}, "sql": {"required": true, "type": "string", "location": "query"}}, "id": "fusiontables.query.sqlGet", "httpMethod": "GET", "path": "query", "response": {"$ref": "Sqlresponse"}}, "sql": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"typed": {"type": "boolean", "location": "query"}, "hdrs": {"type": "boolean", "location": "query"}, "sql": {"required": true, "type": "string", "location": "query"}}, "id": "fusiontables.query.sql", "httpMethod": "POST", "path": "query", "response": {"$ref": "Sqlresponse"}}}}', true));
$this->style = new Google_StyleServiceResource($this, $this->serviceName, 'style', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "StyleSetting"}, "response": {"$ref": "StyleSetting"}, "httpMethod": "POST", "path": "tables/{tableId}/styles", "id": "fusiontables.style.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "styleId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "fusiontables.style.get", "httpMethod": "GET", "path": "tables/{tableId}/styles/{styleId}", "response": {"$ref": "StyleSetting"}}, "list": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "tableId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}}, "id": "fusiontables.style.list", "httpMethod": "GET", "path": "tables/{tableId}/styles", "response": {"$ref": "StyleSettingList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "styleId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "StyleSetting"}, "response": {"$ref": "StyleSetting"}, "httpMethod": "PUT", "path": "tables/{tableId}/styles/{styleId}", "id": "fusiontables.style.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "styleId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "StyleSetting"}, "response": {"$ref": "StyleSetting"}, "httpMethod": "PATCH", "path": "tables/{tableId}/styles/{styleId}", "id": "fusiontables.style.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "path": "tables/{tableId}/styles/{styleId}", "id": "fusiontables.style.delete", "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "styleId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "httpMethod": "DELETE"}}}', true));
$this->template = new Google_TemplateServiceResource($this, $this->serviceName, 'template', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Template"}, "response": {"$ref": "Template"}, "httpMethod": "POST", "path": "tables/{tableId}/templates", "id": "fusiontables.template.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "templateId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "id": "fusiontables.template.get", "httpMethod": "GET", "path": "tables/{tableId}/templates/{templateId}", "response": {"$ref": "Template"}}, "list": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "tableId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}}, "id": "fusiontables.template.list", "httpMethod": "GET", "path": "tables/{tableId}/templates", "response": {"$ref": "TemplateList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "templateId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Template"}, "response": {"$ref": "Template"}, "httpMethod": "PUT", "path": "tables/{tableId}/templates/{templateId}", "id": "fusiontables.template.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "templateId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "request": {"$ref": "Template"}, "response": {"$ref": "Template"}, "httpMethod": "PATCH", "path": "tables/{tableId}/templates/{templateId}", "id": "fusiontables.template.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "path": "tables/{tableId}/templates/{templateId}", "id": "fusiontables.template.delete", "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}, "templateId": {"required": true, "type": "integer", "location": "path", "format": "int32"}}, "httpMethod": "DELETE"}}}', true));
$this->table = new Google_TableServiceResource($this, $this->serviceName, 'table', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "POST", "path": "tables", "id": "fusiontables.table.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}}, "id": "fusiontables.table.get", "httpMethod": "GET", "path": "tables/{tableId}", "response": {"$ref": "Table"}}, "list": {"scopes": ["https://www.googleapis.com/auth/fusiontables", "https://www.googleapis.com/auth/fusiontables.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}}, "response": {"$ref": "TableList"}, "httpMethod": "GET", "path": "tables", "id": "fusiontables.table.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"replaceViewDefinition": {"type": "boolean", "location": "query"}, "tableId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "PUT", "path": "tables/{tableId}", "id": "fusiontables.table.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "parameters": {"replaceViewDefinition": {"type": "boolean", "location": "query"}, "tableId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "PATCH", "path": "tables/{tableId}", "id": "fusiontables.table.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/fusiontables"], "path": "tables/{tableId}", "id": "fusiontables.table.delete", "parameters": {"tableId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Bucket extends Google_Model {
public $opacity;
public $weight;
public $min;
public $color;
public $max;
public $icon;
public function setOpacity($opacity) {
$this->opacity = $opacity;
}
public function getOpacity() {
return $this->opacity;
}
public function setWeight($weight) {
$this->weight = $weight;
}
public function getWeight() {
return $this->weight;
}
public function setMin($min) {
$this->min = $min;
}
public function getMin() {
return $this->min;
}
public function setColor($color) {
$this->color = $color;
}
public function getColor() {
return $this->color;
}
public function setMax($max) {
$this->max = $max;
}
public function getMax() {
return $this->max;
}
public function setIcon($icon) {
$this->icon = $icon;
}
public function getIcon() {
return $this->icon;
}
}
class Google_Column extends Google_Model {
public $kind;
public $type;
public $columnId;
public $name;
protected $__baseColumnType = 'Google_ColumnBaseColumn';
protected $__baseColumnDataType = '';
public $baseColumn;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setColumnId($columnId) {
$this->columnId = $columnId;
}
public function getColumnId() {
return $this->columnId;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setBaseColumn(Google_ColumnBaseColumn $baseColumn) {
$this->baseColumn = $baseColumn;
}
public function getBaseColumn() {
return $this->baseColumn;
}
}
class Google_ColumnBaseColumn extends Google_Model {
public $tableIndex;
public $columnId;
public function setTableIndex($tableIndex) {
$this->tableIndex = $tableIndex;
}
public function getTableIndex() {
return $this->tableIndex;
}
public function setColumnId($columnId) {
$this->columnId = $columnId;
}
public function getColumnId() {
return $this->columnId;
}
}
class Google_ColumnList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Column';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Column) */ $items) {
$this->assertIsArray($items, 'Google_Column', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_Geometry extends Google_Model {
public $geometry;
public $type;
public $geometries;
public function setGeometry($geometry) {
$this->geometry = $geometry;
}
public function getGeometry() {
return $this->geometry;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setGeometries(/* array(Google_object) */ $geometries) {
$this->assertIsArray($geometries, 'Google_object', __METHOD__);
$this->geometries = $geometries;
}
public function getGeometries() {
return $this->geometries;
}
}
class Google_Line extends Google_Model {
public $type;
public $coordinates;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setCoordinates(/* array(Google_double) */ $coordinates) {
$this->assertIsArray($coordinates, 'Google_double', __METHOD__);
$this->coordinates = $coordinates;
}
public function getCoordinates() {
return $this->coordinates;
}
}
class Google_LineStyle extends Google_Model {
public $strokeWeight;
protected $__strokeWeightStylerType = 'Google_StyleFunction';
protected $__strokeWeightStylerDataType = '';
public $strokeWeightStyler;
public $strokeColor;
public $strokeOpacity;
protected $__strokeColorStylerType = 'Google_StyleFunction';
protected $__strokeColorStylerDataType = '';
public $strokeColorStyler;
public function setStrokeWeight($strokeWeight) {
$this->strokeWeight = $strokeWeight;
}
public function getStrokeWeight() {
return $this->strokeWeight;
}
public function setStrokeWeightStyler(Google_StyleFunction $strokeWeightStyler) {
$this->strokeWeightStyler = $strokeWeightStyler;
}
public function getStrokeWeightStyler() {
return $this->strokeWeightStyler;
}
public function setStrokeColor($strokeColor) {
$this->strokeColor = $strokeColor;
}
public function getStrokeColor() {
return $this->strokeColor;
}
public function setStrokeOpacity($strokeOpacity) {
$this->strokeOpacity = $strokeOpacity;
}
public function getStrokeOpacity() {
return $this->strokeOpacity;
}
public function setStrokeColorStyler(Google_StyleFunction $strokeColorStyler) {
$this->strokeColorStyler = $strokeColorStyler;
}
public function getStrokeColorStyler() {
return $this->strokeColorStyler;
}
}
class Google_Point extends Google_Model {
public $type;
public $coordinates;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setCoordinates(/* array(Google_double) */ $coordinates) {
$this->assertIsArray($coordinates, 'Google_double', __METHOD__);
$this->coordinates = $coordinates;
}
public function getCoordinates() {
return $this->coordinates;
}
}
class Google_PointStyle extends Google_Model {
protected $__iconStylerType = 'Google_StyleFunction';
protected $__iconStylerDataType = '';
public $iconStyler;
public $iconName;
public function setIconStyler(Google_StyleFunction $iconStyler) {
$this->iconStyler = $iconStyler;
}
public function getIconStyler() {
return $this->iconStyler;
}
public function setIconName($iconName) {
$this->iconName = $iconName;
}
public function getIconName() {
return $this->iconName;
}
}
class Google_Polygon extends Google_Model {
public $type;
public $coordinates;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setCoordinates(/* array(Google_double) */ $coordinates) {
$this->assertIsArray($coordinates, 'Google_double', __METHOD__);
$this->coordinates = $coordinates;
}
public function getCoordinates() {
return $this->coordinates;
}
}
class Google_PolygonStyle extends Google_Model {
protected $__strokeColorStylerType = 'Google_StyleFunction';
protected $__strokeColorStylerDataType = '';
public $strokeColorStyler;
public $strokeWeight;
public $strokeOpacity;
protected $__strokeWeightStylerType = 'Google_StyleFunction';
protected $__strokeWeightStylerDataType = '';
public $strokeWeightStyler;
protected $__fillColorStylerType = 'Google_StyleFunction';
protected $__fillColorStylerDataType = '';
public $fillColorStyler;
public $fillColor;
public $strokeColor;
public $fillOpacity;
public function setStrokeColorStyler(Google_StyleFunction $strokeColorStyler) {
$this->strokeColorStyler = $strokeColorStyler;
}
public function getStrokeColorStyler() {
return $this->strokeColorStyler;
}
public function setStrokeWeight($strokeWeight) {
$this->strokeWeight = $strokeWeight;
}
public function getStrokeWeight() {
return $this->strokeWeight;
}
public function setStrokeOpacity($strokeOpacity) {
$this->strokeOpacity = $strokeOpacity;
}
public function getStrokeOpacity() {
return $this->strokeOpacity;
}
public function setStrokeWeightStyler(Google_StyleFunction $strokeWeightStyler) {
$this->strokeWeightStyler = $strokeWeightStyler;
}
public function getStrokeWeightStyler() {
return $this->strokeWeightStyler;
}
public function setFillColorStyler(Google_StyleFunction $fillColorStyler) {
$this->fillColorStyler = $fillColorStyler;
}
public function getFillColorStyler() {
return $this->fillColorStyler;
}
public function setFillColor($fillColor) {
$this->fillColor = $fillColor;
}
public function getFillColor() {
return $this->fillColor;
}
public function setStrokeColor($strokeColor) {
$this->strokeColor = $strokeColor;
}
public function getStrokeColor() {
return $this->strokeColor;
}
public function setFillOpacity($fillOpacity) {
$this->fillOpacity = $fillOpacity;
}
public function getFillOpacity() {
return $this->fillOpacity;
}
}
class Google_Sqlresponse extends Google_Model {
public $kind;
public $rows;
public $columns;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows(/* array(Google_object) */ $rows) {
$this->assertIsArray($rows, 'Google_object', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setColumns(/* array(Google_string) */ $columns) {
$this->assertIsArray($columns, 'Google_string', __METHOD__);
$this->columns = $columns;
}
public function getColumns() {
return $this->columns;
}
}
class Google_StyleFunction extends Google_Model {
protected $__gradientType = 'Google_StyleFunctionGradient';
protected $__gradientDataType = '';
public $gradient;
public $columnName;
protected $__bucketsType = 'Google_Bucket';
protected $__bucketsDataType = 'array';
public $buckets;
public $kind;
public function setGradient(Google_StyleFunctionGradient $gradient) {
$this->gradient = $gradient;
}
public function getGradient() {
return $this->gradient;
}
public function setColumnName($columnName) {
$this->columnName = $columnName;
}
public function getColumnName() {
return $this->columnName;
}
public function setBuckets(/* array(Google_Bucket) */ $buckets) {
$this->assertIsArray($buckets, 'Google_Bucket', __METHOD__);
$this->buckets = $buckets;
}
public function getBuckets() {
return $this->buckets;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_StyleFunctionGradient extends Google_Model {
public $max;
protected $__colorsType = 'Google_StyleFunctionGradientColors';
protected $__colorsDataType = 'array';
public $colors;
public $min;
public function setMax($max) {
$this->max = $max;
}
public function getMax() {
return $this->max;
}
public function setColors(/* array(Google_StyleFunctionGradientColors) */ $colors) {
$this->assertIsArray($colors, 'Google_StyleFunctionGradientColors', __METHOD__);
$this->colors = $colors;
}
public function getColors() {
return $this->colors;
}
public function setMin($min) {
$this->min = $min;
}
public function getMin() {
return $this->min;
}
}
class Google_StyleFunctionGradientColors extends Google_Model {
public $color;
public $opacity;
public function setColor($color) {
$this->color = $color;
}
public function getColor() {
return $this->color;
}
public function setOpacity($opacity) {
$this->opacity = $opacity;
}
public function getOpacity() {
return $this->opacity;
}
}
class Google_StyleSetting extends Google_Model {
protected $__markerOptionsType = 'Google_PointStyle';
protected $__markerOptionsDataType = '';
public $markerOptions;
public $kind;
public $name;
protected $__polygonOptionsType = 'Google_PolygonStyle';
protected $__polygonOptionsDataType = '';
public $polygonOptions;
public $isDefaultForTable;
protected $__polylineOptionsType = 'Google_LineStyle';
protected $__polylineOptionsDataType = '';
public $polylineOptions;
public $tableId;
public $styleId;
public function setMarkerOptions(Google_PointStyle $markerOptions) {
$this->markerOptions = $markerOptions;
}
public function getMarkerOptions() {
return $this->markerOptions;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPolygonOptions(Google_PolygonStyle $polygonOptions) {
$this->polygonOptions = $polygonOptions;
}
public function getPolygonOptions() {
return $this->polygonOptions;
}
public function setIsDefaultForTable($isDefaultForTable) {
$this->isDefaultForTable = $isDefaultForTable;
}
public function getIsDefaultForTable() {
return $this->isDefaultForTable;
}
public function setPolylineOptions(Google_LineStyle $polylineOptions) {
$this->polylineOptions = $polylineOptions;
}
public function getPolylineOptions() {
return $this->polylineOptions;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setStyleId($styleId) {
$this->styleId = $styleId;
}
public function getStyleId() {
return $this->styleId;
}
}
class Google_StyleSettingList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_StyleSetting';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_StyleSetting) */ $items) {
$this->assertIsArray($items, 'Google_StyleSetting', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_Table extends Google_Model {
public $kind;
public $attribution;
public $description;
public $isExportable;
public $baseTableIds;
public $attributionLink;
public $sql;
public $tableId;
protected $__columnsType = 'Google_Column';
protected $__columnsDataType = 'array';
public $columns;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAttribution($attribution) {
$this->attribution = $attribution;
}
public function getAttribution() {
return $this->attribution;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setIsExportable($isExportable) {
$this->isExportable = $isExportable;
}
public function getIsExportable() {
return $this->isExportable;
}
public function setBaseTableIds(/* array(Google_string) */ $baseTableIds) {
$this->assertIsArray($baseTableIds, 'Google_string', __METHOD__);
$this->baseTableIds = $baseTableIds;
}
public function getBaseTableIds() {
return $this->baseTableIds;
}
public function setAttributionLink($attributionLink) {
$this->attributionLink = $attributionLink;
}
public function getAttributionLink() {
return $this->attributionLink;
}
public function setSql($sql) {
$this->sql = $sql;
}
public function getSql() {
return $this->sql;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setColumns(/* array(Google_Column) */ $columns) {
$this->assertIsArray($columns, 'Google_Column', __METHOD__);
$this->columns = $columns;
}
public function getColumns() {
return $this->columns;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_TableList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Table';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Table) */ $items) {
$this->assertIsArray($items, 'Google_Table', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Template extends Google_Model {
public $body;
public $kind;
public $name;
public $automaticColumnNames;
public $isDefaultForTable;
public $tableId;
public $templateId;
public function setBody($body) {
$this->body = $body;
}
public function getBody() {
return $this->body;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setAutomaticColumnNames(/* array(Google_string) */ $automaticColumnNames) {
$this->assertIsArray($automaticColumnNames, 'Google_string', __METHOD__);
$this->automaticColumnNames = $automaticColumnNames;
}
public function getAutomaticColumnNames() {
return $this->automaticColumnNames;
}
public function setIsDefaultForTable($isDefaultForTable) {
$this->isDefaultForTable = $isDefaultForTable;
}
public function getIsDefaultForTable() {
return $this->isDefaultForTable;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setTemplateId($templateId) {
$this->templateId = $templateId;
}
public function getTemplateId() {
return $this->templateId;
}
}
class Google_TemplateList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Template';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Template) */ $items) {
$this->assertIsArray($items, 'Google_Template', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_FusiontablesService.php | PHP | asf20 | 51,903 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "objectAccessControls" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google_StorageService(...);
* $objectAccessControls = $storageService->objectAccessControls;
* </code>
*/
class Google_ObjectAccessControlsServiceResource extends Google_ServiceResource {
/**
* Creates a new ACL entry on the specified object. (objectAccessControls.insert)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param Google_ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_ObjectAccessControl
*/
public function insert($bucket, $object, Google_ObjectAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_ObjectAccessControl($data);
} else {
return $data;
}
}
/**
* Returns the ACL entry for the specified entity on the specified object.
* (objectAccessControls.get)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param array $optParams Optional parameters.
* @return Google_ObjectAccessControl
*/
public function get($bucket, $object, $entity, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'entity' => $entity);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_ObjectAccessControl($data);
} else {
return $data;
}
}
/**
* Retrieves ACL entries on the specified object. (objectAccessControls.list)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param array $optParams Optional parameters.
* @return Google_ObjectAccessControls
*/
public function listObjectAccessControls($bucket, $object, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ObjectAccessControls($data);
} else {
return $data;
}
}
/**
* Updates an ACL entry on the specified object. (objectAccessControls.update)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param Google_ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_ObjectAccessControl
*/
public function update($bucket, $object, $entity, Google_ObjectAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_ObjectAccessControl($data);
} else {
return $data;
}
}
/**
* Updates an ACL entry on the specified object. This method supports patch semantics.
* (objectAccessControls.patch)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param Google_ObjectAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_ObjectAccessControl
*/
public function patch($bucket, $object, $entity, Google_ObjectAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'entity' => $entity, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_ObjectAccessControl($data);
} else {
return $data;
}
}
/**
* Deletes the ACL entry for the specified entity on the specified object.
* (objectAccessControls.delete)
*
* @param string $bucket Name of a bucket.
* @param string $object Name of the object.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*/
public function delete($bucket, $object, $entity, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'entity' => $entity);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "bucketAccessControls" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google_StorageService(...);
* $bucketAccessControls = $storageService->bucketAccessControls;
* </code>
*/
class Google_BucketAccessControlsServiceResource extends Google_ServiceResource {
/**
* Creates a new ACL entry on the specified bucket. (bucketAccessControls.insert)
*
* @param string $bucket Name of a bucket.
* @param Google_BucketAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_BucketAccessControl
*/
public function insert($bucket, Google_BucketAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_BucketAccessControl($data);
} else {
return $data;
}
}
/**
* Returns the ACL entry for the specified entity on the specified bucket.
* (bucketAccessControls.get)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param array $optParams Optional parameters.
* @return Google_BucketAccessControl
*/
public function get($bucket, $entity, $optParams = array()) {
$params = array('bucket' => $bucket, 'entity' => $entity);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_BucketAccessControl($data);
} else {
return $data;
}
}
/**
* Retrieves ACL entries on the specified bucket. (bucketAccessControls.list)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
* @return Google_BucketAccessControls
*/
public function listBucketAccessControls($bucket, $optParams = array()) {
$params = array('bucket' => $bucket);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_BucketAccessControls($data);
} else {
return $data;
}
}
/**
* Updates an ACL entry on the specified bucket. (bucketAccessControls.update)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param Google_BucketAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_BucketAccessControl
*/
public function update($bucket, $entity, Google_BucketAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_BucketAccessControl($data);
} else {
return $data;
}
}
/**
* Updates an ACL entry on the specified bucket. This method supports patch semantics.
* (bucketAccessControls.patch)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param Google_BucketAccessControl $postBody
* @param array $optParams Optional parameters.
* @return Google_BucketAccessControl
*/
public function patch($bucket, $entity, Google_BucketAccessControl $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'entity' => $entity, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_BucketAccessControl($data);
} else {
return $data;
}
}
/**
* Deletes the ACL entry for the specified entity on the specified bucket.
* (bucketAccessControls.delete)
*
* @param string $bucket Name of a bucket.
* @param string $entity The entity holding the permission. Can be user-userId, group-groupId, allUsers, or allAuthenticatedUsers.
* @param array $optParams Optional parameters.
*/
public function delete($bucket, $entity, $optParams = array()) {
$params = array('bucket' => $bucket, 'entity' => $entity);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "objects" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google_StorageService(...);
* $objects = $storageService->objects;
* </code>
*/
class Google_ObjectsServiceResource extends Google_ServiceResource {
/**
* Stores new data blobs and associated metadata. (objects.insert)
*
* @param string $bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.
* @param Google_StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.
* @opt_param string projection Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full.
* @return Google_StorageObject
*/
public function insert($bucket, Google_StorageObject $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_StorageObject($data);
} else {
return $data;
}
}
/**
* Retrieves objects or their associated metadata. (objects.get)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to no_acl.
* @return Google_StorageObject
*/
public function get($bucket, $object, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_StorageObject($data);
} else {
return $data;
}
}
/**
* Retrieves a list of objects matching the criteria. (objects.list)
*
* @param string $bucket Name of the bucket in which to look for objects.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.
* @opt_param string projection Set of properties to return. Defaults to no_acl.
* @opt_param string prefix Filter results to objects whose names begin with this prefix.
* @opt_param string pageToken A previously-returned page token representing part of the larger set of results to view.
* @opt_param string delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
* @return Google_Objects
*/
public function listObjects($bucket, $optParams = array()) {
$params = array('bucket' => $bucket);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Objects($data);
} else {
return $data;
}
}
/**
* Updates a data blob's associated metadata. (objects.update)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object.
* @param Google_StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to full.
* @return Google_StorageObject
*/
public function update($bucket, $object, Google_StorageObject $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_StorageObject($data);
} else {
return $data;
}
}
/**
* Updates a data blob's associated metadata. This method supports patch semantics. (objects.patch)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object.
* @param Google_StorageObject $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to full.
* @return Google_StorageObject
*/
public function patch($bucket, $object, Google_StorageObject $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_StorageObject($data);
} else {
return $data;
}
}
/**
* Deletes data blobs and associated metadata. (objects.delete)
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object.
* @param array $optParams Optional parameters.
*/
public function delete($bucket, $object, $optParams = array()) {
$params = array('bucket' => $bucket, 'object' => $object);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "buckets" collection of methods.
* Typical usage is:
* <code>
* $storageService = new Google_StorageService(...);
* $buckets = $storageService->buckets;
* </code>
*/
class Google_BucketsServiceResource extends Google_ServiceResource {
/**
* Creates a new bucket. (buckets.insert)
*
* @param Google_Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.
* @return Google_Bucket
*/
public function insert(Google_Bucket $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Bucket($data);
} else {
return $data;
}
}
/**
* Returns metadata for the specified bucket. (buckets.get)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to no_acl.
* @return Google_Bucket
*/
public function get($bucket, $optParams = array()) {
$params = array('bucket' => $bucket);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Bucket($data);
} else {
return $data;
}
}
/**
* Retrieves a list of buckets for a given project. (buckets.list)
*
* @param string $projectId A valid API project identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string max-results Maximum number of buckets to return.
* @opt_param string pageToken A previously-returned page token representing part of the larger set of results to view.
* @opt_param string projection Set of properties to return. Defaults to no_acl.
* @return Google_Buckets
*/
public function listBuckets($projectId, $optParams = array()) {
$params = array('projectId' => $projectId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Buckets($data);
} else {
return $data;
}
}
/**
* Updates a bucket. (buckets.update)
*
* @param string $bucket Name of a bucket.
* @param Google_Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to full.
* @return Google_Bucket
*/
public function update($bucket, Google_Bucket $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Bucket($data);
} else {
return $data;
}
}
/**
* Updates a bucket. This method supports patch semantics. (buckets.patch)
*
* @param string $bucket Name of a bucket.
* @param Google_Bucket $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string projection Set of properties to return. Defaults to full.
* @return Google_Bucket
*/
public function patch($bucket, Google_Bucket $postBody, $optParams = array()) {
$params = array('bucket' => $bucket, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Bucket($data);
} else {
return $data;
}
}
/**
* Deletes an empty bucket. (buckets.delete)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*/
public function delete($bucket, $optParams = array()) {
$params = array('bucket' => $bucket);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Storage (v1beta1).
*
* <p>
* Lets you store and retrieve potentially-large, immutable data objects.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/storage/docs/developer-guide.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_StorageService extends Google_Service {
public $objectAccessControls;
public $bucketAccessControls;
public $objects;
public $buckets;
/**
* Constructs the internal representation of the Storage service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'storage/v1beta1/';
$this->version = 'v1beta1';
$this->serviceName = 'storage';
$client->addService($this->serviceName, $this->version);
$this->objectAccessControls = new Google_ObjectAccessControlsServiceResource($this, $this->serviceName, 'objectAccessControls', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "ObjectAccessControl"}, "response": {"$ref": "ObjectAccessControl"}, "httpMethod": "POST", "path": "b/{bucket}/o/{object}/acl", "id": "storage.objectAccessControls.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "id": "storage.objectAccessControls.get", "httpMethod": "GET", "path": "b/{bucket}/o/{object}/acl/{entity}", "response": {"$ref": "ObjectAccessControl"}}, "list": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}}, "id": "storage.objectAccessControls.list", "httpMethod": "GET", "path": "b/{bucket}/o/{object}/acl", "response": {"$ref": "ObjectAccessControls"}}, "update": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "ObjectAccessControl"}, "response": {"$ref": "ObjectAccessControl"}, "httpMethod": "PUT", "path": "b/{bucket}/o/{object}/acl/{entity}", "id": "storage.objectAccessControls.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "ObjectAccessControl"}, "response": {"$ref": "ObjectAccessControl"}, "httpMethod": "PATCH", "path": "b/{bucket}/o/{object}/acl/{entity}", "id": "storage.objectAccessControls.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "path": "b/{bucket}/o/{object}/acl/{entity}", "id": "storage.objectAccessControls.delete", "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->bucketAccessControls = new Google_BucketAccessControlsServiceResource($this, $this->serviceName, 'bucketAccessControls', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "BucketAccessControl"}, "response": {"$ref": "BucketAccessControl"}, "httpMethod": "POST", "path": "b/{bucket}/acl", "id": "storage.bucketAccessControls.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "id": "storage.bucketAccessControls.get", "httpMethod": "GET", "path": "b/{bucket}/acl/{entity}", "response": {"$ref": "BucketAccessControl"}}, "list": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}}, "id": "storage.bucketAccessControls.list", "httpMethod": "GET", "path": "b/{bucket}/acl", "response": {"$ref": "BucketAccessControls"}}, "update": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "BucketAccessControl"}, "response": {"$ref": "BucketAccessControl"}, "httpMethod": "PUT", "path": "b/{bucket}/acl/{entity}", "id": "storage.bucketAccessControls.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "BucketAccessControl"}, "response": {"$ref": "BucketAccessControl"}, "httpMethod": "PATCH", "path": "b/{bucket}/acl/{entity}", "id": "storage.bucketAccessControls.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"], "path": "b/{bucket}/acl/{entity}", "id": "storage.bucketAccessControls.delete", "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "entity": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->objects = new Google_ObjectsServiceResource($this, $this->serviceName, 'objects', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "name": {"type": "string", "location": "query"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "supportsMediaUpload": true, "request": {"$ref": "Object"}, "mediaUpload": {"protocols": {"simple": {"path": "/upload/storage/v1beta1/b/{bucket}/o", "multipart": true}, "resumable": {"path": "/resumable/upload/storage/v1beta1/b/{bucket}/o", "multipart": true}}, "accept": ["*/*"]}, "response": {"$ref": "Object"}, "httpMethod": "POST", "path": "b/{bucket}/o", "id": "storage.objects.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "id": "storage.objects.get", "httpMethod": "GET", "supportsMediaDownload": true, "path": "b/{bucket}/o/{object}", "response": {"$ref": "Object"}}, "list": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"max-results": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}, "bucket": {"required": true, "type": "string", "location": "path"}, "prefix": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "delimiter": {"type": "string", "location": "query"}}, "response": {"$ref": "Objects"}, "httpMethod": "GET", "supportsSubscription": true, "path": "b/{bucket}/o", "id": "storage.objects.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "request": {"$ref": "Object"}, "response": {"$ref": "Object"}, "httpMethod": "PUT", "path": "b/{bucket}/o/{object}", "id": "storage.objects.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "request": {"$ref": "Object"}, "response": {"$ref": "Object"}, "httpMethod": "PATCH", "path": "b/{bucket}/o/{object}", "id": "storage.objects.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "path": "b/{bucket}/o/{object}", "id": "storage.objects.delete", "parameters": {"object": {"required": true, "type": "string", "location": "path"}, "bucket": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->buckets = new Google_BucketsServiceResource($this, $this->serviceName, 'buckets', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "request": {"$ref": "Bucket"}, "response": {"$ref": "Bucket"}, "httpMethod": "POST", "path": "b", "id": "storage.buckets.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "id": "storage.buckets.get", "httpMethod": "GET", "path": "b/{bucket}", "response": {"$ref": "Bucket"}}, "list": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"max-results": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}, "projectId": {"required": true, "type": "string", "location": "query", "format": "uint64"}}, "id": "storage.buckets.list", "httpMethod": "GET", "path": "b", "response": {"$ref": "Buckets"}}, "update": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "request": {"$ref": "Bucket"}, "response": {"$ref": "Bucket"}, "httpMethod": "PUT", "path": "b/{bucket}", "id": "storage.buckets.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}, "projection": {"enum": ["full", "no_acl"], "type": "string", "location": "query"}}, "request": {"$ref": "Bucket"}, "response": {"$ref": "Bucket"}, "httpMethod": "PATCH", "path": "b/{bucket}", "id": "storage.buckets.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/devstorage.read_write"], "path": "b/{bucket}", "id": "storage.buckets.delete", "parameters": {"bucket": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Bucket extends Google_Model {
protected $__websiteType = 'Google_BucketWebsite';
protected $__websiteDataType = '';
public $website;
public $kind;
public $timeCreated;
public $projectId;
protected $__aclType = 'Google_BucketAccessControl';
protected $__aclDataType = 'array';
public $acl;
protected $__defaultObjectAclType = 'Google_ObjectAccessControl';
protected $__defaultObjectAclDataType = 'array';
public $defaultObjectAcl;
public $location;
protected $__ownerType = 'Google_BucketOwner';
protected $__ownerDataType = '';
public $owner;
public $id;
public $selfLink;
public function setWebsite(Google_BucketWebsite $website) {
$this->website = $website;
}
public function getWebsite() {
return $this->website;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTimeCreated($timeCreated) {
$this->timeCreated = $timeCreated;
}
public function getTimeCreated() {
return $this->timeCreated;
}
public function setProjectId($projectId) {
$this->projectId = $projectId;
}
public function getProjectId() {
return $this->projectId;
}
public function setAcl(/* array(Google_BucketAccessControl) */ $acl) {
$this->assertIsArray($acl, 'Google_BucketAccessControl', __METHOD__);
$this->acl = $acl;
}
public function getAcl() {
return $this->acl;
}
public function setDefaultObjectAcl(/* array(Google_ObjectAccessControl) */ $defaultObjectAcl) {
$this->assertIsArray($defaultObjectAcl, 'Google_ObjectAccessControl', __METHOD__);
$this->defaultObjectAcl = $defaultObjectAcl;
}
public function getDefaultObjectAcl() {
return $this->defaultObjectAcl;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setOwner(Google_BucketOwner $owner) {
$this->owner = $owner;
}
public function getOwner() {
return $this->owner;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_BucketAccessControl extends Google_Model {
public $domain;
public $bucket;
public $kind;
public $id;
public $role;
public $entityId;
public $entity;
public $email;
public $selfLink;
public function setDomain($domain) {
$this->domain = $domain;
}
public function getDomain() {
return $this->domain;
}
public function setBucket($bucket) {
$this->bucket = $bucket;
}
public function getBucket() {
return $this->bucket;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setRole($role) {
$this->role = $role;
}
public function getRole() {
return $this->role;
}
public function setEntityId($entityId) {
$this->entityId = $entityId;
}
public function getEntityId() {
return $this->entityId;
}
public function setEntity($entity) {
$this->entity = $entity;
}
public function getEntity() {
return $this->entity;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_BucketAccessControls extends Google_Model {
protected $__itemsType = 'Google_BucketAccessControl';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_BucketAccessControl) */ $items) {
$this->assertIsArray($items, 'Google_BucketAccessControl', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_BucketOwner extends Google_Model {
public $entityId;
public $entity;
public function setEntityId($entityId) {
$this->entityId = $entityId;
}
public function getEntityId() {
return $this->entityId;
}
public function setEntity($entity) {
$this->entity = $entity;
}
public function getEntity() {
return $this->entity;
}
}
class Google_BucketWebsite extends Google_Model {
public $notFoundPage;
public $mainPageSuffix;
public function setNotFoundPage($notFoundPage) {
$this->notFoundPage = $notFoundPage;
}
public function getNotFoundPage() {
return $this->notFoundPage;
}
public function setMainPageSuffix($mainPageSuffix) {
$this->mainPageSuffix = $mainPageSuffix;
}
public function getMainPageSuffix() {
return $this->mainPageSuffix;
}
}
class Google_Buckets extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Bucket';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Bucket) */ $items) {
$this->assertIsArray($items, 'Google_Bucket', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_ObjectAccessControl extends Google_Model {
public $domain;
public $object;
public $bucket;
public $kind;
public $id;
public $role;
public $entityId;
public $entity;
public $email;
public $selfLink;
public function setDomain($domain) {
$this->domain = $domain;
}
public function getDomain() {
return $this->domain;
}
public function setObject($object) {
$this->object = $object;
}
public function getObject() {
return $this->object;
}
public function setBucket($bucket) {
$this->bucket = $bucket;
}
public function getBucket() {
return $this->bucket;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setRole($role) {
$this->role = $role;
}
public function getRole() {
return $this->role;
}
public function setEntityId($entityId) {
$this->entityId = $entityId;
}
public function getEntityId() {
return $this->entityId;
}
public function setEntity($entity) {
$this->entity = $entity;
}
public function getEntity() {
return $this->entity;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ObjectAccessControls extends Google_Model {
protected $__itemsType = 'Google_ObjectAccessControl';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_ObjectAccessControl) */ $items) {
$this->assertIsArray($items, 'Google_ObjectAccessControl', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Objects extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_StorageObject';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $prefixes;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_StorageObject) */ $items) {
$this->assertIsArray($items, 'Google_StorageObject', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPrefixes(/* array(Google_string) */ $prefixes) {
$this->assertIsArray($prefixes, 'Google_string', __METHOD__);
$this->prefixes = $prefixes;
}
public function getPrefixes() {
return $this->prefixes;
}
}
class Google_StorageObject extends Google_Model {
public $kind;
public $name;
protected $__mediaType = 'Google_StorageObjectMedia';
protected $__mediaDataType = '';
public $media;
public $bucket;
public $contentEncoding;
public $selfLink;
protected $__ownerType = 'Google_StorageObjectOwner';
protected $__ownerDataType = '';
public $owner;
public $cacheControl;
protected $__aclType = 'Google_ObjectAccessControl';
protected $__aclDataType = 'array';
public $acl;
public $id;
public $contentDisposition;
public $metadata;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setMedia(Google_StorageObjectMedia $media) {
$this->media = $media;
}
public function getMedia() {
return $this->media;
}
public function setBucket($bucket) {
$this->bucket = $bucket;
}
public function getBucket() {
return $this->bucket;
}
public function setContentEncoding($contentEncoding) {
$this->contentEncoding = $contentEncoding;
}
public function getContentEncoding() {
return $this->contentEncoding;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setOwner(Google_StorageObjectOwner $owner) {
$this->owner = $owner;
}
public function getOwner() {
return $this->owner;
}
public function setCacheControl($cacheControl) {
$this->cacheControl = $cacheControl;
}
public function getCacheControl() {
return $this->cacheControl;
}
public function setAcl(/* array(Google_ObjectAccessControl) */ $acl) {
$this->assertIsArray($acl, 'Google_ObjectAccessControl', __METHOD__);
$this->acl = $acl;
}
public function getAcl() {
return $this->acl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setContentDisposition($contentDisposition) {
$this->contentDisposition = $contentDisposition;
}
public function getContentDisposition() {
return $this->contentDisposition;
}
public function setMetadata($metadata) {
$this->metadata = $metadata;
}
public function getMetadata() {
return $this->metadata;
}
}
class Google_StorageObjectMedia extends Google_Model {
public $contentType;
public $timeCreated;
public $algorithm;
public $length;
public $link;
public $hash;
public $data;
public function setContentType($contentType) {
$this->contentType = $contentType;
}
public function getContentType() {
return $this->contentType;
}
public function setTimeCreated($timeCreated) {
$this->timeCreated = $timeCreated;
}
public function getTimeCreated() {
return $this->timeCreated;
}
public function setAlgorithm($algorithm) {
$this->algorithm = $algorithm;
}
public function getAlgorithm() {
return $this->algorithm;
}
public function setLength($length) {
$this->length = $length;
}
public function getLength() {
return $this->length;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setHash($hash) {
$this->hash = $hash;
}
public function getHash() {
return $this->hash;
}
public function setData($data) {
$this->data = $data;
}
public function getData() {
return $this->data;
}
}
class Google_StorageObjectOwner extends Google_Model {
public $entityId;
public $entity;
public function setEntityId($entityId) {
$this->entityId = $entityId;
}
public function getEntityId() {
return $this->entityId;
}
public function setEntity($entity) {
$this->entity = $entity;
}
public function getEntity() {
return $this->entity;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_StorageService.php | PHP | asf20 | 46,430 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "pagespeedapi" collection of methods.
* Typical usage is:
* <code>
* $pagespeedonlineService = new Google_PagespeedonlineService(...);
* $pagespeedapi = $pagespeedonlineService->pagespeedapi;
* </code>
*/
class Google_PagespeedapiServiceResource extends Google_ServiceResource {
/**
* Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list
* of suggestions to make that page faster, and other information. (pagespeedapi.runpagespeed)
*
* @param string $url The URL to fetch and analyze
* @param array $optParams Optional parameters.
*
* @opt_param string locale The locale used to localize formatted results
* @opt_param string rule A Page Speed rule to run; if none are given, all rules are run
* @opt_param string strategy The analysis strategy to use
* @return Google_Result
*/
public function runpagespeed($url, $optParams = array()) {
$params = array('url' => $url);
$params = array_merge($params, $optParams);
$data = $this->__call('runpagespeed', array($params));
if ($this->useObjects()) {
return new Google_Result($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Pagespeedonline (v1).
*
* <p>
* Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/pagespeedonline/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PagespeedonlineService extends Google_Service {
public $pagespeedapi;
/**
* Constructs the internal representation of the Pagespeedonline service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'pagespeedonline/v1/';
$this->version = 'v1';
$this->serviceName = 'pagespeedonline';
$client->addService($this->serviceName, $this->version);
$this->pagespeedapi = new Google_PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"httpMethod": "GET", "response": {"$ref": "Result"}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "path": "runPagespeed"}}}', true));
}
}
class Google_Result extends Google_Model {
public $kind;
protected $__formattedResultsType = 'Google_ResultFormattedResults';
protected $__formattedResultsDataType = '';
public $formattedResults;
public $title;
protected $__versionType = 'Google_ResultVersion';
protected $__versionDataType = '';
public $version;
public $score;
public $responseCode;
public $invalidRules;
protected $__pageStatsType = 'Google_ResultPageStats';
protected $__pageStatsDataType = '';
public $pageStats;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setFormattedResults(Google_ResultFormattedResults $formattedResults) {
$this->formattedResults = $formattedResults;
}
public function getFormattedResults() {
return $this->formattedResults;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setVersion(Google_ResultVersion $version) {
$this->version = $version;
}
public function getVersion() {
return $this->version;
}
public function setScore($score) {
$this->score = $score;
}
public function getScore() {
return $this->score;
}
public function setResponseCode($responseCode) {
$this->responseCode = $responseCode;
}
public function getResponseCode() {
return $this->responseCode;
}
public function setInvalidRules(/* array(Google_string) */ $invalidRules) {
$this->assertIsArray($invalidRules, 'Google_string', __METHOD__);
$this->invalidRules = $invalidRules;
}
public function getInvalidRules() {
return $this->invalidRules;
}
public function setPageStats(Google_ResultPageStats $pageStats) {
$this->pageStats = $pageStats;
}
public function getPageStats() {
return $this->pageStats;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ResultFormattedResults extends Google_Model {
public $locale;
protected $__ruleResultsType = 'Google_ResultFormattedResultsRuleResults';
protected $__ruleResultsDataType = 'map';
public $ruleResults;
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setRuleResults(Google_ResultFormattedResultsRuleResults $ruleResults) {
$this->ruleResults = $ruleResults;
}
public function getRuleResults() {
return $this->ruleResults;
}
}
class Google_ResultFormattedResultsRuleResults extends Google_Model {
public $localizedRuleName;
protected $__urlBlocksType = 'Google_ResultFormattedResultsRuleResultsUrlBlocks';
protected $__urlBlocksDataType = 'array';
public $urlBlocks;
public $ruleScore;
public $ruleImpact;
public function setLocalizedRuleName($localizedRuleName) {
$this->localizedRuleName = $localizedRuleName;
}
public function getLocalizedRuleName() {
return $this->localizedRuleName;
}
public function setUrlBlocks(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocks) */ $urlBlocks) {
$this->assertIsArray($urlBlocks, 'Google_ResultFormattedResultsRuleResultsUrlBlocks', __METHOD__);
$this->urlBlocks = $urlBlocks;
}
public function getUrlBlocks() {
return $this->urlBlocks;
}
public function setRuleScore($ruleScore) {
$this->ruleScore = $ruleScore;
}
public function getRuleScore() {
return $this->ruleScore;
}
public function setRuleImpact($ruleImpact) {
$this->ruleImpact = $ruleImpact;
}
public function getRuleImpact() {
return $this->ruleImpact;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocks extends Google_Model {
protected $__headerType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeader';
protected $__headerDataType = '';
public $header;
protected $__urlsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls';
protected $__urlsDataType = 'array';
public $urls;
public function setHeader(Google_ResultFormattedResultsRuleResultsUrlBlocksHeader $header) {
$this->header = $header;
}
public function getHeader() {
return $this->header;
}
public function setUrls(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrls) */ $urls) {
$this->assertIsArray($urls, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrls', __METHOD__);
$this->urls = $urls;
}
public function getUrls() {
return $this->urls;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeader extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs) */ $args) {
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksHeaderArgs extends Google_Model {
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_ResultFormattedResultsRuleResultsUrlBlocksUrls extends Google_Model {
protected $__detailsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails';
protected $__detailsDataType = 'array';
public $details;
protected $__resultType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult';
protected $__resultDataType = '';
public $result;
public function setDetails(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails) */ $details) {
$this->assertIsArray($details, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails', __METHOD__);
$this->details = $details;
}
public function getDetails() {
return $this->details;
}
public function setResult(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetails extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs) */ $args) {
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsDetailsArgs extends Google_Model {
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_ResultFormattedResultsRuleResultsUrlBlocksUrlsResult extends Google_Model {
protected $__argsType = 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs';
protected $__argsDataType = 'array';
public $args;
public $format;
public function setArgs(/* array(Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs) */ $args) {
$this->assertIsArray($args, 'Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs', __METHOD__);
$this->args = $args;
}
public function getArgs() {
return $this->args;
}
public function setFormat($format) {
$this->format = $format;
}
public function getFormat() {
return $this->format;
}
}
class Google_ResultFormattedResultsRuleResultsUrlBlocksUrlsResultArgs extends Google_Model {
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_ResultPageStats extends Google_Model {
public $otherResponseBytes;
public $flashResponseBytes;
public $totalRequestBytes;
public $numberCssResources;
public $numberResources;
public $cssResponseBytes;
public $javascriptResponseBytes;
public $imageResponseBytes;
public $numberHosts;
public $numberStaticResources;
public $htmlResponseBytes;
public $numberJsResources;
public $textResponseBytes;
public function setOtherResponseBytes($otherResponseBytes) {
$this->otherResponseBytes = $otherResponseBytes;
}
public function getOtherResponseBytes() {
return $this->otherResponseBytes;
}
public function setFlashResponseBytes($flashResponseBytes) {
$this->flashResponseBytes = $flashResponseBytes;
}
public function getFlashResponseBytes() {
return $this->flashResponseBytes;
}
public function setTotalRequestBytes($totalRequestBytes) {
$this->totalRequestBytes = $totalRequestBytes;
}
public function getTotalRequestBytes() {
return $this->totalRequestBytes;
}
public function setNumberCssResources($numberCssResources) {
$this->numberCssResources = $numberCssResources;
}
public function getNumberCssResources() {
return $this->numberCssResources;
}
public function setNumberResources($numberResources) {
$this->numberResources = $numberResources;
}
public function getNumberResources() {
return $this->numberResources;
}
public function setCssResponseBytes($cssResponseBytes) {
$this->cssResponseBytes = $cssResponseBytes;
}
public function getCssResponseBytes() {
return $this->cssResponseBytes;
}
public function setJavascriptResponseBytes($javascriptResponseBytes) {
$this->javascriptResponseBytes = $javascriptResponseBytes;
}
public function getJavascriptResponseBytes() {
return $this->javascriptResponseBytes;
}
public function setImageResponseBytes($imageResponseBytes) {
$this->imageResponseBytes = $imageResponseBytes;
}
public function getImageResponseBytes() {
return $this->imageResponseBytes;
}
public function setNumberHosts($numberHosts) {
$this->numberHosts = $numberHosts;
}
public function getNumberHosts() {
return $this->numberHosts;
}
public function setNumberStaticResources($numberStaticResources) {
$this->numberStaticResources = $numberStaticResources;
}
public function getNumberStaticResources() {
return $this->numberStaticResources;
}
public function setHtmlResponseBytes($htmlResponseBytes) {
$this->htmlResponseBytes = $htmlResponseBytes;
}
public function getHtmlResponseBytes() {
return $this->htmlResponseBytes;
}
public function setNumberJsResources($numberJsResources) {
$this->numberJsResources = $numberJsResources;
}
public function getNumberJsResources() {
return $this->numberJsResources;
}
public function setTextResponseBytes($textResponseBytes) {
$this->textResponseBytes = $textResponseBytes;
}
public function getTextResponseBytes() {
return $this->textResponseBytes;
}
}
class Google_ResultVersion extends Google_Model {
public $major;
public $minor;
public function setMajor($major) {
$this->major = $major;
}
public function getMajor() {
return $this->major;
}
public function setMinor($minor) {
$this->minor = $minor;
}
public function getMinor() {
return $this->minor;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_PagespeedonlineService.php | PHP | asf20 | 15,354 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "moments" collection of methods.
* Typical usage is:
* <code>
* $plusService = new Google_PlusMomentsService(...);
* $moments = $plusService->moments;
* </code>
*/
class Google_MomentsServiceResource extends Google_ServiceResource {
/**
* Record a user activity (e.g Bill watched a video on Youtube) (moments.insert)
*
* @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
* @param string $collection The collection to which to write moments.
* @param Google_Moment $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool debug Return the moment as written. Should be used only for debugging.
* @return Google_Moment
*/
public function insert($userId, $collection, Google_Moment $postBody, $optParams = array()) {
$params = array('userId' => $userId, 'collection' => $collection, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Moment($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Plus (v1moments).
*
* <p>
* The Google+ API enables developers to build on top of the Google+ platform.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/+/history/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_PlusMomentsService extends Google_Service {
public $moments;
/**
* Constructs the internal representation of the Plus service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'plus/v1moments/people/';
$this->version = 'v1moments';
$this->serviceName = 'plus';
$client->addService($this->serviceName, $this->version);
$this->moments = new Google_MomentsServiceResource($this, $this->serviceName, 'moments',
json_decode('{"methods": {"insert": {"parameters": {"debug": {"type": "boolean", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}, "collection": {"required": true, "type": "string", "location": "path", "enum": ["vault"]}}, "request": {"$ref": "Moment"}, "response": {"$ref": "Moment"}, "httpMethod": "POST", "path": "{userId}/moments/{collection}", "id": "plus.moments.insert"}}}', true));
}
}
class Google_ItemScope extends Google_Model {
public $startDate;
public $endDate;
public $text;
public $image;
protected $__addressType = 'Google_ItemScope';
protected $__addressDataType = '';
public $address;
public $birthDate;
public $datePublished;
public $addressLocality;
public $duration;
public $additionalName;
public $worstRating;
protected $__contributorType = 'Google_ItemScope';
protected $__contributorDataType = 'array';
public $contributor;
public $thumbnailUrl;
public $id;
public $postOfficeBoxNumber;
protected $__attendeesType = 'Google_ItemScope';
protected $__attendeesDataType = 'array';
public $attendees;
protected $__authorType = 'Google_ItemScope';
protected $__authorDataType = 'array';
public $author;
protected $__associated_mediaType = 'Google_ItemScope';
protected $__associated_mediaDataType = 'array';
public $associated_media;
public $bestRating;
public $addressCountry;
public $width;
public $streetAddress;
protected $__locationType = 'Google_ItemScope';
protected $__locationDataType = '';
public $location;
public $latitude;
protected $__byArtistType = 'Google_ItemScope';
protected $__byArtistDataType = '';
public $byArtist;
public $type;
public $dateModified;
public $contentSize;
public $contentUrl;
protected $__partOfTVSeriesType = 'Google_ItemScope';
protected $__partOfTVSeriesDataType = '';
public $partOfTVSeries;
public $description;
public $familyName;
public $kind;
public $dateCreated;
public $postalCode;
public $attendeeCount;
protected $__inAlbumType = 'Google_ItemScope';
protected $__inAlbumDataType = '';
public $inAlbum;
public $addressRegion;
public $height;
protected $__geoType = 'Google_ItemScope';
protected $__geoDataType = '';
public $geo;
public $embedUrl;
public $tickerSymbol;
public $playerType;
protected $__aboutType = 'Google_ItemScope';
protected $__aboutDataType = '';
public $about;
public $givenName;
public $name;
protected $__performersType = 'Google_ItemScope';
protected $__performersDataType = 'array';
public $performers;
public $url;
public $gender;
public $longitude;
protected $__thumbnailType = 'Google_ItemScope';
protected $__thumbnailDataType = '';
public $thumbnail;
public $caption;
public $ratingValue;
protected $__reviewRatingType = 'Google_ItemScope';
protected $__reviewRatingDataType = '';
public $reviewRating;
protected $__audioType = 'Google_ItemScope';
protected $__audioDataType = '';
public $audio;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
public function getEndDate() {
return $this->endDate;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setImage($image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setAddress(Google_ItemScope $address) {
$this->address = $address;
}
public function getAddress() {
return $this->address;
}
public function setBirthDate($birthDate) {
$this->birthDate = $birthDate;
}
public function getBirthDate() {
return $this->birthDate;
}
public function setDatePublished($datePublished) {
$this->datePublished = $datePublished;
}
public function getDatePublished() {
return $this->datePublished;
}
public function setAddressLocality($addressLocality) {
$this->addressLocality = $addressLocality;
}
public function getAddressLocality() {
return $this->addressLocality;
}
public function setDuration($duration) {
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
public function setAdditionalName(/* array(Google_string) */ $additionalName) {
$this->assertIsArray($additionalName, 'Google_string', __METHOD__);
$this->additionalName = $additionalName;
}
public function getAdditionalName() {
return $this->additionalName;
}
public function setWorstRating($worstRating) {
$this->worstRating = $worstRating;
}
public function getWorstRating() {
return $this->worstRating;
}
public function setContributor(/* array(Google_ItemScope) */ $contributor) {
$this->assertIsArray($contributor, 'Google_ItemScope', __METHOD__);
$this->contributor = $contributor;
}
public function getContributor() {
return $this->contributor;
}
public function setThumbnailUrl($thumbnailUrl) {
$this->thumbnailUrl = $thumbnailUrl;
}
public function getThumbnailUrl() {
return $this->thumbnailUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setPostOfficeBoxNumber($postOfficeBoxNumber) {
$this->postOfficeBoxNumber = $postOfficeBoxNumber;
}
public function getPostOfficeBoxNumber() {
return $this->postOfficeBoxNumber;
}
public function setAttendees(/* array(Google_ItemScope) */ $attendees) {
$this->assertIsArray($attendees, 'Google_ItemScope', __METHOD__);
$this->attendees = $attendees;
}
public function getAttendees() {
return $this->attendees;
}
public function setAuthor(/* array(Google_ItemScope) */ $author) {
$this->assertIsArray($author, 'Google_ItemScope', __METHOD__);
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setAssociated_media(/* array(Google_ItemScope) */ $associated_media) {
$this->assertIsArray($associated_media, 'Google_ItemScope', __METHOD__);
$this->associated_media = $associated_media;
}
public function getAssociated_media() {
return $this->associated_media;
}
public function setBestRating($bestRating) {
$this->bestRating = $bestRating;
}
public function getBestRating() {
return $this->bestRating;
}
public function setAddressCountry($addressCountry) {
$this->addressCountry = $addressCountry;
}
public function getAddressCountry() {
return $this->addressCountry;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setStreetAddress($streetAddress) {
$this->streetAddress = $streetAddress;
}
public function getStreetAddress() {
return $this->streetAddress;
}
public function setLocation(Google_ItemScope $location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setByArtist(Google_ItemScope $byArtist) {
$this->byArtist = $byArtist;
}
public function getByArtist() {
return $this->byArtist;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setDateModified($dateModified) {
$this->dateModified = $dateModified;
}
public function getDateModified() {
return $this->dateModified;
}
public function setContentSize($contentSize) {
$this->contentSize = $contentSize;
}
public function getContentSize() {
return $this->contentSize;
}
public function setContentUrl($contentUrl) {
$this->contentUrl = $contentUrl;
}
public function getContentUrl() {
return $this->contentUrl;
}
public function setPartOfTVSeries(Google_ItemScope $partOfTVSeries) {
$this->partOfTVSeries = $partOfTVSeries;
}
public function getPartOfTVSeries() {
return $this->partOfTVSeries;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setFamilyName($familyName) {
$this->familyName = $familyName;
}
public function getFamilyName() {
return $this->familyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDateCreated($dateCreated) {
$this->dateCreated = $dateCreated;
}
public function getDateCreated() {
return $this->dateCreated;
}
public function setPostalCode($postalCode) {
$this->postalCode = $postalCode;
}
public function getPostalCode() {
return $this->postalCode;
}
public function setAttendeeCount($attendeeCount) {
$this->attendeeCount = $attendeeCount;
}
public function getAttendeeCount() {
return $this->attendeeCount;
}
public function setInAlbum(Google_ItemScope $inAlbum) {
$this->inAlbum = $inAlbum;
}
public function getInAlbum() {
return $this->inAlbum;
}
public function setAddressRegion($addressRegion) {
$this->addressRegion = $addressRegion;
}
public function getAddressRegion() {
return $this->addressRegion;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
public function setGeo(Google_ItemScope $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setEmbedUrl($embedUrl) {
$this->embedUrl = $embedUrl;
}
public function getEmbedUrl() {
return $this->embedUrl;
}
public function setTickerSymbol($tickerSymbol) {
$this->tickerSymbol = $tickerSymbol;
}
public function getTickerSymbol() {
return $this->tickerSymbol;
}
public function setPlayerType($playerType) {
$this->playerType = $playerType;
}
public function getPlayerType() {
return $this->playerType;
}
public function setAbout(Google_ItemScope $about) {
$this->about = $about;
}
public function getAbout() {
return $this->about;
}
public function setGivenName($givenName) {
$this->givenName = $givenName;
}
public function getGivenName() {
return $this->givenName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPerformers(/* array(Google_ItemScope) */ $performers) {
$this->assertIsArray($performers, 'Google_ItemScope', __METHOD__);
$this->performers = $performers;
}
public function getPerformers() {
return $this->performers;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setThumbnail(Google_ItemScope $thumbnail) {
$this->thumbnail = $thumbnail;
}
public function getThumbnail() {
return $this->thumbnail;
}
public function setCaption($caption) {
$this->caption = $caption;
}
public function getCaption() {
return $this->caption;
}
public function setRatingValue($ratingValue) {
$this->ratingValue = $ratingValue;
}
public function getRatingValue() {
return $this->ratingValue;
}
public function setReviewRating(Google_ItemScope $reviewRating) {
$this->reviewRating = $reviewRating;
}
public function getReviewRating() {
return $this->reviewRating;
}
public function setAudio(Google_ItemScope $audio) {
$this->audio = $audio;
}
public function getAudio() {
return $this->audio;
}
}
class Google_Moment extends Google_Model {
public $startDate;
public $kind;
protected $__targetType = 'Google_ItemScope';
protected $__targetDataType = '';
public $target;
protected $__verbType = 'Google_MomentVerb';
protected $__verbDataType = '';
public $verb;
protected $__resultType = 'Google_ItemScope';
protected $__resultDataType = '';
public $result;
public $type;
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTarget(Google_ItemScope $target) {
$this->target = $target;
}
public function getTarget() {
return $this->target;
}
public function setVerb(Google_MomentVerb $verb) {
$this->verb = $verb;
}
public function getVerb() {
return $this->verb;
}
public function setResult(Google_ItemScope $result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_MomentVerb extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_PlusMomentsService.php | PHP | asf20 | 16,301 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "products" collection of methods.
* Typical usage is:
* <code>
* $shoppingService = new Google_ShoppingService(...);
* $products = $shoppingService->products;
* </code>
*/
class Google_ProductsServiceResource extends Google_ServiceResource {
/**
* Returns a list of products and content modules (products.list)
*
* @param string $source Query source
* @param array $optParams Optional parameters.
*
* @opt_param string facets.include Facets to include (applies when useGcsConfig == false)
* @opt_param bool plusOne.enabled Whether to return +1 button code
* @opt_param bool plusOne.useGcsConfig Whether to use +1 button styles configured in the GCS account
* @opt_param bool facets.enabled Whether to return facet information
* @opt_param bool relatedQueries.useGcsConfig This parameter is currently ignored
* @opt_param bool promotions.enabled Whether to return promotion information
* @opt_param string channels Channels specification
* @opt_param string currency Currency restriction (ISO 4217)
* @opt_param bool categoryRecommendations.enabled Whether to return category recommendation information
* @opt_param string facets.discover Facets to discover
* @opt_param string categoryRecommendations.category Category for which to retrieve recommendations
* @opt_param string startIndex Index (1-based) of first product to return
* @opt_param string availability Comma separated list of availabilities (outOfStock, limited, inStock, backOrder, preOrder, onDisplayToOrder) to return
* @opt_param string crowdBy Crowding specification
* @opt_param bool spelling.enabled Whether to return spelling suggestions
* @opt_param string taxonomy Taxonomy name
* @opt_param bool spelling.useGcsConfig This parameter is currently ignored
* @opt_param string useCase One of CommerceSearchUseCase, ShoppingApiUseCase
* @opt_param string location Location used to determine tax and shipping
* @opt_param int maxVariants Maximum number of variant results to return per result
* @opt_param string categories.include Category specification
* @opt_param string boostBy Boosting specification
* @opt_param bool safe Whether safe search is enabled. Default: true
* @opt_param bool categories.useGcsConfig This parameter is currently ignored
* @opt_param string maxResults Maximum number of results to return
* @opt_param bool facets.useGcsConfig Whether to return facet information as configured in the GCS account
* @opt_param bool categories.enabled Whether to return category information
* @opt_param string plusOne.styles +1 button rendering styles
* @opt_param string attributeFilter Comma separated list of attributes to return
* @opt_param bool clickTracking Whether to add a click tracking parameter to offer URLs
* @opt_param string thumbnails Image thumbnails specification
* @opt_param string language Language restriction (BCP 47)
* @opt_param string categoryRecommendations.include Category recommendation specification
* @opt_param string country Country restriction (ISO 3166)
* @opt_param string rankBy Ranking specification
* @opt_param string restrictBy Restriction specification
* @opt_param string q Search query
* @opt_param bool redirects.enabled Whether to return redirect information
* @opt_param bool redirects.useGcsConfig Whether to return redirect information as configured in the GCS account
* @opt_param bool relatedQueries.enabled Whether to return related queries
* @opt_param bool categoryRecommendations.useGcsConfig This parameter is currently ignored
* @opt_param bool promotions.useGcsConfig Whether to return promotion information as configured in the GCS account
* @return Google_Products
*/
public function listProducts($source, $optParams = array()) {
$params = array('source' => $source);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Products($data);
} else {
return $data;
}
}
/**
* Returns a single product (products.get)
*
* @param string $source Query source
* @param string $accountId Merchant center account id
* @param string $productIdType Type of productId
* @param string $productId Id of product
* @param array $optParams Optional parameters.
*
* @opt_param string categories.include Category specification
* @opt_param bool recommendations.enabled Whether to return recommendation information
* @opt_param string thumbnails Thumbnail specification
* @opt_param bool plusOne.useGcsConfig Whether to use +1 button styles configured in the GCS account
* @opt_param string taxonomy Merchant taxonomy
* @opt_param bool categories.useGcsConfig This parameter is currently ignored
* @opt_param string plusOne.styles +1 button rendering styles
* @opt_param string recommendations.include Recommendation specification
* @opt_param bool categories.enabled Whether to return category information
* @opt_param string location Location used to determine tax and shipping
* @opt_param bool plusOne.enabled Whether to return +1 button code
* @opt_param string attributeFilter Comma separated list of attributes to return
* @opt_param bool recommendations.useGcsConfig This parameter is currently ignored
* @return Google_Product
*/
public function get($source, $accountId, $productIdType, $productId, $optParams = array()) {
$params = array('source' => $source, 'accountId' => $accountId, 'productIdType' => $productIdType, 'productId' => $productId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Product($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Shopping (v1).
*
* <p>
* Lets you search over product data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/shopping/search/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_ShoppingService extends Google_Service {
public $products;
/**
* Constructs the internal representation of the Shopping service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'shopping/search/v1/';
$this->version = 'v1';
$this->serviceName = 'shopping';
$client->addService($this->serviceName, $this->version);
$this->products = new Google_ProductsServiceResource($this, $this->serviceName, 'products', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/shoppingapi"], "parameters": {"facets.include": {"type": "string", "location": "query"}, "plusOne.enabled": {"type": "boolean", "location": "query"}, "plusOne.useGcsConfig": {"type": "boolean", "location": "query"}, "facets.enabled": {"type": "boolean", "location": "query"}, "relatedQueries.useGcsConfig": {"type": "boolean", "location": "query"}, "promotions.enabled": {"type": "boolean", "location": "query"}, "channels": {"type": "string", "location": "query"}, "currency": {"type": "string", "location": "query"}, "startIndex": {"type": "integer", "location": "query", "format": "uint32"}, "facets.discover": {"type": "string", "location": "query"}, "categoryRecommendations.category": {"type": "string", "location": "query"}, "availability": {"type": "string", "location": "query"}, "crowdBy": {"type": "string", "location": "query"}, "spelling.enabled": {"type": "boolean", "location": "query"}, "taxonomy": {"type": "string", "location": "query"}, "spelling.useGcsConfig": {"type": "boolean", "location": "query"}, "source": {"required": true, "type": "string", "location": "path"}, "useCase": {"type": "string", "location": "query"}, "location": {"type": "string", "location": "query"}, "maxVariants": {"type": "integer", "location": "query", "format": "int32"}, "categories.include": {"type": "string", "location": "query"}, "boostBy": {"type": "string", "location": "query"}, "safe": {"type": "boolean", "location": "query"}, "categories.useGcsConfig": {"type": "boolean", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "facets.useGcsConfig": {"type": "boolean", "location": "query"}, "categories.enabled": {"type": "boolean", "location": "query"}, "plusOne.styles": {"type": "string", "location": "query"}, "attributeFilter": {"type": "string", "location": "query"}, "clickTracking": {"type": "boolean", "location": "query"}, "categoryRecommendations.enabled": {"type": "boolean", "location": "query"}, "thumbnails": {"type": "string", "location": "query"}, "language": {"type": "string", "location": "query"}, "categoryRecommendations.include": {"type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "rankBy": {"type": "string", "location": "query"}, "restrictBy": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}, "redirects.enabled": {"type": "boolean", "location": "query"}, "redirects.useGcsConfig": {"type": "boolean", "location": "query"}, "relatedQueries.enabled": {"type": "boolean", "location": "query"}, "categoryRecommendations.useGcsConfig": {"type": "boolean", "location": "query"}, "promotions.useGcsConfig": {"type": "boolean", "location": "query"}}, "id": "shopping.products.list", "httpMethod": "GET", "path": "{source}/products", "response": {"$ref": "Products"}}, "get": {"scopes": ["https://www.googleapis.com/auth/shoppingapi"], "parameters": {"categories.include": {"type": "string", "location": "query"}, "recommendations.enabled": {"type": "boolean", "location": "query"}, "thumbnails": {"type": "string", "location": "query"}, "plusOne.useGcsConfig": {"type": "boolean", "location": "query"}, "source": {"required": true, "type": "string", "location": "path"}, "taxonomy": {"type": "string", "location": "query"}, "productIdType": {"required": true, "type": "string", "location": "path"}, "categories.useGcsConfig": {"type": "boolean", "location": "query"}, "plusOne.styles": {"type": "string", "location": "query"}, "recommendations.include": {"type": "string", "location": "query"}, "categories.enabled": {"type": "boolean", "location": "query"}, "location": {"type": "string", "location": "query"}, "plusOne.enabled": {"type": "boolean", "location": "query"}, "attributeFilter": {"type": "string", "location": "query"}, "recommendations.useGcsConfig": {"type": "boolean", "location": "query"}, "productId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "integer", "location": "path", "format": "uint32"}}, "id": "shopping.products.get", "httpMethod": "GET", "path": "{source}/products/{accountId}/{productIdType}/{productId}", "response": {"$ref": "Product"}}}}', true));
}
}
class Google_Product extends Google_Model {
public $selfLink;
public $kind;
protected $__productType = 'Google_ShoppingModelProductJsonV1';
protected $__productDataType = '';
public $product;
public $requestId;
protected $__recommendationsType = 'Google_ShoppingModelRecommendationsJsonV1';
protected $__recommendationsDataType = 'array';
public $recommendations;
protected $__debugType = 'Google_ShoppingModelDebugJsonV1';
protected $__debugDataType = '';
public $debug;
public $id;
protected $__categoriesType = 'Google_ShoppingModelCategoryJsonV1';
protected $__categoriesDataType = 'array';
public $categories;
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setProduct(Google_ShoppingModelProductJsonV1 $product) {
$this->product = $product;
}
public function getProduct() {
return $this->product;
}
public function setRequestId($requestId) {
$this->requestId = $requestId;
}
public function getRequestId() {
return $this->requestId;
}
public function setRecommendations(/* array(Google_ShoppingModelRecommendationsJsonV1) */ $recommendations) {
$this->assertIsArray($recommendations, 'Google_ShoppingModelRecommendationsJsonV1', __METHOD__);
$this->recommendations = $recommendations;
}
public function getRecommendations() {
return $this->recommendations;
}
public function setDebug(Google_ShoppingModelDebugJsonV1 $debug) {
$this->debug = $debug;
}
public function getDebug() {
return $this->debug;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCategories(/* array(Google_ShoppingModelCategoryJsonV1) */ $categories) {
$this->assertIsArray($categories, 'Google_ShoppingModelCategoryJsonV1', __METHOD__);
$this->categories = $categories;
}
public function getCategories() {
return $this->categories;
}
}
class Google_Products extends Google_Model {
protected $__promotionsType = 'Google_ProductsPromotions';
protected $__promotionsDataType = 'array';
public $promotions;
public $selfLink;
public $kind;
protected $__storesType = 'Google_ProductsStores';
protected $__storesDataType = 'array';
public $stores;
public $currentItemCount;
protected $__itemsType = 'Google_Product';
protected $__itemsDataType = 'array';
public $items;
protected $__facetsType = 'Google_ProductsFacets';
protected $__facetsDataType = 'array';
public $facets;
public $itemsPerPage;
public $redirects;
public $nextLink;
public $relatedQueries;
public $totalItems;
public $startIndex;
public $etag;
public $requestId;
protected $__categoryRecommendationsType = 'Google_ShoppingModelRecommendationsJsonV1';
protected $__categoryRecommendationsDataType = 'array';
public $categoryRecommendations;
protected $__debugType = 'Google_ShoppingModelDebugJsonV1';
protected $__debugDataType = '';
public $debug;
protected $__spellingType = 'Google_ProductsSpelling';
protected $__spellingDataType = '';
public $spelling;
public $previousLink;
public $id;
protected $__categoriesType = 'Google_ShoppingModelCategoryJsonV1';
protected $__categoriesDataType = 'array';
public $categories;
public function setPromotions(/* array(Google_ProductsPromotions) */ $promotions) {
$this->assertIsArray($promotions, 'Google_ProductsPromotions', __METHOD__);
$this->promotions = $promotions;
}
public function getPromotions() {
return $this->promotions;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStores(/* array(Google_ProductsStores) */ $stores) {
$this->assertIsArray($stores, 'Google_ProductsStores', __METHOD__);
$this->stores = $stores;
}
public function getStores() {
return $this->stores;
}
public function setCurrentItemCount($currentItemCount) {
$this->currentItemCount = $currentItemCount;
}
public function getCurrentItemCount() {
return $this->currentItemCount;
}
public function setItems(/* array(Google_Product) */ $items) {
$this->assertIsArray($items, 'Google_Product', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setFacets(/* array(Google_ProductsFacets) */ $facets) {
$this->assertIsArray($facets, 'Google_ProductsFacets', __METHOD__);
$this->facets = $facets;
}
public function getFacets() {
return $this->facets;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setRedirects(/* array(Google_string) */ $redirects) {
$this->assertIsArray($redirects, 'Google_string', __METHOD__);
$this->redirects = $redirects;
}
public function getRedirects() {
return $this->redirects;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setRelatedQueries(/* array(Google_string) */ $relatedQueries) {
$this->assertIsArray($relatedQueries, 'Google_string', __METHOD__);
$this->relatedQueries = $relatedQueries;
}
public function getRelatedQueries() {
return $this->relatedQueries;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setRequestId($requestId) {
$this->requestId = $requestId;
}
public function getRequestId() {
return $this->requestId;
}
public function setCategoryRecommendations(/* array(Google_ShoppingModelRecommendationsJsonV1) */ $categoryRecommendations) {
$this->assertIsArray($categoryRecommendations, 'Google_ShoppingModelRecommendationsJsonV1', __METHOD__);
$this->categoryRecommendations = $categoryRecommendations;
}
public function getCategoryRecommendations() {
return $this->categoryRecommendations;
}
public function setDebug(Google_ShoppingModelDebugJsonV1 $debug) {
$this->debug = $debug;
}
public function getDebug() {
return $this->debug;
}
public function setSpelling(Google_ProductsSpelling $spelling) {
$this->spelling = $spelling;
}
public function getSpelling() {
return $this->spelling;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setCategories(/* array(Google_ShoppingModelCategoryJsonV1) */ $categories) {
$this->assertIsArray($categories, 'Google_ShoppingModelCategoryJsonV1', __METHOD__);
$this->categories = $categories;
}
public function getCategories() {
return $this->categories;
}
}
class Google_ProductsFacets extends Google_Model {
public $count;
public $displayName;
public $name;
protected $__bucketsType = 'Google_ProductsFacetsBuckets';
protected $__bucketsDataType = 'array';
public $buckets;
public $property;
public $type;
public $unit;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setBuckets(/* array(Google_ProductsFacetsBuckets) */ $buckets) {
$this->assertIsArray($buckets, 'Google_ProductsFacetsBuckets', __METHOD__);
$this->buckets = $buckets;
}
public function getBuckets() {
return $this->buckets;
}
public function setProperty($property) {
$this->property = $property;
}
public function getProperty() {
return $this->property;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setUnit($unit) {
$this->unit = $unit;
}
public function getUnit() {
return $this->unit;
}
}
class Google_ProductsFacetsBuckets extends Google_Model {
public $count;
public $minExclusive;
public $min;
public $max;
public $value;
public $maxExclusive;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setMinExclusive($minExclusive) {
$this->minExclusive = $minExclusive;
}
public function getMinExclusive() {
return $this->minExclusive;
}
public function setMin($min) {
$this->min = $min;
}
public function getMin() {
return $this->min;
}
public function setMax($max) {
$this->max = $max;
}
public function getMax() {
return $this->max;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
public function setMaxExclusive($maxExclusive) {
$this->maxExclusive = $maxExclusive;
}
public function getMaxExclusive() {
return $this->maxExclusive;
}
}
class Google_ProductsPromotions extends Google_Model {
protected $__productType = 'Google_ShoppingModelProductJsonV1';
protected $__productDataType = '';
public $product;
public $description;
public $imageLink;
public $destLink;
public $customHtml;
protected $__customFieldsType = 'Google_ProductsPromotionsCustomFields';
protected $__customFieldsDataType = 'array';
public $customFields;
public $type;
public $name;
public function setProduct(Google_ShoppingModelProductJsonV1 $product) {
$this->product = $product;
}
public function getProduct() {
return $this->product;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setImageLink($imageLink) {
$this->imageLink = $imageLink;
}
public function getImageLink() {
return $this->imageLink;
}
public function setDestLink($destLink) {
$this->destLink = $destLink;
}
public function getDestLink() {
return $this->destLink;
}
public function setCustomHtml($customHtml) {
$this->customHtml = $customHtml;
}
public function getCustomHtml() {
return $this->customHtml;
}
public function setCustomFields(/* array(Google_ProductsPromotionsCustomFields) */ $customFields) {
$this->assertIsArray($customFields, 'Google_ProductsPromotionsCustomFields', __METHOD__);
$this->customFields = $customFields;
}
public function getCustomFields() {
return $this->customFields;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_ProductsPromotionsCustomFields extends Google_Model {
public $name;
public $value;
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
}
class Google_ProductsSpelling extends Google_Model {
public $suggestion;
public function setSuggestion($suggestion) {
$this->suggestion = $suggestion;
}
public function getSuggestion() {
return $this->suggestion;
}
}
class Google_ProductsStores extends Google_Model {
public $storeCode;
public $name;
public $storeName;
public $storeId;
public $telephone;
public $location;
public $address;
public function setStoreCode($storeCode) {
$this->storeCode = $storeCode;
}
public function getStoreCode() {
return $this->storeCode;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setStoreName($storeName) {
$this->storeName = $storeName;
}
public function getStoreName() {
return $this->storeName;
}
public function setStoreId($storeId) {
$this->storeId = $storeId;
}
public function getStoreId() {
return $this->storeId;
}
public function setTelephone($telephone) {
$this->telephone = $telephone;
}
public function getTelephone() {
return $this->telephone;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setAddress($address) {
$this->address = $address;
}
public function getAddress() {
return $this->address;
}
}
class Google_ShoppingModelCategoryJsonV1 extends Google_Model {
public $url;
public $shortName;
public $parents;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setShortName($shortName) {
$this->shortName = $shortName;
}
public function getShortName() {
return $this->shortName;
}
public function setParents(/* array(Google_string) */ $parents) {
$this->assertIsArray($parents, 'Google_string', __METHOD__);
$this->parents = $parents;
}
public function getParents() {
return $this->parents;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_ShoppingModelDebugJsonV1 extends Google_Model {
public $searchRequest;
public $rdcResponse;
public $facetsRequest;
public $searchResponse;
public $elapsedMillis;
public $facetsResponse;
protected $__backendTimesType = 'Google_ShoppingModelDebugJsonV1BackendTimes';
protected $__backendTimesDataType = 'array';
public $backendTimes;
public function setSearchRequest($searchRequest) {
$this->searchRequest = $searchRequest;
}
public function getSearchRequest() {
return $this->searchRequest;
}
public function setRdcResponse($rdcResponse) {
$this->rdcResponse = $rdcResponse;
}
public function getRdcResponse() {
return $this->rdcResponse;
}
public function setFacetsRequest($facetsRequest) {
$this->facetsRequest = $facetsRequest;
}
public function getFacetsRequest() {
return $this->facetsRequest;
}
public function setSearchResponse($searchResponse) {
$this->searchResponse = $searchResponse;
}
public function getSearchResponse() {
return $this->searchResponse;
}
public function setElapsedMillis($elapsedMillis) {
$this->elapsedMillis = $elapsedMillis;
}
public function getElapsedMillis() {
return $this->elapsedMillis;
}
public function setFacetsResponse($facetsResponse) {
$this->facetsResponse = $facetsResponse;
}
public function getFacetsResponse() {
return $this->facetsResponse;
}
public function setBackendTimes(/* array(Google_ShoppingModelDebugJsonV1BackendTimes) */ $backendTimes) {
$this->assertIsArray($backendTimes, 'Google_ShoppingModelDebugJsonV1BackendTimes', __METHOD__);
$this->backendTimes = $backendTimes;
}
public function getBackendTimes() {
return $this->backendTimes;
}
}
class Google_ShoppingModelDebugJsonV1BackendTimes extends Google_Model {
public $serverMillis;
public $hostName;
public $name;
public $elapsedMillis;
public function setServerMillis($serverMillis) {
$this->serverMillis = $serverMillis;
}
public function getServerMillis() {
return $this->serverMillis;
}
public function setHostName($hostName) {
$this->hostName = $hostName;
}
public function getHostName() {
return $this->hostName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setElapsedMillis($elapsedMillis) {
$this->elapsedMillis = $elapsedMillis;
}
public function getElapsedMillis() {
return $this->elapsedMillis;
}
}
class Google_ShoppingModelProductJsonV1 extends Google_Model {
public $queryMatched;
public $gtin;
protected $__imagesType = 'Google_ShoppingModelProductJsonV1Images';
protected $__imagesDataType = 'array';
public $images;
protected $__inventoriesType = 'Google_ShoppingModelProductJsonV1Inventories';
protected $__inventoriesDataType = 'array';
public $inventories;
protected $__authorType = 'Google_ShoppingModelProductJsonV1Author';
protected $__authorDataType = '';
public $author;
public $score;
public $condition;
public $providedId;
public $internal8;
public $description;
public $gtins;
public $internal1;
public $brand;
public $internal3;
protected $__internal4Type = 'Google_ShoppingModelProductJsonV1Internal4';
protected $__internal4DataType = 'array';
public $internal4;
public $internal6;
public $internal7;
public $link;
public $mpns;
protected $__attributesType = 'Google_ShoppingModelProductJsonV1Attributes';
protected $__attributesDataType = 'array';
public $attributes;
public $totalMatchingVariants;
protected $__variantsType = 'Google_ShoppingModelProductJsonV1Variants';
protected $__variantsDataType = 'array';
public $variants;
public $modificationTime;
public $categories;
public $language;
public $country;
public $title;
public $creationTime;
public $internal14;
public $internal12;
public $internal13;
public $internal10;
public $plusOne;
public $googleId;
public $internal15;
public function setQueryMatched($queryMatched) {
$this->queryMatched = $queryMatched;
}
public function getQueryMatched() {
return $this->queryMatched;
}
public function setGtin($gtin) {
$this->gtin = $gtin;
}
public function getGtin() {
return $this->gtin;
}
public function setImages(/* array(Google_ShoppingModelProductJsonV1Images) */ $images) {
$this->assertIsArray($images, 'Google_ShoppingModelProductJsonV1Images', __METHOD__);
$this->images = $images;
}
public function getImages() {
return $this->images;
}
public function setInventories(/* array(Google_ShoppingModelProductJsonV1Inventories) */ $inventories) {
$this->assertIsArray($inventories, 'Google_ShoppingModelProductJsonV1Inventories', __METHOD__);
$this->inventories = $inventories;
}
public function getInventories() {
return $this->inventories;
}
public function setAuthor(Google_ShoppingModelProductJsonV1Author $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setScore($score) {
$this->score = $score;
}
public function getScore() {
return $this->score;
}
public function setCondition($condition) {
$this->condition = $condition;
}
public function getCondition() {
return $this->condition;
}
public function setProvidedId($providedId) {
$this->providedId = $providedId;
}
public function getProvidedId() {
return $this->providedId;
}
public function setInternal8(/* array(Google_string) */ $internal8) {
$this->assertIsArray($internal8, 'Google_string', __METHOD__);
$this->internal8 = $internal8;
}
public function getInternal8() {
return $this->internal8;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setGtins(/* array(Google_string) */ $gtins) {
$this->assertIsArray($gtins, 'Google_string', __METHOD__);
$this->gtins = $gtins;
}
public function getGtins() {
return $this->gtins;
}
public function setInternal1(/* array(Google_string) */ $internal1) {
$this->assertIsArray($internal1, 'Google_string', __METHOD__);
$this->internal1 = $internal1;
}
public function getInternal1() {
return $this->internal1;
}
public function setBrand($brand) {
$this->brand = $brand;
}
public function getBrand() {
return $this->brand;
}
public function setInternal3($internal3) {
$this->internal3 = $internal3;
}
public function getInternal3() {
return $this->internal3;
}
public function setInternal4(/* array(Google_ShoppingModelProductJsonV1Internal4) */ $internal4) {
$this->assertIsArray($internal4, 'Google_ShoppingModelProductJsonV1Internal4', __METHOD__);
$this->internal4 = $internal4;
}
public function getInternal4() {
return $this->internal4;
}
public function setInternal6($internal6) {
$this->internal6 = $internal6;
}
public function getInternal6() {
return $this->internal6;
}
public function setInternal7($internal7) {
$this->internal7 = $internal7;
}
public function getInternal7() {
return $this->internal7;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setMpns(/* array(Google_string) */ $mpns) {
$this->assertIsArray($mpns, 'Google_string', __METHOD__);
$this->mpns = $mpns;
}
public function getMpns() {
return $this->mpns;
}
public function setAttributes(/* array(Google_ShoppingModelProductJsonV1Attributes) */ $attributes) {
$this->assertIsArray($attributes, 'Google_ShoppingModelProductJsonV1Attributes', __METHOD__);
$this->attributes = $attributes;
}
public function getAttributes() {
return $this->attributes;
}
public function setTotalMatchingVariants($totalMatchingVariants) {
$this->totalMatchingVariants = $totalMatchingVariants;
}
public function getTotalMatchingVariants() {
return $this->totalMatchingVariants;
}
public function setVariants(/* array(Google_ShoppingModelProductJsonV1Variants) */ $variants) {
$this->assertIsArray($variants, 'Google_ShoppingModelProductJsonV1Variants', __METHOD__);
$this->variants = $variants;
}
public function getVariants() {
return $this->variants;
}
public function setModificationTime($modificationTime) {
$this->modificationTime = $modificationTime;
}
public function getModificationTime() {
return $this->modificationTime;
}
public function setCategories(/* array(Google_string) */ $categories) {
$this->assertIsArray($categories, 'Google_string', __METHOD__);
$this->categories = $categories;
}
public function getCategories() {
return $this->categories;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setCountry($country) {
$this->country = $country;
}
public function getCountry() {
return $this->country;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setCreationTime($creationTime) {
$this->creationTime = $creationTime;
}
public function getCreationTime() {
return $this->creationTime;
}
public function setInternal14($internal14) {
$this->internal14 = $internal14;
}
public function getInternal14() {
return $this->internal14;
}
public function setInternal12($internal12) {
$this->internal12 = $internal12;
}
public function getInternal12() {
return $this->internal12;
}
public function setInternal13($internal13) {
$this->internal13 = $internal13;
}
public function getInternal13() {
return $this->internal13;
}
public function setInternal10(/* array(Google_string) */ $internal10) {
$this->assertIsArray($internal10, 'Google_string', __METHOD__);
$this->internal10 = $internal10;
}
public function getInternal10() {
return $this->internal10;
}
public function setPlusOne($plusOne) {
$this->plusOne = $plusOne;
}
public function getPlusOne() {
return $this->plusOne;
}
public function setGoogleId($googleId) {
$this->googleId = $googleId;
}
public function getGoogleId() {
return $this->googleId;
}
public function setInternal15($internal15) {
$this->internal15 = $internal15;
}
public function getInternal15() {
return $this->internal15;
}
}
class Google_ShoppingModelProductJsonV1Attributes extends Google_Model {
public $type;
public $value;
public $displayName;
public $name;
public $unit;
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;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setUnit($unit) {
$this->unit = $unit;
}
public function getUnit() {
return $this->unit;
}
}
class Google_ShoppingModelProductJsonV1Author extends Google_Model {
public $name;
public $accountId;
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_ShoppingModelProductJsonV1Images extends Google_Model {
public $status;
public $link;
protected $__thumbnailsType = 'Google_ShoppingModelProductJsonV1ImagesThumbnails';
protected $__thumbnailsDataType = 'array';
public $thumbnails;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setThumbnails(/* array(Google_ShoppingModelProductJsonV1ImagesThumbnails) */ $thumbnails) {
$this->assertIsArray($thumbnails, 'Google_ShoppingModelProductJsonV1ImagesThumbnails', __METHOD__);
$this->thumbnails = $thumbnails;
}
public function getThumbnails() {
return $this->thumbnails;
}
}
class Google_ShoppingModelProductJsonV1ImagesThumbnails extends Google_Model {
public $content;
public $width;
public $link;
public $height;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_ShoppingModelProductJsonV1Internal4 extends Google_Model {
public $node;
public $confidence;
public function setNode($node) {
$this->node = $node;
}
public function getNode() {
return $this->node;
}
public function setConfidence($confidence) {
$this->confidence = $confidence;
}
public function getConfidence() {
return $this->confidence;
}
}
class Google_ShoppingModelProductJsonV1Inventories extends Google_Model {
public $installmentPrice;
public $installmentMonths;
public $distance;
public $price;
public $storeId;
public $tax;
public $shipping;
public $currency;
public $salePrice;
public $originalPrice;
public $distanceUnit;
public $saleStartDate;
public $availability;
public $channel;
public $saleEndDate;
public function setInstallmentPrice($installmentPrice) {
$this->installmentPrice = $installmentPrice;
}
public function getInstallmentPrice() {
return $this->installmentPrice;
}
public function setInstallmentMonths($installmentMonths) {
$this->installmentMonths = $installmentMonths;
}
public function getInstallmentMonths() {
return $this->installmentMonths;
}
public function setDistance($distance) {
$this->distance = $distance;
}
public function getDistance() {
return $this->distance;
}
public function setPrice($price) {
$this->price = $price;
}
public function getPrice() {
return $this->price;
}
public function setStoreId($storeId) {
$this->storeId = $storeId;
}
public function getStoreId() {
return $this->storeId;
}
public function setTax($tax) {
$this->tax = $tax;
}
public function getTax() {
return $this->tax;
}
public function setShipping($shipping) {
$this->shipping = $shipping;
}
public function getShipping() {
return $this->shipping;
}
public function setCurrency($currency) {
$this->currency = $currency;
}
public function getCurrency() {
return $this->currency;
}
public function setSalePrice($salePrice) {
$this->salePrice = $salePrice;
}
public function getSalePrice() {
return $this->salePrice;
}
public function setOriginalPrice($originalPrice) {
$this->originalPrice = $originalPrice;
}
public function getOriginalPrice() {
return $this->originalPrice;
}
public function setDistanceUnit($distanceUnit) {
$this->distanceUnit = $distanceUnit;
}
public function getDistanceUnit() {
return $this->distanceUnit;
}
public function setSaleStartDate($saleStartDate) {
$this->saleStartDate = $saleStartDate;
}
public function getSaleStartDate() {
return $this->saleStartDate;
}
public function setAvailability($availability) {
$this->availability = $availability;
}
public function getAvailability() {
return $this->availability;
}
public function setChannel($channel) {
$this->channel = $channel;
}
public function getChannel() {
return $this->channel;
}
public function setSaleEndDate($saleEndDate) {
$this->saleEndDate = $saleEndDate;
}
public function getSaleEndDate() {
return $this->saleEndDate;
}
}
class Google_ShoppingModelProductJsonV1Variants extends Google_Model {
protected $__variantType = 'Google_ShoppingModelProductJsonV1';
protected $__variantDataType = '';
public $variant;
public function setVariant(Google_ShoppingModelProductJsonV1 $variant) {
$this->variant = $variant;
}
public function getVariant() {
return $this->variant;
}
}
class Google_ShoppingModelRecommendationsJsonV1 extends Google_Model {
protected $__recommendationListType = 'Google_ShoppingModelRecommendationsJsonV1RecommendationList';
protected $__recommendationListDataType = 'array';
public $recommendationList;
public $type;
public function setRecommendationList(/* array(Google_ShoppingModelRecommendationsJsonV1RecommendationList) */ $recommendationList) {
$this->assertIsArray($recommendationList, 'Google_ShoppingModelRecommendationsJsonV1RecommendationList', __METHOD__);
$this->recommendationList = $recommendationList;
}
public function getRecommendationList() {
return $this->recommendationList;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_ShoppingModelRecommendationsJsonV1RecommendationList extends Google_Model {
protected $__productType = 'Google_ShoppingModelProductJsonV1';
protected $__productDataType = '';
public $product;
public function setProduct(Google_ShoppingModelProductJsonV1 $product) {
$this->product = $product;
}
public function getProduct() {
return $this->product;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_ShoppingService.php | PHP | asf20 | 44,200 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "text" collection of methods.
* Typical usage is:
* <code>
* $freebaseService = new Google_FreebaseService(...);
* $text = $freebaseService->text;
* </code>
*/
class Google_TextServiceResource extends Google_ServiceResource {
/**
* Returns blob attached to node at specified id as HTML (text.get)
*
* @param string $id The id of the item that you want data about
* @param array $optParams Optional parameters.
*
* @opt_param string maxlength The max number of characters to return. Valid only for 'plain' format.
* @opt_param string format Sanitizing transformation.
* @return Google_ContentserviceGet
*/
public function get($id, $optParams = array()) {
$params = array('id' => $id);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_ContentserviceGet($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Freebase (v1).
*
* <p>
* Lets you access the Freebase repository of open data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://wiki.freebase.com/wiki/API" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_FreebaseService extends Google_Service {
public $text;
/**
* Constructs the internal representation of the Freebase service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'freebase/v1/';
$this->version = 'v1';
$this->serviceName = 'freebase';
$client->addService($this->serviceName, $this->version);
$this->text = new Google_TextServiceResource($this, $this->serviceName, 'text', json_decode('{"methods": {"get": {"httpMethod": "GET", "response": {"$ref": "ContentserviceGet"}, "id": "freebase.text.get", "parameters": {"maxlength": {"type": "integer", "location": "query", "format": "uint32"}, "id": {"repeated": true, "required": true, "type": "string", "location": "path"}, "format": {"default": "plain", "enum": ["html", "plain", "raw"], "type": "string", "location": "query"}}, "path": "text{/id*}"}}}', true));
}
}
class Google_ContentserviceGet extends Google_Model {
public $result;
public function setResult($result) {
$this->result = $result;
}
public function getResult() {
return $this->result;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_FreebaseService.php | PHP | asf20 | 3,056 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "webfonts" collection of methods.
* Typical usage is:
* <code>
* $webfontsService = new Google_WebfontsService(...);
* $webfonts = $webfontsService->webfonts;
* </code>
*/
class Google_WebfontsServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of fonts currently served by the Google Web Fonts Developer API
* (webfonts.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string sort Enables sorting of the list
* @return Google_WebfontList
*/
public function listWebfonts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_WebfontList($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Webfonts (v1).
*
* <p>
* The Google Web Fonts Developer API.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/webfonts/docs/developer_api.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_WebfontsService extends Google_Service {
public $webfonts;
/**
* Constructs the internal representation of the Webfonts service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'webfonts/v1/';
$this->version = 'v1';
$this->serviceName = 'webfonts';
$client->addService($this->serviceName, $this->version);
$this->webfonts = new Google_WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"httpMethod": "GET", "response": {"$ref": "WebfontList"}, "id": "webfonts.webfonts.list", "parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "path": "webfonts"}}}', true));
}
}
class Google_Webfont extends Google_Model {
public $kind;
public $variants;
public $subsets;
public $family;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setVariants($variants) {
$this->variants = $variants;
}
public function getVariants() {
return $this->variants;
}
public function setSubsets($subsets) {
$this->subsets = $subsets;
}
public function getSubsets() {
return $this->subsets;
}
public function setFamily($family) {
$this->family = $family;
}
public function getFamily() {
return $this->family;
}
}
class Google_WebfontList extends Google_Model {
protected $__itemsType = 'Google_Webfont';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Webfont) */ $items) {
$this->assertIsArray($items, 'Google_Webfont', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_WebfontsService.php | PHP | asf20 | 3,756 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "files" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $files = $driveService->files;
* </code>
*/
class Google_FilesServiceResource extends Google_ServiceResource {
/**
* Insert a new file. (files.insert)
*
* @param Google_DriveFile $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
* @opt_param string targetLanguage Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
* @opt_param string sourceLanguage The language of the original file to be translated.
* @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
* @opt_param bool pinned Whether to pin the head revision of the uploaded file.
* @opt_param bool ocr Whether to attempt OCR on .jpg, .png, or .gif uploads.
* @opt_param string timedTextTrackName The timed text track name.
* @opt_param string timedTextLanguage The language of the timed text.
* @return Google_DriveFile
*/
public function insert(Google_DriveFile $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Restores a file from the trash. (files.untrash)
*
* @param string $fileId The ID of the file to untrash.
* @param array $optParams Optional parameters.
* @return Google_DriveFile
*/
public function untrash($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('untrash', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Moves a file to the trash. (files.trash)
*
* @param string $fileId The ID of the file to trash.
* @param array $optParams Optional parameters.
* @return Google_DriveFile
*/
public function trash($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('trash', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Gets a file's metadata by ID. (files.get)
*
* @param string $fileId The ID for the file in question.
* @param array $optParams Optional parameters.
*
* @opt_param bool updateViewedDate Whether to update the view date after successfully retrieving the file.
* @opt_param string projection This parameter is deprecated and has no function.
* @return Google_DriveFile
*/
public function get($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Lists the user's files. (files.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string q Query string for searching files.
* @opt_param string pageToken Page token for files.
* @opt_param string projection This parameter is deprecated and has no function.
* @opt_param int maxResults Maximum number of files to return.
* @return Google_FileList
*/
public function listFiles($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_FileList($data);
} else {
return $data;
}
}
/**
* Updates file metadata and/or content (files.update)
*
* @param string $fileId The ID of the file to update.
* @param Google_DriveFile $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
* @opt_param string targetLanguage Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
* @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date.
* @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file.
* @opt_param string sourceLanguage The language of the original file to be translated.
* @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
* @opt_param bool pinned Whether to pin the new revision.
* @opt_param bool newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
* @opt_param bool ocr Whether to attempt OCR on .jpg, .png, or .gif uploads.
* @opt_param string timedTextLanguage The language of the timed text.
* @opt_param string timedTextTrackName The timed text track name.
* @return Google_DriveFile
*/
public function update($fileId, Google_DriveFile $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Updates file metadata and/or content. This method supports patch semantics. (files.patch)
*
* @param string $fileId The ID of the file to update.
* @param Google_DriveFile $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
* @opt_param string targetLanguage Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
* @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date.
* @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file.
* @opt_param string sourceLanguage The language of the original file to be translated.
* @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
* @opt_param bool pinned Whether to pin the new revision.
* @opt_param bool newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
* @opt_param bool ocr Whether to attempt OCR on .jpg, .png, or .gif uploads.
* @opt_param string timedTextLanguage The language of the timed text.
* @opt_param string timedTextTrackName The timed text track name.
* @return Google_DriveFile
*/
public function patch($fileId, Google_DriveFile $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Set the file's updated time to the current server time. (files.touch)
*
* @param string $fileId The ID of the file to update.
* @param array $optParams Optional parameters.
* @return Google_DriveFile
*/
public function touch($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('touch', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Creates a copy of the specified file. (files.copy)
*
* @param string $fileId The ID of the file to copy.
* @param Google_DriveFile $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
* @opt_param string targetLanguage Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
* @opt_param string sourceLanguage The language of the original file to be translated.
* @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
* @opt_param bool pinned Whether to pin the head revision of the new copy.
* @opt_param bool ocr Whether to attempt OCR on .jpg, .png, or .gif uploads.
* @opt_param string timedTextLanguage The language of the timed text.
* @opt_param string timedTextTrackName The timed text track name.
* @return Google_DriveFile
*/
public function copy($fileId, Google_DriveFile $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('copy', array($params));
if ($this->useObjects()) {
return new Google_DriveFile($data);
} else {
return $data;
}
}
/**
* Permanently deletes a file by ID. Skips the trash. (files.delete)
*
* @param string $fileId The ID of the file to delete.
* @param array $optParams Optional parameters.
*/
public function delete($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "about" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $about = $driveService->about;
* </code>
*/
class Google_AboutServiceResource extends Google_ServiceResource {
/**
* Gets the information about the current user along with Drive API settings (about.get)
*
* @param array $optParams Optional parameters.
*
* @opt_param bool includeSubscribed Whether to include subscribed items when calculating the number of remaining change IDs
* @opt_param string maxChangeIdCount Maximum number of remaining change IDs to count
* @opt_param string startChangeId Change ID to start counting from when calculating number of remaining change IDs
* @return Google_About
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_About($data);
} else {
return $data;
}
}
}
/**
* The "apps" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $apps = $driveService->apps;
* </code>
*/
class Google_AppsServiceResource extends Google_ServiceResource {
/**
* Lists a user's apps. (apps.list)
*
* @param array $optParams Optional parameters.
* @return Google_AppList
*/
public function listApps($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AppList($data);
} else {
return $data;
}
}
/**
* Gets a specific app. (apps.get)
*
* @param string $appId The ID of the app.
* @param array $optParams Optional parameters.
* @return Google_App
*/
public function get($appId, $optParams = array()) {
$params = array('appId' => $appId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_App($data);
} else {
return $data;
}
}
}
/**
* The "parents" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $parents = $driveService->parents;
* </code>
*/
class Google_ParentsServiceResource extends Google_ServiceResource {
/**
* Adds a parent folder for a file. (parents.insert)
*
* @param string $fileId The ID of the file.
* @param Google_ParentReference $postBody
* @param array $optParams Optional parameters.
* @return Google_ParentReference
*/
public function insert($fileId, Google_ParentReference $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_ParentReference($data);
} else {
return $data;
}
}
/**
* Gets a specific parent reference. (parents.get)
*
* @param string $fileId The ID of the file.
* @param string $parentId The ID of the parent.
* @param array $optParams Optional parameters.
* @return Google_ParentReference
*/
public function get($fileId, $parentId, $optParams = array()) {
$params = array('fileId' => $fileId, 'parentId' => $parentId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_ParentReference($data);
} else {
return $data;
}
}
/**
* Lists a file's parents. (parents.list)
*
* @param string $fileId The ID of the file.
* @param array $optParams Optional parameters.
* @return Google_ParentList
*/
public function listParents($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ParentList($data);
} else {
return $data;
}
}
/**
* Removes a parent from a file. (parents.delete)
*
* @param string $fileId The ID of the file.
* @param string $parentId The ID of the parent.
* @param array $optParams Optional parameters.
*/
public function delete($fileId, $parentId, $optParams = array()) {
$params = array('fileId' => $fileId, 'parentId' => $parentId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "revisions" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $revisions = $driveService->revisions;
* </code>
*/
class Google_RevisionsServiceResource extends Google_ServiceResource {
/**
* Updates a revision. This method supports patch semantics. (revisions.patch)
*
* @param string $fileId The ID for the file.
* @param string $revisionId The ID for the revision.
* @param Google_Revision $postBody
* @param array $optParams Optional parameters.
* @return Google_Revision
*/
public function patch($fileId, $revisionId, Google_Revision $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'revisionId' => $revisionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Revision($data);
} else {
return $data;
}
}
/**
* Gets a specific revision. (revisions.get)
*
* @param string $fileId The ID of the file.
* @param string $revisionId The ID of the revision.
* @param array $optParams Optional parameters.
* @return Google_Revision
*/
public function get($fileId, $revisionId, $optParams = array()) {
$params = array('fileId' => $fileId, 'revisionId' => $revisionId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Revision($data);
} else {
return $data;
}
}
/**
* Lists a file's revisions. (revisions.list)
*
* @param string $fileId The ID of the file.
* @param array $optParams Optional parameters.
* @return Google_RevisionList
*/
public function listRevisions($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_RevisionList($data);
} else {
return $data;
}
}
/**
* Updates a revision. (revisions.update)
*
* @param string $fileId The ID for the file.
* @param string $revisionId The ID for the revision.
* @param Google_Revision $postBody
* @param array $optParams Optional parameters.
* @return Google_Revision
*/
public function update($fileId, $revisionId, Google_Revision $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'revisionId' => $revisionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Revision($data);
} else {
return $data;
}
}
/**
* Removes a revision. (revisions.delete)
*
* @param string $fileId The ID of the file.
* @param string $revisionId The ID of the revision.
* @param array $optParams Optional parameters.
*/
public function delete($fileId, $revisionId, $optParams = array()) {
$params = array('fileId' => $fileId, 'revisionId' => $revisionId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "changes" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $changes = $driveService->changes;
* </code>
*/
class Google_ChangesServiceResource extends Google_ServiceResource {
/**
* Lists the changes for a user. (changes.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param bool includeSubscribed Whether to include subscribed items.
* @opt_param string startChangeId Change ID to start listing changes from.
* @opt_param bool includeDeleted Whether to include deleted items.
* @opt_param int maxResults Maximum number of changes to return.
* @opt_param string pageToken Page token for changes.
* @return Google_ChangeList
*/
public function listChanges($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ChangeList($data);
} else {
return $data;
}
}
/**
* Gets a specific change. (changes.get)
*
* @param string $changeId The ID of the change.
* @param array $optParams Optional parameters.
* @return Google_Change
*/
public function get($changeId, $optParams = array()) {
$params = array('changeId' => $changeId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Change($data);
} else {
return $data;
}
}
}
/**
* The "children" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $children = $driveService->children;
* </code>
*/
class Google_ChildrenServiceResource extends Google_ServiceResource {
/**
* Inserts a file into a folder. (children.insert)
*
* @param string $folderId The ID of the folder.
* @param Google_ChildReference $postBody
* @param array $optParams Optional parameters.
* @return Google_ChildReference
*/
public function insert($folderId, Google_ChildReference $postBody, $optParams = array()) {
$params = array('folderId' => $folderId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_ChildReference($data);
} else {
return $data;
}
}
/**
* Gets a specific child reference. (children.get)
*
* @param string $folderId The ID of the folder.
* @param string $childId The ID of the child.
* @param array $optParams Optional parameters.
* @return Google_ChildReference
*/
public function get($folderId, $childId, $optParams = array()) {
$params = array('folderId' => $folderId, 'childId' => $childId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_ChildReference($data);
} else {
return $data;
}
}
/**
* Lists a folder's children. (children.list)
*
* @param string $folderId The ID of the folder.
* @param array $optParams Optional parameters.
*
* @opt_param string q Query string for searching children.
* @opt_param string pageToken Page token for children.
* @opt_param int maxResults Maximum number of children to return.
* @return Google_ChildList
*/
public function listChildren($folderId, $optParams = array()) {
$params = array('folderId' => $folderId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ChildList($data);
} else {
return $data;
}
}
/**
* Removes a child from a folder. (children.delete)
*
* @param string $folderId The ID of the folder.
* @param string $childId The ID of the child.
* @param array $optParams Optional parameters.
*/
public function delete($folderId, $childId, $optParams = array()) {
$params = array('folderId' => $folderId, 'childId' => $childId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "permissions" collection of methods.
* Typical usage is:
* <code>
* $driveService = new Google_DriveService(...);
* $permissions = $driveService->permissions;
* </code>
*/
class Google_PermissionsServiceResource extends Google_ServiceResource {
/**
* Inserts a permission for a file. (permissions.insert)
*
* @param string $fileId The ID for the file.
* @param Google_Permission $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool sendNotificationEmails Whether to send notification emails.
* @return Google_Permission
*/
public function insert($fileId, Google_Permission $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Permission($data);
} else {
return $data;
}
}
/**
* Gets a permission by ID. (permissions.get)
*
* @param string $fileId The ID for the file.
* @param string $permissionId The ID for the permission.
* @param array $optParams Optional parameters.
* @return Google_Permission
*/
public function get($fileId, $permissionId, $optParams = array()) {
$params = array('fileId' => $fileId, 'permissionId' => $permissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Permission($data);
} else {
return $data;
}
}
/**
* Lists a file's permissions. (permissions.list)
*
* @param string $fileId The ID for the file.
* @param array $optParams Optional parameters.
* @return Google_PermissionList
*/
public function listPermissions($fileId, $optParams = array()) {
$params = array('fileId' => $fileId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PermissionList($data);
} else {
return $data;
}
}
/**
* Updates a permission. (permissions.update)
*
* @param string $fileId The ID for the file.
* @param string $permissionId The ID for the permission.
* @param Google_Permission $postBody
* @param array $optParams Optional parameters.
* @return Google_Permission
*/
public function update($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Permission($data);
} else {
return $data;
}
}
/**
* Updates a permission. This method supports patch semantics. (permissions.patch)
*
* @param string $fileId The ID for the file.
* @param string $permissionId The ID for the permission.
* @param Google_Permission $postBody
* @param array $optParams Optional parameters.
* @return Google_Permission
*/
public function patch($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) {
$params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Permission($data);
} else {
return $data;
}
}
/**
* Deletes a permission from a file. (permissions.delete)
*
* @param string $fileId The ID for the file.
* @param string $permissionId The ID for the permission.
* @param array $optParams Optional parameters.
*/
public function delete($fileId, $permissionId, $optParams = array()) {
$params = array('fileId' => $fileId, 'permissionId' => $permissionId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Drive (v2).
*
* <p>
* The API to interact with Drive.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/drive/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_DriveService extends Google_Service {
public $files;
public $about;
public $apps;
public $parents;
public $revisions;
public $changes;
public $children;
public $permissions;
/**
* Constructs the internal representation of the Drive service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'drive/v2/';
$this->version = 'v2';
$this->serviceName = 'drive';
$client->addService($this->serviceName, $this->version);
$this->files = new Google_FilesServiceResource($this, $this->serviceName, 'files', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"convert": {"default": "false", "type": "boolean", "location": "query"}, "targetLanguage": {"type": "string", "location": "query"}, "sourceLanguage": {"type": "string", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"default": "false", "type": "boolean", "location": "query"}, "ocr": {"default": "false", "type": "boolean", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}}, "supportsMediaUpload": true, "request": {"$ref": "File"}, "mediaUpload": {"maxSize": "10GB", "protocols": {"simple": {"path": "/upload/drive/v2/files", "multipart": true}, "resumable": {"path": "/resumable/upload/drive/v2/files", "multipart": true}}, "accept": ["*/*"]}, "response": {"$ref": "File"}, "httpMethod": "POST", "path": "files", "id": "drive.files.insert"}, "untrash": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.files.untrash", "httpMethod": "POST", "path": "files/{fileId}/untrash", "response": {"$ref": "File"}}, "trash": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.files.trash", "httpMethod": "POST", "path": "files/{fileId}/trash", "response": {"$ref": "File"}}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"updateViewedDate": {"default": "false", "type": "boolean", "location": "query"}, "projection": {"enum": ["BASIC", "FULL"], "type": "string", "location": "query"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.files.get", "httpMethod": "GET", "path": "files/{fileId}", "response": {"$ref": "File"}}, "list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"q": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "projection": {"enum": ["BASIC", "FULL"], "type": "string", "location": "query"}, "maxResults": {"default": "100", "minimum": "0", "type": "integer", "location": "query", "format": "int32"}}, "response": {"$ref": "FileList"}, "httpMethod": "GET", "path": "files", "id": "drive.files.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"convert": {"default": "false", "type": "boolean", "location": "query"}, "ocr": {"default": "false", "type": "boolean", "location": "query"}, "setModifiedDate": {"default": "false", "type": "boolean", "location": "query"}, "updateViewedDate": {"default": "true", "type": "boolean", "location": "query"}, "sourceLanguage": {"type": "string", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"default": "false", "type": "boolean", "location": "query"}, "newRevision": {"default": "true", "type": "boolean", "location": "query"}, "targetLanguage": {"type": "string", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "supportsMediaUpload": true, "request": {"$ref": "File"}, "mediaUpload": {"maxSize": "10GB", "protocols": {"simple": {"path": "/upload/drive/v2/files/{fileId}", "multipart": true}, "resumable": {"path": "/resumable/upload/drive/v2/files/{fileId}", "multipart": true}}, "accept": ["*/*"]}, "response": {"$ref": "File"}, "httpMethod": "PUT", "path": "files/{fileId}", "id": "drive.files.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"convert": {"default": "false", "type": "boolean", "location": "query"}, "ocr": {"default": "false", "type": "boolean", "location": "query"}, "setModifiedDate": {"default": "false", "type": "boolean", "location": "query"}, "updateViewedDate": {"default": "true", "type": "boolean", "location": "query"}, "sourceLanguage": {"type": "string", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"default": "false", "type": "boolean", "location": "query"}, "newRevision": {"default": "true", "type": "boolean", "location": "query"}, "targetLanguage": {"type": "string", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "httpMethod": "PATCH", "path": "files/{fileId}", "id": "drive.files.patch"}, "touch": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.files.touch", "httpMethod": "POST", "path": "files/{fileId}/touch", "response": {"$ref": "File"}}, "copy": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"convert": {"default": "false", "type": "boolean", "location": "query"}, "ocr": {"default": "false", "type": "boolean", "location": "query"}, "sourceLanguage": {"type": "string", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"default": "false", "type": "boolean", "location": "query"}, "targetLanguage": {"type": "string", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "httpMethod": "POST", "path": "files/{fileId}/copy", "id": "drive.files.copy"}, "delete": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "path": "files/{fileId}", "id": "drive.files.delete", "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->about = new Google_AboutServiceResource($this, $this->serviceName, 'about', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"includeSubscribed": {"default": "true", "type": "boolean", "location": "query"}, "maxChangeIdCount": {"default": "1", "type": "string", "location": "query", "format": "int64"}, "startChangeId": {"type": "string", "location": "query", "format": "int64"}}, "response": {"$ref": "About"}, "httpMethod": "GET", "path": "about", "id": "drive.about.get"}}}', true));
$this->apps = new Google_AppsServiceResource($this, $this->serviceName, 'apps', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/drive.apps.readonly"], "path": "apps", "response": {"$ref": "AppList"}, "id": "drive.apps.list", "httpMethod": "GET"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive.apps.readonly"], "parameters": {"appId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.apps.get", "httpMethod": "GET", "path": "apps/{appId}", "response": {"$ref": "App"}}}}', true));
$this->parents = new Google_ParentsServiceResource($this, $this->serviceName, 'parents', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "ParentReference"}, "response": {"$ref": "ParentReference"}, "httpMethod": "POST", "path": "files/{fileId}/parents", "id": "drive.parents.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"parentId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.parents.get", "httpMethod": "GET", "path": "files/{fileId}/parents/{parentId}", "response": {"$ref": "ParentReference"}}, "list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.parents.list", "httpMethod": "GET", "path": "files/{fileId}/parents", "response": {"$ref": "ParentList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "path": "files/{fileId}/parents/{parentId}", "id": "drive.parents.delete", "parameters": {"parentId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->revisions = new Google_RevisionsServiceResource($this, $this->serviceName, 'revisions', json_decode('{"methods": {"patch": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"revisionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Revision"}, "response": {"$ref": "Revision"}, "httpMethod": "PATCH", "path": "files/{fileId}/revisions/{revisionId}", "id": "drive.revisions.patch"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"revisionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.revisions.get", "httpMethod": "GET", "path": "files/{fileId}/revisions/{revisionId}", "response": {"$ref": "Revision"}}, "list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.revisions.list", "httpMethod": "GET", "path": "files/{fileId}/revisions", "response": {"$ref": "RevisionList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"revisionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Revision"}, "response": {"$ref": "Revision"}, "httpMethod": "PUT", "path": "files/{fileId}/revisions/{revisionId}", "id": "drive.revisions.update"}, "delete": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "path": "files/{fileId}/revisions/{revisionId}", "id": "drive.revisions.delete", "parameters": {"revisionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->changes = new Google_ChangesServiceResource($this, $this->serviceName, 'changes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"includeSubscribed": {"default": "true", "type": "boolean", "location": "query"}, "startChangeId": {"type": "string", "location": "query", "format": "int64"}, "includeDeleted": {"default": "true", "type": "boolean", "location": "query"}, "maxResults": {"default": "100", "minimum": "0", "type": "integer", "location": "query", "format": "int32"}, "pageToken": {"type": "string", "location": "query"}}, "response": {"$ref": "ChangeList"}, "httpMethod": "GET", "path": "changes", "id": "drive.changes.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"changeId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.changes.get", "httpMethod": "GET", "path": "changes/{changeId}", "response": {"$ref": "Change"}}}}', true));
$this->children = new Google_ChildrenServiceResource($this, $this->serviceName, 'children', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"folderId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "ChildReference"}, "response": {"$ref": "ChildReference"}, "httpMethod": "POST", "path": "files/{folderId}/children", "id": "drive.children.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"folderId": {"required": true, "type": "string", "location": "path"}, "childId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.children.get", "httpMethod": "GET", "path": "files/{folderId}/children/{childId}", "response": {"$ref": "ChildReference"}}, "list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"q": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "folderId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"default": "100", "minimum": "0", "type": "integer", "location": "query", "format": "int32"}}, "id": "drive.children.list", "httpMethod": "GET", "path": "files/{folderId}/children", "response": {"$ref": "ChildList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "path": "files/{folderId}/children/{childId}", "id": "drive.children.delete", "parameters": {"folderId": {"required": true, "type": "string", "location": "path"}, "childId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->permissions = new Google_PermissionsServiceResource($this, $this->serviceName, 'permissions', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"sendNotificationEmails": {"default": "true", "type": "boolean", "location": "query"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "httpMethod": "POST", "path": "files/{fileId}/permissions", "id": "drive.permissions.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"permissionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.permissions.get", "httpMethod": "GET", "path": "files/{fileId}/permissions/{permissionId}", "response": {"$ref": "Permission"}}, "list": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "parameters": {"fileId": {"required": true, "type": "string", "location": "path"}}, "id": "drive.permissions.list", "httpMethod": "GET", "path": "files/{fileId}/permissions", "response": {"$ref": "PermissionList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"permissionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "httpMethod": "PUT", "path": "files/{fileId}/permissions/{permissionId}", "id": "drive.permissions.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "parameters": {"permissionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "httpMethod": "PATCH", "path": "files/{fileId}/permissions/{permissionId}", "id": "drive.permissions.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "path": "files/{fileId}/permissions/{permissionId}", "id": "drive.permissions.delete", "parameters": {"permissionId": {"required": true, "type": "string", "location": "path"}, "fileId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_About extends Google_Model {
public $kind;
protected $__featuresType = 'Google_AboutFeatures';
protected $__featuresDataType = 'array';
public $features;
public $quotaBytesUsed;
public $permissionId;
protected $__maxUploadSizesType = 'Google_AboutMaxUploadSizes';
protected $__maxUploadSizesDataType = 'array';
public $maxUploadSizes;
public $name;
public $remainingChangeIds;
protected $__additionalRoleInfoType = 'Google_AboutAdditionalRoleInfo';
protected $__additionalRoleInfoDataType = 'array';
public $additionalRoleInfo;
public $etag;
protected $__importFormatsType = 'Google_AboutImportFormats';
protected $__importFormatsDataType = 'array';
public $importFormats;
public $quotaBytesTotal;
public $rootFolderId;
public $largestChangeId;
public $quotaBytesUsedInTrash;
protected $__exportFormatsType = 'Google_AboutExportFormats';
protected $__exportFormatsDataType = 'array';
public $exportFormats;
public $domainSharingPolicy;
public $selfLink;
public $isCurrentAppInstalled;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setFeatures(/* array(Google_AboutFeatures) */ $features) {
$this->assertIsArray($features, 'Google_AboutFeatures', __METHOD__);
$this->features = $features;
}
public function getFeatures() {
return $this->features;
}
public function setQuotaBytesUsed($quotaBytesUsed) {
$this->quotaBytesUsed = $quotaBytesUsed;
}
public function getQuotaBytesUsed() {
return $this->quotaBytesUsed;
}
public function setPermissionId($permissionId) {
$this->permissionId = $permissionId;
}
public function getPermissionId() {
return $this->permissionId;
}
public function setMaxUploadSizes(/* array(Google_AboutMaxUploadSizes) */ $maxUploadSizes) {
$this->assertIsArray($maxUploadSizes, 'Google_AboutMaxUploadSizes', __METHOD__);
$this->maxUploadSizes = $maxUploadSizes;
}
public function getMaxUploadSizes() {
return $this->maxUploadSizes;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setRemainingChangeIds($remainingChangeIds) {
$this->remainingChangeIds = $remainingChangeIds;
}
public function getRemainingChangeIds() {
return $this->remainingChangeIds;
}
public function setAdditionalRoleInfo(/* array(Google_AboutAdditionalRoleInfo) */ $additionalRoleInfo) {
$this->assertIsArray($additionalRoleInfo, 'Google_AboutAdditionalRoleInfo', __METHOD__);
$this->additionalRoleInfo = $additionalRoleInfo;
}
public function getAdditionalRoleInfo() {
return $this->additionalRoleInfo;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setImportFormats(/* array(Google_AboutImportFormats) */ $importFormats) {
$this->assertIsArray($importFormats, 'Google_AboutImportFormats', __METHOD__);
$this->importFormats = $importFormats;
}
public function getImportFormats() {
return $this->importFormats;
}
public function setQuotaBytesTotal($quotaBytesTotal) {
$this->quotaBytesTotal = $quotaBytesTotal;
}
public function getQuotaBytesTotal() {
return $this->quotaBytesTotal;
}
public function setRootFolderId($rootFolderId) {
$this->rootFolderId = $rootFolderId;
}
public function getRootFolderId() {
return $this->rootFolderId;
}
public function setLargestChangeId($largestChangeId) {
$this->largestChangeId = $largestChangeId;
}
public function getLargestChangeId() {
return $this->largestChangeId;
}
public function setQuotaBytesUsedInTrash($quotaBytesUsedInTrash) {
$this->quotaBytesUsedInTrash = $quotaBytesUsedInTrash;
}
public function getQuotaBytesUsedInTrash() {
return $this->quotaBytesUsedInTrash;
}
public function setExportFormats(/* array(Google_AboutExportFormats) */ $exportFormats) {
$this->assertIsArray($exportFormats, 'Google_AboutExportFormats', __METHOD__);
$this->exportFormats = $exportFormats;
}
public function getExportFormats() {
return $this->exportFormats;
}
public function setDomainSharingPolicy($domainSharingPolicy) {
$this->domainSharingPolicy = $domainSharingPolicy;
}
public function getDomainSharingPolicy() {
return $this->domainSharingPolicy;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setIsCurrentAppInstalled($isCurrentAppInstalled) {
$this->isCurrentAppInstalled = $isCurrentAppInstalled;
}
public function getIsCurrentAppInstalled() {
return $this->isCurrentAppInstalled;
}
}
class Google_AboutAdditionalRoleInfo extends Google_Model {
protected $__roleSetsType = 'Google_AboutAdditionalRoleInfoRoleSets';
protected $__roleSetsDataType = 'array';
public $roleSets;
public $type;
public function setRoleSets(/* array(Google_AboutAdditionalRoleInfoRoleSets) */ $roleSets) {
$this->assertIsArray($roleSets, 'Google_AboutAdditionalRoleInfoRoleSets', __METHOD__);
$this->roleSets = $roleSets;
}
public function getRoleSets() {
return $this->roleSets;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_AboutAdditionalRoleInfoRoleSets extends Google_Model {
public $primaryRole;
public $additionalRoles;
public function setPrimaryRole($primaryRole) {
$this->primaryRole = $primaryRole;
}
public function getPrimaryRole() {
return $this->primaryRole;
}
public function setAdditionalRoles(/* array(Google_string) */ $additionalRoles) {
$this->assertIsArray($additionalRoles, 'Google_string', __METHOD__);
$this->additionalRoles = $additionalRoles;
}
public function getAdditionalRoles() {
return $this->additionalRoles;
}
}
class Google_AboutExportFormats extends Google_Model {
public $source;
public $targets;
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setTargets(/* array(Google_string) */ $targets) {
$this->assertIsArray($targets, 'Google_string', __METHOD__);
$this->targets = $targets;
}
public function getTargets() {
return $this->targets;
}
}
class Google_AboutFeatures extends Google_Model {
public $featureName;
public $featureRate;
public function setFeatureName($featureName) {
$this->featureName = $featureName;
}
public function getFeatureName() {
return $this->featureName;
}
public function setFeatureRate($featureRate) {
$this->featureRate = $featureRate;
}
public function getFeatureRate() {
return $this->featureRate;
}
}
class Google_AboutImportFormats extends Google_Model {
public $source;
public $targets;
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setTargets(/* array(Google_string) */ $targets) {
$this->assertIsArray($targets, 'Google_string', __METHOD__);
$this->targets = $targets;
}
public function getTargets() {
return $this->targets;
}
}
class Google_AboutMaxUploadSizes extends Google_Model {
public $type;
public $size;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setSize($size) {
$this->size = $size;
}
public function getSize() {
return $this->size;
}
}
class Google_App extends Google_Model {
public $kind;
public $primaryFileExtensions;
public $useByDefault;
public $name;
protected $__iconsType = 'Google_AppIcons';
protected $__iconsDataType = 'array';
public $icons;
public $secondaryFileExtensions;
public $installed;
public $productUrl;
public $secondaryMimeTypes;
public $authorized;
public $supportsCreate;
public $supportsImport;
public $primaryMimeTypes;
public $id;
public $objectType;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPrimaryFileExtensions(/* array(Google_string) */ $primaryFileExtensions) {
$this->assertIsArray($primaryFileExtensions, 'Google_string', __METHOD__);
$this->primaryFileExtensions = $primaryFileExtensions;
}
public function getPrimaryFileExtensions() {
return $this->primaryFileExtensions;
}
public function setUseByDefault($useByDefault) {
$this->useByDefault = $useByDefault;
}
public function getUseByDefault() {
return $this->useByDefault;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setIcons(/* array(Google_AppIcons) */ $icons) {
$this->assertIsArray($icons, 'Google_AppIcons', __METHOD__);
$this->icons = $icons;
}
public function getIcons() {
return $this->icons;
}
public function setSecondaryFileExtensions(/* array(Google_string) */ $secondaryFileExtensions) {
$this->assertIsArray($secondaryFileExtensions, 'Google_string', __METHOD__);
$this->secondaryFileExtensions = $secondaryFileExtensions;
}
public function getSecondaryFileExtensions() {
return $this->secondaryFileExtensions;
}
public function setInstalled($installed) {
$this->installed = $installed;
}
public function getInstalled() {
return $this->installed;
}
public function setProductUrl($productUrl) {
$this->productUrl = $productUrl;
}
public function getProductUrl() {
return $this->productUrl;
}
public function setSecondaryMimeTypes(/* array(Google_string) */ $secondaryMimeTypes) {
$this->assertIsArray($secondaryMimeTypes, 'Google_string', __METHOD__);
$this->secondaryMimeTypes = $secondaryMimeTypes;
}
public function getSecondaryMimeTypes() {
return $this->secondaryMimeTypes;
}
public function setAuthorized($authorized) {
$this->authorized = $authorized;
}
public function getAuthorized() {
return $this->authorized;
}
public function setSupportsCreate($supportsCreate) {
$this->supportsCreate = $supportsCreate;
}
public function getSupportsCreate() {
return $this->supportsCreate;
}
public function setSupportsImport($supportsImport) {
$this->supportsImport = $supportsImport;
}
public function getSupportsImport() {
return $this->supportsImport;
}
public function setPrimaryMimeTypes(/* array(Google_string) */ $primaryMimeTypes) {
$this->assertIsArray($primaryMimeTypes, 'Google_string', __METHOD__);
$this->primaryMimeTypes = $primaryMimeTypes;
}
public function getPrimaryMimeTypes() {
return $this->primaryMimeTypes;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setObjectType($objectType) {
$this->objectType = $objectType;
}
public function getObjectType() {
return $this->objectType;
}
}
class Google_AppIcons extends Google_Model {
public $category;
public $iconUrl;
public $size;
public function setCategory($category) {
$this->category = $category;
}
public function getCategory() {
return $this->category;
}
public function setIconUrl($iconUrl) {
$this->iconUrl = $iconUrl;
}
public function getIconUrl() {
return $this->iconUrl;
}
public function setSize($size) {
$this->size = $size;
}
public function getSize() {
return $this->size;
}
}
class Google_AppList extends Google_Model {
protected $__itemsType = 'Google_App';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public $selfLink;
public function setItems(/* array(Google_App) */ $items) {
$this->assertIsArray($items, 'Google_App', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Change extends Google_Model {
public $kind;
public $deleted;
protected $__fileType = 'Google_DriveFile';
protected $__fileDataType = '';
public $file;
public $id;
public $selfLink;
public $fileId;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDeleted($deleted) {
$this->deleted = $deleted;
}
public function getDeleted() {
return $this->deleted;
}
public function setFile(Google_DriveFile $file) {
$this->file = $file;
}
public function getFile() {
return $this->file;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setFileId($fileId) {
$this->fileId = $fileId;
}
public function getFileId() {
return $this->fileId;
}
}
class Google_ChangeList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_Change';
protected $__itemsDataType = 'array';
public $items;
public $nextLink;
public $etag;
public $largestChangeId;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Change) */ $items) {
$this->assertIsArray($items, 'Google_Change', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setLargestChangeId($largestChangeId) {
$this->largestChangeId = $largestChangeId;
}
public function getLargestChangeId() {
return $this->largestChangeId;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ChildList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_ChildReference';
protected $__itemsDataType = 'array';
public $items;
public $nextLink;
public $etag;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_ChildReference) */ $items) {
$this->assertIsArray($items, 'Google_ChildReference', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ChildReference extends Google_Model {
public $kind;
public $childLink;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setChildLink($childLink) {
$this->childLink = $childLink;
}
public function getChildLink() {
return $this->childLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_DriveFile extends Google_Model {
public $mimeType;
public $thumbnailLink;
protected $__labelsType = 'Google_DriveFileLabels';
protected $__labelsDataType = '';
public $labels;
protected $__indexableTextType = 'Google_DriveFileIndexableText';
protected $__indexableTextDataType = '';
public $indexableText;
public $explicitlyTrashed;
public $etag;
public $lastModifyingUserName;
public $writersCanShare;
public $id;
public $title;
public $ownerNames;
public $sharedWithMeDate;
public $lastViewedByMeDate;
protected $__parentsType = 'Google_ParentReference';
protected $__parentsDataType = 'array';
public $parents;
public $exportLinks;
public $originalFilename;
public $description;
public $webContentLink;
public $editable;
public $kind;
public $quotaBytesUsed;
public $fileSize;
public $createdDate;
public $md5Checksum;
protected $__imageMediaMetadataType = 'Google_DriveFileImageMediaMetadata';
protected $__imageMediaMetadataDataType = '';
public $imageMediaMetadata;
public $embedLink;
public $alternateLink;
public $modifiedByMeDate;
public $downloadUrl;
protected $__userPermissionType = 'Google_Permission';
protected $__userPermissionDataType = '';
public $userPermission;
public $fileExtension;
public $selfLink;
public $modifiedDate;
public function setMimeType($mimeType) {
$this->mimeType = $mimeType;
}
public function getMimeType() {
return $this->mimeType;
}
public function setThumbnailLink($thumbnailLink) {
$this->thumbnailLink = $thumbnailLink;
}
public function getThumbnailLink() {
return $this->thumbnailLink;
}
public function setLabels(Google_DriveFileLabels $labels) {
$this->labels = $labels;
}
public function getLabels() {
return $this->labels;
}
public function setIndexableText(Google_DriveFileIndexableText $indexableText) {
$this->indexableText = $indexableText;
}
public function getIndexableText() {
return $this->indexableText;
}
public function setExplicitlyTrashed($explicitlyTrashed) {
$this->explicitlyTrashed = $explicitlyTrashed;
}
public function getExplicitlyTrashed() {
return $this->explicitlyTrashed;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setLastModifyingUserName($lastModifyingUserName) {
$this->lastModifyingUserName = $lastModifyingUserName;
}
public function getLastModifyingUserName() {
return $this->lastModifyingUserName;
}
public function setWritersCanShare($writersCanShare) {
$this->writersCanShare = $writersCanShare;
}
public function getWritersCanShare() {
return $this->writersCanShare;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setOwnerNames(/* array(Google_string) */ $ownerNames) {
$this->assertIsArray($ownerNames, 'Google_string', __METHOD__);
$this->ownerNames = $ownerNames;
}
public function getOwnerNames() {
return $this->ownerNames;
}
public function setSharedWithMeDate($sharedWithMeDate) {
$this->sharedWithMeDate = $sharedWithMeDate;
}
public function getSharedWithMeDate() {
return $this->sharedWithMeDate;
}
public function setLastViewedByMeDate($lastViewedByMeDate) {
$this->lastViewedByMeDate = $lastViewedByMeDate;
}
public function getLastViewedByMeDate() {
return $this->lastViewedByMeDate;
}
public function setParents(/* array(Google_ParentReference) */ $parents) {
$this->assertIsArray($parents, 'Google_ParentReference', __METHOD__);
$this->parents = $parents;
}
public function getParents() {
return $this->parents;
}
public function setExportLinks($exportLinks) {
$this->exportLinks = $exportLinks;
}
public function getExportLinks() {
return $this->exportLinks;
}
public function setOriginalFilename($originalFilename) {
$this->originalFilename = $originalFilename;
}
public function getOriginalFilename() {
return $this->originalFilename;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setWebContentLink($webContentLink) {
$this->webContentLink = $webContentLink;
}
public function getWebContentLink() {
return $this->webContentLink;
}
public function setEditable($editable) {
$this->editable = $editable;
}
public function getEditable() {
return $this->editable;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setQuotaBytesUsed($quotaBytesUsed) {
$this->quotaBytesUsed = $quotaBytesUsed;
}
public function getQuotaBytesUsed() {
return $this->quotaBytesUsed;
}
public function setFileSize($fileSize) {
$this->fileSize = $fileSize;
}
public function getFileSize() {
return $this->fileSize;
}
public function setCreatedDate($createdDate) {
$this->createdDate = $createdDate;
}
public function getCreatedDate() {
return $this->createdDate;
}
public function setMd5Checksum($md5Checksum) {
$this->md5Checksum = $md5Checksum;
}
public function getMd5Checksum() {
return $this->md5Checksum;
}
public function setImageMediaMetadata(Google_DriveFileImageMediaMetadata $imageMediaMetadata) {
$this->imageMediaMetadata = $imageMediaMetadata;
}
public function getImageMediaMetadata() {
return $this->imageMediaMetadata;
}
public function setEmbedLink($embedLink) {
$this->embedLink = $embedLink;
}
public function getEmbedLink() {
return $this->embedLink;
}
public function setAlternateLink($alternateLink) {
$this->alternateLink = $alternateLink;
}
public function getAlternateLink() {
return $this->alternateLink;
}
public function setModifiedByMeDate($modifiedByMeDate) {
$this->modifiedByMeDate = $modifiedByMeDate;
}
public function getModifiedByMeDate() {
return $this->modifiedByMeDate;
}
public function setDownloadUrl($downloadUrl) {
$this->downloadUrl = $downloadUrl;
}
public function getDownloadUrl() {
return $this->downloadUrl;
}
public function setUserPermission(Google_Permission $userPermission) {
$this->userPermission = $userPermission;
}
public function getUserPermission() {
return $this->userPermission;
}
public function setFileExtension($fileExtension) {
$this->fileExtension = $fileExtension;
}
public function getFileExtension() {
return $this->fileExtension;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setModifiedDate($modifiedDate) {
$this->modifiedDate = $modifiedDate;
}
public function getModifiedDate() {
return $this->modifiedDate;
}
}
class Google_DriveFileImageMediaMetadata extends Google_Model {
public $width;
public $rotation;
protected $__locationType = 'Google_DriveFileImageMediaMetadataLocation';
protected $__locationDataType = '';
public $location;
public $height;
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setRotation($rotation) {
$this->rotation = $rotation;
}
public function getRotation() {
return $this->rotation;
}
public function setLocation(Google_DriveFileImageMediaMetadataLocation $location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_DriveFileImageMediaMetadataLocation extends Google_Model {
public $latitude;
public $altitude;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setAltitude($altitude) {
$this->altitude = $altitude;
}
public function getAltitude() {
return $this->altitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_DriveFileIndexableText extends Google_Model {
public $text;
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
}
class Google_DriveFileLabels extends Google_Model {
public $restricted;
public $hidden;
public $viewed;
public $starred;
public $trashed;
public function setRestricted($restricted) {
$this->restricted = $restricted;
}
public function getRestricted() {
return $this->restricted;
}
public function setHidden($hidden) {
$this->hidden = $hidden;
}
public function getHidden() {
return $this->hidden;
}
public function setViewed($viewed) {
$this->viewed = $viewed;
}
public function getViewed() {
return $this->viewed;
}
public function setStarred($starred) {
$this->starred = $starred;
}
public function getStarred() {
return $this->starred;
}
public function setTrashed($trashed) {
$this->trashed = $trashed;
}
public function getTrashed() {
return $this->trashed;
}
}
class Google_FileList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__itemsType = 'Google_DriveFile';
protected $__itemsDataType = 'array';
public $items;
public $nextLink;
public $etag;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_DriveFile) */ $items) {
$this->assertIsArray($items, 'Google_DriveFile', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ParentList extends Google_Model {
protected $__itemsType = 'Google_ParentReference';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public $selfLink;
public function setItems(/* array(Google_ParentReference) */ $items) {
$this->assertIsArray($items, 'Google_ParentReference', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ParentReference extends Google_Model {
public $selfLink;
public $kind;
public $id;
public $isRoot;
public $parentLink;
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setIsRoot($isRoot) {
$this->isRoot = $isRoot;
}
public function getIsRoot() {
return $this->isRoot;
}
public function setParentLink($parentLink) {
$this->parentLink = $parentLink;
}
public function getParentLink() {
return $this->parentLink;
}
}
class Google_Permission extends Google_Model {
public $withLink;
public $kind;
public $name;
public $value;
public $id;
public $authKey;
public $etag;
public $role;
public $photoLink;
public $type;
public $additionalRoles;
public $selfLink;
public function setWithLink($withLink) {
$this->withLink = $withLink;
}
public function getWithLink() {
return $this->withLink;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAuthKey($authKey) {
$this->authKey = $authKey;
}
public function getAuthKey() {
return $this->authKey;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setRole($role) {
$this->role = $role;
}
public function getRole() {
return $this->role;
}
public function setPhotoLink($photoLink) {
$this->photoLink = $photoLink;
}
public function getPhotoLink() {
return $this->photoLink;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setAdditionalRoles(/* array(Google_string) */ $additionalRoles) {
$this->assertIsArray($additionalRoles, 'Google_string', __METHOD__);
$this->additionalRoles = $additionalRoles;
}
public function getAdditionalRoles() {
return $this->additionalRoles;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_PermissionList extends Google_Model {
protected $__itemsType = 'Google_Permission';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public $selfLink;
public function setItems(/* array(Google_Permission) */ $items) {
$this->assertIsArray($items, 'Google_Permission', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Revision extends Google_Model {
public $mimeType;
public $pinned;
public $kind;
public $publishedLink;
public $publishedOutsideDomain;
public $publishAuto;
public $published;
public $downloadUrl;
public $selfLink;
public $etag;
public $fileSize;
public $exportLinks;
public $lastModifyingUserName;
public $originalFilename;
public $id;
public $md5Checksum;
public $modifiedDate;
public function setMimeType($mimeType) {
$this->mimeType = $mimeType;
}
public function getMimeType() {
return $this->mimeType;
}
public function setPinned($pinned) {
$this->pinned = $pinned;
}
public function getPinned() {
return $this->pinned;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPublishedLink($publishedLink) {
$this->publishedLink = $publishedLink;
}
public function getPublishedLink() {
return $this->publishedLink;
}
public function setPublishedOutsideDomain($publishedOutsideDomain) {
$this->publishedOutsideDomain = $publishedOutsideDomain;
}
public function getPublishedOutsideDomain() {
return $this->publishedOutsideDomain;
}
public function setPublishAuto($publishAuto) {
$this->publishAuto = $publishAuto;
}
public function getPublishAuto() {
return $this->publishAuto;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setDownloadUrl($downloadUrl) {
$this->downloadUrl = $downloadUrl;
}
public function getDownloadUrl() {
return $this->downloadUrl;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setFileSize($fileSize) {
$this->fileSize = $fileSize;
}
public function getFileSize() {
return $this->fileSize;
}
public function setExportLinks($exportLinks) {
$this->exportLinks = $exportLinks;
}
public function getExportLinks() {
return $this->exportLinks;
}
public function setLastModifyingUserName($lastModifyingUserName) {
$this->lastModifyingUserName = $lastModifyingUserName;
}
public function getLastModifyingUserName() {
return $this->lastModifyingUserName;
}
public function setOriginalFilename($originalFilename) {
$this->originalFilename = $originalFilename;
}
public function getOriginalFilename() {
return $this->originalFilename;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setMd5Checksum($md5Checksum) {
$this->md5Checksum = $md5Checksum;
}
public function getMd5Checksum() {
return $this->md5Checksum;
}
public function setModifiedDate($modifiedDate) {
$this->modifiedDate = $modifiedDate;
}
public function getModifiedDate() {
return $this->modifiedDate;
}
}
class Google_RevisionList extends Google_Model {
protected $__itemsType = 'Google_Revision';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public $selfLink;
public function setItems(/* array(Google_Revision) */ $items) {
$this->assertIsArray($items, 'Google_Revision', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_DriveService.php | PHP | asf20 | 83,277 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "management" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $management = $analyticsService->management;
* </code>
*/
class Google_ManagementServiceResource extends Google_ServiceResource {
}
/**
* The "webproperties" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $webproperties = $analyticsService->webproperties;
* </code>
*/
class Google_ManagementWebpropertiesServiceResource extends Google_ServiceResource {
/**
* Lists web properties to which the user has access. (webproperties.list)
*
* @param string $accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of web properties to include in this response.
* @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @return Google_Webproperties
*/
public function listManagementWebproperties($accountId, $optParams = array()) {
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Webproperties($data);
} else {
return $data;
}
}
}
/**
* The "segments" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $segments = $analyticsService->segments;
* </code>
*/
class Google_ManagementSegmentsServiceResource extends Google_ServiceResource {
/**
* Lists advanced segments to which the user has access. (segments.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of advanced segments to include in this response.
* @opt_param int start-index An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @return Google_Segments
*/
public function listManagementSegments($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Segments($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $accounts = $analyticsService->accounts;
* </code>
*/
class Google_ManagementAccountsServiceResource extends Google_ServiceResource {
/**
* Lists all accounts to which the user has access. (accounts.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of accounts to include in this response.
* @opt_param int start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @return Google_Accounts
*/
public function listManagementAccounts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Accounts($data);
} else {
return $data;
}
}
}
/**
* The "goals" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $goals = $analyticsService->goals;
* </code>
*/
class Google_ManagementGoalsServiceResource extends Google_ServiceResource {
/**
* Lists goals to which the user has access. (goals.list)
*
* @param string $accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.
* @param string $webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.
* @param string $profileId Profile ID to retrieve goals for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of goals to include in this response.
* @opt_param int start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @return Google_Goals
*/
public function listManagementGoals($accountId, $webPropertyId, $profileId, $optParams = array()) {
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Goals($data);
} else {
return $data;
}
}
}
/**
* The "profiles" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $profiles = $analyticsService->profiles;
* </code>
*/
class Google_ManagementProfilesServiceResource extends Google_ServiceResource {
/**
* Lists profiles to which the user has access. (profiles.list)
*
* @param string $accountId Account ID for the profiles to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.
* @param string $webPropertyId Web property ID for the profiles to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access.
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of profiles to include in this response.
* @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @return Google_Profiles
*/
public function listManagementProfiles($accountId, $webPropertyId, $optParams = array()) {
$params = array('accountId' => $accountId, 'webPropertyId' => $webPropertyId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Profiles($data);
} else {
return $data;
}
}
}
/**
* The "data" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $data = $analyticsService->data;
* </code>
*/
class Google_DataServiceResource extends Google_ServiceResource {
}
/**
* The "mcf" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $mcf = $analyticsService->mcf;
* </code>
*/
class Google_DataMcfServiceResource extends Google_ServiceResource {
/**
* Returns Analytics Multi-Channel Funnels data for a profile. (mcf.get)
*
* @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics profile ID.
* @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD.
* @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD.
* @param string $metrics A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of entries to include in this feed.
* @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.
* @opt_param string dimensions A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.
* @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @opt_param string filters A comma-separated list of dimension or metric filters to be applied to the Analytics data.
* @return Google_McfData
*/
public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) {
$params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_McfData($data);
} else {
return $data;
}
}
}
/**
* The "ga" collection of methods.
* Typical usage is:
* <code>
* $analyticsService = new Google_AnalyticsService(...);
* $ga = $analyticsService->ga;
* </code>
*/
class Google_DataGaServiceResource extends Google_ServiceResource {
/**
* Returns Analytics data for a profile. (ga.get)
*
* @param string $ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics profile ID.
* @param string $start_date Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD.
* @param string $end_date End date for fetching Analytics data. All requests should specify an end date formatted as YYYY-MM-DD.
* @param string $metrics A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified.
* @param array $optParams Optional parameters.
*
* @opt_param int max-results The maximum number of entries to include in this feed.
* @opt_param string sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.
* @opt_param string dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.
* @opt_param int start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
* @opt_param string segment An Analytics advanced segment to be applied to data.
* @opt_param string filters A comma-separated list of dimension or metric filters to be applied to Analytics data.
* @return Google_GaData
*/
public function get($ids, $start_date, $end_date, $metrics, $optParams = array()) {
$params = array('ids' => $ids, 'start-date' => $start_date, 'end-date' => $end_date, 'metrics' => $metrics);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_GaData($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Analytics (v3).
*
* <p>
* View and manage your Google Analytics data
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/analytics" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AnalyticsService extends Google_Service {
public $management_webproperties;
public $management_segments;
public $management_accounts;
public $management_goals;
public $management_profiles;
public $data_mcf;
public $data_ga;
/**
* Constructs the internal representation of the Analytics service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'analytics/v3/';
$this->version = 'v3';
$this->serviceName = 'analytics';
$client->addService($this->serviceName, $this->version);
$this->management_webproperties = new Google_ManagementWebpropertiesServiceResource($this, $this->serviceName, 'webproperties', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "analytics.management.webproperties.list", "httpMethod": "GET", "path": "management/accounts/{accountId}/webproperties", "response": {"$ref": "Webproperties"}}}}', true));
$this->management_segments = new Google_ManagementSegmentsServiceResource($this, $this->serviceName, 'segments', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}}, "response": {"$ref": "Segments"}, "httpMethod": "GET", "path": "management/segments", "id": "analytics.management.segments.list"}}}', true));
$this->management_accounts = new Google_ManagementAccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}}, "response": {"$ref": "Accounts"}, "httpMethod": "GET", "path": "management/accounts", "id": "analytics.management.accounts.list"}}}', true));
$this->management_goals = new Google_ManagementGoalsServiceResource($this, $this->serviceName, 'goals', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "profileId": {"required": true, "type": "string", "location": "path"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "webPropertyId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "analytics.management.goals.list", "httpMethod": "GET", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", "response": {"$ref": "Goals"}}}}', true));
$this->management_profiles = new Google_ManagementProfilesServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "webPropertyId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "analytics.management.profiles.list", "httpMethod": "GET", "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", "response": {"$ref": "Profiles"}}}}', true));
$this->data_mcf = new Google_DataMcfServiceResource($this, $this->serviceName, 'mcf', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "sort": {"type": "string", "location": "query"}, "dimensions": {"type": "string", "location": "query"}, "start-date": {"required": true, "type": "string", "location": "query"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "ids": {"required": true, "type": "string", "location": "query"}, "metrics": {"required": true, "type": "string", "location": "query"}, "filters": {"type": "string", "location": "query"}, "end-date": {"required": true, "type": "string", "location": "query"}}, "id": "analytics.data.mcf.get", "httpMethod": "GET", "path": "data/mcf", "response": {"$ref": "McfData"}}}}', true));
$this->data_ga = new Google_DataGaServiceResource($this, $this->serviceName, 'ga', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/analytics.readonly"], "parameters": {"max-results": {"type": "integer", "location": "query", "format": "int32"}, "sort": {"type": "string", "location": "query"}, "dimensions": {"type": "string", "location": "query"}, "start-date": {"required": true, "type": "string", "location": "query"}, "start-index": {"minimum": "1", "type": "integer", "location": "query", "format": "int32"}, "segment": {"type": "string", "location": "query"}, "ids": {"required": true, "type": "string", "location": "query"}, "metrics": {"required": true, "type": "string", "location": "query"}, "filters": {"type": "string", "location": "query"}, "end-date": {"required": true, "type": "string", "location": "query"}}, "id": "analytics.data.ga.get", "httpMethod": "GET", "path": "data/ga", "response": {"$ref": "GaData"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $kind;
public $name;
public $created;
public $updated;
protected $__childLinkType = 'Google_AccountChildLink';
protected $__childLinkDataType = '';
public $childLink;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setChildLink(Google_AccountChildLink $childLink) {
$this->childLink = $childLink;
}
public function getChildLink() {
return $this->childLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_AccountChildLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_Accounts extends Google_Model {
public $username;
public $kind;
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $itemsPerPage;
public $previousLink;
public $startIndex;
public $nextLink;
public $totalResults;
public function setUsername($username) {
$this->username = $username;
}
public function getUsername() {
return $this->username;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Account) */ $items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
}
class Google_GaData extends Google_Model {
public $kind;
public $rows;
public $containsSampledData;
public $totalResults;
public $itemsPerPage;
public $totalsForAllResults;
public $nextLink;
public $id;
protected $__queryType = 'Google_GaDataQuery';
protected $__queryDataType = '';
public $query;
public $previousLink;
protected $__profileInfoType = 'Google_GaDataProfileInfo';
protected $__profileInfoDataType = '';
public $profileInfo;
protected $__columnHeadersType = 'Google_GaDataColumnHeaders';
protected $__columnHeadersDataType = 'array';
public $columnHeaders;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows(/* array(Google_string) */ $rows) {
$this->assertIsArray($rows, 'Google_string', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setContainsSampledData($containsSampledData) {
$this->containsSampledData = $containsSampledData;
}
public function getContainsSampledData() {
return $this->containsSampledData;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setTotalsForAllResults($totalsForAllResults) {
$this->totalsForAllResults = $totalsForAllResults;
}
public function getTotalsForAllResults() {
return $this->totalsForAllResults;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setQuery(Google_GaDataQuery $query) {
$this->query = $query;
}
public function getQuery() {
return $this->query;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setProfileInfo(Google_GaDataProfileInfo $profileInfo) {
$this->profileInfo = $profileInfo;
}
public function getProfileInfo() {
return $this->profileInfo;
}
public function setColumnHeaders(/* array(Google_GaDataColumnHeaders) */ $columnHeaders) {
$this->assertIsArray($columnHeaders, 'Google_GaDataColumnHeaders', __METHOD__);
$this->columnHeaders = $columnHeaders;
}
public function getColumnHeaders() {
return $this->columnHeaders;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_GaDataColumnHeaders extends Google_Model {
public $dataType;
public $columnType;
public $name;
public function setDataType($dataType) {
$this->dataType = $dataType;
}
public function getDataType() {
return $this->dataType;
}
public function setColumnType($columnType) {
$this->columnType = $columnType;
}
public function getColumnType() {
return $this->columnType;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_GaDataProfileInfo extends Google_Model {
public $webPropertyId;
public $internalWebPropertyId;
public $tableId;
public $profileId;
public $profileName;
public $accountId;
public function setWebPropertyId($webPropertyId) {
$this->webPropertyId = $webPropertyId;
}
public function getWebPropertyId() {
return $this->webPropertyId;
}
public function setInternalWebPropertyId($internalWebPropertyId) {
$this->internalWebPropertyId = $internalWebPropertyId;
}
public function getInternalWebPropertyId() {
return $this->internalWebPropertyId;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setProfileId($profileId) {
$this->profileId = $profileId;
}
public function getProfileId() {
return $this->profileId;
}
public function setProfileName($profileName) {
$this->profileName = $profileName;
}
public function getProfileName() {
return $this->profileName;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_GaDataQuery extends Google_Model {
public $max_results;
public $sort;
public $dimensions;
public $start_date;
public $start_index;
public $segment;
public $ids;
public $metrics;
public $filters;
public $end_date;
public function setMax_results($max_results) {
$this->max_results = $max_results;
}
public function getMax_results() {
return $this->max_results;
}
public function setSort(/* array(Google_string) */ $sort) {
$this->assertIsArray($sort, 'Google_string', __METHOD__);
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setDimensions($dimensions) {
$this->dimensions = $dimensions;
}
public function getDimensions() {
return $this->dimensions;
}
public function setStart_date($start_date) {
$this->start_date = $start_date;
}
public function getStart_date() {
return $this->start_date;
}
public function setStart_index($start_index) {
$this->start_index = $start_index;
}
public function getStart_index() {
return $this->start_index;
}
public function setSegment($segment) {
$this->segment = $segment;
}
public function getSegment() {
return $this->segment;
}
public function setIds($ids) {
$this->ids = $ids;
}
public function getIds() {
return $this->ids;
}
public function setMetrics(/* array(Google_string) */ $metrics) {
$this->assertIsArray($metrics, 'Google_string', __METHOD__);
$this->metrics = $metrics;
}
public function getMetrics() {
return $this->metrics;
}
public function setFilters($filters) {
$this->filters = $filters;
}
public function getFilters() {
return $this->filters;
}
public function setEnd_date($end_date) {
$this->end_date = $end_date;
}
public function getEnd_date() {
return $this->end_date;
}
}
class Google_Goal extends Google_Model {
public $kind;
protected $__visitTimeOnSiteDetailsType = 'Google_GoalVisitTimeOnSiteDetails';
protected $__visitTimeOnSiteDetailsDataType = '';
public $visitTimeOnSiteDetails;
public $name;
public $created;
protected $__urlDestinationDetailsType = 'Google_GoalUrlDestinationDetails';
protected $__urlDestinationDetailsDataType = '';
public $urlDestinationDetails;
public $updated;
public $value;
protected $__visitNumPagesDetailsType = 'Google_GoalVisitNumPagesDetails';
protected $__visitNumPagesDetailsDataType = '';
public $visitNumPagesDetails;
public $internalWebPropertyId;
protected $__eventDetailsType = 'Google_GoalEventDetails';
protected $__eventDetailsDataType = '';
public $eventDetails;
public $webPropertyId;
public $active;
public $profileId;
protected $__parentLinkType = 'Google_GoalParentLink';
protected $__parentLinkDataType = '';
public $parentLink;
public $type;
public $id;
public $selfLink;
public $accountId;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setVisitTimeOnSiteDetails(Google_GoalVisitTimeOnSiteDetails $visitTimeOnSiteDetails) {
$this->visitTimeOnSiteDetails = $visitTimeOnSiteDetails;
}
public function getVisitTimeOnSiteDetails() {
return $this->visitTimeOnSiteDetails;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setUrlDestinationDetails(Google_GoalUrlDestinationDetails $urlDestinationDetails) {
$this->urlDestinationDetails = $urlDestinationDetails;
}
public function getUrlDestinationDetails() {
return $this->urlDestinationDetails;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
public function setVisitNumPagesDetails(Google_GoalVisitNumPagesDetails $visitNumPagesDetails) {
$this->visitNumPagesDetails = $visitNumPagesDetails;
}
public function getVisitNumPagesDetails() {
return $this->visitNumPagesDetails;
}
public function setInternalWebPropertyId($internalWebPropertyId) {
$this->internalWebPropertyId = $internalWebPropertyId;
}
public function getInternalWebPropertyId() {
return $this->internalWebPropertyId;
}
public function setEventDetails(Google_GoalEventDetails $eventDetails) {
$this->eventDetails = $eventDetails;
}
public function getEventDetails() {
return $this->eventDetails;
}
public function setWebPropertyId($webPropertyId) {
$this->webPropertyId = $webPropertyId;
}
public function getWebPropertyId() {
return $this->webPropertyId;
}
public function setActive($active) {
$this->active = $active;
}
public function getActive() {
return $this->active;
}
public function setProfileId($profileId) {
$this->profileId = $profileId;
}
public function getProfileId() {
return $this->profileId;
}
public function setParentLink(Google_GoalParentLink $parentLink) {
$this->parentLink = $parentLink;
}
public function getParentLink() {
return $this->parentLink;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_GoalEventDetails extends Google_Model {
protected $__eventConditionsType = 'Google_GoalEventDetailsEventConditions';
protected $__eventConditionsDataType = 'array';
public $eventConditions;
public $useEventValue;
public function setEventConditions(/* array(Google_GoalEventDetailsEventConditions) */ $eventConditions) {
$this->assertIsArray($eventConditions, 'Google_GoalEventDetailsEventConditions', __METHOD__);
$this->eventConditions = $eventConditions;
}
public function getEventConditions() {
return $this->eventConditions;
}
public function setUseEventValue($useEventValue) {
$this->useEventValue = $useEventValue;
}
public function getUseEventValue() {
return $this->useEventValue;
}
}
class Google_GoalEventDetailsEventConditions extends Google_Model {
public $type;
public $matchType;
public $expression;
public $comparisonType;
public $comparisonValue;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setMatchType($matchType) {
$this->matchType = $matchType;
}
public function getMatchType() {
return $this->matchType;
}
public function setExpression($expression) {
$this->expression = $expression;
}
public function getExpression() {
return $this->expression;
}
public function setComparisonType($comparisonType) {
$this->comparisonType = $comparisonType;
}
public function getComparisonType() {
return $this->comparisonType;
}
public function setComparisonValue($comparisonValue) {
$this->comparisonValue = $comparisonValue;
}
public function getComparisonValue() {
return $this->comparisonValue;
}
}
class Google_GoalParentLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_GoalUrlDestinationDetails extends Google_Model {
public $url;
public $caseSensitive;
public $matchType;
protected $__stepsType = 'Google_GoalUrlDestinationDetailsSteps';
protected $__stepsDataType = 'array';
public $steps;
public $firstStepRequired;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setCaseSensitive($caseSensitive) {
$this->caseSensitive = $caseSensitive;
}
public function getCaseSensitive() {
return $this->caseSensitive;
}
public function setMatchType($matchType) {
$this->matchType = $matchType;
}
public function getMatchType() {
return $this->matchType;
}
public function setSteps(/* array(Google_GoalUrlDestinationDetailsSteps) */ $steps) {
$this->assertIsArray($steps, 'Google_GoalUrlDestinationDetailsSteps', __METHOD__);
$this->steps = $steps;
}
public function getSteps() {
return $this->steps;
}
public function setFirstStepRequired($firstStepRequired) {
$this->firstStepRequired = $firstStepRequired;
}
public function getFirstStepRequired() {
return $this->firstStepRequired;
}
}
class Google_GoalUrlDestinationDetailsSteps extends Google_Model {
public $url;
public $name;
public $number;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setNumber($number) {
$this->number = $number;
}
public function getNumber() {
return $this->number;
}
}
class Google_GoalVisitNumPagesDetails extends Google_Model {
public $comparisonType;
public $comparisonValue;
public function setComparisonType($comparisonType) {
$this->comparisonType = $comparisonType;
}
public function getComparisonType() {
return $this->comparisonType;
}
public function setComparisonValue($comparisonValue) {
$this->comparisonValue = $comparisonValue;
}
public function getComparisonValue() {
return $this->comparisonValue;
}
}
class Google_GoalVisitTimeOnSiteDetails extends Google_Model {
public $comparisonType;
public $comparisonValue;
public function setComparisonType($comparisonType) {
$this->comparisonType = $comparisonType;
}
public function getComparisonType() {
return $this->comparisonType;
}
public function setComparisonValue($comparisonValue) {
$this->comparisonValue = $comparisonValue;
}
public function getComparisonValue() {
return $this->comparisonValue;
}
}
class Google_Goals extends Google_Model {
public $username;
public $kind;
protected $__itemsType = 'Google_Goal';
protected $__itemsDataType = 'array';
public $items;
public $itemsPerPage;
public $previousLink;
public $startIndex;
public $nextLink;
public $totalResults;
public function setUsername($username) {
$this->username = $username;
}
public function getUsername() {
return $this->username;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Goal) */ $items) {
$this->assertIsArray($items, 'Google_Goal', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
}
class Google_McfData extends Google_Model {
public $kind;
protected $__rowsType = 'Google_McfDataRows';
protected $__rowsDataType = 'array';
public $rows;
public $containsSampledData;
public $totalResults;
public $itemsPerPage;
public $totalsForAllResults;
public $nextLink;
public $id;
protected $__queryType = 'Google_McfDataQuery';
protected $__queryDataType = '';
public $query;
public $previousLink;
protected $__profileInfoType = 'Google_McfDataProfileInfo';
protected $__profileInfoDataType = '';
public $profileInfo;
protected $__columnHeadersType = 'Google_McfDataColumnHeaders';
protected $__columnHeadersDataType = 'array';
public $columnHeaders;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows(/* array(Google_McfDataRows) */ $rows) {
$this->assertIsArray($rows, 'Google_McfDataRows', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setContainsSampledData($containsSampledData) {
$this->containsSampledData = $containsSampledData;
}
public function getContainsSampledData() {
return $this->containsSampledData;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setTotalsForAllResults($totalsForAllResults) {
$this->totalsForAllResults = $totalsForAllResults;
}
public function getTotalsForAllResults() {
return $this->totalsForAllResults;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setQuery(Google_McfDataQuery $query) {
$this->query = $query;
}
public function getQuery() {
return $this->query;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setProfileInfo(Google_McfDataProfileInfo $profileInfo) {
$this->profileInfo = $profileInfo;
}
public function getProfileInfo() {
return $this->profileInfo;
}
public function setColumnHeaders(/* array(Google_McfDataColumnHeaders) */ $columnHeaders) {
$this->assertIsArray($columnHeaders, 'Google_McfDataColumnHeaders', __METHOD__);
$this->columnHeaders = $columnHeaders;
}
public function getColumnHeaders() {
return $this->columnHeaders;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_McfDataColumnHeaders extends Google_Model {
public $dataType;
public $columnType;
public $name;
public function setDataType($dataType) {
$this->dataType = $dataType;
}
public function getDataType() {
return $this->dataType;
}
public function setColumnType($columnType) {
$this->columnType = $columnType;
}
public function getColumnType() {
return $this->columnType;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_McfDataProfileInfo extends Google_Model {
public $webPropertyId;
public $internalWebPropertyId;
public $tableId;
public $profileId;
public $profileName;
public $accountId;
public function setWebPropertyId($webPropertyId) {
$this->webPropertyId = $webPropertyId;
}
public function getWebPropertyId() {
return $this->webPropertyId;
}
public function setInternalWebPropertyId($internalWebPropertyId) {
$this->internalWebPropertyId = $internalWebPropertyId;
}
public function getInternalWebPropertyId() {
return $this->internalWebPropertyId;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setProfileId($profileId) {
$this->profileId = $profileId;
}
public function getProfileId() {
return $this->profileId;
}
public function setProfileName($profileName) {
$this->profileName = $profileName;
}
public function getProfileName() {
return $this->profileName;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_McfDataQuery extends Google_Model {
public $max_results;
public $sort;
public $dimensions;
public $start_date;
public $start_index;
public $segment;
public $ids;
public $metrics;
public $filters;
public $end_date;
public function setMax_results($max_results) {
$this->max_results = $max_results;
}
public function getMax_results() {
return $this->max_results;
}
public function setSort(/* array(Google_string) */ $sort) {
$this->assertIsArray($sort, 'Google_string', __METHOD__);
$this->sort = $sort;
}
public function getSort() {
return $this->sort;
}
public function setDimensions($dimensions) {
$this->dimensions = $dimensions;
}
public function getDimensions() {
return $this->dimensions;
}
public function setStart_date($start_date) {
$this->start_date = $start_date;
}
public function getStart_date() {
return $this->start_date;
}
public function setStart_index($start_index) {
$this->start_index = $start_index;
}
public function getStart_index() {
return $this->start_index;
}
public function setSegment($segment) {
$this->segment = $segment;
}
public function getSegment() {
return $this->segment;
}
public function setIds($ids) {
$this->ids = $ids;
}
public function getIds() {
return $this->ids;
}
public function setMetrics(/* array(Google_string) */ $metrics) {
$this->assertIsArray($metrics, 'Google_string', __METHOD__);
$this->metrics = $metrics;
}
public function getMetrics() {
return $this->metrics;
}
public function setFilters($filters) {
$this->filters = $filters;
}
public function getFilters() {
return $this->filters;
}
public function setEnd_date($end_date) {
$this->end_date = $end_date;
}
public function getEnd_date() {
return $this->end_date;
}
}
class Google_McfDataRows extends Google_Model {
public $primitiveValue;
protected $__conversionPathValueType = 'Google_McfDataRowsConversionPathValue';
protected $__conversionPathValueDataType = 'array';
public $conversionPathValue;
public function setPrimitiveValue($primitiveValue) {
$this->primitiveValue = $primitiveValue;
}
public function getPrimitiveValue() {
return $this->primitiveValue;
}
public function setConversionPathValue(/* array(Google_McfDataRowsConversionPathValue) */ $conversionPathValue) {
$this->assertIsArray($conversionPathValue, 'Google_McfDataRowsConversionPathValue', __METHOD__);
$this->conversionPathValue = $conversionPathValue;
}
public function getConversionPathValue() {
return $this->conversionPathValue;
}
}
class Google_McfDataRowsConversionPathValue extends Google_Model {
public $nodeValue;
public $interactionType;
public function setNodeValue($nodeValue) {
$this->nodeValue = $nodeValue;
}
public function getNodeValue() {
return $this->nodeValue;
}
public function setInteractionType($interactionType) {
$this->interactionType = $interactionType;
}
public function getInteractionType() {
return $this->interactionType;
}
}
class Google_Profile extends Google_Model {
public $defaultPage;
public $kind;
public $excludeQueryParameters;
public $name;
public $created;
public $webPropertyId;
public $updated;
public $siteSearchQueryParameters;
public $currency;
public $internalWebPropertyId;
protected $__childLinkType = 'Google_ProfileChildLink';
protected $__childLinkDataType = '';
public $childLink;
public $timezone;
public $siteSearchCategoryParameters;
protected $__parentLinkType = 'Google_ProfileParentLink';
protected $__parentLinkDataType = '';
public $parentLink;
public $id;
public $selfLink;
public $accountId;
public function setDefaultPage($defaultPage) {
$this->defaultPage = $defaultPage;
}
public function getDefaultPage() {
return $this->defaultPage;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setExcludeQueryParameters($excludeQueryParameters) {
$this->excludeQueryParameters = $excludeQueryParameters;
}
public function getExcludeQueryParameters() {
return $this->excludeQueryParameters;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setWebPropertyId($webPropertyId) {
$this->webPropertyId = $webPropertyId;
}
public function getWebPropertyId() {
return $this->webPropertyId;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setSiteSearchQueryParameters($siteSearchQueryParameters) {
$this->siteSearchQueryParameters = $siteSearchQueryParameters;
}
public function getSiteSearchQueryParameters() {
return $this->siteSearchQueryParameters;
}
public function setCurrency($currency) {
$this->currency = $currency;
}
public function getCurrency() {
return $this->currency;
}
public function setInternalWebPropertyId($internalWebPropertyId) {
$this->internalWebPropertyId = $internalWebPropertyId;
}
public function getInternalWebPropertyId() {
return $this->internalWebPropertyId;
}
public function setChildLink(Google_ProfileChildLink $childLink) {
$this->childLink = $childLink;
}
public function getChildLink() {
return $this->childLink;
}
public function setTimezone($timezone) {
$this->timezone = $timezone;
}
public function getTimezone() {
return $this->timezone;
}
public function setSiteSearchCategoryParameters($siteSearchCategoryParameters) {
$this->siteSearchCategoryParameters = $siteSearchCategoryParameters;
}
public function getSiteSearchCategoryParameters() {
return $this->siteSearchCategoryParameters;
}
public function setParentLink(Google_ProfileParentLink $parentLink) {
$this->parentLink = $parentLink;
}
public function getParentLink() {
return $this->parentLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_ProfileChildLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_ProfileParentLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_Profiles extends Google_Model {
public $username;
public $kind;
protected $__itemsType = 'Google_Profile';
protected $__itemsDataType = 'array';
public $items;
public $itemsPerPage;
public $previousLink;
public $startIndex;
public $nextLink;
public $totalResults;
public function setUsername($username) {
$this->username = $username;
}
public function getUsername() {
return $this->username;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Profile) */ $items) {
$this->assertIsArray($items, 'Google_Profile', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
}
class Google_Segment extends Google_Model {
public $definition;
public $kind;
public $segmentId;
public $created;
public $updated;
public $id;
public $selfLink;
public $name;
public function setDefinition($definition) {
$this->definition = $definition;
}
public function getDefinition() {
return $this->definition;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setSegmentId($segmentId) {
$this->segmentId = $segmentId;
}
public function getSegmentId() {
return $this->segmentId;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Segments extends Google_Model {
public $username;
public $kind;
protected $__itemsType = 'Google_Segment';
protected $__itemsDataType = 'array';
public $items;
public $itemsPerPage;
public $previousLink;
public $startIndex;
public $nextLink;
public $totalResults;
public function setUsername($username) {
$this->username = $username;
}
public function getUsername() {
return $this->username;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Segment) */ $items) {
$this->assertIsArray($items, 'Google_Segment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
}
class Google_Webproperties extends Google_Model {
public $username;
public $kind;
protected $__itemsType = 'Google_Webproperty';
protected $__itemsDataType = 'array';
public $items;
public $itemsPerPage;
public $previousLink;
public $startIndex;
public $nextLink;
public $totalResults;
public function setUsername($username) {
$this->username = $username;
}
public function getUsername() {
return $this->username;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItems(/* array(Google_Webproperty) */ $items) {
$this->assertIsArray($items, 'Google_Webproperty', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setPreviousLink($previousLink) {
$this->previousLink = $previousLink;
}
public function getPreviousLink() {
return $this->previousLink;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setNextLink($nextLink) {
$this->nextLink = $nextLink;
}
public function getNextLink() {
return $this->nextLink;
}
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
}
class Google_Webproperty extends Google_Model {
public $kind;
public $name;
public $created;
public $updated;
public $websiteUrl;
public $internalWebPropertyId;
protected $__childLinkType = 'Google_WebpropertyChildLink';
protected $__childLinkDataType = '';
public $childLink;
protected $__parentLinkType = 'Google_WebpropertyParentLink';
protected $__parentLinkDataType = '';
public $parentLink;
public $id;
public $selfLink;
public $accountId;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setWebsiteUrl($websiteUrl) {
$this->websiteUrl = $websiteUrl;
}
public function getWebsiteUrl() {
return $this->websiteUrl;
}
public function setInternalWebPropertyId($internalWebPropertyId) {
$this->internalWebPropertyId = $internalWebPropertyId;
}
public function getInternalWebPropertyId() {
return $this->internalWebPropertyId;
}
public function setChildLink(Google_WebpropertyChildLink $childLink) {
$this->childLink = $childLink;
}
public function getChildLink() {
return $this->childLink;
}
public function setParentLink(Google_WebpropertyParentLink $parentLink) {
$this->parentLink = $parentLink;
}
public function getParentLink() {
return $this->parentLink;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_WebpropertyChildLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_WebpropertyParentLink extends Google_Model {
public $href;
public $type;
public function setHref($href) {
$this->href = $href;
}
public function getHref() {
return $this->href;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_AnalyticsService.php | PHP | asf20 | 59,356 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "url" collection of methods.
* Typical usage is:
* <code>
* $urlshortenerService = new Google_UrlshortenerService(...);
* $url = $urlshortenerService->url;
* </code>
*/
class Google_UrlServiceResource extends Google_ServiceResource {
/**
* Creates a new short URL. (url.insert)
*
* @param Google_Url $postBody
* @param array $optParams Optional parameters.
* @return Google_Url
*/
public function insert(Google_Url $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
/**
* Retrieves a list of URLs shortened by a user. (url.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string start-token Token for requesting successive pages of results.
* @opt_param string projection Additional information to return.
* @return Google_UrlHistory
*/
public function listUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_UrlHistory($data);
} else {
return $data;
}
}
/**
* Expands a short URL or gets creation time and analytics. (url.get)
*
* @param string $shortUrl The short URL, including the protocol.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Additional information to return.
* @return Google_Url
*/
public function get($shortUrl, $optParams = array()) {
$params = array('shortUrl' => $shortUrl);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Urlshortener (v1).
*
* <p>
* Lets you create, inspect, and manage goo.gl short URLs
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/urlshortener/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_UrlshortenerService extends Google_Service {
public $url;
/**
* Constructs the internal representation of the Urlshortener service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'urlshortener/v1/';
$this->version = 'v1';
$this->serviceName = 'urlshortener';
$client->addService($this->serviceName, $this->version);
$this->url = new Google_UrlServiceResource($this, $this->serviceName, 'url', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "request": {"$ref": "Url"}, "response": {"$ref": "Url"}, "httpMethod": "POST", "path": "url", "id": "urlshortener.url.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "parameters": {"start-token": {"type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "FULL"], "type": "string", "location": "query"}}, "response": {"$ref": "UrlHistory"}, "httpMethod": "GET", "path": "url/history", "id": "urlshortener.url.list"}, "get": {"httpMethod": "GET", "response": {"$ref": "Url"}, "id": "urlshortener.url.get", "parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "path": "url"}}}', true));
}
}
class Google_AnalyticsSnapshot extends Google_Model {
public $shortUrlClicks;
protected $__countriesType = 'Google_StringCount';
protected $__countriesDataType = 'array';
public $countries;
protected $__platformsType = 'Google_StringCount';
protected $__platformsDataType = 'array';
public $platforms;
protected $__browsersType = 'Google_StringCount';
protected $__browsersDataType = 'array';
public $browsers;
protected $__referrersType = 'Google_StringCount';
protected $__referrersDataType = 'array';
public $referrers;
public $longUrlClicks;
public function setShortUrlClicks($shortUrlClicks) {
$this->shortUrlClicks = $shortUrlClicks;
}
public function getShortUrlClicks() {
return $this->shortUrlClicks;
}
public function setCountries(/* array(Google_StringCount) */ $countries) {
$this->assertIsArray($countries, 'Google_StringCount', __METHOD__);
$this->countries = $countries;
}
public function getCountries() {
return $this->countries;
}
public function setPlatforms(/* array(Google_StringCount) */ $platforms) {
$this->assertIsArray($platforms, 'Google_StringCount', __METHOD__);
$this->platforms = $platforms;
}
public function getPlatforms() {
return $this->platforms;
}
public function setBrowsers(/* array(Google_StringCount) */ $browsers) {
$this->assertIsArray($browsers, 'Google_StringCount', __METHOD__);
$this->browsers = $browsers;
}
public function getBrowsers() {
return $this->browsers;
}
public function setReferrers(/* array(Google_StringCount) */ $referrers) {
$this->assertIsArray($referrers, 'Google_StringCount', __METHOD__);
$this->referrers = $referrers;
}
public function getReferrers() {
return $this->referrers;
}
public function setLongUrlClicks($longUrlClicks) {
$this->longUrlClicks = $longUrlClicks;
}
public function getLongUrlClicks() {
return $this->longUrlClicks;
}
}
class Google_AnalyticsSummary extends Google_Model {
protected $__weekType = 'Google_AnalyticsSnapshot';
protected $__weekDataType = '';
public $week;
protected $__allTimeType = 'Google_AnalyticsSnapshot';
protected $__allTimeDataType = '';
public $allTime;
protected $__twoHoursType = 'Google_AnalyticsSnapshot';
protected $__twoHoursDataType = '';
public $twoHours;
protected $__dayType = 'Google_AnalyticsSnapshot';
protected $__dayDataType = '';
public $day;
protected $__monthType = 'Google_AnalyticsSnapshot';
protected $__monthDataType = '';
public $month;
public function setWeek(Google_AnalyticsSnapshot $week) {
$this->week = $week;
}
public function getWeek() {
return $this->week;
}
public function setAllTime(Google_AnalyticsSnapshot $allTime) {
$this->allTime = $allTime;
}
public function getAllTime() {
return $this->allTime;
}
public function setTwoHours(Google_AnalyticsSnapshot $twoHours) {
$this->twoHours = $twoHours;
}
public function getTwoHours() {
return $this->twoHours;
}
public function setDay(Google_AnalyticsSnapshot $day) {
$this->day = $day;
}
public function getDay() {
return $this->day;
}
public function setMonth(Google_AnalyticsSnapshot $month) {
$this->month = $month;
}
public function getMonth() {
return $this->month;
}
}
class Google_StringCount extends Google_Model {
public $count;
public $id;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_Url extends Google_Model {
public $status;
public $kind;
public $created;
protected $__analyticsType = 'Google_AnalyticsSummary';
protected $__analyticsDataType = '';
public $analytics;
public $longUrl;
public $id;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setAnalytics(Google_AnalyticsSummary $analytics) {
$this->analytics = $analytics;
}
public function getAnalytics() {
return $this->analytics;
}
public function setLongUrl($longUrl) {
$this->longUrl = $longUrl;
}
public function getLongUrl() {
return $this->longUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_UrlHistory extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Url';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $itemsPerPage;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Url) */ $items) {
$this->assertIsArray($items, 'Google_Url', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_UrlshortenerService.php | PHP | asf20 | 10,218 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "channels" collection of methods.
* Typical usage is:
* <code>
* $youtubeService = new Google_YoutubeService(...);
* $channels = $youtubeService->channels;
* </code>
*/
class Google_ChannelsServiceResource extends Google_ServiceResource {
/**
* Browse the YouTube channel collection. Either the 'id' or 'mine' parameter must be set.
* (channels.list)
*
* @param string $part Parts of the channel resource to be returned.
* @param array $optParams Optional parameters.
*
* @opt_param string id YouTube IDs of the channels to be returned.
* @opt_param string mine Flag indicating only return the channel ids of the authenticated user.
* @return Google_ChannelListResponse
*/
public function listChannels($part, $optParams = array()) {
$params = array('part' => $part);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ChannelListResponse($data);
} else {
return $data;
}
}
}
/**
* The "search" collection of methods.
* Typical usage is:
* <code>
* $youtubeService = new Google_YoutubeService(...);
* $search = $youtubeService->search;
* </code>
*/
class Google_SearchServiceResource extends Google_ServiceResource {
/**
* Universal search for youtube. (search.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string q Query to search in Youtube.
* @opt_param string startIndex Index of the first search result to return.
* @opt_param string type Type of resource to search.
* @opt_param string order Sort order.
* @opt_param string maxResults Maximum number of search results to return per page.
* @return Google_SearchListResponse
*/
public function listSearch($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SearchListResponse($data);
} else {
return $data;
}
}
}
/**
* The "playlistitems" collection of methods.
* Typical usage is:
* <code>
* $youtubeService = new Google_YoutubeService(...);
* $playlistitems = $youtubeService->playlistitems;
* </code>
*/
class Google_PlaylistitemsServiceResource extends Google_ServiceResource {
/**
* Browse the YouTube playlist collection. (playlistitems.list)
*
* @param string $part Parts of the playlist resource to be returned.
* @param array $optParams Optional parameters.
*
* @opt_param string startIndex Index of the first element to return (starts at 0)
* @opt_param string playlistId Retrieves playlist items from the given playlist id.
* @opt_param string id YouTube IDs of the playlists to be returned.
* @opt_param string maxResults Maximum number of results to return
* @return Google_PlaylistItemListResponse
*/
public function listPlaylistitems($part, $optParams = array()) {
$params = array('part' => $part);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PlaylistItemListResponse($data);
} else {
return $data;
}
}
}
/**
* The "playlists" collection of methods.
* Typical usage is:
* <code>
* $youtubeService = new Google_YoutubeService(...);
* $playlists = $youtubeService->playlists;
* </code>
*/
class Google_PlaylistsServiceResource extends Google_ServiceResource {
/**
* Browse the YouTube playlist collection. (playlists.list)
*
* @param string $id YouTube IDs of the playlists to be returned.
* @param string $part Parts of the playlist resource to be returned.
* @param array $optParams Optional parameters.
* @return Google_PlaylistListResponse
*/
public function listPlaylists($id, $part, $optParams = array()) {
$params = array('id' => $id, 'part' => $part);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PlaylistListResponse($data);
} else {
return $data;
}
}
}
/**
* The "videos" collection of methods.
* Typical usage is:
* <code>
* $youtubeService = new Google_YoutubeService(...);
* $videos = $youtubeService->videos;
* </code>
*/
class Google_VideosServiceResource extends Google_ServiceResource {
/**
* Browse the YouTube video collection. (videos.list)
*
* @param string $id YouTube IDs of the videos to be returned.
* @param string $part Parts of the video resource to be returned.
* @param array $optParams Optional parameters.
* @return Google_VideoListResponse
*/
public function listVideos($id, $part, $optParams = array()) {
$params = array('id' => $id, 'part' => $part);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_VideoListResponse($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Youtube (v3alpha).
*
* <p>
* Programmatic access to YouTube features.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/youtube" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_YoutubeService extends Google_Service {
public $channels;
public $search;
public $playlistitems;
public $playlists;
public $videos;
/**
* Constructs the internal representation of the Youtube service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'youtube/v3alpha/';
$this->version = 'v3alpha';
$this->serviceName = 'youtube';
$client->addService($this->serviceName, $this->version);
$this->channels = new Google_ChannelsServiceResource($this, $this->serviceName, 'channels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/youtube"], "parameters": {"part": {"required": true, "type": "string", "location": "query"}, "id": {"type": "string", "location": "query"}, "mine": {"type": "string", "location": "query"}}, "id": "youtube.channels.list", "httpMethod": "GET", "path": "channels", "response": {"$ref": "ChannelListResponse"}}}}', true));
$this->search = new Google_SearchServiceResource($this, $this->serviceName, 'search', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/youtube"], "parameters": {"q": {"type": "string", "location": "query"}, "startIndex": {"format": "uint32", "default": "0", "maximum": "1000", "minimum": "0", "location": "query", "type": "integer"}, "type": {"repeated": true, "enum": ["channel", "playlist", "video"], "type": "string", "location": "query"}, "order": {"default": "SEARCH_SORT_RELEVANCE", "enum": ["date", "rating", "relevance", "view_count"], "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "25", "maximum": "50", "minimum": "0", "location": "query", "type": "integer"}}, "response": {"$ref": "SearchListResponse"}, "httpMethod": "GET", "path": "search", "id": "youtube.search.list"}}}', true));
$this->playlistitems = new Google_PlaylistitemsServiceResource($this, $this->serviceName, 'playlistitems', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/youtube"], "parameters": {"startIndex": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "part": {"required": true, "type": "string", "location": "query"}, "playlistId": {"type": "string", "location": "query"}, "id": {"type": "string", "location": "query"}, "maxResults": {"default": "50", "minimum": "0", "type": "integer", "location": "query", "format": "uint32"}}, "id": "youtube.playlistitems.list", "httpMethod": "GET", "path": "playlistitems", "response": {"$ref": "PlaylistItemListResponse"}}}}', true));
$this->playlists = new Google_PlaylistsServiceResource($this, $this->serviceName, 'playlists', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/youtube"], "parameters": {"part": {"required": true, "type": "string", "location": "query"}, "id": {"required": true, "type": "string", "location": "query"}}, "id": "youtube.playlists.list", "httpMethod": "GET", "path": "playlists", "response": {"$ref": "PlaylistListResponse"}}}}', true));
$this->videos = new Google_VideosServiceResource($this, $this->serviceName, 'videos', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/youtube"], "parameters": {"part": {"required": true, "type": "string", "location": "query"}, "id": {"required": true, "type": "string", "location": "query"}}, "id": "youtube.videos.list", "httpMethod": "GET", "path": "videos", "response": {"$ref": "VideoListResponse"}}}}', true));
}
}
class Google_Channel extends Google_Model {
public $kind;
protected $__statisticsType = 'Google_ChannelStatistics';
protected $__statisticsDataType = '';
public $statistics;
protected $__contentDetailsType = 'Google_ChannelContentDetails';
protected $__contentDetailsDataType = '';
public $contentDetails;
protected $__snippetType = 'Google_ChannelSnippet';
protected $__snippetDataType = '';
public $snippet;
public $etag;
public $id;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStatistics(Google_ChannelStatistics $statistics) {
$this->statistics = $statistics;
}
public function getStatistics() {
return $this->statistics;
}
public function setContentDetails(Google_ChannelContentDetails $contentDetails) {
$this->contentDetails = $contentDetails;
}
public function getContentDetails() {
return $this->contentDetails;
}
public function setSnippet(Google_ChannelSnippet $snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
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;
}
}
class Google_ChannelContentDetails extends Google_Model {
public $privacyStatus;
public $uploads;
public function setPrivacyStatus($privacyStatus) {
$this->privacyStatus = $privacyStatus;
}
public function getPrivacyStatus() {
return $this->privacyStatus;
}
public function setUploads($uploads) {
$this->uploads = $uploads;
}
public function getUploads() {
return $this->uploads;
}
}
class Google_ChannelListResponse extends Google_Model {
protected $__channelsType = 'Google_Channel';
protected $__channelsDataType = 'map';
public $channels;
public $kind;
public $etag;
public function setChannels(Google_Channel $channels) {
$this->channels = $channels;
}
public function getChannels() {
return $this->channels;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_ChannelSnippet extends Google_Model {
public $title;
public $description;
protected $__thumbnailsType = 'Google_Thumbnail';
protected $__thumbnailsDataType = 'map';
public $thumbnails;
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setThumbnails(Google_Thumbnail $thumbnails) {
$this->thumbnails = $thumbnails;
}
public function getThumbnails() {
return $this->thumbnails;
}
}
class Google_ChannelStatistics extends Google_Model {
public $commentCount;
public $subscriberCount;
public $videoCount;
public $viewCount;
public function setCommentCount($commentCount) {
$this->commentCount = $commentCount;
}
public function getCommentCount() {
return $this->commentCount;
}
public function setSubscriberCount($subscriberCount) {
$this->subscriberCount = $subscriberCount;
}
public function getSubscriberCount() {
return $this->subscriberCount;
}
public function setVideoCount($videoCount) {
$this->videoCount = $videoCount;
}
public function getVideoCount() {
return $this->videoCount;
}
public function setViewCount($viewCount) {
$this->viewCount = $viewCount;
}
public function getViewCount() {
return $this->viewCount;
}
}
class Google_PageInfo extends Google_Model {
public $totalResults;
public $startIndex;
public $resultPerPage;
public function setTotalResults($totalResults) {
$this->totalResults = $totalResults;
}
public function getTotalResults() {
return $this->totalResults;
}
public function setStartIndex($startIndex) {
$this->startIndex = $startIndex;
}
public function getStartIndex() {
return $this->startIndex;
}
public function setResultPerPage($resultPerPage) {
$this->resultPerPage = $resultPerPage;
}
public function getResultPerPage() {
return $this->resultPerPage;
}
}
class Google_Playlist extends Google_Model {
protected $__snippetType = 'Google_PlaylistSnippet';
protected $__snippetDataType = '';
public $snippet;
public $kind;
public $etag;
public $id;
public function setSnippet(Google_PlaylistSnippet $snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
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;
}
}
class Google_PlaylistItem extends Google_Model {
protected $__snippetType = 'Google_PlaylistItemSnippet';
protected $__snippetDataType = '';
public $snippet;
public $kind;
public $etag;
public $id;
public function setSnippet(Google_PlaylistItemSnippet $snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
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;
}
}
class Google_PlaylistItemListResponse extends Google_Model {
protected $__playlistItemsType = 'Google_PlaylistItem';
protected $__playlistItemsDataType = 'map';
public $playlistItems;
public $kind;
public $etag;
public function setPlaylistItems(Google_PlaylistItem $playlistItems) {
$this->playlistItems = $playlistItems;
}
public function getPlaylistItems() {
return $this->playlistItems;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_PlaylistItemSnippet extends Google_Model {
public $playlistId;
public $description;
public $title;
protected $__resourceIdType = 'Google_ResourceId';
protected $__resourceIdDataType = '';
public $resourceId;
public $channelId;
public $publishedAt;
public $position;
public function setPlaylistId($playlistId) {
$this->playlistId = $playlistId;
}
public function getPlaylistId() {
return $this->playlistId;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setResourceId(Google_ResourceId $resourceId) {
$this->resourceId = $resourceId;
}
public function getResourceId() {
return $this->resourceId;
}
public function setChannelId($channelId) {
$this->channelId = $channelId;
}
public function getChannelId() {
return $this->channelId;
}
public function setPublishedAt($publishedAt) {
$this->publishedAt = $publishedAt;
}
public function getPublishedAt() {
return $this->publishedAt;
}
public function setPosition($position) {
$this->position = $position;
}
public function getPosition() {
return $this->position;
}
}
class Google_PlaylistListResponse extends Google_Model {
public $kind;
public $etag;
protected $__playlistsType = 'Google_Playlist';
protected $__playlistsDataType = 'map';
public $playlists;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setPlaylists(Google_Playlist $playlists) {
$this->playlists = $playlists;
}
public function getPlaylists() {
return $this->playlists;
}
}
class Google_PlaylistSnippet extends Google_Model {
public $title;
public $channelId;
public $description;
public $publishedAt;
public $tags;
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setChannelId($channelId) {
$this->channelId = $channelId;
}
public function getChannelId() {
return $this->channelId;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setPublishedAt($publishedAt) {
$this->publishedAt = $publishedAt;
}
public function getPublishedAt() {
return $this->publishedAt;
}
public function setTags(/* array(Google_string) */ $tags) {
$this->assertIsArray($tags, 'Google_string', __METHOD__);
$this->tags = $tags;
}
public function getTags() {
return $this->tags;
}
}
class Google_ResourceId extends Google_Model {
public $kind;
public $channelId;
public $playlistId;
public $videoId;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setChannelId($channelId) {
$this->channelId = $channelId;
}
public function getChannelId() {
return $this->channelId;
}
public function setPlaylistId($playlistId) {
$this->playlistId = $playlistId;
}
public function getPlaylistId() {
return $this->playlistId;
}
public function setVideoId($videoId) {
$this->videoId = $videoId;
}
public function getVideoId() {
return $this->videoId;
}
}
class Google_SearchListResponse extends Google_Model {
protected $__searchResultsType = 'Google_SearchResult';
protected $__searchResultsDataType = 'array';
public $searchResults;
public $kind;
public $etag;
protected $__pageInfoType = 'Google_PageInfo';
protected $__pageInfoDataType = '';
public $pageInfo;
public function setSearchResults(/* array(Google_SearchResult) */ $searchResults) {
$this->assertIsArray($searchResults, 'Google_SearchResult', __METHOD__);
$this->searchResults = $searchResults;
}
public function getSearchResults() {
return $this->searchResults;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setPageInfo(Google_PageInfo $pageInfo) {
$this->pageInfo = $pageInfo;
}
public function getPageInfo() {
return $this->pageInfo;
}
}
class Google_SearchResult extends Google_Model {
protected $__snippetType = 'Google_SearchResultSnippet';
protected $__snippetDataType = '';
public $snippet;
public $kind;
public $etag;
protected $__idType = 'Google_ResourceId';
protected $__idDataType = '';
public $id;
public function setSnippet(Google_SearchResultSnippet $snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setId(Google_ResourceId $id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_SearchResultSnippet extends Google_Model {
public $channelId;
public $description;
public $publishedAt;
public $title;
public function setChannelId($channelId) {
$this->channelId = $channelId;
}
public function getChannelId() {
return $this->channelId;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setPublishedAt($publishedAt) {
$this->publishedAt = $publishedAt;
}
public function getPublishedAt() {
return $this->publishedAt;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_Thumbnail extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_Video extends Google_Model {
protected $__statusType = 'Google_VideoStatus';
protected $__statusDataType = '';
public $status;
public $kind;
protected $__statisticsType = 'Google_VideoStatistics';
protected $__statisticsDataType = '';
public $statistics;
protected $__contentDetailsType = 'Google_VideoContentDetails';
protected $__contentDetailsDataType = '';
public $contentDetails;
protected $__snippetType = 'Google_VideoSnippet';
protected $__snippetDataType = '';
public $snippet;
protected $__playerType = 'Google_VideoPlayer';
protected $__playerDataType = '';
public $player;
public $etag;
public $id;
public function setStatus(Google_VideoStatus $status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStatistics(Google_VideoStatistics $statistics) {
$this->statistics = $statistics;
}
public function getStatistics() {
return $this->statistics;
}
public function setContentDetails(Google_VideoContentDetails $contentDetails) {
$this->contentDetails = $contentDetails;
}
public function getContentDetails() {
return $this->contentDetails;
}
public function setSnippet(Google_VideoSnippet $snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setPlayer(Google_VideoPlayer $player) {
$this->player = $player;
}
public function getPlayer() {
return $this->player;
}
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;
}
}
class Google_VideoContentDetails extends Google_Model {
public $duration;
public $aspectRatio;
public function setDuration($duration) {
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
public function setAspectRatio($aspectRatio) {
$this->aspectRatio = $aspectRatio;
}
public function getAspectRatio() {
return $this->aspectRatio;
}
}
class Google_VideoListResponse extends Google_Model {
public $kind;
public $etag;
protected $__videosType = 'Google_Video';
protected $__videosDataType = 'map';
public $videos;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setVideos(Google_Video $videos) {
$this->videos = $videos;
}
public function getVideos() {
return $this->videos;
}
}
class Google_VideoPlayer extends Google_Model {
public $embedHtml;
public function setEmbedHtml($embedHtml) {
$this->embedHtml = $embedHtml;
}
public function getEmbedHtml() {
return $this->embedHtml;
}
}
class Google_VideoSnippet extends Google_Model {
protected $__thumbnailsType = 'Google_Thumbnail';
protected $__thumbnailsDataType = 'map';
public $thumbnails;
public $tags;
public $channelId;
public $publishedAt;
public $title;
public $categoryId;
public $description;
public function setThumbnails(Google_Thumbnail $thumbnails) {
$this->thumbnails = $thumbnails;
}
public function getThumbnails() {
return $this->thumbnails;
}
public function setTags(/* array(Google_string) */ $tags) {
$this->assertIsArray($tags, 'Google_string', __METHOD__);
$this->tags = $tags;
}
public function getTags() {
return $this->tags;
}
public function setChannelId($channelId) {
$this->channelId = $channelId;
}
public function getChannelId() {
return $this->channelId;
}
public function setPublishedAt($publishedAt) {
$this->publishedAt = $publishedAt;
}
public function getPublishedAt() {
return $this->publishedAt;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setCategoryId($categoryId) {
$this->categoryId = $categoryId;
}
public function getCategoryId() {
return $this->categoryId;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class Google_VideoStatistics extends Google_Model {
public $commentCount;
public $viewCount;
public $favoriteCount;
public $dislikeCount;
public $likeCount;
public function setCommentCount($commentCount) {
$this->commentCount = $commentCount;
}
public function getCommentCount() {
return $this->commentCount;
}
public function setViewCount($viewCount) {
$this->viewCount = $viewCount;
}
public function getViewCount() {
return $this->viewCount;
}
public function setFavoriteCount($favoriteCount) {
$this->favoriteCount = $favoriteCount;
}
public function getFavoriteCount() {
return $this->favoriteCount;
}
public function setDislikeCount($dislikeCount) {
$this->dislikeCount = $dislikeCount;
}
public function getDislikeCount() {
return $this->dislikeCount;
}
public function setLikeCount($likeCount) {
$this->likeCount = $likeCount;
}
public function getLikeCount() {
return $this->likeCount;
}
}
class Google_VideoStatus extends Google_Model {
public $privacyStatus;
public $uploadStatus;
public $rejectionReason;
public $failureReason;
public function setPrivacyStatus($privacyStatus) {
$this->privacyStatus = $privacyStatus;
}
public function getPrivacyStatus() {
return $this->privacyStatus;
}
public function setUploadStatus($uploadStatus) {
$this->uploadStatus = $uploadStatus;
}
public function getUploadStatus() {
return $this->uploadStatus;
}
public function setRejectionReason($rejectionReason) {
$this->rejectionReason = $rejectionReason;
}
public function getRejectionReason() {
return $this->rejectionReason;
}
public function setFailureReason($failureReason) {
$this->failureReason = $failureReason;
}
public function getFailureReason() {
return $this->failureReason;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_YoutubeService.php | PHP | asf20 | 29,286 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "blogs" collection of methods.
* Typical usage is:
* <code>
* $bloggerService = new Google_BloggerService(...);
* $blogs = $bloggerService->blogs;
* </code>
*/
class Google_BlogsServiceResource extends Google_ServiceResource {
/**
* Retrieves a list of blogs, possibly filtered. (blogs.listByUser)
*
* @param string $userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.
* @param array $optParams Optional parameters.
* @return Google_BlogList
*/
public function listByUser($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('listByUser', array($params));
if ($this->useObjects()) {
return new Google_BlogList($data);
} else {
return $data;
}
}
/**
* Retrieve a Blog by URL. (blogs.getByUrl)
*
* @param array $optParams Optional parameters.
*
* @opt_param string url The URL of the blog to retrieve.
* @return Google_Blog
*/
public function getByUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('getByUrl', array($params));
if ($this->useObjects()) {
return new Google_Blog($data);
} else {
return $data;
}
}
/**
* Gets one blog by id. (blogs.get)
*
* @param string $blogId The ID of the blog to get.
* @param array $optParams Optional parameters.
*
* @opt_param string maxPosts Maximum number of posts to pull back with the blog.
* @return Google_Blog
*/
public function get($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Blog($data);
} else {
return $data;
}
}
}
/**
* The "posts" collection of methods.
* Typical usage is:
* <code>
* $bloggerService = new Google_BloggerService(...);
* $posts = $bloggerService->posts;
* </code>
*/
class Google_PostsServiceResource extends Google_ServiceResource {
/**
* Add a post. (posts.insert)
*
* @param string $blogId ID of the blog to fetch the post from.
* @param Google_Post $postBody
* @param array $optParams Optional parameters.
* @return Google_Post
*/
public function insert($blogId, Google_Post $postBody, $optParams = array()) {
$params = array('blogId' => $blogId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Post($data);
} else {
return $data;
}
}
/**
* Search for a post. (posts.search)
*
* @param string $blogId ID of the blog to fetch the post from.
* @param array $optParams Optional parameters.
*
* @opt_param string q Query terms to search this blog for matching posts.
* @return Google_PostList
*/
public function search($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('search', array($params));
if ($this->useObjects()) {
return new Google_PostList($data);
} else {
return $data;
}
}
/**
* Get a post by id. (posts.get)
*
* @param string $blogId ID of the blog to fetch the post from.
* @param string $postId The ID of the post
* @param array $optParams Optional parameters.
*
* @opt_param string maxComments Maximum number of comments to pull back on a post.
* @return Google_Post
*/
public function get($blogId, $postId, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Post($data);
} else {
return $data;
}
}
/**
* Retrieves a list of posts, possibly filtered. (posts.list)
*
* @param string $blogId ID of the blog to fetch posts from.
* @param array $optParams Optional parameters.
*
* @opt_param string startDate Earliest post date to fetch, a date-time with RFC 3339 formatting.
* @opt_param string endDate Latest post date to fetch, a date-time with RFC 3339 formatting.
* @opt_param string labels Comma-separated list of labels to search for.
* @opt_param string maxResults Maximum number of posts to fetch.
* @opt_param string pageToken Continuation token if the request is paged.
* @opt_param bool fetchBodies Whether the body content of posts is included.
* @return Google_PostList
*/
public function listPosts($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PostList($data);
} else {
return $data;
}
}
/**
* Update a post. (posts.update)
*
* @param string $blogId The ID of the Blog.
* @param string $postId The ID of the Post.
* @param Google_Post $postBody
* @param array $optParams Optional parameters.
* @return Google_Post
*/
public function update($blogId, $postId, Google_Post $postBody, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Post($data);
} else {
return $data;
}
}
/**
* Retrieve a Post by Path. (posts.getByPath)
*
* @param string $blogId ID of the blog to fetch the post from.
* @param array $optParams Optional parameters.
*
* @opt_param string path Path of the Post to retrieve.
* @opt_param string maxComments Maximum number of comments to pull back on a post.
* @return Google_Post
*/
public function getByPath($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('getByPath', array($params));
if ($this->useObjects()) {
return new Google_Post($data);
} else {
return $data;
}
}
/**
* Update a post. This method supports patch semantics. (posts.patch)
*
* @param string $blogId The ID of the Blog.
* @param string $postId The ID of the Post.
* @param Google_Post $postBody
* @param array $optParams Optional parameters.
* @return Google_Post
*/
public function patch($blogId, $postId, Google_Post $postBody, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Post($data);
} else {
return $data;
}
}
/**
* Delete a post by id. (posts.delete)
*
* @param string $blogId The Id of the Blog.
* @param string $postId The ID of the Post.
* @param array $optParams Optional parameters.
*/
public function delete($blogId, $postId, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "pages" collection of methods.
* Typical usage is:
* <code>
* $bloggerService = new Google_BloggerService(...);
* $pages = $bloggerService->pages;
* </code>
*/
class Google_PagesServiceResource extends Google_ServiceResource {
/**
* Retrieves pages for a blog, possibly filtered. (pages.list)
*
* @param string $blogId ID of the blog to fetch pages from.
* @param array $optParams Optional parameters.
*
* @opt_param bool fetchBodies Whether to retrieve the Page bodies.
* @return Google_PageList
*/
public function listPages($blogId, $optParams = array()) {
$params = array('blogId' => $blogId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_PageList($data);
} else {
return $data;
}
}
/**
* Gets one blog page by id. (pages.get)
*
* @param string $blogId ID of the blog containing the page.
* @param string $pageId The ID of the page to get.
* @param array $optParams Optional parameters.
* @return Google_Page
*/
public function get($blogId, $pageId, $optParams = array()) {
$params = array('blogId' => $blogId, 'pageId' => $pageId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Page($data);
} else {
return $data;
}
}
}
/**
* The "comments" collection of methods.
* Typical usage is:
* <code>
* $bloggerService = new Google_BloggerService(...);
* $comments = $bloggerService->comments;
* </code>
*/
class Google_CommentsServiceResource extends Google_ServiceResource {
/**
* Retrieves the comments for a blog, possibly filtered. (comments.list)
*
* @param string $blogId ID of the blog to fetch comments from.
* @param string $postId ID of the post to fetch posts from.
* @param array $optParams Optional parameters.
*
* @opt_param string startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting.
* @opt_param string endDate Latest date of comment to fetch, a date-time with RFC 3339 formatting.
* @opt_param string maxResults Maximum number of comments to include in the result.
* @opt_param string pageToken Continuation token if request is paged.
* @opt_param bool fetchBodies Whether the body content of the comments is included.
* @return Google_CommentList
*/
public function listComments($blogId, $postId, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CommentList($data);
} else {
return $data;
}
}
/**
* Gets one comment by id. (comments.get)
*
* @param string $blogId ID of the blog to containing the comment.
* @param string $postId ID of the post to fetch posts from.
* @param string $commentId The ID of the comment to get.
* @param array $optParams Optional parameters.
* @return Google_Comment
*/
public function get($blogId, $postId, $commentId, $optParams = array()) {
$params = array('blogId' => $blogId, 'postId' => $postId, 'commentId' => $commentId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Comment($data);
} else {
return $data;
}
}
}
/**
* The "users" collection of methods.
* Typical usage is:
* <code>
* $bloggerService = new Google_BloggerService(...);
* $users = $bloggerService->users;
* </code>
*/
class Google_UsersServiceResource extends Google_ServiceResource {
/**
* Gets one user by id. (users.get)
*
* @param string $userId The ID of the user to get.
* @param array $optParams Optional parameters.
* @return Google_User
*/
public function get($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_User($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Blogger (v3).
*
* <p>
* API for access to the data within Blogger.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/blogger/docs/3.0/getting_started" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_BloggerService extends Google_Service {
public $blogs;
public $posts;
public $pages;
public $comments;
public $users;
/**
* Constructs the internal representation of the Blogger service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'blogger/v3/';
$this->version = 'v3';
$this->serviceName = 'blogger';
$client->addService($this->serviceName, $this->version);
$this->blogs = new Google_BlogsServiceResource($this, $this->serviceName, 'blogs', json_decode('{"methods": {"listByUser": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.blogs.listByUser", "httpMethod": "GET", "path": "users/{userId}/blogs", "response": {"$ref": "BlogList"}}, "getByUrl": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"url": {"type": "string", "location": "query"}}, "response": {"$ref": "Blog"}, "httpMethod": "GET", "path": "blogs/byurl", "id": "blogger.blogs.getByUrl"}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"maxPosts": {"type": "integer", "location": "query", "format": "uint32"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.blogs.get", "httpMethod": "GET", "path": "blogs/{blogId}", "response": {"$ref": "Blog"}}}}', true));
$this->posts = new Google_PostsServiceResource($this, $this->serviceName, 'posts', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"blogId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Post"}, "response": {"$ref": "Post"}, "httpMethod": "POST", "path": "blogs/{blogId}/posts", "id": "blogger.posts.insert"}, "search": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"q": {"type": "string", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.posts.search", "httpMethod": "GET", "path": "blogs/{blogId}/posts/search", "response": {"$ref": "PostList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"maxComments": {"type": "integer", "location": "query", "format": "uint32"}, "blogId": {"required": true, "type": "string", "location": "path"}, "postId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.posts.get", "httpMethod": "GET", "path": "blogs/{blogId}/posts/{postId}", "response": {"$ref": "Post"}}, "list": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"startDate": {"type": "string", "location": "query", "format": "date-time"}, "endDate": {"type": "string", "location": "query", "format": "date-time"}, "labels": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "fetchBodies": {"type": "boolean", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.posts.list", "httpMethod": "GET", "path": "blogs/{blogId}/posts", "response": {"$ref": "PostList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"postId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Post"}, "response": {"$ref": "Post"}, "httpMethod": "PUT", "path": "blogs/{blogId}/posts/{postId}", "id": "blogger.posts.update"}, "getByPath": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"path": {"type": "string", "location": "query"}, "maxComments": {"type": "integer", "location": "query", "format": "uint32"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.posts.getByPath", "httpMethod": "GET", "path": "blogs/{blogId}/posts/bypath", "response": {"$ref": "Post"}}, "patch": {"scopes": ["https://www.googleapis.com/auth/blogger"], "parameters": {"postId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Post"}, "response": {"$ref": "Post"}, "httpMethod": "PATCH", "path": "blogs/{blogId}/posts/{postId}", "id": "blogger.posts.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/blogger"], "path": "blogs/{blogId}/posts/{postId}", "id": "blogger.posts.delete", "parameters": {"postId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->pages = new Google_PagesServiceResource($this, $this->serviceName, 'pages', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"fetchBodies": {"type": "boolean", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.pages.list", "httpMethod": "GET", "path": "blogs/{blogId}/pages", "response": {"$ref": "PageList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"pageId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.pages.get", "httpMethod": "GET", "path": "blogs/{blogId}/pages/{pageId}", "response": {"$ref": "Page"}}}}', true));
$this->comments = new Google_CommentsServiceResource($this, $this->serviceName, 'comments', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"startDate": {"type": "string", "location": "query", "format": "date-time"}, "postId": {"required": true, "type": "string", "location": "path"}, "endDate": {"type": "string", "location": "query", "format": "date-time"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "fetchBodies": {"type": "boolean", "location": "query"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.comments.list", "httpMethod": "GET", "path": "blogs/{blogId}/posts/{postId}/comments", "response": {"$ref": "CommentList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"commentId": {"required": true, "type": "string", "location": "path"}, "postId": {"required": true, "type": "string", "location": "path"}, "blogId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.comments.get", "httpMethod": "GET", "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", "response": {"$ref": "Comment"}}}}', true));
$this->users = new Google_UsersServiceResource($this, $this->serviceName, 'users', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/blogger", "https://www.googleapis.com/auth/blogger.readonly"], "parameters": {"userId": {"required": true, "type": "string", "location": "path"}}, "id": "blogger.users.get", "httpMethod": "GET", "path": "users/{userId}", "response": {"$ref": "User"}}}}', true));
}
}
class Google_Blog extends Google_Model {
public $kind;
public $description;
protected $__localeType = 'Google_BlogLocale';
protected $__localeDataType = '';
public $locale;
protected $__postsType = 'Google_BlogPosts';
protected $__postsDataType = '';
public $posts;
public $customMetaData;
public $updated;
protected $__pagesType = 'Google_BlogPages';
protected $__pagesDataType = '';
public $pages;
public $url;
public $published;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setLocale(Google_BlogLocale $locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setPosts(Google_BlogPosts $posts) {
$this->posts = $posts;
}
public function getPosts() {
return $this->posts;
}
public function setCustomMetaData($customMetaData) {
$this->customMetaData = $customMetaData;
}
public function getCustomMetaData() {
return $this->customMetaData;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setPages(Google_BlogPages $pages) {
$this->pages = $pages;
}
public function getPages() {
return $this->pages;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_BlogList extends Google_Model {
protected $__itemsType = 'Google_Blog';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Blog) */ $items) {
$this->assertIsArray($items, 'Google_Blog', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_BlogLocale extends Google_Model {
public $country;
public $variant;
public $language;
public function setCountry($country) {
$this->country = $country;
}
public function getCountry() {
return $this->country;
}
public function setVariant($variant) {
$this->variant = $variant;
}
public function getVariant() {
return $this->variant;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
class Google_BlogPages extends Google_Model {
public $totalItems;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_BlogPosts extends Google_Model {
public $totalItems;
protected $__itemsType = 'Google_Post';
protected $__itemsDataType = 'array';
public $items;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setItems(/* array(Google_Post) */ $items) {
$this->assertIsArray($items, 'Google_Post', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Comment extends Google_Model {
public $content;
public $kind;
protected $__inReplyToType = 'Google_CommentInReplyTo';
protected $__inReplyToDataType = '';
public $inReplyTo;
protected $__authorType = 'Google_CommentAuthor';
protected $__authorDataType = '';
public $author;
public $updated;
protected $__blogType = 'Google_CommentBlog';
protected $__blogDataType = '';
public $blog;
public $published;
protected $__postType = 'Google_CommentPost';
protected $__postDataType = '';
public $post;
public $id;
public $selfLink;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setInReplyTo(Google_CommentInReplyTo $inReplyTo) {
$this->inReplyTo = $inReplyTo;
}
public function getInReplyTo() {
return $this->inReplyTo;
}
public function setAuthor(Google_CommentAuthor $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setBlog(Google_CommentBlog $blog) {
$this->blog = $blog;
}
public function getBlog() {
return $this->blog;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setPost(Google_CommentPost $post) {
$this->post = $post;
}
public function getPost() {
return $this->post;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_CommentAuthor extends Google_Model {
public $url;
protected $__imageType = 'Google_CommentAuthorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_CommentAuthorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentAuthorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_CommentBlog extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentInReplyTo extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_CommentList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Comment';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $prevPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Comment) */ $items) {
$this->assertIsArray($items, 'Google_Comment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
}
class Google_CommentPost extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_Page extends Google_Model {
public $content;
public $kind;
protected $__authorType = 'Google_PageAuthor';
protected $__authorDataType = '';
public $author;
public $url;
public $title;
public $updated;
protected $__blogType = 'Google_PageBlog';
protected $__blogDataType = '';
public $blog;
public $published;
public $id;
public $selfLink;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAuthor(Google_PageAuthor $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setBlog(Google_PageBlog $blog) {
$this->blog = $blog;
}
public function getBlog() {
return $this->blog;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_PageAuthor extends Google_Model {
public $url;
protected $__imageType = 'Google_PageAuthorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_PageAuthorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_PageAuthorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_PageBlog extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_PageList extends Google_Model {
protected $__itemsType = 'Google_Page';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Page) */ $items) {
$this->assertIsArray($items, 'Google_Page', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Post extends Google_Model {
public $content;
public $kind;
protected $__authorType = 'Google_PostAuthor';
protected $__authorDataType = '';
public $author;
protected $__repliesType = 'Google_PostReplies';
protected $__repliesDataType = '';
public $replies;
public $labels;
public $customMetaData;
public $updated;
protected $__blogType = 'Google_PostBlog';
protected $__blogDataType = '';
public $blog;
public $url;
protected $__locationType = 'Google_PostLocation';
protected $__locationDataType = '';
public $location;
public $published;
public $title;
public $id;
public $selfLink;
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAuthor(Google_PostAuthor $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setReplies(Google_PostReplies $replies) {
$this->replies = $replies;
}
public function getReplies() {
return $this->replies;
}
public function setLabels(/* array(Google_string) */ $labels) {
$this->assertIsArray($labels, 'Google_string', __METHOD__);
$this->labels = $labels;
}
public function getLabels() {
return $this->labels;
}
public function setCustomMetaData($customMetaData) {
$this->customMetaData = $customMetaData;
}
public function getCustomMetaData() {
return $this->customMetaData;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setBlog(Google_PostBlog $blog) {
$this->blog = $blog;
}
public function getBlog() {
return $this->blog;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setLocation(Google_PostLocation $location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setPublished($published) {
$this->published = $published;
}
public function getPublished() {
return $this->published;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_PostAuthor extends Google_Model {
public $url;
protected $__imageType = 'Google_PostAuthorImage';
protected $__imageDataType = '';
public $image;
public $displayName;
public $id;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setImage(Google_PostAuthorImage $image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_PostAuthorImage extends Google_Model {
public $url;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
}
class Google_PostBlog extends Google_Model {
public $id;
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_PostList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Post';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $prevPageToken;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Post) */ $items) {
$this->assertIsArray($items, 'Google_Post', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setPrevPageToken($prevPageToken) {
$this->prevPageToken = $prevPageToken;
}
public function getPrevPageToken() {
return $this->prevPageToken;
}
}
class Google_PostLocation extends Google_Model {
public $lat;
public $lng;
public $span;
public $name;
public function setLat($lat) {
$this->lat = $lat;
}
public function getLat() {
return $this->lat;
}
public function setLng($lng) {
$this->lng = $lng;
}
public function getLng() {
return $this->lng;
}
public function setSpan($span) {
$this->span = $span;
}
public function getSpan() {
return $this->span;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_PostReplies extends Google_Model {
public $totalItems;
protected $__itemsType = 'Google_Comment';
protected $__itemsDataType = 'array';
public $items;
public $selfLink;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setItems(/* array(Google_Comment) */ $items) {
$this->assertIsArray($items, 'Google_Comment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_User extends Google_Model {
public $about;
public $displayName;
public $created;
protected $__localeType = 'Google_UserLocale';
protected $__localeDataType = '';
public $locale;
protected $__blogsType = 'Google_UserBlogs';
protected $__blogsDataType = '';
public $blogs;
public $kind;
public $url;
public $id;
public $selfLink;
public function setAbout($about) {
$this->about = $about;
}
public function getAbout() {
return $this->about;
}
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setLocale(Google_UserLocale $locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setBlogs(Google_UserBlogs $blogs) {
$this->blogs = $blogs;
}
public function getBlogs() {
return $this->blogs;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_UserBlogs extends Google_Model {
public $selfLink;
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_UserLocale extends Google_Model {
public $country;
public $variant;
public $language;
public function setCountry($country) {
$this->country = $country;
}
public function getCountry() {
return $this->country;
}
public function setVariant($variant) {
$this->variant = $variant;
}
public function getVariant() {
return $this->variant;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_BloggerService.php | PHP | asf20 | 41,662 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "urlchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $urlchannels = $adsenseService->urlchannels;
* </code>
*/
class Google_UrlchannelsServiceResource extends Google_ServiceResource {
/**
* List all URL channels in the specified ad client for this AdSense account. (urlchannels.list)
*
* @param string $adClientId Ad client for which to list URL channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of URL channels to include in the response, used for paging.
* @return Google_UrlChannels
*/
public function listUrlchannels($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_UrlChannels($data);
} else {
return $data;
}
}
}
/**
* The "adunits" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adunits = $adsenseService->adunits;
* </code>
*/
class Google_AdunitsServiceResource extends Google_ServiceResource {
/**
* List all ad units in the specified ad client for this AdSense account. (adunits.list)
*
* @param string $adClientId Ad client for which to list ad units.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeInactive Whether to include inactive ad units. Default: true.
* @opt_param string pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of ad units to include in the response, used for paging.
* @return Google_AdUnits
*/
public function listAdunits($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdUnits($data);
} else {
return $data;
}
}
/**
* Gets the specified ad unit in the specified ad client. (adunits.get)
*
* @param string $adClientId Ad client for which to get the ad unit.
* @param string $adUnitId Ad unit to retrieve.
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function get($adClientId, $adUnitId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
}
/**
* The "customchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $customchannels = $adsenseService->customchannels;
* </code>
*/
class Google_AdunitsCustomchannelsServiceResource extends Google_ServiceResource {
/**
* List all custom channels which the specified ad unit belongs to. (customchannels.list)
*
* @param string $adClientId Ad client which contains the ad unit.
* @param string $adUnitId Ad unit for which to list custom channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of custom channels to include in the response, used for paging.
* @return Google_CustomChannels
*/
public function listAdunitsCustomchannels($adClientId, $adUnitId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CustomChannels($data);
} else {
return $data;
}
}
}
/**
* The "adclients" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adclients = $adsenseService->adclients;
* </code>
*/
class Google_AdclientsServiceResource extends Google_ServiceResource {
/**
* List all ad clients in this AdSense account. (adclients.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of ad clients to include in the response, used for paging.
* @return Google_AdClients
*/
public function listAdclients($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdClients($data);
} else {
return $data;
}
}
}
/**
* The "reports" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $reports = $adsenseService->reports;
* </code>
*/
class Google_ReportsServiceResource extends Google_ServiceResource {
/**
* Generate an AdSense report based on the report request sent in the query parameters. Returns the
* result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
* (reports.generate)
*
* @param string $startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param string $endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param array $optParams Optional parameters.
*
* @opt_param string sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
* @opt_param string locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
* @opt_param string metric Numeric columns to include in the report.
* @opt_param int maxResults The maximum number of rows of report data to return.
* @opt_param string filter Filters to be run on the report.
* @opt_param string currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
* @opt_param int startIndex Index of the first row of report data to return.
* @opt_param string dimension Dimensions to base the report on.
* @opt_param string accountId Accounts upon which to report.
* @return Google_AdsenseReportsGenerateResponse
*/
public function generate($startDate, $endDate, $optParams = array()) {
$params = array('startDate' => $startDate, 'endDate' => $endDate);
$params = array_merge($params, $optParams);
$data = $this->__call('generate', array($params));
if ($this->useObjects()) {
return new Google_AdsenseReportsGenerateResponse($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $accounts = $adsenseService->accounts;
* </code>
*/
class Google_AccountsServiceResource extends Google_ServiceResource {
/**
* List all accounts available to this AdSense account. (accounts.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of accounts to include in the response, used for paging.
* @return Google_Accounts
*/
public function listAccounts($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Accounts($data);
} else {
return $data;
}
}
/**
* Get information about the selected AdSense account. (accounts.get)
*
* @param string $accountId Account to get information about.
* @param array $optParams Optional parameters.
*
* @opt_param bool tree Whether the tree of sub accounts should be returned.
* @return Google_Account
*/
public function get($accountId, $optParams = array()) {
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Account($data);
} else {
return $data;
}
}
}
/**
* The "urlchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $urlchannels = $adsenseService->urlchannels;
* </code>
*/
class Google_AccountsUrlchannelsServiceResource extends Google_ServiceResource {
/**
* List all URL channels in the specified ad client for the specified account. (urlchannels.list)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client for which to list URL channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of URL channels to include in the response, used for paging.
* @return Google_UrlChannels
*/
public function listAccountsUrlchannels($accountId, $adClientId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_UrlChannels($data);
} else {
return $data;
}
}
}
/**
* The "adunits" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adunits = $adsenseService->adunits;
* </code>
*/
class Google_AccountsAdunitsServiceResource extends Google_ServiceResource {
/**
* List all ad units in the specified ad client for the specified account. (adunits.list)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client for which to list ad units.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeInactive Whether to include inactive ad units. Default: true.
* @opt_param string pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of ad units to include in the response, used for paging.
* @return Google_AdUnits
*/
public function listAccountsAdunits($accountId, $adClientId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdUnits($data);
} else {
return $data;
}
}
/**
* Gets the specified ad unit in the specified ad client for the specified account. (adunits.get)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client for which to get the ad unit.
* @param string $adUnitId Ad unit to retrieve.
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function get($accountId, $adClientId, $adUnitId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
}
/**
* The "customchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $customchannels = $adsenseService->customchannels;
* </code>
*/
class Google_AccountsAdunitsCustomchannelsServiceResource extends Google_ServiceResource {
/**
* List all custom channels which the specified ad unit belongs to. (customchannels.list)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client which contains the ad unit.
* @param string $adUnitId Ad unit for which to list custom channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of custom channels to include in the response, used for paging.
* @return Google_CustomChannels
*/
public function listAccountsAdunitsCustomchannels($accountId, $adClientId, $adUnitId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CustomChannels($data);
} else {
return $data;
}
}
}
/**
* The "adclients" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adclients = $adsenseService->adclients;
* </code>
*/
class Google_AccountsAdclientsServiceResource extends Google_ServiceResource {
/**
* List all ad clients in the specified account. (adclients.list)
*
* @param string $accountId Account for which to list ad clients.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of ad clients to include in the response, used for paging.
* @return Google_AdClients
*/
public function listAccountsAdclients($accountId, $optParams = array()) {
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdClients($data);
} else {
return $data;
}
}
}
/**
* The "reports" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $reports = $adsenseService->reports;
* </code>
*/
class Google_AccountsReportsServiceResource extends Google_ServiceResource {
/**
* Generate an AdSense report based on the report request sent in the query parameters. Returns the
* result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
* (reports.generate)
*
* @param string $accountId Account upon which to report.
* @param string $startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param string $endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param array $optParams Optional parameters.
*
* @opt_param string sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
* @opt_param string locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
* @opt_param string metric Numeric columns to include in the report.
* @opt_param int maxResults The maximum number of rows of report data to return.
* @opt_param string filter Filters to be run on the report.
* @opt_param string currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
* @opt_param int startIndex Index of the first row of report data to return.
* @opt_param string dimension Dimensions to base the report on.
* @return Google_AdsenseReportsGenerateResponse
*/
public function generate($accountId, $startDate, $endDate, $optParams = array()) {
$params = array('accountId' => $accountId, 'startDate' => $startDate, 'endDate' => $endDate);
$params = array_merge($params, $optParams);
$data = $this->__call('generate', array($params));
if ($this->useObjects()) {
return new Google_AdsenseReportsGenerateResponse($data);
} else {
return $data;
}
}
}
/**
* The "customchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $customchannels = $adsenseService->customchannels;
* </code>
*/
class Google_AccountsCustomchannelsServiceResource extends Google_ServiceResource {
/**
* List all custom channels in the specified ad client for the specified account.
* (customchannels.list)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client for which to list custom channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of custom channels to include in the response, used for paging.
* @return Google_CustomChannels
*/
public function listAccountsCustomchannels($accountId, $adClientId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CustomChannels($data);
} else {
return $data;
}
}
/**
* Get the specified custom channel from the specified ad client for the specified account.
* (customchannels.get)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client which contains the custom channel.
* @param string $customChannelId Custom channel to retrieve.
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function get($accountId, $adClientId, $customChannelId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
}
/**
* The "adunits" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adunits = $adsenseService->adunits;
* </code>
*/
class Google_AccountsCustomchannelsAdunitsServiceResource extends Google_ServiceResource {
/**
* List all ad units in the specified custom channel. (adunits.list)
*
* @param string $accountId Account to which the ad client belongs.
* @param string $adClientId Ad client which contains the custom channel.
* @param string $customChannelId Custom channel for which to list ad units.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeInactive Whether to include inactive ad units. Default: true.
* @opt_param int maxResults The maximum number of ad units to include in the response, used for paging.
* @opt_param string pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @return Google_AdUnits
*/
public function listAccountsCustomchannelsAdunits($accountId, $adClientId, $customChannelId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdUnits($data);
} else {
return $data;
}
}
}
/**
* The "customchannels" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $customchannels = $adsenseService->customchannels;
* </code>
*/
class Google_CustomchannelsServiceResource extends Google_ServiceResource {
/**
* List all custom channels in the specified ad client for this AdSense account.
* (customchannels.list)
*
* @param string $adClientId Ad client for which to list custom channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of custom channels to include in the response, used for paging.
* @return Google_CustomChannels
*/
public function listCustomchannels($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CustomChannels($data);
} else {
return $data;
}
}
/**
* Get the specified custom channel from the specified ad client. (customchannels.get)
*
* @param string $adClientId Ad client which contains the custom channel.
* @param string $customChannelId Custom channel to retrieve.
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function get($adClientId, $customChannelId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
}
/**
* The "adunits" collection of methods.
* Typical usage is:
* <code>
* $adsenseService = new Google_AdsenseService(...);
* $adunits = $adsenseService->adunits;
* </code>
*/
class Google_CustomchannelsAdunitsServiceResource extends Google_ServiceResource {
/**
* List all ad units in the specified custom channel. (adunits.list)
*
* @param string $adClientId Ad client which contains the custom channel.
* @param string $customChannelId Custom channel for which to list ad units.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeInactive Whether to include inactive ad units. Default: true.
* @opt_param string pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param int maxResults The maximum number of ad units to include in the response, used for paging.
* @return Google_AdUnits
*/
public function listCustomchannelsAdunits($adClientId, $customChannelId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdUnits($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Adsense (v1.1).
*
* <p>
* Gives AdSense publishers access to their inventory and the ability to generate reports
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/adsense/management/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AdsenseService extends Google_Service {
public $urlchannels;
public $adunits;
public $adunits_customchannels;
public $adclients;
public $reports;
public $accounts;
public $accounts_urlchannels;
public $accounts_adunits;
public $accounts_adunits_customchannels;
public $accounts_adclients;
public $accounts_reports;
public $accounts_customchannels;
public $accounts_customchannels_adunits;
public $customchannels;
public $customchannels_adunits;
/**
* Constructs the internal representation of the Adsense service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'adsense/v1.1/';
$this->version = 'v1.1';
$this->serviceName = 'adsense';
$client->addService($this->serviceName, $this->version);
$this->urlchannels = new Google_UrlchannelsServiceResource($this, $this->serviceName, 'urlchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "id": "adsense.urlchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/urlchannels", "response": {"$ref": "UrlChannels"}}}}', true));
$this->adunits = new Google_AdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "id": "adsense.adunits.list", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits", "response": {"$ref": "AdUnits"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.adunits.get", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits/{adUnitId}", "response": {"$ref": "AdUnit"}}}}', true));
$this->adunits_customchannels = new Google_AdunitsCustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "adUnitId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.adunits.customchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", "response": {"$ref": "CustomChannels"}}}}', true));
$this->adclients = new Google_AdclientsServiceResource($this, $this->serviceName, 'adclients', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "response": {"$ref": "AdClients"}, "httpMethod": "GET", "path": "adclients", "id": "adsense.adclients.list"}}}', true));
$this->reports = new Google_ReportsServiceResource($this, $this->serviceName, 'reports', json_decode('{"methods": {"generate": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"sort": {"repeated": true, "type": "string", "location": "query"}, "startDate": {"required": true, "type": "string", "location": "query"}, "endDate": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "metric": {"repeated": true, "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "50000", "format": "int32"}, "filter": {"repeated": true, "type": "string", "location": "query"}, "currency": {"type": "string", "location": "query"}, "startIndex": {"location": "query", "minimum": "0", "type": "integer", "maximum": "5000", "format": "int32"}, "dimension": {"repeated": true, "type": "string", "location": "query"}, "accountId": {"repeated": true, "type": "string", "location": "query"}}, "id": "adsense.reports.generate", "httpMethod": "GET", "supportsMediaDownload": true, "path": "reports", "response": {"$ref": "AdsenseReportsGenerateResponse"}}}}', true));
$this->accounts = new Google_AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "response": {"$ref": "Accounts"}, "httpMethod": "GET", "path": "accounts", "id": "adsense.accounts.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"tree": {"type": "boolean", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.get", "httpMethod": "GET", "path": "accounts/{accountId}", "response": {"$ref": "Account"}}}}', true));
$this->accounts_urlchannels = new Google_AccountsUrlchannelsServiceResource($this, $this->serviceName, 'urlchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.urlchannels.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", "response": {"$ref": "UrlChannels"}}}}', true));
$this->accounts_adunits = new Google_AccountsAdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.adunits.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits", "response": {"$ref": "AdUnits"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.adunits.get", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", "response": {"$ref": "AdUnit"}}}}', true));
$this->accounts_adunits_customchannels = new Google_AccountsAdunitsCustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.adunits.customchannels.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels", "response": {"$ref": "CustomChannels"}}}}', true));
$this->accounts_adclients = new Google_AccountsAdclientsServiceResource($this, $this->serviceName, 'adclients', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.adclients.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients", "response": {"$ref": "AdClients"}}}}', true));
$this->accounts_reports = new Google_AccountsReportsServiceResource($this, $this->serviceName, 'reports', json_decode('{"methods": {"generate": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"sort": {"repeated": true, "type": "string", "location": "query"}, "startDate": {"required": true, "type": "string", "location": "query"}, "endDate": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "metric": {"repeated": true, "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "50000", "format": "int32"}, "filter": {"repeated": true, "type": "string", "location": "query"}, "currency": {"type": "string", "location": "query"}, "startIndex": {"location": "query", "minimum": "0", "type": "integer", "maximum": "5000", "format": "int32"}, "dimension": {"repeated": true, "type": "string", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.reports.generate", "httpMethod": "GET", "supportsMediaDownload": true, "path": "accounts/{accountId}/reports", "response": {"$ref": "AdsenseReportsGenerateResponse"}}}}', true));
$this->accounts_customchannels = new Google_AccountsCustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.customchannels.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", "response": {"$ref": "CustomChannels"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.customchannels.get", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", "response": {"$ref": "CustomChannel"}}}}', true));
$this->accounts_customchannels_adunits = new Google_AccountsCustomchannelsAdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}, "pageToken": {"type": "string", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.accounts.customchannels.adunits.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits", "response": {"$ref": "AdUnits"}}}}', true));
$this->customchannels = new Google_CustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "id": "adsense.customchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/customchannels", "response": {"$ref": "CustomChannels"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}}, "id": "adsense.customchannels.get", "httpMethod": "GET", "path": "adclients/{adClientId}/customchannels/{customChannelId}", "response": {"$ref": "CustomChannel"}}}}', true));
$this->customchannels_adunits = new Google_CustomchannelsAdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsense", "https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "int32"}}, "id": "adsense.customchannels.adunits.list", "httpMethod": "GET", "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", "response": {"$ref": "AdUnits"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $kind;
public $id;
protected $__subAccountsType = 'Google_Account';
protected $__subAccountsDataType = 'array';
public $subAccounts;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSubAccounts($subAccounts) {
$this->assertIsArray($subAccounts, 'Google_Account', __METHOD__);
$this->subAccounts = $subAccounts;
}
public function getSubAccounts() {
return $this->subAccounts;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Accounts extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AdClient extends Google_Model {
public $productCode;
public $kind;
public $id;
public $supportsReporting;
public function setProductCode($productCode) {
$this->productCode = $productCode;
}
public function getProductCode() {
return $this->productCode;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSupportsReporting($supportsReporting) {
$this->supportsReporting = $supportsReporting;
}
public function getSupportsReporting() {
return $this->supportsReporting;
}
}
class Google_AdClients extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_AdClient';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_AdClient', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AdUnit extends Google_Model {
public $status;
public $kind;
public $code;
public $id;
public $name;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCode($code) {
$this->code = $code;
}
public function getCode() {
return $this->code;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_AdUnits extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_AdUnit';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_AdUnit', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AdsenseReportsGenerateResponse extends Google_Model {
public $kind;
public $rows;
public $warnings;
public $totals;
protected $__headersType = 'Google_AdsenseReportsGenerateResponseHeaders';
protected $__headersDataType = 'array';
public $headers;
public $totalMatchedRows;
public $averages;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows($rows) {
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setWarnings($warnings) {
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
public function setTotals($totals) {
$this->totals = $totals;
}
public function getTotals() {
return $this->totals;
}
public function setHeaders($headers) {
$this->assertIsArray($headers, 'Google_AdsenseReportsGenerateResponseHeaders', __METHOD__);
$this->headers = $headers;
}
public function getHeaders() {
return $this->headers;
}
public function setTotalMatchedRows($totalMatchedRows) {
$this->totalMatchedRows = $totalMatchedRows;
}
public function getTotalMatchedRows() {
return $this->totalMatchedRows;
}
public function setAverages($averages) {
$this->averages = $averages;
}
public function getAverages() {
return $this->averages;
}
}
class Google_AdsenseReportsGenerateResponseHeaders extends Google_Model {
public $currency;
public $type;
public $name;
public function setCurrency($currency) {
$this->currency = $currency;
}
public function getCurrency() {
return $this->currency;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_CustomChannel extends Google_Model {
public $kind;
public $code;
protected $__targetingInfoType = 'Google_CustomChannelTargetingInfo';
protected $__targetingInfoDataType = '';
public $targetingInfo;
public $id;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCode($code) {
$this->code = $code;
}
public function getCode() {
return $this->code;
}
public function setTargetingInfo(Google_CustomChannelTargetingInfo $targetingInfo) {
$this->targetingInfo = $targetingInfo;
}
public function getTargetingInfo() {
return $this->targetingInfo;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_CustomChannelTargetingInfo extends Google_Model {
public $location;
public $adsAppearOn;
public $siteLanguage;
public $description;
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
public function setAdsAppearOn($adsAppearOn) {
$this->adsAppearOn = $adsAppearOn;
}
public function getAdsAppearOn() {
return $this->adsAppearOn;
}
public function setSiteLanguage($siteLanguage) {
$this->siteLanguage = $siteLanguage;
}
public function getSiteLanguage() {
return $this->siteLanguage;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class Google_CustomChannels extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_CustomChannel';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_CustomChannel', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_UrlChannel extends Google_Model {
public $kind;
public $id;
public $urlPattern;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setUrlPattern($urlPattern) {
$this->urlPattern = $urlPattern;
}
public function getUrlPattern() {
return $this->urlPattern;
}
}
class Google_UrlChannels extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_UrlChannel';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_UrlChannel', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_AdsenseService.php | PHP | asf20 | 52,488 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "urlchannels" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $urlchannels = $adsensehostService->urlchannels;
* </code>
*/
class Google_UrlchannelsServiceResource extends Google_ServiceResource {
/**
* Add a new URL channel to the host AdSense account. (urlchannels.insert)
*
* @param string $adClientId Ad client to which the new URL channel will be added.
* @param Google_UrlChannel $postBody
* @param array $optParams Optional parameters.
* @return Google_UrlChannel
*/
public function insert($adClientId, Google_UrlChannel $postBody, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_UrlChannel($data);
} else {
return $data;
}
}
/**
* List all host URL channels in the host AdSense account. (urlchannels.list)
*
* @param string $adClientId Ad client for which to list URL channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of URL channels to include in the response, used for paging.
* @return Google_UrlChannels
*/
public function listUrlchannels($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_UrlChannels($data);
} else {
return $data;
}
}
/**
* Delete a URL channel from the host AdSense account. (urlchannels.delete)
*
* @param string $adClientId Ad client from which to delete the URL channel.
* @param string $urlChannelId URL channel to delete.
* @param array $optParams Optional parameters.
* @return Google_UrlChannel
*/
public function delete($adClientId, $urlChannelId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'urlChannelId' => $urlChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_UrlChannel($data);
} else {
return $data;
}
}
}
/**
* The "adclients" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $adclients = $adsensehostService->adclients;
* </code>
*/
class Google_AdclientsServiceResource extends Google_ServiceResource {
/**
* List all host ad clients in this AdSense account. (adclients.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of ad clients to include in the response, used for paging.
* @return Google_AdClients
*/
public function listAdclients($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdClients($data);
} else {
return $data;
}
}
/**
* Get information about one of the ad clients in the Host AdSense account. (adclients.get)
*
* @param string $adClientId Ad client to get.
* @param array $optParams Optional parameters.
* @return Google_AdClient
*/
public function get($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AdClient($data);
} else {
return $data;
}
}
}
/**
* The "associationsessions" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $associationsessions = $adsensehostService->associationsessions;
* </code>
*/
class Google_AssociationsessionsServiceResource extends Google_ServiceResource {
/**
* Create an association session for initiating an association with an AdSense user.
* (associationsessions.start)
*
* @param string $productCode Products to associate with the user.
* @param string $websiteUrl The URL of the user's hosted website.
* @param array $optParams Optional parameters.
*
* @opt_param string websiteLocale The locale of the user's hosted website.
* @opt_param string userLocale The preferred locale of the user.
* @return Google_AssociationSession
*/
public function start($productCode, $websiteUrl, $optParams = array()) {
$params = array('productCode' => $productCode, 'websiteUrl' => $websiteUrl);
$params = array_merge($params, $optParams);
$data = $this->__call('start', array($params));
if ($this->useObjects()) {
return new Google_AssociationSession($data);
} else {
return $data;
}
}
/**
* Verify an association session after the association callback returns from AdSense signup.
* (associationsessions.verify)
*
* @param string $token The token returned to the association callback URL.
* @param array $optParams Optional parameters.
* @return Google_AssociationSession
*/
public function verify($token, $optParams = array()) {
$params = array('token' => $token);
$params = array_merge($params, $optParams);
$data = $this->__call('verify', array($params));
if ($this->useObjects()) {
return new Google_AssociationSession($data);
} else {
return $data;
}
}
}
/**
* The "reports" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $reports = $adsensehostService->reports;
* </code>
*/
class Google_ReportsServiceResource extends Google_ServiceResource {
/**
* Generate an AdSense report based on the report request sent in the query parameters. Returns the
* result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
* (reports.generate)
*
* @param string $endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param string $startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param array $optParams Optional parameters.
*
* @opt_param string sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
* @opt_param string locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
* @opt_param string metric Numeric columns to include in the report.
* @opt_param string maxResults The maximum number of rows of report data to return.
* @opt_param string filter Filters to be run on the report.
* @opt_param string startIndex Index of the first row of report data to return.
* @opt_param string dimension Dimensions to base the report on.
* @return Google_Report
*/
public function generate($endDate, $startDate, $optParams = array()) {
$params = array('endDate' => $endDate, 'startDate' => $startDate);
$params = array_merge($params, $optParams);
$data = $this->__call('generate', array($params));
if ($this->useObjects()) {
return new Google_Report($data);
} else {
return $data;
}
}
}
/**
* The "accounts" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $accounts = $adsensehostService->accounts;
* </code>
*/
class Google_AccountsServiceResource extends Google_ServiceResource {
/**
* List hosted accounts associated with this AdSense account by ad client id. (accounts.list)
*
* @param string $filterAdClientId Ad clients to list accounts for.
* @param array $optParams Optional parameters.
* @return Google_Accounts
*/
public function listAccounts($filterAdClientId, $optParams = array()) {
$params = array('filterAdClientId' => $filterAdClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Accounts($data);
} else {
return $data;
}
}
/**
* Get information about the selected associated AdSense account. (accounts.get)
*
* @param string $accountId Account to get information about.
* @param array $optParams Optional parameters.
* @return Google_Account
*/
public function get($accountId, $optParams = array()) {
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Account($data);
} else {
return $data;
}
}
}
/**
* The "adunits" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $adunits = $adsensehostService->adunits;
* </code>
*/
class Google_AccountsAdunitsServiceResource extends Google_ServiceResource {
/**
* Insert the supplied ad unit into the specified publisher AdSense account. (adunits.insert)
*
* @param string $accountId Account which will contain the ad unit.
* @param string $adClientId Ad client into which to insert the ad unit.
* @param Google_AdUnit $postBody
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function insert($accountId, $adClientId, Google_AdUnit $postBody, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
/**
* Get the specified host ad unit in this AdSense account. (adunits.get)
*
* @param string $accountId Account which contains the ad unit.
* @param string $adClientId Ad client for which to get ad unit.
* @param string $adUnitId Ad unit to get.
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function get($accountId, $adClientId, $adUnitId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
/**
* Get ad code for the specified ad unit, attaching the specified host custom channels.
* (adunits.getAdCode)
*
* @param string $accountId Account which contains the ad client.
* @param string $adClientId Ad client with contains the ad unit.
* @param string $adUnitId Ad unit to get the code for.
* @param array $optParams Optional parameters.
*
* @opt_param string hostCustomChannelId Host custom channel to attach to the ad code.
* @return Google_AdCode
*/
public function getAdCode($accountId, $adClientId, $adUnitId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('getAdCode', array($params));
if ($this->useObjects()) {
return new Google_AdCode($data);
} else {
return $data;
}
}
/**
* List all ad units in the specified publisher's AdSense account. (adunits.list)
*
* @param string $accountId Account which contains the ad client.
* @param string $adClientId Ad client for which to list ad units.
* @param array $optParams Optional parameters.
*
* @opt_param bool includeInactive Whether to include inactive ad units. Default: true.
* @opt_param string pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of ad units to include in the response, used for paging.
* @return Google_AdUnits
*/
public function listAccountsAdunits($accountId, $adClientId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdUnits($data);
} else {
return $data;
}
}
/**
* Update the supplied ad unit in the specified publisher AdSense account. (adunits.update)
*
* @param string $accountId Account which contains the ad client.
* @param string $adClientId Ad client which contains the ad unit.
* @param Google_AdUnit $postBody
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function update($accountId, $adClientId, Google_AdUnit $postBody, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
/**
* Update the supplied ad unit in the specified publisher AdSense account. This method supports
* patch semantics. (adunits.patch)
*
* @param string $accountId Account which contains the ad client.
* @param string $adClientId Ad client which contains the ad unit.
* @param string $adUnitId Ad unit to get.
* @param Google_AdUnit $postBody
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function patch($accountId, $adClientId, $adUnitId, Google_AdUnit $postBody, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
/**
* Delete the specified ad unit from the specified publisher AdSense account. (adunits.delete)
*
* @param string $accountId Account which contains the ad unit.
* @param string $adClientId Ad client for which to get ad unit.
* @param string $adUnitId Ad unit to delete.
* @param array $optParams Optional parameters.
* @return Google_AdUnit
*/
public function delete($accountId, $adClientId, $adUnitId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId, 'adUnitId' => $adUnitId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_AdUnit($data);
} else {
return $data;
}
}
}
/**
* The "adclients" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $adclients = $adsensehostService->adclients;
* </code>
*/
class Google_AccountsAdclientsServiceResource extends Google_ServiceResource {
/**
* List all hosted ad clients in the specified hosted account. (adclients.list)
*
* @param string $accountId Account for which to list ad clients.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of ad clients to include in the response, used for paging.
* @return Google_AdClients
*/
public function listAccountsAdclients($accountId, $optParams = array()) {
$params = array('accountId' => $accountId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_AdClients($data);
} else {
return $data;
}
}
/**
* Get information about one of the ad clients in the specified publisher's AdSense account.
* (adclients.get)
*
* @param string $accountId Account which contains the ad client.
* @param string $adClientId Ad client to get.
* @param array $optParams Optional parameters.
* @return Google_AdClient
*/
public function get($accountId, $adClientId, $optParams = array()) {
$params = array('accountId' => $accountId, 'adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_AdClient($data);
} else {
return $data;
}
}
}
/**
* The "reports" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $reports = $adsensehostService->reports;
* </code>
*/
class Google_AccountsReportsServiceResource extends Google_ServiceResource {
/**
* Generate an AdSense report based on the report request sent in the query parameters. Returns the
* result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
* (reports.generate)
*
* @param string $accountId Hosted account upon which to report.
* @param string $startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param string $endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive.
* @param array $optParams Optional parameters.
*
* @opt_param string sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
* @opt_param string locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
* @opt_param string metric Numeric columns to include in the report.
* @opt_param string maxResults The maximum number of rows of report data to return.
* @opt_param string filter Filters to be run on the report.
* @opt_param string startIndex Index of the first row of report data to return.
* @opt_param string dimension Dimensions to base the report on.
* @return Google_Report
*/
public function generate($accountId, $startDate, $endDate, $optParams = array()) {
$params = array('accountId' => $accountId, 'startDate' => $startDate, 'endDate' => $endDate);
$params = array_merge($params, $optParams);
$data = $this->__call('generate', array($params));
if ($this->useObjects()) {
return new Google_Report($data);
} else {
return $data;
}
}
}
/**
* The "customchannels" collection of methods.
* Typical usage is:
* <code>
* $adsensehostService = new Google_AdsensehostService(...);
* $customchannels = $adsensehostService->customchannels;
* </code>
*/
class Google_CustomchannelsServiceResource extends Google_ServiceResource {
/**
* Add a new custom channel to the host AdSense account. (customchannels.insert)
*
* @param string $adClientId Ad client to which the new custom channel will be added.
* @param Google_CustomChannel $postBody
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function insert($adClientId, Google_CustomChannel $postBody, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
/**
* Get a specific custom channel from the host AdSense account. (customchannels.get)
*
* @param string $adClientId Ad client from which to get the custom channel.
* @param string $customChannelId Custom channel to get.
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function get($adClientId, $customChannelId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
/**
* List all host custom channels in this AdSense account. (customchannels.list)
*
* @param string $adClientId Ad client for which to list custom channels.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
* @opt_param string maxResults The maximum number of custom channels to include in the response, used for paging.
* @return Google_CustomChannels
*/
public function listCustomchannels($adClientId, $optParams = array()) {
$params = array('adClientId' => $adClientId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CustomChannels($data);
} else {
return $data;
}
}
/**
* Update a custom channel in the host AdSense account. (customchannels.update)
*
* @param string $adClientId Ad client in which the custom channel will be updated.
* @param Google_CustomChannel $postBody
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function update($adClientId, Google_CustomChannel $postBody, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
/**
* Update a custom channel in the host AdSense account. This method supports patch semantics.
* (customchannels.patch)
*
* @param string $adClientId Ad client in which the custom channel will be updated.
* @param string $customChannelId Custom channel to get.
* @param Google_CustomChannel $postBody
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function patch($adClientId, $customChannelId, Google_CustomChannel $postBody, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'customChannelId' => $customChannelId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
/**
* Delete a specific custom channel from the host AdSense account. (customchannels.delete)
*
* @param string $adClientId Ad client from which to delete the custom channel.
* @param string $customChannelId Custom channel to delete.
* @param array $optParams Optional parameters.
* @return Google_CustomChannel
*/
public function delete($adClientId, $customChannelId, $optParams = array()) {
$params = array('adClientId' => $adClientId, 'customChannelId' => $customChannelId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_CustomChannel($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Adsensehost (v4.1).
*
* <p>
* Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/adsense/host/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_AdsensehostService extends Google_Service {
public $urlchannels;
public $adclients;
public $associationsessions;
public $reports;
public $accounts;
public $accounts_adunits;
public $accounts_adclients;
public $accounts_reports;
public $customchannels;
/**
* Constructs the internal representation of the Adsensehost service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'adsensehost/v4.1/';
$this->version = 'v4.1';
$this->serviceName = 'adsensehost';
$client->addService($this->serviceName, $this->version);
$this->urlchannels = new Google_UrlchannelsServiceResource($this, $this->serviceName, 'urlchannels', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "UrlChannel"}, "response": {"$ref": "UrlChannel"}, "httpMethod": "POST", "path": "adclients/{adClientId}/urlchannels", "id": "adsensehost.urlchannels.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "uint32"}}, "id": "adsensehost.urlchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/urlchannels", "response": {"$ref": "UrlChannels"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "urlChannelId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.urlchannels.delete", "httpMethod": "DELETE", "path": "adclients/{adClientId}/urlchannels/{urlChannelId}", "response": {"$ref": "UrlChannel"}}}}', true));
$this->adclients = new Google_AdclientsServiceResource($this, $this->serviceName, 'adclients', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "uint32"}}, "response": {"$ref": "AdClients"}, "httpMethod": "GET", "path": "adclients", "id": "adsensehost.adclients.list"}, "get": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.adclients.get", "httpMethod": "GET", "path": "adclients/{adClientId}", "response": {"$ref": "AdClient"}}}}', true));
$this->associationsessions = new Google_AssociationsessionsServiceResource($this, $this->serviceName, 'associationsessions', json_decode('{"methods": {"start": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"websiteLocale": {"type": "string", "location": "query"}, "productCode": {"repeated": true, "required": true, "type": "string", "location": "query", "enum": ["AFC", "AFF", "AFMC", "AFS"]}, "userLocale": {"type": "string", "location": "query"}, "websiteUrl": {"required": true, "type": "string", "location": "query"}}, "id": "adsensehost.associationsessions.start", "httpMethod": "GET", "path": "associationsessions/start", "response": {"$ref": "AssociationSession"}}, "verify": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"token": {"required": true, "type": "string", "location": "query"}}, "id": "adsensehost.associationsessions.verify", "httpMethod": "GET", "path": "associationsessions/verify", "response": {"$ref": "AssociationSession"}}}}', true));
$this->reports = new Google_ReportsServiceResource($this, $this->serviceName, 'reports', json_decode('{"methods": {"generate": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"sort": {"repeated": true, "type": "string", "location": "query"}, "startDate": {"required": true, "type": "string", "location": "query"}, "endDate": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "metric": {"repeated": true, "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "50000", "format": "uint32"}, "filter": {"repeated": true, "type": "string", "location": "query"}, "startIndex": {"location": "query", "minimum": "0", "type": "integer", "maximum": "5000", "format": "uint32"}, "dimension": {"repeated": true, "type": "string", "location": "query"}}, "id": "adsensehost.reports.generate", "httpMethod": "GET", "path": "reports", "response": {"$ref": "Report"}}}}', true));
$this->accounts = new Google_AccountsServiceResource($this, $this->serviceName, 'accounts', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"filterAdClientId": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "id": "adsensehost.accounts.list", "httpMethod": "GET", "path": "accounts", "response": {"$ref": "Accounts"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.get", "httpMethod": "GET", "path": "accounts/{accountId}", "response": {"$ref": "Account"}}}}', true));
$this->accounts_adunits = new Google_AccountsAdunitsServiceResource($this, $this->serviceName, 'adunits', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AdUnit"}, "response": {"$ref": "AdUnit"}, "httpMethod": "POST", "path": "accounts/{accountId}/adclients/{adClientId}/adunits", "id": "adsensehost.accounts.adunits.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adunits.get", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", "response": {"$ref": "AdUnit"}}, "getAdCode": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "hostCustomChannelId": {"repeated": true, "type": "string", "location": "query"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adunits.getAdCode", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode", "response": {"$ref": "AdCode"}}, "list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"includeInactive": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "uint32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adunits.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}/adunits", "response": {"$ref": "AdUnits"}}, "update": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AdUnit"}, "response": {"$ref": "AdUnit"}, "httpMethod": "PUT", "path": "accounts/{accountId}/adclients/{adClientId}/adunits", "id": "adsensehost.accounts.adunits.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "AdUnit"}, "response": {"$ref": "AdUnit"}, "httpMethod": "PATCH", "path": "accounts/{accountId}/adclients/{adClientId}/adunits", "id": "adsensehost.accounts.adunits.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "adUnitId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adunits.delete", "httpMethod": "DELETE", "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}", "response": {"$ref": "AdUnit"}}}}', true));
$this->accounts_adclients = new Google_AccountsAdclientsServiceResource($this, $this->serviceName, 'adclients', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "uint32"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adclients.list", "httpMethod": "GET", "path": "accounts/{accountId}/adclients", "response": {"$ref": "AdClients"}}, "get": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.adclients.get", "httpMethod": "GET", "path": "accounts/{accountId}/adclients/{adClientId}", "response": {"$ref": "AdClient"}}}}', true));
$this->accounts_reports = new Google_AccountsReportsServiceResource($this, $this->serviceName, 'reports', json_decode('{"methods": {"generate": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"sort": {"repeated": true, "type": "string", "location": "query"}, "startDate": {"required": true, "type": "string", "location": "query"}, "endDate": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "metric": {"repeated": true, "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "50000", "format": "uint32"}, "filter": {"repeated": true, "type": "string", "location": "query"}, "startIndex": {"location": "query", "minimum": "0", "type": "integer", "maximum": "5000", "format": "uint32"}, "dimension": {"repeated": true, "type": "string", "location": "query"}, "accountId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.accounts.reports.generate", "httpMethod": "GET", "path": "accounts/{accountId}/reports", "response": {"$ref": "Report"}}}}', true));
$this->customchannels = new Google_CustomchannelsServiceResource($this, $this->serviceName, 'customchannels', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CustomChannel"}, "response": {"$ref": "CustomChannel"}, "httpMethod": "POST", "path": "adclients/{adClientId}/customchannels", "id": "adsensehost.customchannels.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.customchannels.get", "httpMethod": "GET", "path": "adclients/{adClientId}/customchannels/{customChannelId}", "response": {"$ref": "CustomChannel"}}, "list": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "10000", "format": "uint32"}}, "id": "adsensehost.customchannels.list", "httpMethod": "GET", "path": "adclients/{adClientId}/customchannels", "response": {"$ref": "CustomChannels"}}, "update": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"adClientId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CustomChannel"}, "response": {"$ref": "CustomChannel"}, "httpMethod": "PUT", "path": "adclients/{adClientId}/customchannels", "id": "adsensehost.customchannels.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"customChannelId": {"required": true, "type": "string", "location": "query"}, "adClientId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "CustomChannel"}, "response": {"$ref": "CustomChannel"}, "httpMethod": "PATCH", "path": "adclients/{adClientId}/customchannels", "id": "adsensehost.customchannels.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/adsensehost"], "parameters": {"customChannelId": {"required": true, "type": "string", "location": "path"}, "adClientId": {"required": true, "type": "string", "location": "path"}}, "id": "adsensehost.customchannels.delete", "httpMethod": "DELETE", "path": "adclients/{adClientId}/customchannels/{customChannelId}", "response": {"$ref": "CustomChannel"}}}}', true));
}
}
class Google_Account extends Google_Model {
public $status;
public $kind;
public $id;
public $name;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Accounts extends Google_Model {
protected $__itemsType = 'Google_Account';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setItems($items) {
$this->assertIsArray($items, 'Google_Account', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AdClient extends Google_Model {
public $productCode;
public $kind;
public $id;
public $arcOptIn;
public $supportsReporting;
public function setProductCode($productCode) {
$this->productCode = $productCode;
}
public function getProductCode() {
return $this->productCode;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setArcOptIn($arcOptIn) {
$this->arcOptIn = $arcOptIn;
}
public function getArcOptIn() {
return $this->arcOptIn;
}
public function setSupportsReporting($supportsReporting) {
$this->supportsReporting = $supportsReporting;
}
public function getSupportsReporting() {
return $this->supportsReporting;
}
}
class Google_AdClients extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_AdClient';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_AdClient', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AdCode extends Google_Model {
public $adCode;
public $kind;
public function setAdCode($adCode) {
$this->adCode = $adCode;
}
public function getAdCode() {
return $this->adCode;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_AdStyle extends Google_Model {
public $corners;
protected $__colorsType = 'Google_AdStyleColors';
protected $__colorsDataType = '';
public $colors;
protected $__fontType = 'Google_AdStyleFont';
protected $__fontDataType = '';
public $font;
public $kind;
public function setCorners($corners) {
$this->corners = $corners;
}
public function getCorners() {
return $this->corners;
}
public function setColors(Google_AdStyleColors $colors) {
$this->colors = $colors;
}
public function getColors() {
return $this->colors;
}
public function setFont(Google_AdStyleFont $font) {
$this->font = $font;
}
public function getFont() {
return $this->font;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_AdStyleColors extends Google_Model {
public $url;
public $text;
public $border;
public $background;
public $title;
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setText($text) {
$this->text = $text;
}
public function getText() {
return $this->text;
}
public function setBorder($border) {
$this->border = $border;
}
public function getBorder() {
return $this->border;
}
public function setBackground($background) {
$this->background = $background;
}
public function getBackground() {
return $this->background;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
}
class Google_AdStyleFont extends Google_Model {
public $family;
public $size;
public function setFamily($family) {
$this->family = $family;
}
public function getFamily() {
return $this->family;
}
public function setSize($size) {
$this->size = $size;
}
public function getSize() {
return $this->size;
}
}
class Google_AdUnit extends Google_Model {
public $status;
public $kind;
public $code;
public $name;
protected $__contentAdsSettingsType = 'Google_AdUnitContentAdsSettings';
protected $__contentAdsSettingsDataType = '';
public $contentAdsSettings;
public $id;
protected $__mobileContentAdsSettingsType = 'Google_AdUnitMobileContentAdsSettings';
protected $__mobileContentAdsSettingsDataType = '';
public $mobileContentAdsSettings;
protected $__customStyleType = 'Google_AdStyle';
protected $__customStyleDataType = '';
public $customStyle;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCode($code) {
$this->code = $code;
}
public function getCode() {
return $this->code;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setContentAdsSettings(Google_AdUnitContentAdsSettings $contentAdsSettings) {
$this->contentAdsSettings = $contentAdsSettings;
}
public function getContentAdsSettings() {
return $this->contentAdsSettings;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setMobileContentAdsSettings(Google_AdUnitMobileContentAdsSettings $mobileContentAdsSettings) {
$this->mobileContentAdsSettings = $mobileContentAdsSettings;
}
public function getMobileContentAdsSettings() {
return $this->mobileContentAdsSettings;
}
public function setCustomStyle(Google_AdStyle $customStyle) {
$this->customStyle = $customStyle;
}
public function getCustomStyle() {
return $this->customStyle;
}
}
class Google_AdUnitContentAdsSettings extends Google_Model {
public $type;
protected $__backupOptionType = 'Google_AdUnitContentAdsSettingsBackupOption';
protected $__backupOptionDataType = '';
public $backupOption;
public $size;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setBackupOption(Google_AdUnitContentAdsSettingsBackupOption $backupOption) {
$this->backupOption = $backupOption;
}
public function getBackupOption() {
return $this->backupOption;
}
public function setSize($size) {
$this->size = $size;
}
public function getSize() {
return $this->size;
}
}
class Google_AdUnitContentAdsSettingsBackupOption extends Google_Model {
public $color;
public $url;
public $type;
public function setColor($color) {
$this->color = $color;
}
public function getColor() {
return $this->color;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_AdUnitMobileContentAdsSettings extends Google_Model {
public $scriptingLanguage;
public $type;
public $markupLanguage;
public $size;
public function setScriptingLanguage($scriptingLanguage) {
$this->scriptingLanguage = $scriptingLanguage;
}
public function getScriptingLanguage() {
return $this->scriptingLanguage;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setMarkupLanguage($markupLanguage) {
$this->markupLanguage = $markupLanguage;
}
public function getMarkupLanguage() {
return $this->markupLanguage;
}
public function setSize($size) {
$this->size = $size;
}
public function getSize() {
return $this->size;
}
}
class Google_AdUnits extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_AdUnit';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_AdUnit', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_AssociationSession extends Google_Model {
public $status;
public $productCodes;
public $kind;
public $userLocale;
public $websiteLocale;
public $redirectUrl;
public $websiteUrl;
public $id;
public $accountId;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setProductCodes($productCodes) {
$this->productCodes = $productCodes;
}
public function getProductCodes() {
return $this->productCodes;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUserLocale($userLocale) {
$this->userLocale = $userLocale;
}
public function getUserLocale() {
return $this->userLocale;
}
public function setWebsiteLocale($websiteLocale) {
$this->websiteLocale = $websiteLocale;
}
public function getWebsiteLocale() {
return $this->websiteLocale;
}
public function setRedirectUrl($redirectUrl) {
$this->redirectUrl = $redirectUrl;
}
public function getRedirectUrl() {
return $this->redirectUrl;
}
public function setWebsiteUrl($websiteUrl) {
$this->websiteUrl = $websiteUrl;
}
public function getWebsiteUrl() {
return $this->websiteUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAccountId($accountId) {
$this->accountId = $accountId;
}
public function getAccountId() {
return $this->accountId;
}
}
class Google_CustomChannel extends Google_Model {
public $kind;
public $code;
public $id;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCode($code) {
$this->code = $code;
}
public function getCode() {
return $this->code;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_CustomChannels extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_CustomChannel';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_CustomChannel', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_Report extends Google_Model {
public $kind;
public $rows;
public $warnings;
public $totals;
protected $__headersType = 'Google_ReportHeaders';
protected $__headersDataType = 'array';
public $headers;
public $totalMatchedRows;
public $averages;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows($rows) {
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setWarnings($warnings) {
$this->warnings = $warnings;
}
public function getWarnings() {
return $this->warnings;
}
public function setTotals($totals) {
$this->totals = $totals;
}
public function getTotals() {
return $this->totals;
}
public function setHeaders($headers) {
$this->assertIsArray($headers, 'Google_ReportHeaders', __METHOD__);
$this->headers = $headers;
}
public function getHeaders() {
return $this->headers;
}
public function setTotalMatchedRows($totalMatchedRows) {
$this->totalMatchedRows = $totalMatchedRows;
}
public function getTotalMatchedRows() {
return $this->totalMatchedRows;
}
public function setAverages($averages) {
$this->averages = $averages;
}
public function getAverages() {
return $this->averages;
}
}
class Google_ReportHeaders extends Google_Model {
public $currency;
public $type;
public $name;
public function setCurrency($currency) {
$this->currency = $currency;
}
public function getCurrency() {
return $this->currency;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_UrlChannel extends Google_Model {
public $kind;
public $id;
public $urlPattern;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setUrlPattern($urlPattern) {
$this->urlPattern = $urlPattern;
}
public function getUrlPattern() {
return $this->urlPattern;
}
}
class Google_UrlChannels extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_UrlChannel';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_UrlChannel', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_AdsensehostService.php | PHP | asf20 | 56,535 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "operations" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $operations = $computeService->operations;
* </code>
*/
class Google_OperationsServiceResource extends Google_ServiceResource {
/**
* Retrieves the specified operation resource. (operations.get)
*
* @param string $project Name of the project scoping this request.
* @param string $operation Name of the operation resource to return.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function get($project, $operation, $optParams = array()) {
$params = array('project' => $project, 'operation' => $operation);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Retrieves the list of operation resources contained within the specified project.
* (operations.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_OperationList
*/
public function listOperations($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_OperationList($data);
} else {
return $data;
}
}
/**
* Deletes the specified operation resource. (operations.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $operation Name of the operation resource to delete.
* @param array $optParams Optional parameters.
*/
public function delete($project, $operation, $optParams = array()) {
$params = array('project' => $project, 'operation' => $operation);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "kernels" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $kernels = $computeService->kernels;
* </code>
*/
class Google_KernelsServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of kernel resources available to the specified project. (kernels.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_KernelList
*/
public function listKernels($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_KernelList($data);
} else {
return $data;
}
}
/**
* Returns the specified kernel resource. (kernels.get)
*
* @param string $project Name of the project scoping this request.
* @param string $kernel Name of the kernel resource to return.
* @param array $optParams Optional parameters.
* @return Google_Kernel
*/
public function get($project, $kernel, $optParams = array()) {
$params = array('project' => $project, 'kernel' => $kernel);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Kernel($data);
} else {
return $data;
}
}
}
/**
* The "disks" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $disks = $computeService->disks;
* </code>
*/
class Google_DisksServiceResource extends Google_ServiceResource {
/**
* Creates a persistent disk resource in the specified project using the data included in the
* request. (disks.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Disk $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Disk $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified persistent disk resource. (disks.get)
*
* @param string $project Name of the project scoping this request.
* @param string $disk Name of the persistent disk resource to return.
* @param array $optParams Optional parameters.
* @return Google_Disk
*/
public function get($project, $disk, $optParams = array()) {
$params = array('project' => $project, 'disk' => $disk);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Disk($data);
} else {
return $data;
}
}
/**
* Retrieves the list of persistent disk resources contained within the specified project.
* (disks.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_DiskList
*/
public function listDisks($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DiskList($data);
} else {
return $data;
}
}
/**
* Deletes the specified persistent disk resource. (disks.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $disk Name of the persistent disk resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $disk, $optParams = array()) {
$params = array('project' => $project, 'disk' => $disk);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "snapshots" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $snapshots = $computeService->snapshots;
* </code>
*/
class Google_SnapshotsServiceResource extends Google_ServiceResource {
/**
* Creates a persistent disk snapshot resource in the specified project using the data included in
* the request. (snapshots.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Snapshot $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Snapshot $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified persistent disk snapshot resource. (snapshots.get)
*
* @param string $project Name of the project scoping this request.
* @param string $snapshot Name of the persistent disk snapshot resource to return.
* @param array $optParams Optional parameters.
* @return Google_Snapshot
*/
public function get($project, $snapshot, $optParams = array()) {
$params = array('project' => $project, 'snapshot' => $snapshot);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Snapshot($data);
} else {
return $data;
}
}
/**
* Retrieves the list of persistent disk snapshot resources contained within the specified project.
* (snapshots.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_SnapshotList
*/
public function listSnapshots($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_SnapshotList($data);
} else {
return $data;
}
}
/**
* Deletes the specified persistent disk snapshot resource. (snapshots.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $snapshot Name of the persistent disk snapshot resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $snapshot, $optParams = array()) {
$params = array('project' => $project, 'snapshot' => $snapshot);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "zones" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $zones = $computeService->zones;
* </code>
*/
class Google_ZonesServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of zone resources available to the specified project. (zones.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_ZoneList
*/
public function listZones($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ZoneList($data);
} else {
return $data;
}
}
/**
* Returns the specified zone resource. (zones.get)
*
* @param string $project Name of the project scoping this request.
* @param string $zone Name of the zone resource to return.
* @param array $optParams Optional parameters.
* @return Google_Zone
*/
public function get($project, $zone, $optParams = array()) {
$params = array('project' => $project, 'zone' => $zone);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Zone($data);
} else {
return $data;
}
}
}
/**
* The "instances" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $instances = $computeService->instances;
* </code>
*/
class Google_InstancesServiceResource extends Google_ServiceResource {
/**
* Creates an instance resource in the specified project using the data included in the request.
* (instances.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Instance $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Instance $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Deletes an access config from an instance's network interface. (instances.deleteAccessConfig)
*
* @param string $project Project name.
* @param string $instance Instance name.
* @param string $access_config Access config name.
* @param string $network_interface Network interface name.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function deleteAccessConfig($project, $instance, $access_config, $network_interface, $optParams = array()) {
$params = array('project' => $project, 'instance' => $instance, 'access_config' => $access_config, 'network_interface' => $network_interface);
$params = array_merge($params, $optParams);
$data = $this->__call('deleteAccessConfig', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified instance resource. (instances.get)
*
* @param string $project Name of the project scoping this request.
* @param string $instance Name of the instance resource to return.
* @param array $optParams Optional parameters.
* @return Google_Instance
*/
public function get($project, $instance, $optParams = array()) {
$params = array('project' => $project, 'instance' => $instance);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Instance($data);
} else {
return $data;
}
}
/**
* Retrieves the list of instance resources contained within the specified project. (instances.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_InstanceList
*/
public function listInstances($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_InstanceList($data);
} else {
return $data;
}
}
/**
* Adds an access config to an instance's network interface. (instances.addAccessConfig)
*
* @param string $project Project name.
* @param string $instance Instance name.
* @param string $network_interface Network interface name.
* @param Google_AccessConfig $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function addAccessConfig($project, $instance, $network_interface, Google_AccessConfig $postBody, $optParams = array()) {
$params = array('project' => $project, 'instance' => $instance, 'network_interface' => $network_interface, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('addAccessConfig', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Deletes the specified instance resource. (instances.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $instance Name of the instance resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $instance, $optParams = array()) {
$params = array('project' => $project, 'instance' => $instance);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "machineTypes" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $machineTypes = $computeService->machineTypes;
* </code>
*/
class Google_MachineTypesServiceResource extends Google_ServiceResource {
/**
* Retrieves the list of machine type resources available to the specified project.
* (machineTypes.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_MachineTypeList
*/
public function listMachineTypes($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_MachineTypeList($data);
} else {
return $data;
}
}
/**
* Returns the specified machine type resource. (machineTypes.get)
*
* @param string $project Name of the project scoping this request.
* @param string $machineType Name of the machine type resource to return.
* @param array $optParams Optional parameters.
* @return Google_MachineType
*/
public function get($project, $machineType, $optParams = array()) {
$params = array('project' => $project, 'machineType' => $machineType);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_MachineType($data);
} else {
return $data;
}
}
}
/**
* The "images" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $images = $computeService->images;
* </code>
*/
class Google_ImagesServiceResource extends Google_ServiceResource {
/**
* Creates an image resource in the specified project using the data included in the request.
* (images.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Image $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Image $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified image resource. (images.get)
*
* @param string $project Name of the project scoping this request.
* @param string $image Name of the image resource to return.
* @param array $optParams Optional parameters.
* @return Google_Image
*/
public function get($project, $image, $optParams = array()) {
$params = array('project' => $project, 'image' => $image);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Image($data);
} else {
return $data;
}
}
/**
* Retrieves the list of image resources available to the specified project. (images.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_ImageList
*/
public function listImages($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ImageList($data);
} else {
return $data;
}
}
/**
* Deletes the specified image resource. (images.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $image Name of the image resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $image, $optParams = array()) {
$params = array('project' => $project, 'image' => $image);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "firewalls" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $firewalls = $computeService->firewalls;
* </code>
*/
class Google_FirewallsServiceResource extends Google_ServiceResource {
/**
* Creates a firewall resource in the specified project using the data included in the request.
* (firewalls.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Firewall $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Firewall $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified firewall resource. (firewalls.get)
*
* @param string $project Name of the project scoping this request.
* @param string $firewall Name of the firewall resource to return.
* @param array $optParams Optional parameters.
* @return Google_Firewall
*/
public function get($project, $firewall, $optParams = array()) {
$params = array('project' => $project, 'firewall' => $firewall);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Firewall($data);
} else {
return $data;
}
}
/**
* Retrieves the list of firewall resources available to the specified project. (firewalls.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_FirewallList
*/
public function listFirewalls($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_FirewallList($data);
} else {
return $data;
}
}
/**
* Updates the specified firewall resource with the data included in the request. (firewalls.update)
*
* @param string $project Name of the project scoping this request.
* @param string $firewall Name of the firewall resource to update.
* @param Google_Firewall $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function update($project, $firewall, Google_Firewall $postBody, $optParams = array()) {
$params = array('project' => $project, 'firewall' => $firewall, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Updates the specified firewall resource with the data included in the request. This method
* supports patch semantics. (firewalls.patch)
*
* @param string $project Name of the project scoping this request.
* @param string $firewall Name of the firewall resource to update.
* @param Google_Firewall $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function patch($project, $firewall, Google_Firewall $postBody, $optParams = array()) {
$params = array('project' => $project, 'firewall' => $firewall, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Deletes the specified firewall resource. (firewalls.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $firewall Name of the firewall resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $firewall, $optParams = array()) {
$params = array('project' => $project, 'firewall' => $firewall);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "networks" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $networks = $computeService->networks;
* </code>
*/
class Google_NetworksServiceResource extends Google_ServiceResource {
/**
* Creates a network resource in the specified project using the data included in the request.
* (networks.insert)
*
* @param string $project Name of the project scoping this request.
* @param Google_Network $postBody
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function insert($project, Google_Network $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
/**
* Returns the specified network resource. (networks.get)
*
* @param string $project Name of the project scoping this request.
* @param string $network Name of the network resource to return.
* @param array $optParams Optional parameters.
* @return Google_Network
*/
public function get($project, $network, $optParams = array()) {
$params = array('project' => $project, 'network' => $network);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Network($data);
} else {
return $data;
}
}
/**
* Retrieves the list of network resources available to the specified project. (networks.list)
*
* @param string $project Name of the project scoping this request.
* @param array $optParams Optional parameters.
*
* @opt_param string filter Optional. Filter expression for filtering listed resources.
* @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
* @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
* @return Google_NetworkList
*/
public function listNetworks($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_NetworkList($data);
} else {
return $data;
}
}
/**
* Deletes the specified network resource. (networks.delete)
*
* @param string $project Name of the project scoping this request.
* @param string $network Name of the network resource to delete.
* @param array $optParams Optional parameters.
* @return Google_Operation
*/
public function delete($project, $network, $optParams = array()) {
$params = array('project' => $project, 'network' => $network);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
}
}
/**
* The "projects" collection of methods.
* Typical usage is:
* <code>
* $computeService = new Google_ComputeService(...);
* $projects = $computeService->projects;
* </code>
*/
class Google_ProjectsServiceResource extends Google_ServiceResource {
/**
* Sets metadata common to all instances within the specified project using the data included in the
* request. (projects.setCommonInstanceMetadata)
*
* @param string $project Name of the project scoping this request.
* @param Google_Metadata $postBody
* @param array $optParams Optional parameters.
*/
public function setCommonInstanceMetadata($project, Google_Metadata $postBody, $optParams = array()) {
$params = array('project' => $project, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('setCommonInstanceMetadata', array($params));
return $data;
}
/**
* Returns the specified project resource. (projects.get)
*
* @param string $project Name of the project resource to retrieve.
* @param array $optParams Optional parameters.
* @return Google_Project
*/
public function get($project, $optParams = array()) {
$params = array('project' => $project);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Project($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Compute (v1beta12).
*
* <p>
* API for the Google Compute Engine service.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/compute/docs/reference/v1beta12" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_ComputeService extends Google_Service {
public $operations;
public $kernels;
public $disks;
public $snapshots;
public $zones;
public $instances;
public $machineTypes;
public $images;
public $firewalls;
public $networks;
public $projects;
/**
* Constructs the internal representation of the Compute service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'compute/v1beta12/projects/';
$this->version = 'v1beta12';
$this->serviceName = 'compute';
$client->addService($this->serviceName, $this->version);
$this->operations = new Google_OperationsServiceResource($this, $this->serviceName, 'operations', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "operation": {"required": true, "type": "string", "location": "path"}}, "id": "compute.operations.get", "httpMethod": "GET", "path": "{project}/operations/{operation}", "response": {"$ref": "Operation"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.operations.list", "httpMethod": "GET", "path": "{project}/operations", "response": {"$ref": "OperationList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "path": "{project}/operations/{operation}", "id": "compute.operations.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "operation": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->kernels = new Google_KernelsServiceResource($this, $this->serviceName, 'kernels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.kernels.list", "httpMethod": "GET", "path": "{project}/kernels", "response": {"$ref": "KernelList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "kernel": {"required": true, "type": "string", "location": "path"}}, "id": "compute.kernels.get", "httpMethod": "GET", "path": "{project}/kernels/{kernel}", "response": {"$ref": "Kernel"}}}}', true));
$this->disks = new Google_DisksServiceResource($this, $this->serviceName, 'disks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Disk"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/disks", "id": "compute.disks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "disk": {"required": true, "type": "string", "location": "path"}}, "id": "compute.disks.get", "httpMethod": "GET", "path": "{project}/disks/{disk}", "response": {"$ref": "Disk"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.disks.list", "httpMethod": "GET", "path": "{project}/disks", "response": {"$ref": "DiskList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "disk": {"required": true, "type": "string", "location": "path"}}, "id": "compute.disks.delete", "httpMethod": "DELETE", "path": "{project}/disks/{disk}", "response": {"$ref": "Operation"}}}}', true));
$this->snapshots = new Google_SnapshotsServiceResource($this, $this->serviceName, 'snapshots', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Snapshot"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/snapshots", "id": "compute.snapshots.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "snapshot": {"required": true, "type": "string", "location": "path"}}, "id": "compute.snapshots.get", "httpMethod": "GET", "path": "{project}/snapshots/{snapshot}", "response": {"$ref": "Snapshot"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.snapshots.list", "httpMethod": "GET", "path": "{project}/snapshots", "response": {"$ref": "SnapshotList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "snapshot": {"required": true, "type": "string", "location": "path"}}, "id": "compute.snapshots.delete", "httpMethod": "DELETE", "path": "{project}/snapshots/{snapshot}", "response": {"$ref": "Operation"}}}}', true));
$this->zones = new Google_ZonesServiceResource($this, $this->serviceName, 'zones', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.zones.list", "httpMethod": "GET", "path": "{project}/zones", "response": {"$ref": "ZoneList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "zone": {"required": true, "type": "string", "location": "path"}}, "id": "compute.zones.get", "httpMethod": "GET", "path": "{project}/zones/{zone}", "response": {"$ref": "Zone"}}}}', true));
$this->instances = new Google_InstancesServiceResource($this, $this->serviceName, 'instances', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Instance"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/instances", "id": "compute.instances.insert"}, "deleteAccessConfig": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}, "access_config": {"required": true, "type": "string", "location": "query"}, "network_interface": {"required": true, "type": "string", "location": "query"}}, "id": "compute.instances.deleteAccessConfig", "httpMethod": "POST", "path": "{project}/instances/{instance}/delete-access-config", "response": {"$ref": "Operation"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}}, "id": "compute.instances.get", "httpMethod": "GET", "path": "{project}/instances/{instance}", "response": {"$ref": "Instance"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.instances.list", "httpMethod": "GET", "path": "{project}/instances", "response": {"$ref": "InstanceList"}}, "addAccessConfig": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}, "network_interface": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "AccessConfig"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/instances/{instance}/add-access-config", "id": "compute.instances.addAccessConfig"}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}}, "id": "compute.instances.delete", "httpMethod": "DELETE", "path": "{project}/instances/{instance}", "response": {"$ref": "Operation"}}}}', true));
$this->machineTypes = new Google_MachineTypesServiceResource($this, $this->serviceName, 'machineTypes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.machineTypes.list", "httpMethod": "GET", "path": "{project}/machine-types", "response": {"$ref": "MachineTypeList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "machineType": {"required": true, "type": "string", "location": "path"}}, "id": "compute.machineTypes.get", "httpMethod": "GET", "path": "{project}/machine-types/{machineType}", "response": {"$ref": "MachineType"}}}}', true));
$this->images = new Google_ImagesServiceResource($this, $this->serviceName, 'images', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.read_only"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Image"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/images", "id": "compute.images.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "image": {"required": true, "type": "string", "location": "path"}}, "id": "compute.images.get", "httpMethod": "GET", "path": "{project}/images/{image}", "response": {"$ref": "Image"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.images.list", "httpMethod": "GET", "path": "{project}/images", "response": {"$ref": "ImageList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "image": {"required": true, "type": "string", "location": "path"}}, "id": "compute.images.delete", "httpMethod": "DELETE", "path": "{project}/images/{image}", "response": {"$ref": "Operation"}}}}', true));
$this->firewalls = new Google_FirewallsServiceResource($this, $this->serviceName, 'firewalls', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Firewall"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/firewalls", "id": "compute.firewalls.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"firewall": {"required": true, "type": "string", "location": "path"}, "project": {"required": true, "type": "string", "location": "path"}}, "id": "compute.firewalls.get", "httpMethod": "GET", "path": "{project}/firewalls/{firewall}", "response": {"$ref": "Firewall"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.firewalls.list", "httpMethod": "GET", "path": "{project}/firewalls", "response": {"$ref": "FirewallList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"firewall": {"required": true, "type": "string", "location": "path"}, "project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Firewall"}, "response": {"$ref": "Operation"}, "httpMethod": "PUT", "path": "{project}/firewalls/{firewall}", "id": "compute.firewalls.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"firewall": {"required": true, "type": "string", "location": "path"}, "project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Firewall"}, "response": {"$ref": "Operation"}, "httpMethod": "PATCH", "path": "{project}/firewalls/{firewall}", "id": "compute.firewalls.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"firewall": {"required": true, "type": "string", "location": "path"}, "project": {"required": true, "type": "string", "location": "path"}}, "id": "compute.firewalls.delete", "httpMethod": "DELETE", "path": "{project}/firewalls/{firewall}", "response": {"$ref": "Operation"}}}}', true));
$this->networks = new Google_NetworksServiceResource($this, $this->serviceName, 'networks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Network"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/networks", "id": "compute.networks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "network": {"required": true, "type": "string", "location": "path"}}, "id": "compute.networks.get", "httpMethod": "GET", "path": "{project}/networks/{network}", "response": {"$ref": "Network"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "id": "compute.networks.list", "httpMethod": "GET", "path": "{project}/networks", "response": {"$ref": "NetworkList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "network": {"required": true, "type": "string", "location": "path"}}, "id": "compute.networks.delete", "httpMethod": "DELETE", "path": "{project}/networks/{network}", "response": {"$ref": "Operation"}}}}', true));
$this->projects = new Google_ProjectsServiceResource($this, $this->serviceName, 'projects', json_decode('{"methods": {"setCommonInstanceMetadata": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Metadata"}, "httpMethod": "POST", "path": "{project}/set-common-instance-metadata", "id": "compute.projects.setCommonInstanceMetadata"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "id": "compute.projects.get", "httpMethod": "GET", "path": "{project}", "response": {"$ref": "Project"}}}}', true));
}
}
class Google_AccessConfig extends Google_Model {
public $kind;
public $type;
public $name;
public $natIP;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setNatIP($natIP) {
$this->natIP = $natIP;
}
public function getNatIP() {
return $this->natIP;
}
}
class Google_AttachedDisk extends Google_Model {
public $deviceName;
public $kind;
public $index;
public $source;
public $mode;
public $deleteOnTerminate;
public $type;
public function setDeviceName($deviceName) {
$this->deviceName = $deviceName;
}
public function getDeviceName() {
return $this->deviceName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setIndex($index) {
$this->index = $index;
}
public function getIndex() {
return $this->index;
}
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setMode($mode) {
$this->mode = $mode;
}
public function getMode() {
return $this->mode;
}
public function setDeleteOnTerminate($deleteOnTerminate) {
$this->deleteOnTerminate = $deleteOnTerminate;
}
public function getDeleteOnTerminate() {
return $this->deleteOnTerminate;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_Disk extends Google_Model {
public $status;
public $sourceSnapshot;
public $kind;
public $description;
public $sizeGb;
public $id;
public $sourceSnapshotId;
public $zone;
public $creationTimestamp;
public $options;
public $selfLink;
public $name;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setSourceSnapshot($sourceSnapshot) {
$this->sourceSnapshot = $sourceSnapshot;
}
public function getSourceSnapshot() {
return $this->sourceSnapshot;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setSizeGb($sizeGb) {
$this->sizeGb = $sizeGb;
}
public function getSizeGb() {
return $this->sizeGb;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSourceSnapshotId($sourceSnapshotId) {
$this->sourceSnapshotId = $sourceSnapshotId;
}
public function getSourceSnapshotId() {
return $this->sourceSnapshotId;
}
public function setZone($zone) {
$this->zone = $zone;
}
public function getZone() {
return $this->zone;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setOptions($options) {
$this->options = $options;
}
public function getOptions() {
return $this->options;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_DiskList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Disk';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Disk', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Firewall extends Google_Model {
public $kind;
public $description;
public $sourceTags;
public $sourceRanges;
public $network;
public $targetTags;
protected $__allowedType = 'Google_FirewallAllowed';
protected $__allowedDataType = 'array';
public $allowed;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setSourceTags($sourceTags) {
$this->sourceTags = $sourceTags;
}
public function getSourceTags() {
return $this->sourceTags;
}
public function setSourceRanges($sourceRanges) {
$this->sourceRanges = $sourceRanges;
}
public function getSourceRanges() {
return $this->sourceRanges;
}
public function setNetwork($network) {
$this->network = $network;
}
public function getNetwork() {
return $this->network;
}
public function setTargetTags($targetTags) {
$this->targetTags = $targetTags;
}
public function getTargetTags() {
return $this->targetTags;
}
public function setAllowed($allowed) {
$this->assertIsArray($allowed, 'Google_FirewallAllowed', __METHOD__);
$this->allowed = $allowed;
}
public function getAllowed() {
return $this->allowed;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_FirewallAllowed extends Google_Model {
public $IPProtocol;
public $ports;
public function setIPProtocol($IPProtocol) {
$this->IPProtocol = $IPProtocol;
}
public function getIPProtocol() {
return $this->IPProtocol;
}
public function setPorts($ports) {
$this->ports = $ports;
}
public function getPorts() {
return $this->ports;
}
}
class Google_FirewallList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Firewall';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Firewall', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Image extends Google_Model {
public $kind;
public $description;
protected $__rawDiskType = 'Google_ImageRawDisk';
protected $__rawDiskDataType = '';
public $rawDisk;
public $preferredKernel;
protected $__diskSnapshotType = 'Google_ImageDiskSnapshot';
protected $__diskSnapshotDataType = '';
public $diskSnapshot;
public $sourceType;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setRawDisk(Google_ImageRawDisk $rawDisk) {
$this->rawDisk = $rawDisk;
}
public function getRawDisk() {
return $this->rawDisk;
}
public function setPreferredKernel($preferredKernel) {
$this->preferredKernel = $preferredKernel;
}
public function getPreferredKernel() {
return $this->preferredKernel;
}
public function setDiskSnapshot(Google_ImageDiskSnapshot $diskSnapshot) {
$this->diskSnapshot = $diskSnapshot;
}
public function getDiskSnapshot() {
return $this->diskSnapshot;
}
public function setSourceType($sourceType) {
$this->sourceType = $sourceType;
}
public function getSourceType() {
return $this->sourceType;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_ImageDiskSnapshot extends Google_Model {
public $source;
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
}
class Google_ImageList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Image';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Image', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ImageRawDisk extends Google_Model {
public $containerType;
public $source;
public $sha1Checksum;
public function setContainerType($containerType) {
$this->containerType = $containerType;
}
public function getContainerType() {
return $this->containerType;
}
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setSha1Checksum($sha1Checksum) {
$this->sha1Checksum = $sha1Checksum;
}
public function getSha1Checksum() {
return $this->sha1Checksum;
}
}
class Google_Instance extends Google_Model {
public $status;
public $kind;
public $machineType;
public $description;
public $zone;
public $tags;
public $image;
protected $__disksType = 'Google_AttachedDisk';
protected $__disksDataType = 'array';
public $disks;
public $name;
public $statusMessage;
protected $__serviceAccountsType = 'Google_ServiceAccount';
protected $__serviceAccountsDataType = 'array';
public $serviceAccounts;
protected $__networkInterfacesType = 'Google_NetworkInterface';
protected $__networkInterfacesDataType = 'array';
public $networkInterfaces;
public $creationTimestamp;
public $id;
public $selfLink;
protected $__metadataType = 'Google_Metadata';
protected $__metadataDataType = '';
public $metadata;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setMachineType($machineType) {
$this->machineType = $machineType;
}
public function getMachineType() {
return $this->machineType;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setZone($zone) {
$this->zone = $zone;
}
public function getZone() {
return $this->zone;
}
public function setTags($tags) {
$this->tags = $tags;
}
public function getTags() {
return $this->tags;
}
public function setImage($image) {
$this->image = $image;
}
public function getImage() {
return $this->image;
}
public function setDisks($disks) {
$this->assertIsArray($disks, 'Google_AttachedDisk', __METHOD__);
$this->disks = $disks;
}
public function getDisks() {
return $this->disks;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setStatusMessage($statusMessage) {
$this->statusMessage = $statusMessage;
}
public function getStatusMessage() {
return $this->statusMessage;
}
public function setServiceAccounts($serviceAccounts) {
$this->assertIsArray($serviceAccounts, 'Google_ServiceAccount', __METHOD__);
$this->serviceAccounts = $serviceAccounts;
}
public function getServiceAccounts() {
return $this->serviceAccounts;
}
public function setNetworkInterfaces($networkInterfaces) {
$this->assertIsArray($networkInterfaces, 'Google_NetworkInterface', __METHOD__);
$this->networkInterfaces = $networkInterfaces;
}
public function getNetworkInterfaces() {
return $this->networkInterfaces;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setMetadata(Google_Metadata $metadata) {
$this->metadata = $metadata;
}
public function getMetadata() {
return $this->metadata;
}
}
class Google_InstanceList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Instance';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Instance', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Kernel extends Google_Model {
public $kind;
public $description;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_KernelList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Kernel';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Kernel', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_MachineType extends Google_Model {
public $guestCpus;
public $imageSpaceGb;
public $kind;
protected $__ephemeralDisksType = 'Google_MachineTypeEphemeralDisks';
protected $__ephemeralDisksDataType = 'array';
public $ephemeralDisks;
public $maximumPersistentDisksSizeGb;
public $description;
public $maximumPersistentDisks;
public $name;
public $memoryMb;
public $availableZone;
public $creationTimestamp;
public $id;
public $selfLink;
public $hostCpus;
public function setGuestCpus($guestCpus) {
$this->guestCpus = $guestCpus;
}
public function getGuestCpus() {
return $this->guestCpus;
}
public function setImageSpaceGb($imageSpaceGb) {
$this->imageSpaceGb = $imageSpaceGb;
}
public function getImageSpaceGb() {
return $this->imageSpaceGb;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEphemeralDisks($ephemeralDisks) {
$this->assertIsArray($ephemeralDisks, 'Google_MachineTypeEphemeralDisks', __METHOD__);
$this->ephemeralDisks = $ephemeralDisks;
}
public function getEphemeralDisks() {
return $this->ephemeralDisks;
}
public function setMaximumPersistentDisksSizeGb($maximumPersistentDisksSizeGb) {
$this->maximumPersistentDisksSizeGb = $maximumPersistentDisksSizeGb;
}
public function getMaximumPersistentDisksSizeGb() {
return $this->maximumPersistentDisksSizeGb;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setMaximumPersistentDisks($maximumPersistentDisks) {
$this->maximumPersistentDisks = $maximumPersistentDisks;
}
public function getMaximumPersistentDisks() {
return $this->maximumPersistentDisks;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setMemoryMb($memoryMb) {
$this->memoryMb = $memoryMb;
}
public function getMemoryMb() {
return $this->memoryMb;
}
public function setAvailableZone($availableZone) {
$this->availableZone = $availableZone;
}
public function getAvailableZone() {
return $this->availableZone;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setHostCpus($hostCpus) {
$this->hostCpus = $hostCpus;
}
public function getHostCpus() {
return $this->hostCpus;
}
}
class Google_MachineTypeEphemeralDisks extends Google_Model {
public $diskGb;
public function setDiskGb($diskGb) {
$this->diskGb = $diskGb;
}
public function getDiskGb() {
return $this->diskGb;
}
}
class Google_MachineTypeList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_MachineType';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_MachineType', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Metadata extends Google_Model {
protected $__itemsType = 'Google_MetadataItems';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems($items) {
$this->assertIsArray($items, 'Google_MetadataItems', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_MetadataItems extends Google_Model {
public $value;
public $key;
public function setValue($value) {
$this->value = $value;
}
public function getValue() {
return $this->value;
}
public function setKey($key) {
$this->key = $key;
}
public function getKey() {
return $this->key;
}
}
class Google_Network extends Google_Model {
public $kind;
public $description;
public $IPv4Range;
public $gatewayIPv4;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setIPv4Range($IPv4Range) {
$this->IPv4Range = $IPv4Range;
}
public function getIPv4Range() {
return $this->IPv4Range;
}
public function setGatewayIPv4($gatewayIPv4) {
$this->gatewayIPv4 = $gatewayIPv4;
}
public function getGatewayIPv4() {
return $this->gatewayIPv4;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_NetworkInterface extends Google_Model {
public $network;
protected $__accessConfigsType = 'Google_AccessConfig';
protected $__accessConfigsDataType = 'array';
public $accessConfigs;
public $networkIP;
public $kind;
public $name;
public function setNetwork($network) {
$this->network = $network;
}
public function getNetwork() {
return $this->network;
}
public function setAccessConfigs($accessConfigs) {
$this->assertIsArray($accessConfigs, 'Google_AccessConfig', __METHOD__);
$this->accessConfigs = $accessConfigs;
}
public function getAccessConfigs() {
return $this->accessConfigs;
}
public function setNetworkIP($networkIP) {
$this->networkIP = $networkIP;
}
public function getNetworkIP() {
return $this->networkIP;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_NetworkList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Network';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Network', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Operation extends Google_Model {
public $status;
public $kind;
public $name;
public $startTime;
public $httpErrorStatusCode;
public $user;
protected $__errorType = 'Google_OperationError';
protected $__errorDataType = '';
public $error;
public $targetId;
public $operationType;
public $statusMessage;
public $insertTime;
public $httpErrorMessage;
public $progress;
public $clientOperationId;
public $endTime;
public $creationTimestamp;
public $id;
public $selfLink;
public $targetLink;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setStartTime($startTime) {
$this->startTime = $startTime;
}
public function getStartTime() {
return $this->startTime;
}
public function setHttpErrorStatusCode($httpErrorStatusCode) {
$this->httpErrorStatusCode = $httpErrorStatusCode;
}
public function getHttpErrorStatusCode() {
return $this->httpErrorStatusCode;
}
public function setUser($user) {
$this->user = $user;
}
public function getUser() {
return $this->user;
}
public function setError(Google_OperationError $error) {
$this->error = $error;
}
public function getError() {
return $this->error;
}
public function setTargetId($targetId) {
$this->targetId = $targetId;
}
public function getTargetId() {
return $this->targetId;
}
public function setOperationType($operationType) {
$this->operationType = $operationType;
}
public function getOperationType() {
return $this->operationType;
}
public function setStatusMessage($statusMessage) {
$this->statusMessage = $statusMessage;
}
public function getStatusMessage() {
return $this->statusMessage;
}
public function setInsertTime($insertTime) {
$this->insertTime = $insertTime;
}
public function getInsertTime() {
return $this->insertTime;
}
public function setHttpErrorMessage($httpErrorMessage) {
$this->httpErrorMessage = $httpErrorMessage;
}
public function getHttpErrorMessage() {
return $this->httpErrorMessage;
}
public function setProgress($progress) {
$this->progress = $progress;
}
public function getProgress() {
return $this->progress;
}
public function setClientOperationId($clientOperationId) {
$this->clientOperationId = $clientOperationId;
}
public function getClientOperationId() {
return $this->clientOperationId;
}
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setTargetLink($targetLink) {
$this->targetLink = $targetLink;
}
public function getTargetLink() {
return $this->targetLink;
}
}
class Google_OperationError extends Google_Model {
protected $__errorsType = 'Google_OperationErrorErrors';
protected $__errorsDataType = 'array';
public $errors;
public function setErrors($errors) {
$this->assertIsArray($errors, 'Google_OperationErrorErrors', __METHOD__);
$this->errors = $errors;
}
public function getErrors() {
return $this->errors;
}
}
class Google_OperationErrorErrors extends Google_Model {
public $message;
public $code;
public $location;
public function setMessage($message) {
$this->message = $message;
}
public function getMessage() {
return $this->message;
}
public function setCode($code) {
$this->code = $code;
}
public function getCode() {
return $this->code;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
}
class Google_OperationList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Operation';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Operation', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Project extends Google_Model {
public $kind;
public $description;
protected $__commonInstanceMetadataType = 'Google_Metadata';
protected $__commonInstanceMetadataDataType = '';
public $commonInstanceMetadata;
public $externalIpAddresses;
protected $__quotasType = 'Google_ProjectQuotas';
protected $__quotasDataType = 'array';
public $quotas;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setCommonInstanceMetadata(Google_Metadata $commonInstanceMetadata) {
$this->commonInstanceMetadata = $commonInstanceMetadata;
}
public function getCommonInstanceMetadata() {
return $this->commonInstanceMetadata;
}
public function setExternalIpAddresses($externalIpAddresses) {
$this->externalIpAddresses = $externalIpAddresses;
}
public function getExternalIpAddresses() {
return $this->externalIpAddresses;
}
public function setQuotas($quotas) {
$this->assertIsArray($quotas, 'Google_ProjectQuotas', __METHOD__);
$this->quotas = $quotas;
}
public function getQuotas() {
return $this->quotas;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_ProjectQuotas extends Google_Model {
public $usage;
public $metric;
public $limit;
public function setUsage($usage) {
$this->usage = $usage;
}
public function getUsage() {
return $this->usage;
}
public function setMetric($metric) {
$this->metric = $metric;
}
public function getMetric() {
return $this->metric;
}
public function setLimit($limit) {
$this->limit = $limit;
}
public function getLimit() {
return $this->limit;
}
}
class Google_ServiceAccount extends Google_Model {
public $scopes;
public $kind;
public $email;
public function setScopes($scopes) {
$this->scopes = $scopes;
}
public function getScopes() {
return $this->scopes;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
}
class Google_Snapshot extends Google_Model {
public $status;
public $kind;
public $description;
public $sourceDisk;
public $sourceDiskId;
public $diskSizeGb;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setSourceDisk($sourceDisk) {
$this->sourceDisk = $sourceDisk;
}
public function getSourceDisk() {
return $this->sourceDisk;
}
public function setSourceDiskId($sourceDiskId) {
$this->sourceDiskId = $sourceDiskId;
}
public function getSourceDiskId() {
return $this->sourceDiskId;
}
public function setDiskSizeGb($diskSizeGb) {
$this->diskSizeGb = $diskSizeGb;
}
public function getDiskSizeGb() {
return $this->diskSizeGb;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_SnapshotList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Snapshot';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Snapshot', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Zone extends Google_Model {
public $status;
public $kind;
public $availableMachineType;
public $description;
protected $__maintenanceWindowsType = 'Google_ZoneMaintenanceWindows';
protected $__maintenanceWindowsDataType = 'array';
public $maintenanceWindows;
public $creationTimestamp;
public $id;
public $selfLink;
public $name;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAvailableMachineType($availableMachineType) {
$this->availableMachineType = $availableMachineType;
}
public function getAvailableMachineType() {
return $this->availableMachineType;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setMaintenanceWindows($maintenanceWindows) {
$this->assertIsArray($maintenanceWindows, 'Google_ZoneMaintenanceWindows', __METHOD__);
$this->maintenanceWindows = $maintenanceWindows;
}
public function getMaintenanceWindows() {
return $this->maintenanceWindows;
}
public function setCreationTimestamp($creationTimestamp) {
$this->creationTimestamp = $creationTimestamp;
}
public function getCreationTimestamp() {
return $this->creationTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_ZoneList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Zone';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $id;
public $selfLink;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Zone', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ZoneMaintenanceWindows extends Google_Model {
public $endTime;
public $beginTime;
public $name;
public $description;
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setBeginTime($beginTime) {
$this->beginTime = $beginTime;
}
public function getBeginTime() {
return $this->beginTime;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_ComputeService.php | PHP | asf20 | 93,180 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "advertisers" collection of methods.
* Typical usage is:
* <code>
* $ganService = new Google_GanService(...);
* $advertisers = $ganService->advertisers;
* </code>
*/
class Google_AdvertisersServiceResource extends Google_ServiceResource {
/**
* Retrieves data about all advertisers that the requesting advertiser/publisher has access to.
* (advertisers.list)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string relationshipStatus Filters out all advertisers for which do not have the given relationship status with the requesting publisher.
* @opt_param double minSevenDayEpc Filters out all advertisers that have a seven day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.
* @opt_param string advertiserCategory Caret(^) delimted list of advertiser categories. Valid categories are defined here: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en=107581. Filters out all advertisers not in one of the given advertiser categories. Optional.
* @opt_param double minNinetyDayEpc Filters out all advertisers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.
* @opt_param string pageToken The value of 'nextPageToken' from the previous page. Optional.
* @opt_param string maxResults Max number of items to return in this page. Optional. Defaults to 20.
* @opt_param int minPayoutRank A value between 1 and 4, where 1 represents the quartile of advertisers with the lowest ranks and 4 represents the quartile of advertisers with the highest ranks. Filters out all advertisers with a lower rank than the given quartile. For example if a 2 was given only advertisers with a payout rank of 25 or higher would be included. Optional.
* @return Google_Advertisers
*/
public function listAdvertisers($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Advertisers($data);
} else {
return $data;
}
}
/**
* Retrieves data about a single advertiser if that the requesting advertiser/publisher has access
* to it. Only publishers can lookup advertisers. Advertisers can request information about
* themselves by omitting the advertiserId query parameter. (advertisers.get)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string advertiserId The ID of the advertiser to look up. Optional.
* @return Google_Advertiser
*/
public function get($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Advertiser($data);
} else {
return $data;
}
}
}
/**
* The "ccOffers" collection of methods.
* Typical usage is:
* <code>
* $ganService = new Google_GanService(...);
* $ccOffers = $ganService->ccOffers;
* </code>
*/
class Google_CcOffersServiceResource extends Google_ServiceResource {
/**
* Retrieves credit card offers for the given publisher. (ccOffers.list)
*
* @param string $publisher The ID of the publisher in question.
* @param array $optParams Optional parameters.
*
* @opt_param string advertiser The advertiser ID of a card issuer whose offers to include. Optional, may be repeated.
* @opt_param string projection The set of fields to return.
* @return Google_CcOffers
*/
public function listCcOffers($publisher, $optParams = array()) {
$params = array('publisher' => $publisher);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_CcOffers($data);
} else {
return $data;
}
}
}
/**
* The "events" collection of methods.
* Typical usage is:
* <code>
* $ganService = new Google_GanService(...);
* $events = $ganService->events;
* </code>
*/
class Google_EventsServiceResource extends Google_ServiceResource {
/**
* Retrieves event data for a given advertiser/publisher. (events.list)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string orderId Caret(^) delimited list of order IDs. Filters out all events that do not reference one of the given order IDs. Optional.
* @opt_param string sku Caret(^) delimited list of SKUs. Filters out all events that do not reference one of the given SKU. Optional.
* @opt_param string eventDateMax Filters out all events later than given date. Optional. Defaults to 24 hours after eventMin.
* @opt_param string type Filters out all events that are not of the given type. Valid values: 'action', 'transaction', 'charge'. Optional.
* @opt_param string linkId Caret(^) delimited list of link IDs. Filters out all events that do not reference one of the given link IDs. Optional.
* @opt_param string modifyDateMin Filters out all events modified earlier than given date. Optional. Defaults to 24 hours before the current modifyDateMax, if modifyDateMax is explicitly set.
* @opt_param string eventDateMin Filters out all events earlier than given date. Optional. Defaults to 24 hours from current date/time.
* @opt_param string memberId Caret(^) delimited list of member IDs. Filters out all events that do not reference one of the given member IDs. Optional.
* @opt_param string maxResults Max number of offers to return in this page. Optional. Defaults to 20.
* @opt_param string advertiserId Caret(^) delimited list of advertiser IDs. Filters out all events that do not reference one of the given advertiser IDs. Only used when under publishers role. Optional.
* @opt_param string pageToken The value of 'nextPageToken' from the previous page. Optional.
* @opt_param string productCategory Caret(^) delimited list of product categories. Filters out all events that do not reference a product in one of the given product categories. Optional.
* @opt_param string chargeType Filters out all charge events that are not of the given charge type. Valid values: 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit', 'debit'. Optional.
* @opt_param string modifyDateMax Filters out all events modified later than given date. Optional. Defaults to 24 hours after modifyDateMin, if modifyDateMin is explicitly set.
* @opt_param string status Filters out all events that do not have the given status. Valid values: 'active', 'canceled'. Optional.
* @opt_param string publisherId Caret(^) delimited list of publisher IDs. Filters out all events that do not reference one of the given publishers IDs. Only used when under advertiser role. Optional.
* @return Google_Events
*/
public function listEvents($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Events($data);
} else {
return $data;
}
}
}
/**
* The "links" collection of methods.
* Typical usage is:
* <code>
* $ganService = new Google_GanService(...);
* $links = $ganService->links;
* </code>
*/
class Google_LinksServiceResource extends Google_ServiceResource {
/**
* Inserts a new link. (links.insert)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param Google_Link $postBody
* @param array $optParams Optional parameters.
* @return Google_Link
*/
public function insert($role, $roleId, Google_Link $postBody, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Link($data);
} else {
return $data;
}
}
/**
* Retrieves all links that match the query parameters. (links.list)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string linkType The type of the link.
* @opt_param string startDateMin The beginning of the start date range.
* @opt_param string assetSize The size of the given asset.
* @opt_param string relationshipStatus The status of the relationship.
* @opt_param string advertiserCategory The advertiser's primary vertical.
* @opt_param string maxResults Max number of items to return in this page. Optional. Defaults to 20.
* @opt_param string advertiserId Limits the resulting links to the ones belonging to the listed advertisers.
* @opt_param string pageToken The value of 'nextPageToken' from the previous page. Optional.
* @opt_param string startDateMax The end of the start date range.
* @opt_param string promotionType The promotion type.
* @opt_param string authorship The role of the author of the link.
* @return Google_Links
*/
public function listLinks($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Links($data);
} else {
return $data;
}
}
/**
* Retrieves data about a single link if the requesting advertiser/publisher has access to it.
* Advertisers can look up their own links. Publishers can look up visible links or links belonging
* to advertisers they are in a relationship with. (links.get)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param string $linkId The ID of the link to look up.
* @param array $optParams Optional parameters.
* @return Google_Link
*/
public function get($role, $roleId, $linkId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId, 'linkId' => $linkId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Link($data);
} else {
return $data;
}
}
}
/**
* The "publishers" collection of methods.
* Typical usage is:
* <code>
* $ganService = new Google_GanService(...);
* $publishers = $ganService->publishers;
* </code>
*/
class Google_PublishersServiceResource extends Google_ServiceResource {
/**
* Retrieves data about all publishers that the requesting advertiser/publisher has access to.
* (publishers.list)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string publisherCategory Caret(^) delimted list of publisher categories. Valid categories: (unclassified|community_and_content|shopping_and_promotion|loyalty_and_rewards|network|search_specialist|comparison_shopping|email). Filters out all publishers not in one of the given advertiser categories. Optional.
* @opt_param string relationshipStatus Filters out all publishers for which do not have the given relationship status with the requesting publisher.
* @opt_param double minSevenDayEpc Filters out all publishers that have a seven day EPC average lower than the given value (inclusive). Min value 0.0. Optional.
* @opt_param double minNinetyDayEpc Filters out all publishers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.
* @opt_param string pageToken The value of 'nextPageToken' from the previous page. Optional.
* @opt_param string maxResults Max number of items to return in this page. Optional. Defaults to 20.
* @opt_param int minPayoutRank A value between 1 and 4, where 1 represents the quartile of publishers with the lowest ranks and 4 represents the quartile of publishers with the highest ranks. Filters out all publishers with a lower rank than the given quartile. For example if a 2 was given only publishers with a payout rank of 25 or higher would be included. Optional.
* @return Google_Publishers
*/
public function listPublishers($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Publishers($data);
} else {
return $data;
}
}
/**
* Retrieves data about a single advertiser if that the requesting advertiser/publisher has access
* to it. Only advertisers can look up publishers. Publishers can request information about
* themselves by omitting the publisherId query parameter. (publishers.get)
*
* @param string $role The role of the requester. Valid values: 'advertisers' or 'publishers'.
* @param string $roleId The ID of the requesting advertiser or publisher.
* @param array $optParams Optional parameters.
*
* @opt_param string publisherId The ID of the publisher to look up. Optional.
* @return Google_Publisher
*/
public function get($role, $roleId, $optParams = array()) {
$params = array('role' => $role, 'roleId' => $roleId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Publisher($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Gan (v1beta1).
*
* <p>
* Lets you have programmatic access to your Google Affiliate Network data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/gan/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_GanService extends Google_Service {
public $advertisers;
public $ccOffers;
public $events;
public $links;
public $publishers;
/**
* Constructs the internal representation of the Gan service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'gan/v1beta1/';
$this->version = 'v1beta1';
$this->serviceName = 'gan';
$client->addService($this->serviceName, $this->version);
$this->advertisers = new Google_AdvertisersServiceResource($this, $this->serviceName, 'advertisers', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"relationshipStatus": {"enum": ["approved", "available", "deactivated", "declined", "pending"], "type": "string", "location": "query"}, "minSevenDayEpc": {"type": "number", "location": "query", "format": "double"}, "advertiserCategory": {"type": "string", "location": "query"}, "minNinetyDayEpc": {"type": "number", "location": "query", "format": "double"}, "pageToken": {"type": "string", "location": "query"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "100", "format": "uint32"}, "roleId": {"required": true, "type": "string", "location": "path"}, "minPayoutRank": {"location": "query", "minimum": "1", "type": "integer", "maximum": "4", "format": "int32"}}, "id": "gan.advertisers.list", "httpMethod": "GET", "path": "{role}/{roleId}/advertisers", "response": {"$ref": "Advertisers"}}, "get": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"advertiserId": {"type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}}, "id": "gan.advertisers.get", "httpMethod": "GET", "path": "{role}/{roleId}/advertiser", "response": {"$ref": "Advertiser"}}}}', true));
$this->ccOffers = new Google_CcOffersServiceResource($this, $this->serviceName, 'ccOffers', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"advertiser": {"repeated": true, "type": "string", "location": "query"}, "projection": {"enum": ["full", "summary"], "type": "string", "location": "query"}, "publisher": {"required": true, "type": "string", "location": "path"}}, "id": "gan.ccOffers.list", "httpMethod": "GET", "path": "publishers/{publisher}/ccOffers", "response": {"$ref": "CcOffers"}}}}', true));
$this->events = new Google_EventsServiceResource($this, $this->serviceName, 'events', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"orderId": {"type": "string", "location": "query"}, "sku": {"type": "string", "location": "query"}, "eventDateMax": {"type": "string", "location": "query"}, "type": {"enum": ["action", "charge", "transaction"], "type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}, "linkId": {"type": "string", "location": "query"}, "status": {"enum": ["active", "canceled"], "type": "string", "location": "query"}, "eventDateMin": {"type": "string", "location": "query"}, "memberId": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "100", "format": "uint32"}, "advertiserId": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "productCategory": {"type": "string", "location": "query"}, "chargeType": {"enum": ["credit", "debit", "monthly_minimum", "other", "slotting_fee", "tier_bonus"], "type": "string", "location": "query"}, "modifyDateMin": {"type": "string", "location": "query"}, "modifyDateMax": {"type": "string", "location": "query"}, "publisherId": {"type": "string", "location": "query"}}, "id": "gan.events.list", "httpMethod": "GET", "path": "{role}/{roleId}/events", "response": {"$ref": "Events"}}}}', true));
$this->links = new Google_LinksServiceResource($this, $this->serviceName, 'links', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/gan"], "parameters": {"roleId": {"required": true, "type": "string", "location": "path"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}}, "request": {"$ref": "Link"}, "response": {"$ref": "Link"}, "httpMethod": "POST", "path": "{role}/{roleId}/link", "id": "gan.links.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"linkType": {"enum": ["banner", "text"], "type": "string", "location": "query"}, "startDateMin": {"type": "string", "location": "query"}, "assetSize": {"repeated": true, "type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}, "relationshipStatus": {"enum": ["approved", "available"], "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "100", "format": "uint32"}, "advertiserCategory": {"repeated": true, "enum": ["apparel_accessories", "appliances_electronics", "auto_dealer", "automotive", "babies_kids", "blogs_personal_sites", "books_magazines", "computers", "dating", "department_stores", "education", "employment", "financial_credit_cards", "financial_other", "flowers_gifts", "grocery", "health_beauty", "home_garden", "hosting_domain", "internet_providers", "legal", "media_entertainment", "medical", "movies_games", "music", "nonprofit", "office_supplies", "online_games", "outdoor", "pets", "real_estate", "restaurants", "sport_fitness", "telecom", "ticketing", "toys_hobbies", "travel", "utilities", "wholesale_relationship", "wine_spirits"], "type": "string", "location": "query"}, "advertiserId": {"repeated": true, "type": "string", "location": "query", "format": "int64"}, "pageToken": {"type": "string", "location": "query"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "startDateMax": {"type": "string", "location": "query"}, "promotionType": {"repeated": true, "enum": ["buy_get", "coupon", "free_gift", "free_gift_wrap", "free_shipping", "none", "ongoing", "percent_off", "price_cut", "product_promotion", "sale", "sweepstakes"], "type": "string", "location": "query"}, "authorship": {"enum": ["advertiser", "publisher"], "type": "string", "location": "query"}}, "id": "gan.links.list", "httpMethod": "GET", "path": "{role}/{roleId}/links", "response": {"$ref": "Links"}}, "get": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"linkId": {"required": true, "type": "string", "location": "path", "format": "int64"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "roleId": {"required": true, "type": "string", "location": "path"}}, "id": "gan.links.get", "httpMethod": "GET", "path": "{role}/{roleId}/link/{linkId}", "response": {"$ref": "Link"}}}}', true));
$this->publishers = new Google_PublishersServiceResource($this, $this->serviceName, 'publishers', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"publisherCategory": {"type": "string", "location": "query"}, "relationshipStatus": {"enum": ["approved", "available", "deactivated", "declined", "pending"], "type": "string", "location": "query"}, "minSevenDayEpc": {"type": "number", "location": "query", "format": "double"}, "minNinetyDayEpc": {"type": "number", "location": "query", "format": "double"}, "pageToken": {"type": "string", "location": "query"}, "role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "100", "format": "uint32"}, "roleId": {"required": true, "type": "string", "location": "path"}, "minPayoutRank": {"location": "query", "minimum": "1", "type": "integer", "maximum": "4", "format": "int32"}}, "id": "gan.publishers.list", "httpMethod": "GET", "path": "{role}/{roleId}/publishers", "response": {"$ref": "Publishers"}}, "get": {"scopes": ["https://www.googleapis.com/auth/gan", "https://www.googleapis.com/auth/gan.readonly"], "parameters": {"role": {"required": true, "type": "string", "location": "path", "enum": ["advertisers", "publishers"]}, "publisherId": {"type": "string", "location": "query"}, "roleId": {"required": true, "type": "string", "location": "path"}}, "id": "gan.publishers.get", "httpMethod": "GET", "path": "{role}/{roleId}/publisher", "response": {"$ref": "Publisher"}}}}', true));
}
}
class Google_Advertiser extends Google_Model {
public $category;
public $contactEmail;
public $kind;
public $siteUrl;
public $contactPhone;
public $description;
public $payoutRank;
public $defaultLinkId;
protected $__epcSevenDayAverageType = 'Google_Money';
protected $__epcSevenDayAverageDataType = '';
public $epcSevenDayAverage;
public $commissionDuration;
public $status;
protected $__epcNinetyDayAverageType = 'Google_Money';
protected $__epcNinetyDayAverageDataType = '';
public $epcNinetyDayAverage;
public $allowPublisherCreatedLinks;
protected $__itemType = 'Google_Advertiser';
protected $__itemDataType = '';
public $item;
public $joinDate;
public $logoUrl;
public $id;
public $productFeedsEnabled;
public $name;
public function setCategory($category) {
$this->category = $category;
}
public function getCategory() {
return $this->category;
}
public function setContactEmail($contactEmail) {
$this->contactEmail = $contactEmail;
}
public function getContactEmail() {
return $this->contactEmail;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setSiteUrl($siteUrl) {
$this->siteUrl = $siteUrl;
}
public function getSiteUrl() {
return $this->siteUrl;
}
public function setContactPhone($contactPhone) {
$this->contactPhone = $contactPhone;
}
public function getContactPhone() {
return $this->contactPhone;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setPayoutRank($payoutRank) {
$this->payoutRank = $payoutRank;
}
public function getPayoutRank() {
return $this->payoutRank;
}
public function setDefaultLinkId($defaultLinkId) {
$this->defaultLinkId = $defaultLinkId;
}
public function getDefaultLinkId() {
return $this->defaultLinkId;
}
public function setEpcSevenDayAverage(Google_Money $epcSevenDayAverage) {
$this->epcSevenDayAverage = $epcSevenDayAverage;
}
public function getEpcSevenDayAverage() {
return $this->epcSevenDayAverage;
}
public function setCommissionDuration($commissionDuration) {
$this->commissionDuration = $commissionDuration;
}
public function getCommissionDuration() {
return $this->commissionDuration;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setEpcNinetyDayAverage(Google_Money $epcNinetyDayAverage) {
$this->epcNinetyDayAverage = $epcNinetyDayAverage;
}
public function getEpcNinetyDayAverage() {
return $this->epcNinetyDayAverage;
}
public function setAllowPublisherCreatedLinks($allowPublisherCreatedLinks) {
$this->allowPublisherCreatedLinks = $allowPublisherCreatedLinks;
}
public function getAllowPublisherCreatedLinks() {
return $this->allowPublisherCreatedLinks;
}
public function setItem(Google_Advertiser $item) {
$this->item = $item;
}
public function getItem() {
return $this->item;
}
public function setJoinDate($joinDate) {
$this->joinDate = $joinDate;
}
public function getJoinDate() {
return $this->joinDate;
}
public function setLogoUrl($logoUrl) {
$this->logoUrl = $logoUrl;
}
public function getLogoUrl() {
return $this->logoUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setProductFeedsEnabled($productFeedsEnabled) {
$this->productFeedsEnabled = $productFeedsEnabled;
}
public function getProductFeedsEnabled() {
return $this->productFeedsEnabled;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_Advertisers extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Advertiser';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Advertiser', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_CcOffer extends Google_Model {
public $luggageInsurance;
public $creditLimitMin;
public $cardName;
public $creditLimitMax;
public $gracePeriodDisplay;
public $offerId;
public $rewardUnit;
public $minPurchaseRate;
public $cardBenefits;
protected $__rewardsType = 'Google_CcOfferRewards';
protected $__rewardsDataType = 'array';
public $rewards;
public $offersImmediateCashReward;
public $travelInsurance;
public $returnedPaymentFee;
public $kind;
public $issuer;
public $maxPurchaseRate;
public $minimumFinanceCharge;
public $existingCustomerOnly;
public $annualFeeDisplay;
public $initialSetupAndProcessingFee;
public $issuerId;
public $purchaseRateAdditionalDetails;
public $prohibitedCategories;
public $fraudLiability;
public $cashAdvanceTerms;
public $landingPageUrl;
public $introCashAdvanceTerms;
public $rewardsExpire;
public $introPurchaseTerms;
protected $__defaultFeesType = 'Google_CcOfferDefaultFees';
protected $__defaultFeesDataType = 'array';
public $defaultFees;
public $extendedWarranty;
public $emergencyInsurance;
public $firstYearAnnualFee;
public $trackingUrl;
public $latePaymentFee;
public $overLimitFee;
public $cardType;
public $approvedCategories;
public $rewardPartner;
public $introBalanceTransferTerms;
public $foreignCurrencyTransactionFee;
public $annualFee;
public $issuerWebsite;
public $variableRatesUpdateFrequency;
public $carRentalInsurance;
public $additionalCardBenefits;
public $ageMinimum;
public $balanceComputationMethod;
public $aprDisplay;
public $additionalCardHolderFee;
public $variableRatesLastUpdated;
public $network;
public $purchaseRateType;
public $statementCopyFee;
public $rewardsHaveBlackoutDates;
public $creditRatingDisplay;
public $flightAccidentInsurance;
public $annualRewardMaximum;
public $balanceTransferTerms;
protected $__bonusRewardsType = 'Google_CcOfferBonusRewards';
protected $__bonusRewardsDataType = 'array';
public $bonusRewards;
public $imageUrl;
public $ageMinimumDetails;
public $disclaimer;
public function setLuggageInsurance($luggageInsurance) {
$this->luggageInsurance = $luggageInsurance;
}
public function getLuggageInsurance() {
return $this->luggageInsurance;
}
public function setCreditLimitMin($creditLimitMin) {
$this->creditLimitMin = $creditLimitMin;
}
public function getCreditLimitMin() {
return $this->creditLimitMin;
}
public function setCardName($cardName) {
$this->cardName = $cardName;
}
public function getCardName() {
return $this->cardName;
}
public function setCreditLimitMax($creditLimitMax) {
$this->creditLimitMax = $creditLimitMax;
}
public function getCreditLimitMax() {
return $this->creditLimitMax;
}
public function setGracePeriodDisplay($gracePeriodDisplay) {
$this->gracePeriodDisplay = $gracePeriodDisplay;
}
public function getGracePeriodDisplay() {
return $this->gracePeriodDisplay;
}
public function setOfferId($offerId) {
$this->offerId = $offerId;
}
public function getOfferId() {
return $this->offerId;
}
public function setRewardUnit($rewardUnit) {
$this->rewardUnit = $rewardUnit;
}
public function getRewardUnit() {
return $this->rewardUnit;
}
public function setMinPurchaseRate($minPurchaseRate) {
$this->minPurchaseRate = $minPurchaseRate;
}
public function getMinPurchaseRate() {
return $this->minPurchaseRate;
}
public function setCardBenefits($cardBenefits) {
$this->cardBenefits = $cardBenefits;
}
public function getCardBenefits() {
return $this->cardBenefits;
}
public function setRewards($rewards) {
$this->assertIsArray($rewards, 'Google_CcOfferRewards', __METHOD__);
$this->rewards = $rewards;
}
public function getRewards() {
return $this->rewards;
}
public function setOffersImmediateCashReward($offersImmediateCashReward) {
$this->offersImmediateCashReward = $offersImmediateCashReward;
}
public function getOffersImmediateCashReward() {
return $this->offersImmediateCashReward;
}
public function setTravelInsurance($travelInsurance) {
$this->travelInsurance = $travelInsurance;
}
public function getTravelInsurance() {
return $this->travelInsurance;
}
public function setReturnedPaymentFee($returnedPaymentFee) {
$this->returnedPaymentFee = $returnedPaymentFee;
}
public function getReturnedPaymentFee() {
return $this->returnedPaymentFee;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setIssuer($issuer) {
$this->issuer = $issuer;
}
public function getIssuer() {
return $this->issuer;
}
public function setMaxPurchaseRate($maxPurchaseRate) {
$this->maxPurchaseRate = $maxPurchaseRate;
}
public function getMaxPurchaseRate() {
return $this->maxPurchaseRate;
}
public function setMinimumFinanceCharge($minimumFinanceCharge) {
$this->minimumFinanceCharge = $minimumFinanceCharge;
}
public function getMinimumFinanceCharge() {
return $this->minimumFinanceCharge;
}
public function setExistingCustomerOnly($existingCustomerOnly) {
$this->existingCustomerOnly = $existingCustomerOnly;
}
public function getExistingCustomerOnly() {
return $this->existingCustomerOnly;
}
public function setAnnualFeeDisplay($annualFeeDisplay) {
$this->annualFeeDisplay = $annualFeeDisplay;
}
public function getAnnualFeeDisplay() {
return $this->annualFeeDisplay;
}
public function setInitialSetupAndProcessingFee($initialSetupAndProcessingFee) {
$this->initialSetupAndProcessingFee = $initialSetupAndProcessingFee;
}
public function getInitialSetupAndProcessingFee() {
return $this->initialSetupAndProcessingFee;
}
public function setIssuerId($issuerId) {
$this->issuerId = $issuerId;
}
public function getIssuerId() {
return $this->issuerId;
}
public function setPurchaseRateAdditionalDetails($purchaseRateAdditionalDetails) {
$this->purchaseRateAdditionalDetails = $purchaseRateAdditionalDetails;
}
public function getPurchaseRateAdditionalDetails() {
return $this->purchaseRateAdditionalDetails;
}
public function setProhibitedCategories($prohibitedCategories) {
$this->prohibitedCategories = $prohibitedCategories;
}
public function getProhibitedCategories() {
return $this->prohibitedCategories;
}
public function setFraudLiability($fraudLiability) {
$this->fraudLiability = $fraudLiability;
}
public function getFraudLiability() {
return $this->fraudLiability;
}
public function setCashAdvanceTerms($cashAdvanceTerms) {
$this->cashAdvanceTerms = $cashAdvanceTerms;
}
public function getCashAdvanceTerms() {
return $this->cashAdvanceTerms;
}
public function setLandingPageUrl($landingPageUrl) {
$this->landingPageUrl = $landingPageUrl;
}
public function getLandingPageUrl() {
return $this->landingPageUrl;
}
public function setIntroCashAdvanceTerms($introCashAdvanceTerms) {
$this->introCashAdvanceTerms = $introCashAdvanceTerms;
}
public function getIntroCashAdvanceTerms() {
return $this->introCashAdvanceTerms;
}
public function setRewardsExpire($rewardsExpire) {
$this->rewardsExpire = $rewardsExpire;
}
public function getRewardsExpire() {
return $this->rewardsExpire;
}
public function setIntroPurchaseTerms($introPurchaseTerms) {
$this->introPurchaseTerms = $introPurchaseTerms;
}
public function getIntroPurchaseTerms() {
return $this->introPurchaseTerms;
}
public function setDefaultFees($defaultFees) {
$this->assertIsArray($defaultFees, 'Google_CcOfferDefaultFees', __METHOD__);
$this->defaultFees = $defaultFees;
}
public function getDefaultFees() {
return $this->defaultFees;
}
public function setExtendedWarranty($extendedWarranty) {
$this->extendedWarranty = $extendedWarranty;
}
public function getExtendedWarranty() {
return $this->extendedWarranty;
}
public function setEmergencyInsurance($emergencyInsurance) {
$this->emergencyInsurance = $emergencyInsurance;
}
public function getEmergencyInsurance() {
return $this->emergencyInsurance;
}
public function setFirstYearAnnualFee($firstYearAnnualFee) {
$this->firstYearAnnualFee = $firstYearAnnualFee;
}
public function getFirstYearAnnualFee() {
return $this->firstYearAnnualFee;
}
public function setTrackingUrl($trackingUrl) {
$this->trackingUrl = $trackingUrl;
}
public function getTrackingUrl() {
return $this->trackingUrl;
}
public function setLatePaymentFee($latePaymentFee) {
$this->latePaymentFee = $latePaymentFee;
}
public function getLatePaymentFee() {
return $this->latePaymentFee;
}
public function setOverLimitFee($overLimitFee) {
$this->overLimitFee = $overLimitFee;
}
public function getOverLimitFee() {
return $this->overLimitFee;
}
public function setCardType($cardType) {
$this->cardType = $cardType;
}
public function getCardType() {
return $this->cardType;
}
public function setApprovedCategories($approvedCategories) {
$this->approvedCategories = $approvedCategories;
}
public function getApprovedCategories() {
return $this->approvedCategories;
}
public function setRewardPartner($rewardPartner) {
$this->rewardPartner = $rewardPartner;
}
public function getRewardPartner() {
return $this->rewardPartner;
}
public function setIntroBalanceTransferTerms($introBalanceTransferTerms) {
$this->introBalanceTransferTerms = $introBalanceTransferTerms;
}
public function getIntroBalanceTransferTerms() {
return $this->introBalanceTransferTerms;
}
public function setForeignCurrencyTransactionFee($foreignCurrencyTransactionFee) {
$this->foreignCurrencyTransactionFee = $foreignCurrencyTransactionFee;
}
public function getForeignCurrencyTransactionFee() {
return $this->foreignCurrencyTransactionFee;
}
public function setAnnualFee($annualFee) {
$this->annualFee = $annualFee;
}
public function getAnnualFee() {
return $this->annualFee;
}
public function setIssuerWebsite($issuerWebsite) {
$this->issuerWebsite = $issuerWebsite;
}
public function getIssuerWebsite() {
return $this->issuerWebsite;
}
public function setVariableRatesUpdateFrequency($variableRatesUpdateFrequency) {
$this->variableRatesUpdateFrequency = $variableRatesUpdateFrequency;
}
public function getVariableRatesUpdateFrequency() {
return $this->variableRatesUpdateFrequency;
}
public function setCarRentalInsurance($carRentalInsurance) {
$this->carRentalInsurance = $carRentalInsurance;
}
public function getCarRentalInsurance() {
return $this->carRentalInsurance;
}
public function setAdditionalCardBenefits($additionalCardBenefits) {
$this->additionalCardBenefits = $additionalCardBenefits;
}
public function getAdditionalCardBenefits() {
return $this->additionalCardBenefits;
}
public function setAgeMinimum($ageMinimum) {
$this->ageMinimum = $ageMinimum;
}
public function getAgeMinimum() {
return $this->ageMinimum;
}
public function setBalanceComputationMethod($balanceComputationMethod) {
$this->balanceComputationMethod = $balanceComputationMethod;
}
public function getBalanceComputationMethod() {
return $this->balanceComputationMethod;
}
public function setAprDisplay($aprDisplay) {
$this->aprDisplay = $aprDisplay;
}
public function getAprDisplay() {
return $this->aprDisplay;
}
public function setAdditionalCardHolderFee($additionalCardHolderFee) {
$this->additionalCardHolderFee = $additionalCardHolderFee;
}
public function getAdditionalCardHolderFee() {
return $this->additionalCardHolderFee;
}
public function setVariableRatesLastUpdated($variableRatesLastUpdated) {
$this->variableRatesLastUpdated = $variableRatesLastUpdated;
}
public function getVariableRatesLastUpdated() {
return $this->variableRatesLastUpdated;
}
public function setNetwork($network) {
$this->network = $network;
}
public function getNetwork() {
return $this->network;
}
public function setPurchaseRateType($purchaseRateType) {
$this->purchaseRateType = $purchaseRateType;
}
public function getPurchaseRateType() {
return $this->purchaseRateType;
}
public function setStatementCopyFee($statementCopyFee) {
$this->statementCopyFee = $statementCopyFee;
}
public function getStatementCopyFee() {
return $this->statementCopyFee;
}
public function setRewardsHaveBlackoutDates($rewardsHaveBlackoutDates) {
$this->rewardsHaveBlackoutDates = $rewardsHaveBlackoutDates;
}
public function getRewardsHaveBlackoutDates() {
return $this->rewardsHaveBlackoutDates;
}
public function setCreditRatingDisplay($creditRatingDisplay) {
$this->creditRatingDisplay = $creditRatingDisplay;
}
public function getCreditRatingDisplay() {
return $this->creditRatingDisplay;
}
public function setFlightAccidentInsurance($flightAccidentInsurance) {
$this->flightAccidentInsurance = $flightAccidentInsurance;
}
public function getFlightAccidentInsurance() {
return $this->flightAccidentInsurance;
}
public function setAnnualRewardMaximum($annualRewardMaximum) {
$this->annualRewardMaximum = $annualRewardMaximum;
}
public function getAnnualRewardMaximum() {
return $this->annualRewardMaximum;
}
public function setBalanceTransferTerms($balanceTransferTerms) {
$this->balanceTransferTerms = $balanceTransferTerms;
}
public function getBalanceTransferTerms() {
return $this->balanceTransferTerms;
}
public function setBonusRewards($bonusRewards) {
$this->assertIsArray($bonusRewards, 'Google_CcOfferBonusRewards', __METHOD__);
$this->bonusRewards = $bonusRewards;
}
public function getBonusRewards() {
return $this->bonusRewards;
}
public function setImageUrl($imageUrl) {
$this->imageUrl = $imageUrl;
}
public function getImageUrl() {
return $this->imageUrl;
}
public function setAgeMinimumDetails($ageMinimumDetails) {
$this->ageMinimumDetails = $ageMinimumDetails;
}
public function getAgeMinimumDetails() {
return $this->ageMinimumDetails;
}
public function setDisclaimer($disclaimer) {
$this->disclaimer = $disclaimer;
}
public function getDisclaimer() {
return $this->disclaimer;
}
}
class Google_CcOfferBonusRewards extends Google_Model {
public $amount;
public $details;
public function setAmount($amount) {
$this->amount = $amount;
}
public function getAmount() {
return $this->amount;
}
public function setDetails($details) {
$this->details = $details;
}
public function getDetails() {
return $this->details;
}
}
class Google_CcOfferDefaultFees extends Google_Model {
public $category;
public $maxRate;
public $minRate;
public $rateType;
public function setCategory($category) {
$this->category = $category;
}
public function getCategory() {
return $this->category;
}
public function setMaxRate($maxRate) {
$this->maxRate = $maxRate;
}
public function getMaxRate() {
return $this->maxRate;
}
public function setMinRate($minRate) {
$this->minRate = $minRate;
}
public function getMinRate() {
return $this->minRate;
}
public function setRateType($rateType) {
$this->rateType = $rateType;
}
public function getRateType() {
return $this->rateType;
}
}
class Google_CcOfferRewards extends Google_Model {
public $category;
public $minRewardTier;
public $maxRewardTier;
public $expirationMonths;
public $amount;
public $additionalDetails;
public function setCategory($category) {
$this->category = $category;
}
public function getCategory() {
return $this->category;
}
public function setMinRewardTier($minRewardTier) {
$this->minRewardTier = $minRewardTier;
}
public function getMinRewardTier() {
return $this->minRewardTier;
}
public function setMaxRewardTier($maxRewardTier) {
$this->maxRewardTier = $maxRewardTier;
}
public function getMaxRewardTier() {
return $this->maxRewardTier;
}
public function setExpirationMonths($expirationMonths) {
$this->expirationMonths = $expirationMonths;
}
public function getExpirationMonths() {
return $this->expirationMonths;
}
public function setAmount($amount) {
$this->amount = $amount;
}
public function getAmount() {
return $this->amount;
}
public function setAdditionalDetails($additionalDetails) {
$this->additionalDetails = $additionalDetails;
}
public function getAdditionalDetails() {
return $this->additionalDetails;
}
}
class Google_CcOffers extends Google_Model {
protected $__itemsType = 'Google_CcOffer';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems($items) {
$this->assertIsArray($items, 'Google_CcOffer', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Event extends Google_Model {
protected $__networkFeeType = 'Google_Money';
protected $__networkFeeDataType = '';
public $networkFee;
public $advertiserName;
public $kind;
public $modifyDate;
public $type;
public $orderId;
public $publisherName;
public $memberId;
public $advertiserId;
public $status;
public $chargeId;
protected $__productsType = 'Google_EventProducts';
protected $__productsDataType = 'array';
public $products;
protected $__earningsType = 'Google_Money';
protected $__earningsDataType = '';
public $earnings;
public $chargeType;
protected $__publisherFeeType = 'Google_Money';
protected $__publisherFeeDataType = '';
public $publisherFee;
protected $__commissionableSalesType = 'Google_Money';
protected $__commissionableSalesDataType = '';
public $commissionableSales;
public $publisherId;
public $eventDate;
public function setNetworkFee(Google_Money $networkFee) {
$this->networkFee = $networkFee;
}
public function getNetworkFee() {
return $this->networkFee;
}
public function setAdvertiserName($advertiserName) {
$this->advertiserName = $advertiserName;
}
public function getAdvertiserName() {
return $this->advertiserName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setModifyDate($modifyDate) {
$this->modifyDate = $modifyDate;
}
public function getModifyDate() {
return $this->modifyDate;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setOrderId($orderId) {
$this->orderId = $orderId;
}
public function getOrderId() {
return $this->orderId;
}
public function setPublisherName($publisherName) {
$this->publisherName = $publisherName;
}
public function getPublisherName() {
return $this->publisherName;
}
public function setMemberId($memberId) {
$this->memberId = $memberId;
}
public function getMemberId() {
return $this->memberId;
}
public function setAdvertiserId($advertiserId) {
$this->advertiserId = $advertiserId;
}
public function getAdvertiserId() {
return $this->advertiserId;
}
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setChargeId($chargeId) {
$this->chargeId = $chargeId;
}
public function getChargeId() {
return $this->chargeId;
}
public function setProducts($products) {
$this->assertIsArray($products, 'Google_EventProducts', __METHOD__);
$this->products = $products;
}
public function getProducts() {
return $this->products;
}
public function setEarnings(Google_Money $earnings) {
$this->earnings = $earnings;
}
public function getEarnings() {
return $this->earnings;
}
public function setChargeType($chargeType) {
$this->chargeType = $chargeType;
}
public function getChargeType() {
return $this->chargeType;
}
public function setPublisherFee(Google_Money $publisherFee) {
$this->publisherFee = $publisherFee;
}
public function getPublisherFee() {
return $this->publisherFee;
}
public function setCommissionableSales(Google_Money $commissionableSales) {
$this->commissionableSales = $commissionableSales;
}
public function getCommissionableSales() {
return $this->commissionableSales;
}
public function setPublisherId($publisherId) {
$this->publisherId = $publisherId;
}
public function getPublisherId() {
return $this->publisherId;
}
public function setEventDate($eventDate) {
$this->eventDate = $eventDate;
}
public function getEventDate() {
return $this->eventDate;
}
}
class Google_EventProducts extends Google_Model {
protected $__networkFeeType = 'Google_Money';
protected $__networkFeeDataType = '';
public $networkFee;
public $sku;
public $categoryName;
public $skuName;
protected $__publisherFeeType = 'Google_Money';
protected $__publisherFeeDataType = '';
public $publisherFee;
protected $__earningsType = 'Google_Money';
protected $__earningsDataType = '';
public $earnings;
protected $__unitPriceType = 'Google_Money';
protected $__unitPriceDataType = '';
public $unitPrice;
public $categoryId;
public $quantity;
public function setNetworkFee(Google_Money $networkFee) {
$this->networkFee = $networkFee;
}
public function getNetworkFee() {
return $this->networkFee;
}
public function setSku($sku) {
$this->sku = $sku;
}
public function getSku() {
return $this->sku;
}
public function setCategoryName($categoryName) {
$this->categoryName = $categoryName;
}
public function getCategoryName() {
return $this->categoryName;
}
public function setSkuName($skuName) {
$this->skuName = $skuName;
}
public function getSkuName() {
return $this->skuName;
}
public function setPublisherFee(Google_Money $publisherFee) {
$this->publisherFee = $publisherFee;
}
public function getPublisherFee() {
return $this->publisherFee;
}
public function setEarnings(Google_Money $earnings) {
$this->earnings = $earnings;
}
public function getEarnings() {
return $this->earnings;
}
public function setUnitPrice(Google_Money $unitPrice) {
$this->unitPrice = $unitPrice;
}
public function getUnitPrice() {
return $this->unitPrice;
}
public function setCategoryId($categoryId) {
$this->categoryId = $categoryId;
}
public function getCategoryId() {
return $this->categoryId;
}
public function setQuantity($quantity) {
$this->quantity = $quantity;
}
public function getQuantity() {
return $this->quantity;
}
}
class Google_Events extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Event';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Event', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Link extends Google_Model {
public $isActive;
public $linkType;
public $kind;
public $endDate;
public $description;
public $name;
public $startDate;
public $createDate;
public $imageAltText;
public $id;
public $advertiserId;
public $impressionTrackingUrl;
public $promotionType;
public $duration;
public $authorship;
public $availability;
public $clickTrackingUrl;
public $destinationUrl;
public function setIsActive($isActive) {
$this->isActive = $isActive;
}
public function getIsActive() {
return $this->isActive;
}
public function setLinkType($linkType) {
$this->linkType = $linkType;
}
public function getLinkType() {
return $this->linkType;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
public function getEndDate() {
return $this->endDate;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
public function getStartDate() {
return $this->startDate;
}
public function setCreateDate($createDate) {
$this->createDate = $createDate;
}
public function getCreateDate() {
return $this->createDate;
}
public function setImageAltText($imageAltText) {
$this->imageAltText = $imageAltText;
}
public function getImageAltText() {
return $this->imageAltText;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAdvertiserId($advertiserId) {
$this->advertiserId = $advertiserId;
}
public function getAdvertiserId() {
return $this->advertiserId;
}
public function setImpressionTrackingUrl($impressionTrackingUrl) {
$this->impressionTrackingUrl = $impressionTrackingUrl;
}
public function getImpressionTrackingUrl() {
return $this->impressionTrackingUrl;
}
public function setPromotionType($promotionType) {
$this->promotionType = $promotionType;
}
public function getPromotionType() {
return $this->promotionType;
}
public function setDuration($duration) {
$this->duration = $duration;
}
public function getDuration() {
return $this->duration;
}
public function setAuthorship($authorship) {
$this->authorship = $authorship;
}
public function getAuthorship() {
return $this->authorship;
}
public function setAvailability($availability) {
$this->availability = $availability;
}
public function getAvailability() {
return $this->availability;
}
public function setClickTrackingUrl($clickTrackingUrl) {
$this->clickTrackingUrl = $clickTrackingUrl;
}
public function getClickTrackingUrl() {
return $this->clickTrackingUrl;
}
public function setDestinationUrl($destinationUrl) {
$this->destinationUrl = $destinationUrl;
}
public function getDestinationUrl() {
return $this->destinationUrl;
}
}
class Google_Links extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Link';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Link', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Money extends Google_Model {
public $amount;
public $currencyCode;
public function setAmount($amount) {
$this->amount = $amount;
}
public function getAmount() {
return $this->amount;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
}
class Google_Publisher extends Google_Model {
public $status;
public $kind;
public $name;
public $classification;
protected $__epcSevenDayAverageType = 'Google_Money';
protected $__epcSevenDayAverageDataType = '';
public $epcSevenDayAverage;
public $payoutRank;
protected $__epcNinetyDayAverageType = 'Google_Money';
protected $__epcNinetyDayAverageDataType = '';
public $epcNinetyDayAverage;
protected $__itemType = 'Google_Publisher';
protected $__itemDataType = '';
public $item;
public $joinDate;
public $sites;
public $id;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setClassification($classification) {
$this->classification = $classification;
}
public function getClassification() {
return $this->classification;
}
public function setEpcSevenDayAverage(Google_Money $epcSevenDayAverage) {
$this->epcSevenDayAverage = $epcSevenDayAverage;
}
public function getEpcSevenDayAverage() {
return $this->epcSevenDayAverage;
}
public function setPayoutRank($payoutRank) {
$this->payoutRank = $payoutRank;
}
public function getPayoutRank() {
return $this->payoutRank;
}
public function setEpcNinetyDayAverage(Google_Money $epcNinetyDayAverage) {
$this->epcNinetyDayAverage = $epcNinetyDayAverage;
}
public function getEpcNinetyDayAverage() {
return $this->epcNinetyDayAverage;
}
public function setItem(Google_Publisher $item) {
$this->item = $item;
}
public function getItem() {
return $this->item;
}
public function setJoinDate($joinDate) {
$this->joinDate = $joinDate;
}
public function getJoinDate() {
return $this->joinDate;
}
public function setSites($sites) {
$this->sites = $sites;
}
public function getSites() {
return $this->sites;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_Publishers extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Publisher';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems($items) {
$this->assertIsArray($items, 'Google_Publisher', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_GanService.php | PHP | asf20 | 61,008 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "taskqueues" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $taskqueues = $taskqueueService->taskqueues;
* </code>
*/
class Google_TaskqueuesServiceResource extends Google_ServiceResource {
/**
* Get detailed information about a TaskQueue. (taskqueues.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to get the properties of.
* @param array $optParams Optional parameters.
*
* @opt_param bool getStats Whether to get stats. Optional.
* @return Google_TaskQueue
*/
public function get($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_TaskQueue($data);
} else {
return $data;
}
}
}
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $taskqueueService = new Google_TaskqueueService(...);
* $tasks = $taskqueueService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Insert a new task in a TaskQueue (tasks.insert)
*
* @param string $project The project under which the queue lies
* @param string $taskqueue The taskqueue to insert the task into
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function insert($project, $taskqueue, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Get a particular task from a TaskQueue. (tasks.get)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue in which the task belongs.
* @param string $task The task to get properties of.
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function get($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* List Tasks in a TaskQueue (tasks.list)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The id of the taskqueue to list tasks from.
* @param array $optParams Optional parameters.
* @return Google_Tasks2
*/
public function listTasks($project, $taskqueue, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Tasks2($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. (tasks.update)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Update tasks that are leased out of a TaskQueue. This method supports patch semantics.
* (tasks.patch)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue
* @param string $task
* @param int $newLeaseSeconds The new lease in seconds.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($project, $taskqueue, $task, $newLeaseSeconds, Google_Task $postBody, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task, 'newLeaseSeconds' => $newLeaseSeconds, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Delete a task from a TaskQueue. (tasks.delete)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to delete a task from.
* @param string $task The id of the task to delete.
* @param array $optParams Optional parameters.
*/
public function delete($project, $taskqueue, $task, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
/**
* Lease 1 or more tasks from a TaskQueue. (tasks.lease)
*
* @param string $project The project under which the queue lies.
* @param string $taskqueue The taskqueue to lease a task from.
* @param int $numTasks The number of tasks to lease.
* @param int $leaseSecs The lease in seconds.
* @param array $optParams Optional parameters.
*
* @opt_param bool groupByTag When true, all returned tasks will have the same tag
* @opt_param string tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag
* @return Google_Tasks
*/
public function lease($project, $taskqueue, $numTasks, $leaseSecs, $optParams = array()) {
$params = array('project' => $project, 'taskqueue' => $taskqueue, 'numTasks' => $numTasks, 'leaseSecs' => $leaseSecs);
$params = array_merge($params, $optParams);
$data = $this->__call('lease', array($params));
if ($this->useObjects()) {
return new Google_Tasks($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Taskqueue (v1beta2).
*
* <p>
* Lets you access a Google App Engine Pull Task Queue over REST.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/appengine/docs/python/taskqueue/rest.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_TaskqueueService extends Google_Service {
public $taskqueues;
public $tasks;
/**
* Constructs the internal representation of the Taskqueue service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'taskqueue/v1beta2/projects/';
$this->version = 'v1beta2';
$this->serviceName = 'taskqueue';
$client->addService($this->serviceName, $this->version);
$this->taskqueues = new Google_TaskqueuesServiceResource($this, $this->serviceName, 'taskqueues', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "getStats": {"type": "boolean", "location": "query"}}, "id": "taskqueue.taskqueues.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}", "response": {"$ref": "TaskQueue"}}}}', true));
$this->tasks = new Google_TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks", "id": "taskqueue.tasks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.get", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}}, "id": "taskqueue.tasks.list", "httpMethod": "GET", "path": "{project}/taskqueues/{taskqueue}/tasks", "response": {"$ref": "Tasks2"}}, "update": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}, "newLeaseSeconds": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "path": "{project}/taskqueues/{taskqueue}/tasks/{task}", "id": "taskqueue.tasks.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}, "lease": {"scopes": ["https://www.googleapis.com/auth/taskqueue", "https://www.googleapis.com/auth/taskqueue.consumer"], "parameters": {"groupByTag": {"type": "boolean", "location": "query"}, "leaseSecs": {"required": true, "type": "integer", "location": "query", "format": "int32"}, "project": {"required": true, "type": "string", "location": "path"}, "taskqueue": {"required": true, "type": "string", "location": "path"}, "tag": {"type": "string", "location": "query"}, "numTasks": {"required": true, "type": "integer", "location": "query", "format": "int32"}}, "id": "taskqueue.tasks.lease", "httpMethod": "POST", "path": "{project}/taskqueues/{taskqueue}/tasks/lease", "response": {"$ref": "Tasks"}}}}', true));
}
}
class Google_Task extends Google_Model {
public $kind;
public $leaseTimestamp;
public $id;
public $tag;
public $payloadBase64;
public $queueName;
public $enqueueTimestamp;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLeaseTimestamp($leaseTimestamp) {
$this->leaseTimestamp = $leaseTimestamp;
}
public function getLeaseTimestamp() {
return $this->leaseTimestamp;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setTag($tag) {
$this->tag = $tag;
}
public function getTag() {
return $this->tag;
}
public function setPayloadBase64($payloadBase64) {
$this->payloadBase64 = $payloadBase64;
}
public function getPayloadBase64() {
return $this->payloadBase64;
}
public function setQueueName($queueName) {
$this->queueName = $queueName;
}
public function getQueueName() {
return $this->queueName;
}
public function setEnqueueTimestamp($enqueueTimestamp) {
$this->enqueueTimestamp = $enqueueTimestamp;
}
public function getEnqueueTimestamp() {
return $this->enqueueTimestamp;
}
}
class Google_TaskQueue extends Google_Model {
public $kind;
protected $__statsType = 'Google_TaskQueueStats';
protected $__statsDataType = '';
public $stats;
public $id;
public $maxLeases;
protected $__aclType = 'Google_TaskQueueAcl';
protected $__aclDataType = '';
public $acl;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStats(Google_TaskQueueStats $stats) {
$this->stats = $stats;
}
public function getStats() {
return $this->stats;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setMaxLeases($maxLeases) {
$this->maxLeases = $maxLeases;
}
public function getMaxLeases() {
return $this->maxLeases;
}
public function setAcl(Google_TaskQueueAcl $acl) {
$this->acl = $acl;
}
public function getAcl() {
return $this->acl;
}
}
class Google_TaskQueueAcl extends Google_Model {
public $consumerEmails;
public $producerEmails;
public $adminEmails;
public function setConsumerEmails(/* array(Google_string) */ $consumerEmails) {
$this->assertIsArray($consumerEmails, 'Google_string', __METHOD__);
$this->consumerEmails = $consumerEmails;
}
public function getConsumerEmails() {
return $this->consumerEmails;
}
public function setProducerEmails(/* array(Google_string) */ $producerEmails) {
$this->assertIsArray($producerEmails, 'Google_string', __METHOD__);
$this->producerEmails = $producerEmails;
}
public function getProducerEmails() {
return $this->producerEmails;
}
public function setAdminEmails(/* array(Google_string) */ $adminEmails) {
$this->assertIsArray($adminEmails, 'Google_string', __METHOD__);
$this->adminEmails = $adminEmails;
}
public function getAdminEmails() {
return $this->adminEmails;
}
}
class Google_TaskQueueStats extends Google_Model {
public $oldestTask;
public $leasedLastMinute;
public $totalTasks;
public $leasedLastHour;
public function setOldestTask($oldestTask) {
$this->oldestTask = $oldestTask;
}
public function getOldestTask() {
return $this->oldestTask;
}
public function setLeasedLastMinute($leasedLastMinute) {
$this->leasedLastMinute = $leasedLastMinute;
}
public function getLeasedLastMinute() {
return $this->leasedLastMinute;
}
public function setTotalTasks($totalTasks) {
$this->totalTasks = $totalTasks;
}
public function getTotalTasks() {
return $this->totalTasks;
}
public function setLeasedLastHour($leasedLastHour) {
$this->leasedLastHour = $leasedLastHour;
}
public function getLeasedLastHour() {
return $this->leasedLastHour;
}
}
class Google_Tasks extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Tasks2 extends Google_Model {
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_TaskqueueService.php | PHP | asf20 | 18,038 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "tasks" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new Google_TasksService(...);
* $tasks = $tasksService->tasks;
* </code>
*/
class Google_TasksServiceResource extends Google_ServiceResource {
/**
* Creates a new task on the specified task list. (tasks.insert)
*
* @param string $tasklist Task list identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string parent Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.
* @opt_param string previous Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.
* @return Google_Task
*/
public function insert($tasklist, Google_Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Returns the specified task. (tasks.get)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function get($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Clears all completed tasks from the specified task list. The affected tasks will be marked as
* 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
* (tasks.clear)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
*/
public function clear($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('clear', array($params));
return $data;
}
/**
* Moves the specified task to another position in the task list. This can include putting it as a
* child task under a new parent and/or move it to a different position among its sibling tasks.
* (tasks.move)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string parent New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional.
* @opt_param string previous New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional.
* @return Google_Task
*/
public function move($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('move', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Returns all tasks in the specified task list. (tasks.list)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
*
* @opt_param string dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
* @opt_param bool showDeleted Flag indicating whether deleted tasks are returned in the result. Optional. The default is False.
* @opt_param string updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time.
* @opt_param string completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
* @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
* @opt_param bool showCompleted Flag indicating whether completed tasks are returned in the result. Optional. The default is True.
* @opt_param string pageToken Token specifying the result page to return. Optional.
* @opt_param string completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date.
* @opt_param bool showHidden Flag indicating whether hidden tasks are returned in the result. Optional. The default is False.
* @opt_param string dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date.
* @return Google_Tasks
*/
public function listTasks($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Tasks($data);
} else {
return $data;
}
}
/**
* Updates the specified task. (tasks.update)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function update($tasklist, $task, Google_Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Updates the specified task. This method supports patch semantics. (tasks.patch)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param Google_Task $postBody
* @param array $optParams Optional parameters.
* @return Google_Task
*/
public function patch($tasklist, $task, Google_Task $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Task($data);
} else {
return $data;
}
}
/**
* Deletes the specified task from the task list. (tasks.delete)
*
* @param string $tasklist Task list identifier.
* @param string $task Task identifier.
* @param array $optParams Optional parameters.
*/
public function delete($tasklist, $task, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'task' => $task);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "tasklists" collection of methods.
* Typical usage is:
* <code>
* $tasksService = new Google_TasksService(...);
* $tasklists = $tasksService->tasklists;
* </code>
*/
class Google_TasklistsServiceResource extends Google_ServiceResource {
/**
* Creates a new task list and adds it to the authenticated user's task lists. (tasklists.insert)
*
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function insert(Google_TaskList $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns the authenticated user's specified task list. (tasklists.get)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function get($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Returns all the authenticated user's task lists. (tasklists.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token specifying the result page to return. Optional.
* @opt_param string maxResults Maximum number of task lists returned on one page. Optional. The default is 100.
* @return Google_TaskLists
*/
public function listTasklists($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TaskLists($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. (tasklists.update)
*
* @param string $tasklist Task list identifier.
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function update($tasklist, Google_TaskList $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Updates the authenticated user's specified task list. This method supports patch semantics.
* (tasklists.patch)
*
* @param string $tasklist Task list identifier.
* @param Google_TaskList $postBody
* @param array $optParams Optional parameters.
* @return Google_TaskList
*/
public function patch($tasklist, Google_TaskList $postBody, $optParams = array()) {
$params = array('tasklist' => $tasklist, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_TaskList($data);
} else {
return $data;
}
}
/**
* Deletes the authenticated user's specified task list. (tasklists.delete)
*
* @param string $tasklist Task list identifier.
* @param array $optParams Optional parameters.
*/
public function delete($tasklist, $optParams = array()) {
$params = array('tasklist' => $tasklist);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Tasks (v1).
*
* <p>
* Lets you manage your tasks and task lists.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/tasks/v1/using.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_TasksService extends Google_Service {
public $tasks;
public $tasklists;
/**
* Constructs the internal representation of the Tasks service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'tasks/v1/';
$this->version = 'v1';
$this->serviceName = 'tasks';
$client->addService($this->serviceName, $this->version);
$this->tasks = new Google_TasksServiceResource($this, $this->serviceName, 'tasks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "POST", "path": "lists/{tasklist}/tasks", "id": "tasks.tasks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasks.get", "httpMethod": "GET", "path": "lists/{tasklist}/tasks/{task}", "response": {"$ref": "Task"}}, "clear": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "lists/{tasklist}/clear", "id": "tasks.tasks.clear", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST"}, "move": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"task": {"required": true, "type": "string", "location": "path"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "parent": {"type": "string", "location": "query"}, "previous": {"type": "string", "location": "query"}}, "id": "tasks.tasks.move", "httpMethod": "POST", "path": "lists/{tasklist}/tasks/{task}/move", "response": {"$ref": "Task"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"dueMax": {"type": "string", "location": "query"}, "tasklist": {"required": true, "type": "string", "location": "path"}, "showDeleted": {"type": "boolean", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "completedMin": {"type": "string", "location": "query"}, "maxResults": {"type": "string", "location": "query", "format": "int64"}, "showCompleted": {"type": "boolean", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "completedMax": {"type": "string", "location": "query"}, "showHidden": {"type": "boolean", "location": "query"}, "dueMin": {"type": "string", "location": "query"}}, "id": "tasks.tasks.list", "httpMethod": "GET", "path": "lists/{tasklist}/tasks", "response": {"$ref": "Tasks"}}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PUT", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Task"}, "response": {"$ref": "Task"}, "httpMethod": "PATCH", "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "lists/{tasklist}/tasks/{task}", "id": "tasks.tasks.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}, "task": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->tasklists = new Google_TasklistsServiceResource($this, $this->serviceName, 'tasklists', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/tasks"], "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "POST", "path": "users/@me/lists", "id": "tasks.tasklists.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "id": "tasks.tasklists.get", "httpMethod": "GET", "path": "users/@me/lists/{tasklist}", "response": {"$ref": "TaskList"}}, "list": {"scopes": ["https://www.googleapis.com/auth/tasks", "https://www.googleapis.com/auth/tasks.readonly"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"type": "string", "location": "query", "format": "int64"}}, "response": {"$ref": "TaskLists"}, "httpMethod": "GET", "path": "users/@me/lists", "id": "tasks.tasklists.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "PUT", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/tasks"], "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "TaskList"}, "response": {"$ref": "TaskList"}, "httpMethod": "PATCH", "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/tasks"], "path": "users/@me/lists/{tasklist}", "id": "tasks.tasklists.delete", "parameters": {"tasklist": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Task extends Google_Model {
public $status;
public $kind;
public $updated;
public $parent;
protected $__linksType = 'Google_TaskLinks';
protected $__linksDataType = 'array';
public $links;
public $title;
public $deleted;
public $completed;
public $due;
public $etag;
public $notes;
public $position;
public $hidden;
public $id;
public $selfLink;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
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;
}
public function setParent($parent) {
$this->parent = $parent;
}
public function getParent() {
return $this->parent;
}
public function setLinks(/* array(Google_TaskLinks) */ $links) {
$this->assertIsArray($links, 'Google_TaskLinks', __METHOD__);
$this->links = $links;
}
public function getLinks() {
return $this->links;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setDeleted($deleted) {
$this->deleted = $deleted;
}
public function getDeleted() {
return $this->deleted;
}
public function setCompleted($completed) {
$this->completed = $completed;
}
public function getCompleted() {
return $this->completed;
}
public function setDue($due) {
$this->due = $due;
}
public function getDue() {
return $this->due;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setNotes($notes) {
$this->notes = $notes;
}
public function getNotes() {
return $this->notes;
}
public function setPosition($position) {
$this->position = $position;
}
public function getPosition() {
return $this->position;
}
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 setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_TaskLinks extends Google_Model {
public $type;
public $link;
public $description;
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class Google_TaskList extends Google_Model {
public $kind;
public $title;
public $updated;
public $etag;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
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 setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_TaskLists extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_TaskList';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_TaskList) */ $items) {
$this->assertIsArray($items, 'Google_TaskList', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_Tasks extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Task';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Task) */ $items) {
$this->assertIsArray($items, 'Google_Task', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_TasksService.php | PHP | asf20 | 23,785 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "userinfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $userinfo = $oauth2Service->userinfo;
* </code>
*/
class Google_UserinfoServiceResource extends Google_ServiceResource {
/**
* (userinfo.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "v2" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $v2 = $oauth2Service->v2;
* </code>
*/
class Google_UserinfoV2ServiceResource extends Google_ServiceResource {
}
/**
* The "me" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $me = $oauth2Service->me;
* </code>
*/
class Google_UserinfoV2MeServiceResource extends Google_ServiceResource {
/**
* (me.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Oauth2 (v2).
*
* <p>
* OAuth2 API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Oauth2Service extends Google_Service {
public $userinfo;
public $userinfo_v2_me;
/**
* Constructs the internal representation of the Oauth2 service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = '';
$this->version = 'v2';
$this->serviceName = 'oauth2';
$client->addService($this->serviceName, $this->version);
$this->userinfo = new Google_UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
$this->userinfo_v2_me = new Google_UserinfoV2MeServiceResource($this, $this->serviceName, 'me', json_decode('{"methods": {"get": {"path": "userinfo/v2/me", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.v2.me.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true));
}
}
class Google_Tokeninfo extends Google_Model {
public $issued_to;
public $user_id;
public $expires_in;
public $access_type;
public $audience;
public $scope;
public $email;
public $verified_email;
public function setIssued_to($issued_to) {
$this->issued_to = $issued_to;
}
public function getIssued_to() {
return $this->issued_to;
}
public function setUser_id($user_id) {
$this->user_id = $user_id;
}
public function getUser_id() {
return $this->user_id;
}
public function setExpires_in($expires_in) {
$this->expires_in = $expires_in;
}
public function getExpires_in() {
return $this->expires_in;
}
public function setAccess_type($access_type) {
$this->access_type = $access_type;
}
public function getAccess_type() {
return $this->access_type;
}
public function setAudience($audience) {
$this->audience = $audience;
}
public function getAudience() {
return $this->audience;
}
public function setScope($scope) {
$this->scope = $scope;
}
public function getScope() {
return $this->scope;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}
class Google_Userinfo extends Google_Model {
public $family_name;
public $name;
public $picture;
public $locale;
public $gender;
public $email;
public $birthday;
public $link;
public $given_name;
public $timezone;
public $id;
public $verified_email;
public function setFamily_name($family_name) {
$this->family_name = $family_name;
}
public function getFamily_name() {
return $this->family_name;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPicture($picture) {
$this->picture = $picture;
}
public function getPicture() {
return $this->picture;
}
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setBirthday($birthday) {
$this->birthday = $birthday;
}
public function getBirthday() {
return $this->birthday;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setGiven_name($given_name) {
$this->given_name = $given_name;
}
public function getGiven_name() {
return $this->given_name;
}
public function setTimezone($timezone) {
$this->timezone = $timezone;
}
public function getTimezone() {
return $this->timezone;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_Oauth2Service.php | PHP | asf20 | 7,028 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "licenseAssignments" collection of methods.
* Typical usage is:
* <code>
* $licensingService = new Google_LicensingService(...);
* $licenseAssignments = $licensingService->licenseAssignments;
* </code>
*/
class Google_LicenseAssignmentsServiceResource extends Google_ServiceResource {
/**
* Assign License. (licenseAssignments.insert)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param Google_LicenseAssignmentInsert $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function insert($productId, $skuId, Google_LicenseAssignmentInsert $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Get license assignment of a particular product and sku for a user (licenseAssignments.get)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function get($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* List license assignments for given product and sku of the customer.
* (licenseAssignments.listForProductAndSku)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProductAndSku($productId, $skuId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProductAndSku', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* List license assignments for given product of the customer. (licenseAssignments.listForProduct)
*
* @param string $productId Name for product
* @param string $customerId CustomerId represents the customer for whom licenseassignments are queried
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Token to fetch the next page.Optional. By default server will return first page
* @opt_param string maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100.
* @return Google_LicenseAssignmentList
*/
public function listForProduct($productId, $customerId, $optParams = array()) {
$params = array('productId' => $productId, 'customerId' => $customerId);
$params = array_merge($params, $optParams);
$data = $this->__call('listForProduct', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignmentList($data);
} else {
return $data;
}
}
/**
* Assign License. (licenseAssignments.update)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function update($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Assign License. This method supports patch semantics. (licenseAssignments.patch)
*
* @param string $productId Name for product
* @param string $skuId Name for sku for which license would be revoked
* @param string $userId email id or unique Id of the user
* @param Google_LicenseAssignment $postBody
* @param array $optParams Optional parameters.
* @return Google_LicenseAssignment
*/
public function patch($productId, $skuId, $userId, Google_LicenseAssignment $postBody, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_LicenseAssignment($data);
} else {
return $data;
}
}
/**
* Revoke License. (licenseAssignments.delete)
*
* @param string $productId Name for product
* @param string $skuId Name for sku
* @param string $userId email id or unique Id of the user
* @param array $optParams Optional parameters.
*/
public function delete($productId, $skuId, $userId, $optParams = array()) {
$params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Licensing (v1).
*
* <p>
* Licensing API to view and manage license for your domain.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/google-apps/licensing/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_LicensingService extends Google_Service {
public $licenseAssignments;
/**
* Constructs the internal representation of the Licensing service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'apps/licensing/v1/product/';
$this->version = 'v1';
$this->serviceName = 'licensing';
$client->addService($this->serviceName, $this->version);
$this->licenseAssignments = new Google_LicenseAssignmentsServiceResource($this, $this->serviceName, 'licenseAssignments', json_decode('{"methods": {"insert": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignmentInsert"}, "id": "licensing.licenseAssignments.insert", "httpMethod": "POST", "path": "{productId}/sku/{skuId}/user", "response": {"$ref": "LicenseAssignment"}}, "get": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.get", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}, "listForProductAndSku": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProductAndSku", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "skuId": {"required": true, "type": "string", "location": "path"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/users"}, "listForProduct": {"httpMethod": "GET", "response": {"$ref": "LicenseAssignmentList"}, "id": "licensing.licenseAssignments.listForProduct", "parameters": {"pageToken": {"default": "", "type": "string", "location": "query"}, "customerId": {"required": true, "type": "string", "location": "query"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "1000", "minimum": "1", "location": "query", "type": "integer"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/users"}, "update": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.update", "httpMethod": "PUT", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "patch": {"parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "LicenseAssignment"}, "id": "licensing.licenseAssignments.patch", "httpMethod": "PATCH", "path": "{productId}/sku/{skuId}/user/{userId}", "response": {"$ref": "LicenseAssignment"}}, "delete": {"httpMethod": "DELETE", "id": "licensing.licenseAssignments.delete", "parameters": {"skuId": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "productId": {"required": true, "type": "string", "location": "path"}}, "path": "{productId}/sku/{skuId}/user/{userId}"}}}', true));
}
}
class Google_LicenseAssignment extends Google_Model {
public $skuId;
public $kind;
public $userId;
public $etags;
public $selfLink;
public $productId;
public function setSkuId($skuId) {
$this->skuId = $skuId;
}
public function getSkuId() {
return $this->skuId;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
public function setEtags($etags) {
$this->etags = $etags;
}
public function getEtags() {
return $this->etags;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setProductId($productId) {
$this->productId = $productId;
}
public function getProductId() {
return $this->productId;
}
}
class Google_LicenseAssignmentInsert extends Google_Model {
public $userId;
public function setUserId($userId) {
$this->userId = $userId;
}
public function getUserId() {
return $this->userId;
}
}
class Google_LicenseAssignmentList extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_LicenseAssignment';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_LicenseAssignment) */ $items) {
$this->assertIsArray($items, 'Google_LicenseAssignment', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_LicensingService.php | PHP | asf20 | 13,151 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "layers" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $layers = $booksService->layers;
* </code>
*/
class Google_LayersServiceResource extends Google_ServiceResource {
/**
* List the layer summaries for a volume. (layers.list)
*
* @param string $volumeId The volume to retrieve layers for.
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken The value of the nextToken from the previous page.
* @opt_param string contentVersion The content version for the requested volume.
* @opt_param string maxResults Maximum number of results to return
* @opt_param string source String to identify the originator of this request.
* @return Google_Layersummaries
*/
public function listLayers($volumeId, $optParams = array()) {
$params = array('volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Layersummaries($data);
} else {
return $data;
}
}
/**
* Gets the layer summary for a volume. (layers.get)
*
* @param string $volumeId The volume to retrieve layers for.
* @param string $summaryId The ID for the layer to get the summary for.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @opt_param string contentVersion The content version for the requested volume.
* @return Google_Layersummary
*/
public function get($volumeId, $summaryId, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'summaryId' => $summaryId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Layersummary($data);
} else {
return $data;
}
}
}
/**
* The "annotationData" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $annotationData = $booksService->annotationData;
* </code>
*/
class Google_LayersAnnotationDataServiceResource extends Google_ServiceResource {
/**
* Gets the annotation data for a volume and layer. (annotationData.list)
*
* @param string $volumeId The volume to retrieve annotation data for.
* @param string $layerId The ID for the layer to get the annotation data.
* @param string $contentVersion The content version for the requested volume.
* @param array $optParams Optional parameters.
*
* @opt_param int scale The requested scale for the image.
* @opt_param string source String to identify the originator of this request.
* @opt_param string locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.
* @opt_param int h The requested pixel height for any images. If height is provided width must also be provided.
* @opt_param string updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).
* @opt_param string maxResults Maximum number of results to return
* @opt_param string annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set.
* @opt_param string pageToken The value of the nextToken from the previous page.
* @opt_param int w The requested pixel width for any images. If width is provided height must also be provided.
* @opt_param string updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).
* @return Google_Annotationsdata
*/
public function listLayersAnnotationData($volumeId, $layerId, $contentVersion, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'layerId' => $layerId, 'contentVersion' => $contentVersion);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Annotationsdata($data);
} else {
return $data;
}
}
/**
* Gets the annotation data. (annotationData.get)
*
* @param string $volumeId The volume to retrieve annotations for.
* @param string $layerId The ID for the layer to get the annotations.
* @param string $annotationDataId The ID of the annotation data to retrieve.
* @param string $contentVersion The content version for the volume you are trying to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param int scale The requested scale for the image.
* @opt_param string locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.
* @opt_param int h The requested pixel height for any images. If height is provided width must also be provided.
* @opt_param string source String to identify the originator of this request.
* @opt_param int w The requested pixel width for any images. If width is provided height must also be provided.
* @return Google_Annotationdata
*/
public function get($volumeId, $layerId, $annotationDataId, $contentVersion, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'layerId' => $layerId, 'annotationDataId' => $annotationDataId, 'contentVersion' => $contentVersion);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Annotationdata($data);
} else {
return $data;
}
}
}
/**
* The "volumeAnnotations" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $volumeAnnotations = $booksService->volumeAnnotations;
* </code>
*/
class Google_LayersVolumeAnnotationsServiceResource extends Google_ServiceResource {
/**
* Gets the volume annotations for a volume and layer. (volumeAnnotations.list)
*
* @param string $volumeId The volume to retrieve annotations for.
* @param string $layerId The ID for the layer to get the annotations.
* @param string $contentVersion The content version for the requested volume.
* @param array $optParams Optional parameters.
*
* @opt_param bool showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.
* @opt_param string endPosition The end position to end retrieving data from.
* @opt_param string endOffset The end offset to end retrieving data from.
* @opt_param string locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.
* @opt_param string updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).
* @opt_param string updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).
* @opt_param string maxResults Maximum number of results to return
* @opt_param string pageToken The value of the nextToken from the previous page.
* @opt_param string source String to identify the originator of this request.
* @opt_param string startOffset The start offset to start retrieving data from.
* @opt_param string startPosition The start position to start retrieving data from.
* @return Google_Volumeannotations
*/
public function listLayersVolumeAnnotations($volumeId, $layerId, $contentVersion, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'layerId' => $layerId, 'contentVersion' => $contentVersion);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Volumeannotations($data);
} else {
return $data;
}
}
/**
* Gets the volume annotation. (volumeAnnotations.get)
*
* @param string $volumeId The volume to retrieve annotations for.
* @param string $layerId The ID for the layer to get the annotations.
* @param string $annotationId The ID of the volume annotation to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.
* @opt_param string source String to identify the originator of this request.
* @return Google_Volumeannotation
*/
public function get($volumeId, $layerId, $annotationId, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'layerId' => $layerId, 'annotationId' => $annotationId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Volumeannotation($data);
} else {
return $data;
}
}
}
/**
* The "bookshelves" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $bookshelves = $booksService->bookshelves;
* </code>
*/
class Google_BookshelvesServiceResource extends Google_ServiceResource {
/**
* Retrieves a list of public bookshelves for the specified user. (bookshelves.list)
*
* @param string $userId ID of user for whom to retrieve bookshelves.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Bookshelves
*/
public function listBookshelves($userId, $optParams = array()) {
$params = array('userId' => $userId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Bookshelves($data);
} else {
return $data;
}
}
/**
* Retrieves metadata for a specific bookshelf for the specified user. (bookshelves.get)
*
* @param string $userId ID of user for whom to retrieve bookshelves.
* @param string $shelf ID of bookshelf to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Bookshelf
*/
public function get($userId, $shelf, $optParams = array()) {
$params = array('userId' => $userId, 'shelf' => $shelf);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Bookshelf($data);
} else {
return $data;
}
}
}
/**
* The "volumes" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $volumes = $booksService->volumes;
* </code>
*/
class Google_BookshelvesVolumesServiceResource extends Google_ServiceResource {
/**
* Retrieves volumes in a specific bookshelf for the specified user. (volumes.list)
*
* @param string $userId ID of user for whom to retrieve bookshelf volumes.
* @param string $shelf ID of bookshelf to retrieve volumes.
* @param array $optParams Optional parameters.
*
* @opt_param bool showPreorders Set to true to show pre-ordered books. Defaults to false.
* @opt_param string maxResults Maximum number of results to return
* @opt_param string source String to identify the originator of this request.
* @opt_param string startIndex Index of the first element to return (starts at 0)
* @return Google_Volumes
*/
public function listBookshelvesVolumes($userId, $shelf, $optParams = array()) {
$params = array('userId' => $userId, 'shelf' => $shelf);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Volumes($data);
} else {
return $data;
}
}
}
/**
* The "myconfig" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $myconfig = $booksService->myconfig;
* </code>
*/
class Google_MyconfigServiceResource extends Google_ServiceResource {
/**
* Release downloaded content access restriction. (myconfig.releaseDownloadAccess)
*
* @param string $volumeIds The volume(s) to release restrictions for.
* @param string $cpksver The device/version ID from which to release the restriction.
* @param array $optParams Optional parameters.
*
* @opt_param string locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.
* @opt_param string source String to identify the originator of this request.
* @return Google_DownloadAccesses
*/
public function releaseDownloadAccess($volumeIds, $cpksver, $optParams = array()) {
$params = array('volumeIds' => $volumeIds, 'cpksver' => $cpksver);
$params = array_merge($params, $optParams);
$data = $this->__call('releaseDownloadAccess', array($params));
if ($this->useObjects()) {
return new Google_DownloadAccesses($data);
} else {
return $data;
}
}
/**
* Request concurrent and download access restrictions. (myconfig.requestAccess)
*
* @param string $source String to identify the originator of this request.
* @param string $volumeId The volume to request concurrent/download restrictions for.
* @param string $nonce The client nonce value.
* @param string $cpksver The device/version ID from which to request the restrictions.
* @param array $optParams Optional parameters.
*
* @opt_param string locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.
* @return Google_RequestAccess
*/
public function requestAccess($source, $volumeId, $nonce, $cpksver, $optParams = array()) {
$params = array('source' => $source, 'volumeId' => $volumeId, 'nonce' => $nonce, 'cpksver' => $cpksver);
$params = array_merge($params, $optParams);
$data = $this->__call('requestAccess', array($params));
if ($this->useObjects()) {
return new Google_RequestAccess($data);
} else {
return $data;
}
}
/**
* Request downloaded content access for specified volumes on the My eBooks shelf.
* (myconfig.syncVolumeLicenses)
*
* @param string $source String to identify the originator of this request.
* @param string $nonce The client nonce value.
* @param string $cpksver The device/version ID from which to release the restriction.
* @param array $optParams Optional parameters.
*
* @opt_param string locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.
* @opt_param bool showPreorders Set to true to show pre-ordered books. Defaults to false.
* @opt_param string volumeIds The volume(s) to request download restrictions for.
* @return Google_Volumes
*/
public function syncVolumeLicenses($source, $nonce, $cpksver, $optParams = array()) {
$params = array('source' => $source, 'nonce' => $nonce, 'cpksver' => $cpksver);
$params = array_merge($params, $optParams);
$data = $this->__call('syncVolumeLicenses', array($params));
if ($this->useObjects()) {
return new Google_Volumes($data);
} else {
return $data;
}
}
}
/**
* The "volumes" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $volumes = $booksService->volumes;
* </code>
*/
class Google_VolumesServiceResource extends Google_ServiceResource {
/**
* Performs a book search. (volumes.list)
*
* @param string $q Full-text search query string.
* @param array $optParams Optional parameters.
*
* @opt_param string orderBy Sort search results.
* @opt_param string projection Restrict information returned to a set of selected fields.
* @opt_param string libraryRestrict Restrict search to this user's library.
* @opt_param string langRestrict Restrict results to books with this language code.
* @opt_param bool showPreorders Set to true to show books available for preorder. Defaults to false.
* @opt_param string printType Restrict to books or magazines.
* @opt_param string maxResults Maximum number of results to return.
* @opt_param string filter Filter search results.
* @opt_param string source String to identify the originator of this request.
* @opt_param string startIndex Index of the first result to return (starts at 0)
* @opt_param string download Restrict to volumes by download availability.
* @opt_param string partner Restrict and brand results for partner ID.
* @return Google_Volumes
*/
public function listVolumes($q, $optParams = array()) {
$params = array('q' => $q);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Volumes($data);
} else {
return $data;
}
}
/**
* Gets volume information for a single volume. (volumes.get)
*
* @param string $volumeId ID of volume to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @opt_param string country ISO-3166-1 code to override the IP-based location.
* @opt_param string projection Restrict information returned to a set of selected fields.
* @opt_param string partner Brand results for partner ID.
* @return Google_Volume
*/
public function get($volumeId, $optParams = array()) {
$params = array('volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Volume($data);
} else {
return $data;
}
}
}
/**
* The "associated" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $associated = $booksService->associated;
* </code>
*/
class Google_VolumesAssociatedServiceResource extends Google_ServiceResource {
/**
* Return a list of associated books. (associated.list)
*
* @param string $volumeId ID of the source volume.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Restrict information returned to a set of selected fields.
* @opt_param string maxResults Maximum number of results to return.
* @opt_param string filter Filter search results.
* @opt_param string source String to identify the originator of this request.
* @opt_param string startIndex Index of the first result to return (starts at 0)
* @opt_param string association Association type.
* @return Google_Volumes
*/
public function listVolumesAssociated($volumeId, $optParams = array()) {
$params = array('volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Volumes($data);
} else {
return $data;
}
}
}
/**
* The "mylibrary" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $mylibrary = $booksService->mylibrary;
* </code>
*/
class Google_MylibraryServiceResource extends Google_ServiceResource {
}
/**
* The "bookshelves" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $bookshelves = $booksService->bookshelves;
* </code>
*/
class Google_MylibraryBookshelvesServiceResource extends Google_ServiceResource {
/**
* Removes a volume from a bookshelf. (bookshelves.removeVolume)
*
* @param string $shelf ID of bookshelf from which to remove a volume.
* @param string $volumeId ID of volume to remove.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
*/
public function removeVolume($shelf, $volumeId, $optParams = array()) {
$params = array('shelf' => $shelf, 'volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('removeVolume', array($params));
return $data;
}
/**
* Retrieves metadata for a specific bookshelf belonging to the authenticated user.
* (bookshelves.get)
*
* @param string $shelf ID of bookshelf to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Bookshelf
*/
public function get($shelf, $optParams = array()) {
$params = array('shelf' => $shelf);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Bookshelf($data);
} else {
return $data;
}
}
/**
* Clears all volumes from a bookshelf. (bookshelves.clearVolumes)
*
* @param string $shelf ID of bookshelf from which to remove a volume.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
*/
public function clearVolumes($shelf, $optParams = array()) {
$params = array('shelf' => $shelf);
$params = array_merge($params, $optParams);
$data = $this->__call('clearVolumes', array($params));
return $data;
}
/**
* Retrieves a list of bookshelves belonging to the authenticated user. (bookshelves.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Bookshelves
*/
public function listMylibraryBookshelves($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Bookshelves($data);
} else {
return $data;
}
}
/**
* Adds a volume to a bookshelf. (bookshelves.addVolume)
*
* @param string $shelf ID of bookshelf to which to add a volume.
* @param string $volumeId ID of volume to add.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
*/
public function addVolume($shelf, $volumeId, $optParams = array()) {
$params = array('shelf' => $shelf, 'volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('addVolume', array($params));
return $data;
}
/**
* Moves a volume within a bookshelf. (bookshelves.moveVolume)
*
* @param string $shelf ID of bookshelf with the volume.
* @param string $volumeId ID of volume to move.
* @param int $volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.)
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
*/
public function moveVolume($shelf, $volumeId, $volumePosition, $optParams = array()) {
$params = array('shelf' => $shelf, 'volumeId' => $volumeId, 'volumePosition' => $volumePosition);
$params = array_merge($params, $optParams);
$data = $this->__call('moveVolume', array($params));
return $data;
}
}
/**
* The "volumes" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $volumes = $booksService->volumes;
* </code>
*/
class Google_MylibraryBookshelvesVolumesServiceResource extends Google_ServiceResource {
/**
* Gets volume information for volumes on a bookshelf. (volumes.list)
*
* @param string $shelf The bookshelf ID or name retrieve volumes for.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Restrict information returned to a set of selected fields.
* @opt_param string country ISO-3166-1 code to override the IP-based location.
* @opt_param bool showPreorders Set to true to show pre-ordered books. Defaults to false.
* @opt_param string maxResults Maximum number of results to return
* @opt_param string q Full-text search query string in this bookshelf.
* @opt_param string source String to identify the originator of this request.
* @opt_param string startIndex Index of the first element to return (starts at 0)
* @return Google_Volumes
*/
public function listMylibraryBookshelvesVolumes($shelf, $optParams = array()) {
$params = array('shelf' => $shelf);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Volumes($data);
} else {
return $data;
}
}
}
/**
* The "readingpositions" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $readingpositions = $booksService->readingpositions;
* </code>
*/
class Google_MylibraryReadingpositionsServiceResource extends Google_ServiceResource {
/**
* Sets my reading position information for a volume. (readingpositions.setPosition)
*
* @param string $volumeId ID of volume for which to update the reading position.
* @param string $timestamp RFC 3339 UTC format timestamp associated with this reading position.
* @param string $position Position string for the new volume reading position.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @opt_param string contentVersion Volume content version for which this reading position applies.
* @opt_param string action Action that caused this reading position to be set.
*/
public function setPosition($volumeId, $timestamp, $position, $optParams = array()) {
$params = array('volumeId' => $volumeId, 'timestamp' => $timestamp, 'position' => $position);
$params = array_merge($params, $optParams);
$data = $this->__call('setPosition', array($params));
return $data;
}
/**
* Retrieves my reading position information for a volume. (readingpositions.get)
*
* @param string $volumeId ID of volume for which to retrieve a reading position.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @opt_param string contentVersion Volume content version for which this reading position is requested.
* @return Google_ReadingPosition
*/
public function get($volumeId, $optParams = array()) {
$params = array('volumeId' => $volumeId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_ReadingPosition($data);
} else {
return $data;
}
}
}
/**
* The "annotations" collection of methods.
* Typical usage is:
* <code>
* $booksService = new Google_BooksService(...);
* $annotations = $booksService->annotations;
* </code>
*/
class Google_MylibraryAnnotationsServiceResource extends Google_ServiceResource {
/**
* Inserts a new annotation. (annotations.insert)
*
* @param Google_Annotation $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Annotation
*/
public function insert(Google_Annotation $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Annotation($data);
} else {
return $data;
}
}
/**
* Gets an annotation by its ID. (annotations.get)
*
* @param string $annotationId The ID for the annotation to retrieve.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Annotation
*/
public function get($annotationId, $optParams = array()) {
$params = array('annotationId' => $annotationId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Annotation($data);
} else {
return $data;
}
}
/**
* Retrieves a list of annotations, possibly filtered. (annotations.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param bool showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.
* @opt_param string updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).
* @opt_param string updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).
* @opt_param string volumeId The volume to restrict annotations to.
* @opt_param string maxResults Maximum number of results to return
* @opt_param string pageToken The value of the nextToken from the previous page.
* @opt_param string pageIds The page ID(s) for the volume that is being queried.
* @opt_param string contentVersion The content version for the requested volume.
* @opt_param string source String to identify the originator of this request.
* @opt_param string layerId The layer ID to limit annotation by.
* @return Google_Annotations
*/
public function listMylibraryAnnotations($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_Annotations($data);
} else {
return $data;
}
}
/**
* Updates an existing annotation. (annotations.update)
*
* @param string $annotationId The ID for the annotation to update.
* @param Google_Annotation $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
* @return Google_Annotation
*/
public function update($annotationId, Google_Annotation $postBody, $optParams = array()) {
$params = array('annotationId' => $annotationId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Annotation($data);
} else {
return $data;
}
}
/**
* Deletes an annotation. (annotations.delete)
*
* @param string $annotationId The ID for the annotation to delete.
* @param array $optParams Optional parameters.
*
* @opt_param string source String to identify the originator of this request.
*/
public function delete($annotationId, $optParams = array()) {
$params = array('annotationId' => $annotationId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* Service definition for Google_Books (v1).
*
* <p>
* Lets you search for books and manage your Google Books library.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/books/docs/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_BooksService extends Google_Service {
public $layers;
public $layers_annotationData;
public $layers_volumeAnnotations;
public $bookshelves;
public $bookshelves_volumes;
public $myconfig;
public $volumes;
public $volumes_associated;
public $mylibrary_bookshelves;
public $mylibrary_bookshelves_volumes;
public $mylibrary_readingpositions;
public $mylibrary_annotations;
/**
* Constructs the internal representation of the Books service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'books/v1/';
$this->version = 'v1';
$this->serviceName = 'books';
$client->addService($this->serviceName, $this->version);
$this->layers = new Google_LayersServiceResource($this, $this->serviceName, 'layers', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "contentVersion": {"type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "200", "format": "uint32"}, "source": {"type": "string", "location": "query"}}, "id": "books.layers.list", "httpMethod": "GET", "path": "volumes/{volumeId}/layersummary", "response": {"$ref": "Layersummaries"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}, "contentVersion": {"type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "summaryId": {"required": true, "type": "string", "location": "path"}}, "id": "books.layers.get", "httpMethod": "GET", "path": "volumes/{volumeId}/layersummary/{summaryId}", "response": {"$ref": "Layersummary"}}}}', true));
$this->layers_annotationData = new Google_LayersAnnotationDataServiceResource($this, $this->serviceName, 'annotationData', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"scale": {"minimum": "0", "type": "integer", "location": "query", "format": "int32"}, "updatedMax": {"type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "h": {"type": "integer", "location": "query", "format": "int32"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "200", "format": "uint32"}, "annotationDataId": {"repeated": true, "type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "contentVersion": {"required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "w": {"type": "integer", "location": "query", "format": "int32"}, "layerId": {"required": true, "type": "string", "location": "path"}, "updatedMin": {"type": "string", "location": "query"}}, "id": "books.layers.annotationData.list", "httpMethod": "GET", "path": "volumes/{volumeId}/layers/{layerId}/data", "response": {"$ref": "Annotationsdata"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"scale": {"minimum": "0", "type": "integer", "location": "query", "format": "int32"}, "locale": {"type": "string", "location": "query"}, "h": {"type": "integer", "location": "query", "format": "int32"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "annotationDataId": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}, "contentVersion": {"required": true, "type": "string", "location": "query"}, "w": {"type": "integer", "location": "query", "format": "int32"}, "layerId": {"required": true, "type": "string", "location": "path"}}, "id": "books.layers.annotationData.get", "httpMethod": "GET", "path": "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}", "response": {"$ref": "Annotationdata"}}}}', true));
$this->layers_volumeAnnotations = new Google_LayersVolumeAnnotationsServiceResource($this, $this->serviceName, 'volumeAnnotations', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"showDeleted": {"type": "boolean", "location": "query"}, "endPosition": {"type": "string", "location": "query"}, "endOffset": {"type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "updatedMax": {"type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "200", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "contentVersion": {"required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "startOffset": {"type": "string", "location": "query"}, "layerId": {"required": true, "type": "string", "location": "path"}, "startPosition": {"type": "string", "location": "query"}}, "id": "books.layers.volumeAnnotations.list", "httpMethod": "GET", "path": "volumes/{volumeId}/layers/{layerId}", "response": {"$ref": "Volumeannotations"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"locale": {"type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "annotationId": {"required": true, "type": "string", "location": "path"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "layerId": {"required": true, "type": "string", "location": "path"}}, "id": "books.layers.volumeAnnotations.get", "httpMethod": "GET", "path": "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}", "response": {"$ref": "Volumeannotation"}}}}', true));
$this->bookshelves = new Google_BookshelvesServiceResource($this, $this->serviceName, 'bookshelves', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "books.bookshelves.list", "httpMethod": "GET", "path": "users/{userId}/bookshelves", "response": {"$ref": "Bookshelves"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "userId": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "id": "books.bookshelves.get", "httpMethod": "GET", "path": "users/{userId}/bookshelves/{shelf}", "response": {"$ref": "Bookshelf"}}}}', true));
$this->bookshelves_volumes = new Google_BookshelvesVolumesServiceResource($this, $this->serviceName, 'volumes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "showPreorders": {"type": "boolean", "location": "query"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "source": {"type": "string", "location": "query"}, "startIndex": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "userId": {"required": true, "type": "string", "location": "path"}}, "id": "books.bookshelves.volumes.list", "httpMethod": "GET", "path": "users/{userId}/bookshelves/{shelf}/volumes", "response": {"$ref": "Volumes"}}}}', true));
$this->myconfig = new Google_MyconfigServiceResource($this, $this->serviceName, 'myconfig', json_decode('{"methods": {"releaseDownloadAccess": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"locale": {"type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "volumeIds": {"repeated": true, "required": true, "type": "string", "location": "query"}}, "id": "books.myconfig.releaseDownloadAccess", "httpMethod": "POST", "path": "myconfig/releaseDownloadAccess", "response": {"$ref": "DownloadAccesses"}}, "requestAccess": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"locale": {"type": "string", "location": "query"}, "nonce": {"required": true, "type": "string", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "query"}, "source": {"required": true, "type": "string", "location": "query"}}, "id": "books.myconfig.requestAccess", "httpMethod": "POST", "path": "myconfig/requestAccess", "response": {"$ref": "RequestAccess"}}, "syncVolumeLicenses": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"nonce": {"required": true, "type": "string", "location": "query"}, "locale": {"type": "string", "location": "query"}, "showPreorders": {"type": "boolean", "location": "query"}, "cpksver": {"required": true, "type": "string", "location": "query"}, "source": {"required": true, "type": "string", "location": "query"}, "volumeIds": {"repeated": true, "type": "string", "location": "query"}}, "id": "books.myconfig.syncVolumeLicenses", "httpMethod": "POST", "path": "myconfig/syncVolumeLicenses", "response": {"$ref": "Volumes"}}}}', true));
$this->volumes = new Google_VolumesServiceResource($this, $this->serviceName, 'volumes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"orderBy": {"enum": ["newest", "relevance"], "type": "string", "location": "query"}, "q": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["full", "lite"], "type": "string", "location": "query"}, "libraryRestrict": {"enum": ["my-library", "no-restrict"], "type": "string", "location": "query"}, "langRestrict": {"type": "string", "location": "query"}, "showPreorders": {"type": "boolean", "location": "query"}, "printType": {"enum": ["all", "books", "magazines"], "type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "40", "format": "uint32"}, "filter": {"enum": ["ebooks", "free-ebooks", "full", "paid-ebooks", "partial"], "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "startIndex": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "download": {"enum": ["epub"], "type": "string", "location": "query"}, "partner": {"type": "string", "location": "query"}}, "id": "books.volumes.list", "httpMethod": "GET", "path": "volumes", "response": {"$ref": "Volumes"}}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"partner": {"type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "projection": {"enum": ["full", "lite"], "type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "id": "books.volumes.get", "httpMethod": "GET", "path": "volumes/{volumeId}", "response": {"$ref": "Volume"}}}}', true));
$this->volumes_associated = new Google_VolumesAssociatedServiceResource($this, $this->serviceName, 'associated', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"projection": {"enum": ["full", "lite"], "type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "40", "format": "uint32"}, "filter": {"enum": ["ebooks", "free-ebooks", "full", "paid-ebooks", "partial"], "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "startIndex": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "association": {"enum": ["complementary"], "type": "string", "location": "query"}}, "id": "books.volumes.associated.list", "httpMethod": "GET", "path": "volumes/{volumeId}/associated", "response": {"$ref": "Volumes"}}}}', true));
$this->mylibrary_bookshelves = new Google_MylibraryBookshelvesServiceResource($this, $this->serviceName, 'bookshelves', json_decode('{"methods": {"removeVolume": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/bookshelves/{shelf}/removeVolume", "id": "books.mylibrary.bookshelves.removeVolume", "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "volumeId": {"required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}}, "httpMethod": "POST"}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "id": "books.mylibrary.bookshelves.get", "httpMethod": "GET", "path": "mylibrary/bookshelves/{shelf}", "response": {"$ref": "Bookshelf"}}, "clearVolumes": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/bookshelves/{shelf}/clearVolumes", "id": "books.mylibrary.bookshelves.clearVolumes", "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}}, "httpMethod": "POST"}, "list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}}, "response": {"$ref": "Bookshelves"}, "httpMethod": "GET", "path": "mylibrary/bookshelves", "id": "books.mylibrary.bookshelves.list"}, "addVolume": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/bookshelves/{shelf}/addVolume", "id": "books.mylibrary.bookshelves.addVolume", "parameters": {"shelf": {"required": true, "type": "string", "location": "path"}, "volumeId": {"required": true, "type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}}, "httpMethod": "POST"}, "moveVolume": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/bookshelves/{shelf}/moveVolume", "id": "books.mylibrary.bookshelves.moveVolume", "parameters": {"source": {"type": "string", "location": "query"}, "volumePosition": {"required": true, "type": "integer", "location": "query", "format": "int32"}, "volumeId": {"required": true, "type": "string", "location": "query"}, "shelf": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "POST"}}}', true));
$this->mylibrary_bookshelves_volumes = new Google_MylibraryBookshelvesVolumesServiceResource($this, $this->serviceName, 'volumes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"projection": {"enum": ["full", "lite"], "type": "string", "location": "query"}, "country": {"type": "string", "location": "query"}, "showPreorders": {"type": "boolean", "location": "query"}, "maxResults": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "q": {"type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "startIndex": {"minimum": "0", "type": "integer", "location": "query", "format": "uint32"}, "shelf": {"required": true, "type": "string", "location": "path"}}, "id": "books.mylibrary.bookshelves.volumes.list", "httpMethod": "GET", "path": "mylibrary/bookshelves/{shelf}/volumes", "response": {"$ref": "Volumes"}}}}', true));
$this->mylibrary_readingpositions = new Google_MylibraryReadingpositionsServiceResource($this, $this->serviceName, 'readingpositions', json_decode('{"methods": {"setPosition": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/readingpositions/{volumeId}/setPosition", "id": "books.mylibrary.readingpositions.setPosition", "parameters": {"timestamp": {"required": true, "type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}, "source": {"type": "string", "location": "query"}, "contentVersion": {"type": "string", "location": "query"}, "action": {"enum": ["bookmark", "chapter", "next-page", "prev-page", "scroll", "search"], "type": "string", "location": "query"}, "position": {"required": true, "type": "string", "location": "query"}}, "httpMethod": "POST"}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}, "contentVersion": {"type": "string", "location": "query"}, "volumeId": {"required": true, "type": "string", "location": "path"}}, "id": "books.mylibrary.readingpositions.get", "httpMethod": "GET", "path": "mylibrary/readingpositions/{volumeId}", "response": {"$ref": "ReadingPosition"}}}}', true));
$this->mylibrary_annotations = new Google_MylibraryAnnotationsServiceResource($this, $this->serviceName, 'annotations', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}}, "request": {"$ref": "Annotation"}, "response": {"$ref": "Annotation"}, "httpMethod": "POST", "path": "mylibrary/annotations", "id": "books.mylibrary.annotations.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}, "annotationId": {"required": true, "type": "string", "location": "path"}}, "id": "books.mylibrary.annotations.get", "httpMethod": "GET", "path": "mylibrary/annotations/{annotationId}", "response": {"$ref": "Annotation"}}, "list": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"showDeleted": {"type": "boolean", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}, "updatedMax": {"type": "string", "location": "query"}, "volumeId": {"type": "string", "location": "query"}, "maxResults": {"location": "query", "minimum": "0", "type": "integer", "maximum": "40", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "pageIds": {"repeated": true, "type": "string", "location": "query"}, "contentVersion": {"type": "string", "location": "query"}, "source": {"type": "string", "location": "query"}, "layerId": {"type": "string", "location": "query"}}, "response": {"$ref": "Annotations"}, "httpMethod": "GET", "path": "mylibrary/annotations", "id": "books.mylibrary.annotations.list"}, "update": {"scopes": ["https://www.googleapis.com/auth/books"], "parameters": {"source": {"type": "string", "location": "query"}, "annotationId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Annotation"}, "response": {"$ref": "Annotation"}, "httpMethod": "PUT", "path": "mylibrary/annotations/{annotationId}", "id": "books.mylibrary.annotations.update"}, "delete": {"scopes": ["https://www.googleapis.com/auth/books"], "path": "mylibrary/annotations/{annotationId}", "id": "books.mylibrary.annotations.delete", "parameters": {"source": {"type": "string", "location": "query"}, "annotationId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
}
}
class Google_Annotation extends Google_Model {
public $kind;
public $updated;
public $created;
public $deleted;
public $beforeSelectedText;
protected $__currentVersionRangesType = 'Google_AnnotationCurrentVersionRanges';
protected $__currentVersionRangesDataType = '';
public $currentVersionRanges;
public $afterSelectedText;
protected $__clientVersionRangesType = 'Google_AnnotationClientVersionRanges';
protected $__clientVersionRangesDataType = '';
public $clientVersionRanges;
public $volumeId;
public $pageIds;
public $layerId;
public $selectedText;
public $highlightStyle;
public $data;
public $id;
public $selfLink;
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;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setDeleted($deleted) {
$this->deleted = $deleted;
}
public function getDeleted() {
return $this->deleted;
}
public function setBeforeSelectedText($beforeSelectedText) {
$this->beforeSelectedText = $beforeSelectedText;
}
public function getBeforeSelectedText() {
return $this->beforeSelectedText;
}
public function setCurrentVersionRanges(Google_AnnotationCurrentVersionRanges $currentVersionRanges) {
$this->currentVersionRanges = $currentVersionRanges;
}
public function getCurrentVersionRanges() {
return $this->currentVersionRanges;
}
public function setAfterSelectedText($afterSelectedText) {
$this->afterSelectedText = $afterSelectedText;
}
public function getAfterSelectedText() {
return $this->afterSelectedText;
}
public function setClientVersionRanges(Google_AnnotationClientVersionRanges $clientVersionRanges) {
$this->clientVersionRanges = $clientVersionRanges;
}
public function getClientVersionRanges() {
return $this->clientVersionRanges;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setPageIds(/* array(Google_string) */ $pageIds) {
$this->assertIsArray($pageIds, 'Google_string', __METHOD__);
$this->pageIds = $pageIds;
}
public function getPageIds() {
return $this->pageIds;
}
public function setLayerId($layerId) {
$this->layerId = $layerId;
}
public function getLayerId() {
return $this->layerId;
}
public function setSelectedText($selectedText) {
$this->selectedText = $selectedText;
}
public function getSelectedText() {
return $this->selectedText;
}
public function setHighlightStyle($highlightStyle) {
$this->highlightStyle = $highlightStyle;
}
public function getHighlightStyle() {
return $this->highlightStyle;
}
public function setData($data) {
$this->data = $data;
}
public function getData() {
return $this->data;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_AnnotationClientVersionRanges extends Google_Model {
public $contentVersion;
protected $__gbTextRangeType = 'Google_BooksAnnotationsRange';
protected $__gbTextRangeDataType = '';
public $gbTextRange;
protected $__cfiRangeType = 'Google_BooksAnnotationsRange';
protected $__cfiRangeDataType = '';
public $cfiRange;
protected $__gbImageRangeType = 'Google_BooksAnnotationsRange';
protected $__gbImageRangeDataType = '';
public $gbImageRange;
public function setContentVersion($contentVersion) {
$this->contentVersion = $contentVersion;
}
public function getContentVersion() {
return $this->contentVersion;
}
public function setGbTextRange(Google_BooksAnnotationsRange $gbTextRange) {
$this->gbTextRange = $gbTextRange;
}
public function getGbTextRange() {
return $this->gbTextRange;
}
public function setCfiRange(Google_BooksAnnotationsRange $cfiRange) {
$this->cfiRange = $cfiRange;
}
public function getCfiRange() {
return $this->cfiRange;
}
public function setGbImageRange(Google_BooksAnnotationsRange $gbImageRange) {
$this->gbImageRange = $gbImageRange;
}
public function getGbImageRange() {
return $this->gbImageRange;
}
}
class Google_AnnotationCurrentVersionRanges extends Google_Model {
public $contentVersion;
protected $__gbTextRangeType = 'Google_BooksAnnotationsRange';
protected $__gbTextRangeDataType = '';
public $gbTextRange;
protected $__cfiRangeType = 'Google_BooksAnnotationsRange';
protected $__cfiRangeDataType = '';
public $cfiRange;
protected $__gbImageRangeType = 'Google_BooksAnnotationsRange';
protected $__gbImageRangeDataType = '';
public $gbImageRange;
public function setContentVersion($contentVersion) {
$this->contentVersion = $contentVersion;
}
public function getContentVersion() {
return $this->contentVersion;
}
public function setGbTextRange(Google_BooksAnnotationsRange $gbTextRange) {
$this->gbTextRange = $gbTextRange;
}
public function getGbTextRange() {
return $this->gbTextRange;
}
public function setCfiRange(Google_BooksAnnotationsRange $cfiRange) {
$this->cfiRange = $cfiRange;
}
public function getCfiRange() {
return $this->cfiRange;
}
public function setGbImageRange(Google_BooksAnnotationsRange $gbImageRange) {
$this->gbImageRange = $gbImageRange;
}
public function getGbImageRange() {
return $this->gbImageRange;
}
}
class Google_Annotationdata extends Google_Model {
public $annotationType;
public $kind;
public $updated;
public $volumeId;
public $encoded_data;
public $layerId;
protected $__dataType = 'Google_BooksLayerGeoData';
protected $__dataDataType = '';
public $data;
public $id;
public $selfLink;
public function setAnnotationType($annotationType) {
$this->annotationType = $annotationType;
}
public function getAnnotationType() {
return $this->annotationType;
}
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;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setEncoded_data($encoded_data) {
$this->encoded_data = $encoded_data;
}
public function getEncoded_data() {
return $this->encoded_data;
}
public function setLayerId($layerId) {
$this->layerId = $layerId;
}
public function getLayerId() {
return $this->layerId;
}
public function setData(Google_BooksLayerGeoData $data) {
$this->data = $data;
}
public function getData() {
return $this->data;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Annotations extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Annotation';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Annotation) */ $items) {
$this->assertIsArray($items, 'Google_Annotation', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_Annotationsdata extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Annotationdata';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Annotationdata) */ $items) {
$this->assertIsArray($items, 'Google_Annotationdata', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_BooksAnnotationsRange extends Google_Model {
public $startPosition;
public $endPosition;
public $startOffset;
public $endOffset;
public function setStartPosition($startPosition) {
$this->startPosition = $startPosition;
}
public function getStartPosition() {
return $this->startPosition;
}
public function setEndPosition($endPosition) {
$this->endPosition = $endPosition;
}
public function getEndPosition() {
return $this->endPosition;
}
public function setStartOffset($startOffset) {
$this->startOffset = $startOffset;
}
public function getStartOffset() {
return $this->startOffset;
}
public function setEndOffset($endOffset) {
$this->endOffset = $endOffset;
}
public function getEndOffset() {
return $this->endOffset;
}
}
class Google_BooksLayerGeoData extends Google_Model {
protected $__geoType = 'Google_BooksLayerGeoDataGeo';
protected $__geoDataType = '';
public $geo;
protected $__commonType = 'Google_BooksLayerGeoDataCommon';
protected $__commonDataType = '';
public $common;
public function setGeo(Google_BooksLayerGeoDataGeo $geo) {
$this->geo = $geo;
}
public function getGeo() {
return $this->geo;
}
public function setCommon(Google_BooksLayerGeoDataCommon $common) {
$this->common = $common;
}
public function getCommon() {
return $this->common;
}
}
class Google_BooksLayerGeoDataCommon extends Google_Model {
public $lang;
public $previewImageUrl;
public $snippet;
public $snippetUrl;
public function setLang($lang) {
$this->lang = $lang;
}
public function getLang() {
return $this->lang;
}
public function setPreviewImageUrl($previewImageUrl) {
$this->previewImageUrl = $previewImageUrl;
}
public function getPreviewImageUrl() {
return $this->previewImageUrl;
}
public function setSnippet($snippet) {
$this->snippet = $snippet;
}
public function getSnippet() {
return $this->snippet;
}
public function setSnippetUrl($snippetUrl) {
$this->snippetUrl = $snippetUrl;
}
public function getSnippetUrl() {
return $this->snippetUrl;
}
}
class Google_BooksLayerGeoDataGeo extends Google_Model {
public $countryCode;
public $title;
public $zoom;
public $longitude;
public $mapType;
public $latitude;
protected $__boundaryType = 'Google_BooksLayerGeoDataGeoBoundary';
protected $__boundaryDataType = 'array';
public $boundary;
protected $__viewportType = 'Google_BooksLayerGeoDataGeoViewport';
protected $__viewportDataType = '';
public $viewport;
public $cachePolicy;
public function setCountryCode($countryCode) {
$this->countryCode = $countryCode;
}
public function getCountryCode() {
return $this->countryCode;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setZoom($zoom) {
$this->zoom = $zoom;
}
public function getZoom() {
return $this->zoom;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
public function setMapType($mapType) {
$this->mapType = $mapType;
}
public function getMapType() {
return $this->mapType;
}
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setBoundary(/* array(Google_BooksLayerGeoDataGeoBoundary) */ $boundary) {
$this->assertIsArray($boundary, 'Google_BooksLayerGeoDataGeoBoundary', __METHOD__);
$this->boundary = $boundary;
}
public function getBoundary() {
return $this->boundary;
}
public function setViewport(Google_BooksLayerGeoDataGeoViewport $viewport) {
$this->viewport = $viewport;
}
public function getViewport() {
return $this->viewport;
}
public function setCachePolicy($cachePolicy) {
$this->cachePolicy = $cachePolicy;
}
public function getCachePolicy() {
return $this->cachePolicy;
}
}
class Google_BooksLayerGeoDataGeoBoundary extends Google_Model {
public $latitude;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_BooksLayerGeoDataGeoViewport extends Google_Model {
protected $__loType = 'Google_BooksLayerGeoDataGeoViewportLo';
protected $__loDataType = '';
public $lo;
protected $__hiType = 'Google_BooksLayerGeoDataGeoViewportHi';
protected $__hiDataType = '';
public $hi;
public function setLo(Google_BooksLayerGeoDataGeoViewportLo $lo) {
$this->lo = $lo;
}
public function getLo() {
return $this->lo;
}
public function setHi(Google_BooksLayerGeoDataGeoViewportHi $hi) {
$this->hi = $hi;
}
public function getHi() {
return $this->hi;
}
}
class Google_BooksLayerGeoDataGeoViewportHi extends Google_Model {
public $latitude;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_BooksLayerGeoDataGeoViewportLo extends Google_Model {
public $latitude;
public $longitude;
public function setLatitude($latitude) {
$this->latitude = $latitude;
}
public function getLatitude() {
return $this->latitude;
}
public function setLongitude($longitude) {
$this->longitude = $longitude;
}
public function getLongitude() {
return $this->longitude;
}
}
class Google_Bookshelf extends Google_Model {
public $kind;
public $description;
public $created;
public $volumeCount;
public $title;
public $updated;
public $access;
public $volumesLastUpdated;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setVolumeCount($volumeCount) {
$this->volumeCount = $volumeCount;
}
public function getVolumeCount() {
return $this->volumeCount;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setAccess($access) {
$this->access = $access;
}
public function getAccess() {
return $this->access;
}
public function setVolumesLastUpdated($volumesLastUpdated) {
$this->volumesLastUpdated = $volumesLastUpdated;
}
public function getVolumesLastUpdated() {
return $this->volumesLastUpdated;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_Bookshelves extends Google_Model {
protected $__itemsType = 'Google_Bookshelf';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setItems(/* array(Google_Bookshelf) */ $items) {
$this->assertIsArray($items, 'Google_Bookshelf', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_ConcurrentAccessRestriction extends Google_Model {
public $nonce;
public $kind;
public $restricted;
public $volumeId;
public $maxConcurrentDevices;
public $deviceAllowed;
public $source;
public $timeWindowSeconds;
public $signature;
public $reasonCode;
public $message;
public function setNonce($nonce) {
$this->nonce = $nonce;
}
public function getNonce() {
return $this->nonce;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRestricted($restricted) {
$this->restricted = $restricted;
}
public function getRestricted() {
return $this->restricted;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setMaxConcurrentDevices($maxConcurrentDevices) {
$this->maxConcurrentDevices = $maxConcurrentDevices;
}
public function getMaxConcurrentDevices() {
return $this->maxConcurrentDevices;
}
public function setDeviceAllowed($deviceAllowed) {
$this->deviceAllowed = $deviceAllowed;
}
public function getDeviceAllowed() {
return $this->deviceAllowed;
}
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setTimeWindowSeconds($timeWindowSeconds) {
$this->timeWindowSeconds = $timeWindowSeconds;
}
public function getTimeWindowSeconds() {
return $this->timeWindowSeconds;
}
public function setSignature($signature) {
$this->signature = $signature;
}
public function getSignature() {
return $this->signature;
}
public function setReasonCode($reasonCode) {
$this->reasonCode = $reasonCode;
}
public function getReasonCode() {
return $this->reasonCode;
}
public function setMessage($message) {
$this->message = $message;
}
public function getMessage() {
return $this->message;
}
}
class Google_DownloadAccessRestriction extends Google_Model {
public $nonce;
public $kind;
public $justAcquired;
public $maxDownloadDevices;
public $downloadsAcquired;
public $signature;
public $volumeId;
public $deviceAllowed;
public $source;
public $restricted;
public $reasonCode;
public $message;
public function setNonce($nonce) {
$this->nonce = $nonce;
}
public function getNonce() {
return $this->nonce;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setJustAcquired($justAcquired) {
$this->justAcquired = $justAcquired;
}
public function getJustAcquired() {
return $this->justAcquired;
}
public function setMaxDownloadDevices($maxDownloadDevices) {
$this->maxDownloadDevices = $maxDownloadDevices;
}
public function getMaxDownloadDevices() {
return $this->maxDownloadDevices;
}
public function setDownloadsAcquired($downloadsAcquired) {
$this->downloadsAcquired = $downloadsAcquired;
}
public function getDownloadsAcquired() {
return $this->downloadsAcquired;
}
public function setSignature($signature) {
$this->signature = $signature;
}
public function getSignature() {
return $this->signature;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setDeviceAllowed($deviceAllowed) {
$this->deviceAllowed = $deviceAllowed;
}
public function getDeviceAllowed() {
return $this->deviceAllowed;
}
public function setSource($source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setRestricted($restricted) {
$this->restricted = $restricted;
}
public function getRestricted() {
return $this->restricted;
}
public function setReasonCode($reasonCode) {
$this->reasonCode = $reasonCode;
}
public function getReasonCode() {
return $this->reasonCode;
}
public function setMessage($message) {
$this->message = $message;
}
public function getMessage() {
return $this->message;
}
}
class Google_DownloadAccesses extends Google_Model {
protected $__downloadAccessListType = 'Google_DownloadAccessRestriction';
protected $__downloadAccessListDataType = 'array';
public $downloadAccessList;
public $kind;
public function setDownloadAccessList(/* array(Google_DownloadAccessRestriction) */ $downloadAccessList) {
$this->assertIsArray($downloadAccessList, 'Google_DownloadAccessRestriction', __METHOD__);
$this->downloadAccessList = $downloadAccessList;
}
public function getDownloadAccessList() {
return $this->downloadAccessList;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Layersummaries extends Google_Model {
public $totalItems;
protected $__itemsType = 'Google_Layersummary';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setItems(/* array(Google_Layersummary) */ $items) {
$this->assertIsArray($items, 'Google_Layersummary', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
class Google_Layersummary extends Google_Model {
public $kind;
public $annotationCount;
public $dataCount;
public $annotationsLink;
public $updated;
public $volumeId;
public $id;
public $annotationTypes;
public $contentVersion;
public $layerId;
public $annotationsDataLink;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAnnotationCount($annotationCount) {
$this->annotationCount = $annotationCount;
}
public function getAnnotationCount() {
return $this->annotationCount;
}
public function setDataCount($dataCount) {
$this->dataCount = $dataCount;
}
public function getDataCount() {
return $this->dataCount;
}
public function setAnnotationsLink($annotationsLink) {
$this->annotationsLink = $annotationsLink;
}
public function getAnnotationsLink() {
return $this->annotationsLink;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setAnnotationTypes(/* array(Google_string) */ $annotationTypes) {
$this->assertIsArray($annotationTypes, 'Google_string', __METHOD__);
$this->annotationTypes = $annotationTypes;
}
public function getAnnotationTypes() {
return $this->annotationTypes;
}
public function setContentVersion($contentVersion) {
$this->contentVersion = $contentVersion;
}
public function getContentVersion() {
return $this->contentVersion;
}
public function setLayerId($layerId) {
$this->layerId = $layerId;
}
public function getLayerId() {
return $this->layerId;
}
public function setAnnotationsDataLink($annotationsDataLink) {
$this->annotationsDataLink = $annotationsDataLink;
}
public function getAnnotationsDataLink() {
return $this->annotationsDataLink;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_ReadingPosition extends Google_Model {
public $kind;
public $gbImagePosition;
public $epubCfiPosition;
public $updated;
public $volumeId;
public $pdfPosition;
public $gbTextPosition;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setGbImagePosition($gbImagePosition) {
$this->gbImagePosition = $gbImagePosition;
}
public function getGbImagePosition() {
return $this->gbImagePosition;
}
public function setEpubCfiPosition($epubCfiPosition) {
$this->epubCfiPosition = $epubCfiPosition;
}
public function getEpubCfiPosition() {
return $this->epubCfiPosition;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setPdfPosition($pdfPosition) {
$this->pdfPosition = $pdfPosition;
}
public function getPdfPosition() {
return $this->pdfPosition;
}
public function setGbTextPosition($gbTextPosition) {
$this->gbTextPosition = $gbTextPosition;
}
public function getGbTextPosition() {
return $this->gbTextPosition;
}
}
class Google_RequestAccess extends Google_Model {
protected $__downloadAccessType = 'Google_DownloadAccessRestriction';
protected $__downloadAccessDataType = '';
public $downloadAccess;
public $kind;
protected $__concurrentAccessType = 'Google_ConcurrentAccessRestriction';
protected $__concurrentAccessDataType = '';
public $concurrentAccess;
public function setDownloadAccess(Google_DownloadAccessRestriction $downloadAccess) {
$this->downloadAccess = $downloadAccess;
}
public function getDownloadAccess() {
return $this->downloadAccess;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setConcurrentAccess(Google_ConcurrentAccessRestriction $concurrentAccess) {
$this->concurrentAccess = $concurrentAccess;
}
public function getConcurrentAccess() {
return $this->concurrentAccess;
}
}
class Google_Review extends Google_Model {
public $rating;
public $kind;
protected $__authorType = 'Google_ReviewAuthor';
protected $__authorDataType = '';
public $author;
public $title;
public $volumeId;
public $content;
protected $__sourceType = 'Google_ReviewSource';
protected $__sourceDataType = '';
public $source;
public $date;
public $type;
public $fullTextUrl;
public function setRating($rating) {
$this->rating = $rating;
}
public function getRating() {
return $this->rating;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAuthor(Google_ReviewAuthor $author) {
$this->author = $author;
}
public function getAuthor() {
return $this->author;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setContent($content) {
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function setSource(Google_ReviewSource $source) {
$this->source = $source;
}
public function getSource() {
return $this->source;
}
public function setDate($date) {
$this->date = $date;
}
public function getDate() {
return $this->date;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setFullTextUrl($fullTextUrl) {
$this->fullTextUrl = $fullTextUrl;
}
public function getFullTextUrl() {
return $this->fullTextUrl;
}
}
class Google_ReviewAuthor extends Google_Model {
public $displayName;
public function setDisplayName($displayName) {
$this->displayName = $displayName;
}
public function getDisplayName() {
return $this->displayName;
}
}
class Google_ReviewSource extends Google_Model {
public $extraDescription;
public $url;
public $description;
public function setExtraDescription($extraDescription) {
$this->extraDescription = $extraDescription;
}
public function getExtraDescription() {
return $this->extraDescription;
}
public function setUrl($url) {
$this->url = $url;
}
public function getUrl() {
return $this->url;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
}
class Google_Volume extends Google_Model {
public $kind;
protected $__accessInfoType = 'Google_VolumeAccessInfo';
protected $__accessInfoDataType = '';
public $accessInfo;
protected $__searchInfoType = 'Google_VolumeSearchInfo';
protected $__searchInfoDataType = '';
public $searchInfo;
protected $__saleInfoType = 'Google_VolumeSaleInfo';
protected $__saleInfoDataType = '';
public $saleInfo;
public $etag;
protected $__userInfoType = 'Google_VolumeUserInfo';
protected $__userInfoDataType = '';
public $userInfo;
protected $__volumeInfoType = 'Google_VolumeVolumeInfo';
protected $__volumeInfoDataType = '';
public $volumeInfo;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setAccessInfo(Google_VolumeAccessInfo $accessInfo) {
$this->accessInfo = $accessInfo;
}
public function getAccessInfo() {
return $this->accessInfo;
}
public function setSearchInfo(Google_VolumeSearchInfo $searchInfo) {
$this->searchInfo = $searchInfo;
}
public function getSearchInfo() {
return $this->searchInfo;
}
public function setSaleInfo(Google_VolumeSaleInfo $saleInfo) {
$this->saleInfo = $saleInfo;
}
public function getSaleInfo() {
return $this->saleInfo;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setUserInfo(Google_VolumeUserInfo $userInfo) {
$this->userInfo = $userInfo;
}
public function getUserInfo() {
return $this->userInfo;
}
public function setVolumeInfo(Google_VolumeVolumeInfo $volumeInfo) {
$this->volumeInfo = $volumeInfo;
}
public function getVolumeInfo() {
return $this->volumeInfo;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_VolumeAccessInfo extends Google_Model {
public $webReaderLink;
public $publicDomain;
public $embeddable;
protected $__downloadAccessType = 'Google_DownloadAccessRestriction';
protected $__downloadAccessDataType = '';
public $downloadAccess;
public $country;
public $viewOrderUrl;
public $textToSpeechPermission;
protected $__pdfType = 'Google_VolumeAccessInfoPdf';
protected $__pdfDataType = '';
public $pdf;
public $viewability;
protected $__epubType = 'Google_VolumeAccessInfoEpub';
protected $__epubDataType = '';
public $epub;
public $accessViewStatus;
public function setWebReaderLink($webReaderLink) {
$this->webReaderLink = $webReaderLink;
}
public function getWebReaderLink() {
return $this->webReaderLink;
}
public function setPublicDomain($publicDomain) {
$this->publicDomain = $publicDomain;
}
public function getPublicDomain() {
return $this->publicDomain;
}
public function setEmbeddable($embeddable) {
$this->embeddable = $embeddable;
}
public function getEmbeddable() {
return $this->embeddable;
}
public function setDownloadAccess(Google_DownloadAccessRestriction $downloadAccess) {
$this->downloadAccess = $downloadAccess;
}
public function getDownloadAccess() {
return $this->downloadAccess;
}
public function setCountry($country) {
$this->country = $country;
}
public function getCountry() {
return $this->country;
}
public function setViewOrderUrl($viewOrderUrl) {
$this->viewOrderUrl = $viewOrderUrl;
}
public function getViewOrderUrl() {
return $this->viewOrderUrl;
}
public function setTextToSpeechPermission($textToSpeechPermission) {
$this->textToSpeechPermission = $textToSpeechPermission;
}
public function getTextToSpeechPermission() {
return $this->textToSpeechPermission;
}
public function setPdf(Google_VolumeAccessInfoPdf $pdf) {
$this->pdf = $pdf;
}
public function getPdf() {
return $this->pdf;
}
public function setViewability($viewability) {
$this->viewability = $viewability;
}
public function getViewability() {
return $this->viewability;
}
public function setEpub(Google_VolumeAccessInfoEpub $epub) {
$this->epub = $epub;
}
public function getEpub() {
return $this->epub;
}
public function setAccessViewStatus($accessViewStatus) {
$this->accessViewStatus = $accessViewStatus;
}
public function getAccessViewStatus() {
return $this->accessViewStatus;
}
}
class Google_VolumeAccessInfoEpub extends Google_Model {
public $isAvailable;
public $downloadLink;
public $acsTokenLink;
public function setIsAvailable($isAvailable) {
$this->isAvailable = $isAvailable;
}
public function getIsAvailable() {
return $this->isAvailable;
}
public function setDownloadLink($downloadLink) {
$this->downloadLink = $downloadLink;
}
public function getDownloadLink() {
return $this->downloadLink;
}
public function setAcsTokenLink($acsTokenLink) {
$this->acsTokenLink = $acsTokenLink;
}
public function getAcsTokenLink() {
return $this->acsTokenLink;
}
}
class Google_VolumeAccessInfoPdf extends Google_Model {
public $isAvailable;
public $downloadLink;
public $acsTokenLink;
public function setIsAvailable($isAvailable) {
$this->isAvailable = $isAvailable;
}
public function getIsAvailable() {
return $this->isAvailable;
}
public function setDownloadLink($downloadLink) {
$this->downloadLink = $downloadLink;
}
public function getDownloadLink() {
return $this->downloadLink;
}
public function setAcsTokenLink($acsTokenLink) {
$this->acsTokenLink = $acsTokenLink;
}
public function getAcsTokenLink() {
return $this->acsTokenLink;
}
}
class Google_VolumeSaleInfo extends Google_Model {
public $country;
protected $__retailPriceType = 'Google_VolumeSaleInfoRetailPrice';
protected $__retailPriceDataType = '';
public $retailPrice;
public $isEbook;
public $saleability;
public $buyLink;
public $onSaleDate;
protected $__listPriceType = 'Google_VolumeSaleInfoListPrice';
protected $__listPriceDataType = '';
public $listPrice;
public function setCountry($country) {
$this->country = $country;
}
public function getCountry() {
return $this->country;
}
public function setRetailPrice(Google_VolumeSaleInfoRetailPrice $retailPrice) {
$this->retailPrice = $retailPrice;
}
public function getRetailPrice() {
return $this->retailPrice;
}
public function setIsEbook($isEbook) {
$this->isEbook = $isEbook;
}
public function getIsEbook() {
return $this->isEbook;
}
public function setSaleability($saleability) {
$this->saleability = $saleability;
}
public function getSaleability() {
return $this->saleability;
}
public function setBuyLink($buyLink) {
$this->buyLink = $buyLink;
}
public function getBuyLink() {
return $this->buyLink;
}
public function setOnSaleDate($onSaleDate) {
$this->onSaleDate = $onSaleDate;
}
public function getOnSaleDate() {
return $this->onSaleDate;
}
public function setListPrice(Google_VolumeSaleInfoListPrice $listPrice) {
$this->listPrice = $listPrice;
}
public function getListPrice() {
return $this->listPrice;
}
}
class Google_VolumeSaleInfoListPrice extends Google_Model {
public $amount;
public $currencyCode;
public function setAmount($amount) {
$this->amount = $amount;
}
public function getAmount() {
return $this->amount;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
}
class Google_VolumeSaleInfoRetailPrice extends Google_Model {
public $amount;
public $currencyCode;
public function setAmount($amount) {
$this->amount = $amount;
}
public function getAmount() {
return $this->amount;
}
public function setCurrencyCode($currencyCode) {
$this->currencyCode = $currencyCode;
}
public function getCurrencyCode() {
return $this->currencyCode;
}
}
class Google_VolumeSearchInfo extends Google_Model {
public $textSnippet;
public function setTextSnippet($textSnippet) {
$this->textSnippet = $textSnippet;
}
public function getTextSnippet() {
return $this->textSnippet;
}
}
class Google_VolumeUserInfo extends Google_Model {
public $isInMyBooks;
public $updated;
protected $__reviewType = 'Google_Review';
protected $__reviewDataType = '';
public $review;
public $isPurchased;
protected $__readingPositionType = 'Google_ReadingPosition';
protected $__readingPositionDataType = '';
public $readingPosition;
public $isPreordered;
public function setIsInMyBooks($isInMyBooks) {
$this->isInMyBooks = $isInMyBooks;
}
public function getIsInMyBooks() {
return $this->isInMyBooks;
}
public function setUpdated($updated) {
$this->updated = $updated;
}
public function getUpdated() {
return $this->updated;
}
public function setReview(Google_Review $review) {
$this->review = $review;
}
public function getReview() {
return $this->review;
}
public function setIsPurchased($isPurchased) {
$this->isPurchased = $isPurchased;
}
public function getIsPurchased() {
return $this->isPurchased;
}
public function setReadingPosition(Google_ReadingPosition $readingPosition) {
$this->readingPosition = $readingPosition;
}
public function getReadingPosition() {
return $this->readingPosition;
}
public function setIsPreordered($isPreordered) {
$this->isPreordered = $isPreordered;
}
public function getIsPreordered() {
return $this->isPreordered;
}
}
class Google_VolumeVolumeInfo extends Google_Model {
public $publisher;
public $subtitle;
public $description;
public $language;
public $pageCount;
protected $__imageLinksType = 'Google_VolumeVolumeInfoImageLinks';
protected $__imageLinksDataType = '';
public $imageLinks;
public $publishedDate;
public $previewLink;
public $printType;
public $ratingsCount;
public $mainCategory;
protected $__dimensionsType = 'Google_VolumeVolumeInfoDimensions';
protected $__dimensionsDataType = '';
public $dimensions;
public $contentVersion;
protected $__industryIdentifiersType = 'Google_VolumeVolumeInfoIndustryIdentifiers';
protected $__industryIdentifiersDataType = 'array';
public $industryIdentifiers;
public $authors;
public $title;
public $canonicalVolumeLink;
public $infoLink;
public $categories;
public $averageRating;
public function setPublisher($publisher) {
$this->publisher = $publisher;
}
public function getPublisher() {
return $this->publisher;
}
public function setSubtitle($subtitle) {
$this->subtitle = $subtitle;
}
public function getSubtitle() {
return $this->subtitle;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setLanguage($language) {
$this->language = $language;
}
public function getLanguage() {
return $this->language;
}
public function setPageCount($pageCount) {
$this->pageCount = $pageCount;
}
public function getPageCount() {
return $this->pageCount;
}
public function setImageLinks(Google_VolumeVolumeInfoImageLinks $imageLinks) {
$this->imageLinks = $imageLinks;
}
public function getImageLinks() {
return $this->imageLinks;
}
public function setPublishedDate($publishedDate) {
$this->publishedDate = $publishedDate;
}
public function getPublishedDate() {
return $this->publishedDate;
}
public function setPreviewLink($previewLink) {
$this->previewLink = $previewLink;
}
public function getPreviewLink() {
return $this->previewLink;
}
public function setPrintType($printType) {
$this->printType = $printType;
}
public function getPrintType() {
return $this->printType;
}
public function setRatingsCount($ratingsCount) {
$this->ratingsCount = $ratingsCount;
}
public function getRatingsCount() {
return $this->ratingsCount;
}
public function setMainCategory($mainCategory) {
$this->mainCategory = $mainCategory;
}
public function getMainCategory() {
return $this->mainCategory;
}
public function setDimensions(Google_VolumeVolumeInfoDimensions $dimensions) {
$this->dimensions = $dimensions;
}
public function getDimensions() {
return $this->dimensions;
}
public function setContentVersion($contentVersion) {
$this->contentVersion = $contentVersion;
}
public function getContentVersion() {
return $this->contentVersion;
}
public function setIndustryIdentifiers(/* array(Google_VolumeVolumeInfoIndustryIdentifiers) */ $industryIdentifiers) {
$this->assertIsArray($industryIdentifiers, 'Google_VolumeVolumeInfoIndustryIdentifiers', __METHOD__);
$this->industryIdentifiers = $industryIdentifiers;
}
public function getIndustryIdentifiers() {
return $this->industryIdentifiers;
}
public function setAuthors(/* array(Google_string) */ $authors) {
$this->assertIsArray($authors, 'Google_string', __METHOD__);
$this->authors = $authors;
}
public function getAuthors() {
return $this->authors;
}
public function setTitle($title) {
$this->title = $title;
}
public function getTitle() {
return $this->title;
}
public function setCanonicalVolumeLink($canonicalVolumeLink) {
$this->canonicalVolumeLink = $canonicalVolumeLink;
}
public function getCanonicalVolumeLink() {
return $this->canonicalVolumeLink;
}
public function setInfoLink($infoLink) {
$this->infoLink = $infoLink;
}
public function getInfoLink() {
return $this->infoLink;
}
public function setCategories(/* array(Google_string) */ $categories) {
$this->assertIsArray($categories, 'Google_string', __METHOD__);
$this->categories = $categories;
}
public function getCategories() {
return $this->categories;
}
public function setAverageRating($averageRating) {
$this->averageRating = $averageRating;
}
public function getAverageRating() {
return $this->averageRating;
}
}
class Google_VolumeVolumeInfoDimensions extends Google_Model {
public $width;
public $thickness;
public $height;
public function setWidth($width) {
$this->width = $width;
}
public function getWidth() {
return $this->width;
}
public function setThickness($thickness) {
$this->thickness = $thickness;
}
public function getThickness() {
return $this->thickness;
}
public function setHeight($height) {
$this->height = $height;
}
public function getHeight() {
return $this->height;
}
}
class Google_VolumeVolumeInfoImageLinks extends Google_Model {
public $medium;
public $smallThumbnail;
public $large;
public $extraLarge;
public $small;
public $thumbnail;
public function setMedium($medium) {
$this->medium = $medium;
}
public function getMedium() {
return $this->medium;
}
public function setSmallThumbnail($smallThumbnail) {
$this->smallThumbnail = $smallThumbnail;
}
public function getSmallThumbnail() {
return $this->smallThumbnail;
}
public function setLarge($large) {
$this->large = $large;
}
public function getLarge() {
return $this->large;
}
public function setExtraLarge($extraLarge) {
$this->extraLarge = $extraLarge;
}
public function getExtraLarge() {
return $this->extraLarge;
}
public function setSmall($small) {
$this->small = $small;
}
public function getSmall() {
return $this->small;
}
public function setThumbnail($thumbnail) {
$this->thumbnail = $thumbnail;
}
public function getThumbnail() {
return $this->thumbnail;
}
}
class Google_VolumeVolumeInfoIndustryIdentifiers extends Google_Model {
public $identifier;
public $type;
public function setIdentifier($identifier) {
$this->identifier = $identifier;
}
public function getIdentifier() {
return $this->identifier;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
}
class Google_Volumeannotation extends Google_Model {
public $annotationType;
public $kind;
public $updated;
public $deleted;
protected $__contentRangesType = 'Google_VolumeannotationContentRanges';
protected $__contentRangesDataType = '';
public $contentRanges;
public $selectedText;
public $volumeId;
public $annotationDataId;
public $annotationDataLink;
public $pageIds;
public $layerId;
public $data;
public $id;
public $selfLink;
public function setAnnotationType($annotationType) {
$this->annotationType = $annotationType;
}
public function getAnnotationType() {
return $this->annotationType;
}
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;
}
public function setDeleted($deleted) {
$this->deleted = $deleted;
}
public function getDeleted() {
return $this->deleted;
}
public function setContentRanges(Google_VolumeannotationContentRanges $contentRanges) {
$this->contentRanges = $contentRanges;
}
public function getContentRanges() {
return $this->contentRanges;
}
public function setSelectedText($selectedText) {
$this->selectedText = $selectedText;
}
public function getSelectedText() {
return $this->selectedText;
}
public function setVolumeId($volumeId) {
$this->volumeId = $volumeId;
}
public function getVolumeId() {
return $this->volumeId;
}
public function setAnnotationDataId($annotationDataId) {
$this->annotationDataId = $annotationDataId;
}
public function getAnnotationDataId() {
return $this->annotationDataId;
}
public function setAnnotationDataLink($annotationDataLink) {
$this->annotationDataLink = $annotationDataLink;
}
public function getAnnotationDataLink() {
return $this->annotationDataLink;
}
public function setPageIds(/* array(Google_string) */ $pageIds) {
$this->assertIsArray($pageIds, 'Google_string', __METHOD__);
$this->pageIds = $pageIds;
}
public function getPageIds() {
return $this->pageIds;
}
public function setLayerId($layerId) {
$this->layerId = $layerId;
}
public function getLayerId() {
return $this->layerId;
}
public function setData($data) {
$this->data = $data;
}
public function getData() {
return $this->data;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_VolumeannotationContentRanges extends Google_Model {
public $contentVersion;
protected $__gbTextRangeType = 'Google_BooksAnnotationsRange';
protected $__gbTextRangeDataType = '';
public $gbTextRange;
protected $__cfiRangeType = 'Google_BooksAnnotationsRange';
protected $__cfiRangeDataType = '';
public $cfiRange;
protected $__gbImageRangeType = 'Google_BooksAnnotationsRange';
protected $__gbImageRangeDataType = '';
public $gbImageRange;
public function setContentVersion($contentVersion) {
$this->contentVersion = $contentVersion;
}
public function getContentVersion() {
return $this->contentVersion;
}
public function setGbTextRange(Google_BooksAnnotationsRange $gbTextRange) {
$this->gbTextRange = $gbTextRange;
}
public function getGbTextRange() {
return $this->gbTextRange;
}
public function setCfiRange(Google_BooksAnnotationsRange $cfiRange) {
$this->cfiRange = $cfiRange;
}
public function getCfiRange() {
return $this->cfiRange;
}
public function setGbImageRange(Google_BooksAnnotationsRange $gbImageRange) {
$this->gbImageRange = $gbImageRange;
}
public function getGbImageRange() {
return $this->gbImageRange;
}
}
class Google_Volumeannotations extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Volumeannotation';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Volumeannotation) */ $items) {
$this->assertIsArray($items, 'Google_Volumeannotation', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_Volumes extends Google_Model {
public $totalItems;
protected $__itemsType = 'Google_Volume';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setItems(/* array(Google_Volume) */ $items) {
$this->assertIsArray($items, 'Google_Volume', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_BooksService.php | PHP | asf20 | 104,674 |
<?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "tables" collection of methods.
* Typical usage is:
* <code>
* $bigqueryService = new Google_BigqueryService(...);
* $tables = $bigqueryService->tables;
* </code>
*/
class Google_TablesServiceResource extends Google_ServiceResource {
/**
* Creates a new, empty table in the dataset. (tables.insert)
*
* @param string $projectId Project ID of the new table
* @param string $datasetId Dataset ID of the new table
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function insert($projectId, $datasetId, Google_Table $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Gets the specified table resource by table ID. This method does not return the data in the table,
* it only returns the table resource, which describes the structure of this table. (tables.get)
*
* @param string $projectId Project ID of the requested table
* @param string $datasetId Dataset ID of the requested table
* @param string $tableId Table ID of the requested table
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function get($projectId, $datasetId, $tableId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Lists all tables in the specified dataset. (tables.list)
*
* @param string $projectId Project ID of the tables to list
* @param string $datasetId Dataset ID of the tables to list
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Page token, returned by a previous call, to request the next page of results
* @opt_param string maxResults Maximum number of results to return
* @return Google_TableList
*/
public function listTables($projectId, $datasetId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TableList($data);
} else {
return $data;
}
}
/**
* Updates information in an existing table, specified by tableId. (tables.update)
*
* @param string $projectId Project ID of the table to update
* @param string $datasetId Dataset ID of the table to update
* @param string $tableId Table ID of the table to update
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function update($projectId, $datasetId, $tableId, Google_Table $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Updates information in an existing table, specified by tableId. This method supports patch
* semantics. (tables.patch)
*
* @param string $projectId Project ID of the table to update
* @param string $datasetId Dataset ID of the table to update
* @param string $tableId Table ID of the table to update
* @param Google_Table $postBody
* @param array $optParams Optional parameters.
* @return Google_Table
*/
public function patch($projectId, $datasetId, $tableId, Google_Table $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Table($data);
} else {
return $data;
}
}
/**
* Deletes the table specified by tableId from the dataset. If the table contains data, all the data
* will be deleted. (tables.delete)
*
* @param string $projectId Project ID of the table to delete
* @param string $datasetId Dataset ID of the table to delete
* @param string $tableId Table ID of the table to delete
* @param array $optParams Optional parameters.
*/
public function delete($projectId, $datasetId, $tableId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "datasets" collection of methods.
* Typical usage is:
* <code>
* $bigqueryService = new Google_BigqueryService(...);
* $datasets = $bigqueryService->datasets;
* </code>
*/
class Google_DatasetsServiceResource extends Google_ServiceResource {
/**
* Creates a new empty dataset. (datasets.insert)
*
* @param string $projectId Project ID of the new dataset
* @param Google_Dataset $postBody
* @param array $optParams Optional parameters.
* @return Google_Dataset
*/
public function insert($projectId, Google_Dataset $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Dataset($data);
} else {
return $data;
}
}
/**
* Returns the dataset specified by datasetID. (datasets.get)
*
* @param string $projectId Project ID of the requested dataset
* @param string $datasetId Dataset ID of the requested dataset
* @param array $optParams Optional parameters.
* @return Google_Dataset
*/
public function get($projectId, $datasetId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Dataset($data);
} else {
return $data;
}
}
/**
* Lists all the datasets in the specified project to which the caller has read access; however, a
* project owner can list (but not necessarily get) all datasets in his project. (datasets.list)
*
* @param string $projectId Project ID of the datasets to be listed
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Page token, returned by a previous call, to request the next page of results
* @opt_param string maxResults The maximum number of results to return
* @return Google_DatasetList
*/
public function listDatasets($projectId, $optParams = array()) {
$params = array('projectId' => $projectId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_DatasetList($data);
} else {
return $data;
}
}
/**
* Updates information in an existing dataset, specified by datasetId. Properties not included in
* the submitted resource will not be changed. If you include the access property without any values
* assigned, the request will fail as you must specify at least one owner for a dataset.
* (datasets.update)
*
* @param string $projectId Project ID of the dataset being updated
* @param string $datasetId Dataset ID of the dataset being updated
* @param Google_Dataset $postBody
* @param array $optParams Optional parameters.
* @return Google_Dataset
*/
public function update($projectId, $datasetId, Google_Dataset $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('update', array($params));
if ($this->useObjects()) {
return new Google_Dataset($data);
} else {
return $data;
}
}
/**
* Updates information in an existing dataset, specified by datasetId. Properties not included in
* the submitted resource will not be changed. If you include the access property without any values
* assigned, the request will fail as you must specify at least one owner for a dataset. This method
* supports patch semantics. (datasets.patch)
*
* @param string $projectId Project ID of the dataset being updated
* @param string $datasetId Dataset ID of the dataset being updated
* @param Google_Dataset $postBody
* @param array $optParams Optional parameters.
* @return Google_Dataset
*/
public function patch($projectId, $datasetId, Google_Dataset $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('patch', array($params));
if ($this->useObjects()) {
return new Google_Dataset($data);
} else {
return $data;
}
}
/**
* Deletes the dataset specified by datasetId value. Before you can delete a dataset, you must
* delete all its tables, either manually or by specifying deleteContents. Immediately after
* deletion, you can create another dataset with the same name. (datasets.delete)
*
* @param string $projectId Project ID of the dataset being deleted
* @param string $datasetId Dataset ID of dataset being deleted
* @param array $optParams Optional parameters.
*
* @opt_param bool deleteContents If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False
*/
public function delete($projectId, $datasetId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId);
$params = array_merge($params, $optParams);
$data = $this->__call('delete', array($params));
return $data;
}
}
/**
* The "jobs" collection of methods.
* Typical usage is:
* <code>
* $bigqueryService = new Google_BigqueryService(...);
* $jobs = $bigqueryService->jobs;
* </code>
*/
class Google_JobsServiceResource extends Google_ServiceResource {
/**
* Starts a new asynchronous job. (jobs.insert)
*
* @param string $projectId Project ID of the project that will be billed for the job
* @param Google_Job $postBody
* @param array $optParams Optional parameters.
* @return Google_Job
*/
public function insert($projectId, Google_Job $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Job($data);
} else {
return $data;
}
}
/**
* Runs a BigQuery SQL query synchronously and returns query results if the query completes within a
* specified timeout. (jobs.query)
*
* @param string $projectId Project ID of the project billed for the query
* @param Google_QueryRequest $postBody
* @param array $optParams Optional parameters.
* @return Google_QueryResponse
*/
public function query($projectId, Google_QueryRequest $postBody, $optParams = array()) {
$params = array('projectId' => $projectId, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('query', array($params));
if ($this->useObjects()) {
return new Google_QueryResponse($data);
} else {
return $data;
}
}
/**
* Lists all the Jobs in the specified project that were started by the user. (jobs.list)
*
* @param string $projectId Project ID of the jobs to list
* @param array $optParams Optional parameters.
*
* @opt_param string projection Restrict information returned to a set of selected fields
* @opt_param string stateFilter Filter for job state
* @opt_param bool allUsers Whether to display jobs owned by all users in the project. Default false
* @opt_param string maxResults Maximum number of results to return
* @opt_param string pageToken Page token, returned by a previous call, to request the next page of results
* @return Google_JobList
*/
public function listJobs($projectId, $optParams = array()) {
$params = array('projectId' => $projectId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_JobList($data);
} else {
return $data;
}
}
/**
* Retrieves the results of a query job. (jobs.getQueryResults)
*
* @param string $projectId Project ID of the query job
* @param string $jobId Job ID of the query job
* @param array $optParams Optional parameters.
*
* @opt_param string timeoutMs How long to wait for the query to complete, in milliseconds, before returning. Default is to return immediately. If the timeout passes before the job completes, the request will fail with a TIMEOUT error
* @opt_param string startIndex Zero-based index of the starting row
* @opt_param string maxResults Maximum number of results to read
* @return Google_GetQueryResultsResponse
*/
public function getQueryResults($projectId, $jobId, $optParams = array()) {
$params = array('projectId' => $projectId, 'jobId' => $jobId);
$params = array_merge($params, $optParams);
$data = $this->__call('getQueryResults', array($params));
if ($this->useObjects()) {
return new Google_GetQueryResultsResponse($data);
} else {
return $data;
}
}
/**
* Retrieves the specified job by ID. (jobs.get)
*
* @param string $projectId Project ID of the requested job
* @param string $jobId Job ID of the requested job
* @param array $optParams Optional parameters.
* @return Google_Job
*/
public function get($projectId, $jobId, $optParams = array()) {
$params = array('projectId' => $projectId, 'jobId' => $jobId);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Job($data);
} else {
return $data;
}
}
}
/**
* The "tabledata" collection of methods.
* Typical usage is:
* <code>
* $bigqueryService = new Google_BigqueryService(...);
* $tabledata = $bigqueryService->tabledata;
* </code>
*/
class Google_TabledataServiceResource extends Google_ServiceResource {
/**
* Retrieves table data from a specified set of rows. (tabledata.list)
*
* @param string $projectId Project ID of the table to read
* @param string $datasetId Dataset ID of the table to read
* @param string $tableId Table ID of the table to read
* @param array $optParams Optional parameters.
*
* @opt_param string maxResults Maximum number of results to return
* @opt_param string pageToken Page token, returned by a previous call, identifying the result set
* @opt_param string startIndex Zero-based index of the starting row to read
* @return Google_TableDataList
*/
public function listTabledata($projectId, $datasetId, $tableId, $optParams = array()) {
$params = array('projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId);
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_TableDataList($data);
} else {
return $data;
}
}
}
/**
* The "projects" collection of methods.
* Typical usage is:
* <code>
* $bigqueryService = new Google_BigqueryService(...);
* $projects = $bigqueryService->projects;
* </code>
*/
class Google_ProjectsServiceResource extends Google_ServiceResource {
/**
* Lists the projects to which you have at least read access. (projects.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string pageToken Page token, returned by a previous call, to request the next page of results
* @opt_param string maxResults Maximum number of results to return
* @return Google_ProjectList
*/
public function listProjects($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_ProjectList($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Bigquery (v2).
*
* <p>
* A data platform for customers to create, manage, share and query data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://code.google.com/apis/bigquery/docs/v2/" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_BigqueryService extends Google_Service {
public $tables;
public $datasets;
public $jobs;
public $tabledata;
public $projects;
/**
* Constructs the internal representation of the Bigquery service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'bigquery/v2/';
$this->version = 'v2';
$this->serviceName = 'bigquery';
$client->addService($this->serviceName, $this->version);
$this->tables = new Google_TablesServiceResource($this, $this->serviceName, 'tables', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "POST", "path": "projects/{projectId}/datasets/{datasetId}/tables", "id": "bigquery.tables.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.tables.get", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "response": {"$ref": "Table"}}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "datasetId": {"required": true, "type": "string", "location": "path"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.tables.list", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}/tables", "response": {"$ref": "TableList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "PUT", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "id": "bigquery.tables.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Table"}, "response": {"$ref": "Table"}, "httpMethod": "PATCH", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "id": "bigquery.tables.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}", "id": "bigquery.tables.delete", "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->datasets = new Google_DatasetsServiceResource($this, $this->serviceName, 'datasets', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "response": {"$ref": "Dataset"}, "httpMethod": "POST", "path": "projects/{projectId}/datasets", "id": "bigquery.datasets.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.datasets.get", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}", "response": {"$ref": "Dataset"}}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.datasets.list", "httpMethod": "GET", "path": "projects/{projectId}/datasets", "response": {"$ref": "DatasetList"}}, "update": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "response": {"$ref": "Dataset"}, "httpMethod": "PUT", "path": "projects/{projectId}/datasets/{datasetId}", "id": "bigquery.datasets.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Dataset"}, "response": {"$ref": "Dataset"}, "httpMethod": "PATCH", "path": "projects/{projectId}/datasets/{datasetId}", "id": "bigquery.datasets.patch"}, "delete": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "path": "projects/{projectId}/datasets/{datasetId}", "id": "bigquery.datasets.delete", "parameters": {"deleteContents": {"type": "boolean", "location": "query"}, "datasetId": {"required": true, "type": "string", "location": "path"}, "projectId": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
$this->jobs = new Google_JobsServiceResource($this, $this->serviceName, 'jobs', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}}, "supportsMediaUpload": true, "request": {"$ref": "Job"}, "mediaUpload": {"protocols": {"simple": {"path": "/upload/bigquery/v2/projects/{projectId}/jobs", "multipart": true}, "resumable": {"path": "/resumable/upload/bigquery/v2/projects/{projectId}/jobs", "multipart": true}}, "accept": ["application/octet-stream"]}, "response": {"$ref": "Job"}, "httpMethod": "POST", "path": "projects/{projectId}/jobs", "id": "bigquery.jobs.insert"}, "query": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "QueryRequest"}, "response": {"$ref": "QueryResponse"}, "httpMethod": "POST", "path": "projects/{projectId}/queries", "id": "bigquery.jobs.query"}, "list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projection": {"enum": ["full", "minimal"], "type": "string", "location": "query"}, "stateFilter": {"repeated": true, "enum": ["done", "pending", "running"], "type": "string", "location": "query"}, "projectId": {"required": true, "type": "string", "location": "path"}, "allUsers": {"type": "boolean", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}}, "id": "bigquery.jobs.list", "httpMethod": "GET", "path": "projects/{projectId}/jobs", "response": {"$ref": "JobList"}}, "getQueryResults": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"timeoutMs": {"type": "integer", "location": "query", "format": "uint32"}, "projectId": {"required": true, "type": "string", "location": "path"}, "startIndex": {"type": "string", "location": "query", "format": "uint64"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "jobId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.jobs.getQueryResults", "httpMethod": "GET", "path": "projects/{projectId}/queries/{jobId}", "response": {"$ref": "GetQueryResultsResponse"}}, "get": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "jobId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.jobs.get", "httpMethod": "GET", "path": "projects/{projectId}/jobs/{jobId}", "response": {"$ref": "Job"}}}}', true));
$this->tabledata = new Google_TabledataServiceResource($this, $this->serviceName, 'tabledata', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"projectId": {"required": true, "type": "string", "location": "path"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}, "pageToken": {"type": "string", "location": "query"}, "startIndex": {"type": "string", "location": "query", "format": "uint64"}, "tableId": {"required": true, "type": "string", "location": "path"}, "datasetId": {"required": true, "type": "string", "location": "path"}}, "id": "bigquery.tabledata.list", "httpMethod": "GET", "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data", "response": {"$ref": "TableDataList"}}}}', true));
$this->projects = new Google_ProjectsServiceResource($this, $this->serviceName, 'projects', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/bigquery"], "parameters": {"pageToken": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "location": "query", "format": "uint32"}}, "response": {"$ref": "ProjectList"}, "httpMethod": "GET", "path": "projects", "id": "bigquery.projects.list"}}}', true));
}
}
class Google_Dataset extends Google_Model {
public $kind;
public $description;
protected $__datasetReferenceType = 'Google_DatasetReference';
protected $__datasetReferenceDataType = '';
public $datasetReference;
public $creationTime;
protected $__accessType = 'Google_DatasetAccess';
protected $__accessDataType = 'array';
public $access;
public $etag;
public $friendlyName;
public $lastModifiedTime;
public $id;
public $selfLink;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setDatasetReference(Google_DatasetReference $datasetReference) {
$this->datasetReference = $datasetReference;
}
public function getDatasetReference() {
return $this->datasetReference;
}
public function setCreationTime($creationTime) {
$this->creationTime = $creationTime;
}
public function getCreationTime() {
return $this->creationTime;
}
public function setAccess(/* array(Google_DatasetAccess) */ $access) {
$this->assertIsArray($access, 'Google_DatasetAccess', __METHOD__);
$this->access = $access;
}
public function getAccess() {
return $this->access;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setFriendlyName($friendlyName) {
$this->friendlyName = $friendlyName;
}
public function getFriendlyName() {
return $this->friendlyName;
}
public function setLastModifiedTime($lastModifiedTime) {
$this->lastModifiedTime = $lastModifiedTime;
}
public function getLastModifiedTime() {
return $this->lastModifiedTime;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_DatasetAccess extends Google_Model {
public $specialGroup;
public $domain;
public $role;
public $groupByEmail;
public $userByEmail;
public function setSpecialGroup($specialGroup) {
$this->specialGroup = $specialGroup;
}
public function getSpecialGroup() {
return $this->specialGroup;
}
public function setDomain($domain) {
$this->domain = $domain;
}
public function getDomain() {
return $this->domain;
}
public function setRole($role) {
$this->role = $role;
}
public function getRole() {
return $this->role;
}
public function setGroupByEmail($groupByEmail) {
$this->groupByEmail = $groupByEmail;
}
public function getGroupByEmail() {
return $this->groupByEmail;
}
public function setUserByEmail($userByEmail) {
$this->userByEmail = $userByEmail;
}
public function getUserByEmail() {
return $this->userByEmail;
}
}
class Google_DatasetList extends Google_Model {
public $nextPageToken;
public $kind;
protected $__datasetsType = 'Google_DatasetListDatasets';
protected $__datasetsDataType = 'array';
public $datasets;
public $etag;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDatasets(/* array(Google_DatasetListDatasets) */ $datasets) {
$this->assertIsArray($datasets, 'Google_DatasetListDatasets', __METHOD__);
$this->datasets = $datasets;
}
public function getDatasets() {
return $this->datasets;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
}
class Google_DatasetListDatasets extends Google_Model {
public $friendlyName;
public $kind;
public $id;
protected $__datasetReferenceType = 'Google_DatasetReference';
protected $__datasetReferenceDataType = '';
public $datasetReference;
public function setFriendlyName($friendlyName) {
$this->friendlyName = $friendlyName;
}
public function getFriendlyName() {
return $this->friendlyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setDatasetReference(Google_DatasetReference $datasetReference) {
$this->datasetReference = $datasetReference;
}
public function getDatasetReference() {
return $this->datasetReference;
}
}
class Google_DatasetReference extends Google_Model {
public $projectId;
public $datasetId;
public function setProjectId($projectId) {
$this->projectId = $projectId;
}
public function getProjectId() {
return $this->projectId;
}
public function setDatasetId($datasetId) {
$this->datasetId = $datasetId;
}
public function getDatasetId() {
return $this->datasetId;
}
}
class Google_ErrorProto extends Google_Model {
public $debugInfo;
public $message;
public $reason;
public $location;
public function setDebugInfo($debugInfo) {
$this->debugInfo = $debugInfo;
}
public function getDebugInfo() {
return $this->debugInfo;
}
public function setMessage($message) {
$this->message = $message;
}
public function getMessage() {
return $this->message;
}
public function setReason($reason) {
$this->reason = $reason;
}
public function getReason() {
return $this->reason;
}
public function setLocation($location) {
$this->location = $location;
}
public function getLocation() {
return $this->location;
}
}
class Google_GetQueryResultsResponse extends Google_Model {
public $kind;
protected $__rowsType = 'Google_TableRow';
protected $__rowsDataType = 'array';
public $rows;
protected $__jobReferenceType = 'Google_JobReference';
protected $__jobReferenceDataType = '';
public $jobReference;
public $jobComplete;
public $totalRows;
public $etag;
protected $__schemaType = 'Google_TableSchema';
protected $__schemaDataType = '';
public $schema;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows(/* array(Google_TableRow) */ $rows) {
$this->assertIsArray($rows, 'Google_TableRow', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setJobReference(Google_JobReference $jobReference) {
$this->jobReference = $jobReference;
}
public function getJobReference() {
return $this->jobReference;
}
public function setJobComplete($jobComplete) {
$this->jobComplete = $jobComplete;
}
public function getJobComplete() {
return $this->jobComplete;
}
public function setTotalRows($totalRows) {
$this->totalRows = $totalRows;
}
public function getTotalRows() {
return $this->totalRows;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setSchema(Google_TableSchema $schema) {
$this->schema = $schema;
}
public function getSchema() {
return $this->schema;
}
}
class Google_Job extends Google_Model {
protected $__statusType = 'Google_JobStatus';
protected $__statusDataType = '';
public $status;
public $kind;
protected $__statisticsType = 'Google_JobStatistics';
protected $__statisticsDataType = '';
public $statistics;
protected $__jobReferenceType = 'Google_JobReference';
protected $__jobReferenceDataType = '';
public $jobReference;
public $etag;
protected $__configurationType = 'Google_JobConfiguration';
protected $__configurationDataType = '';
public $configuration;
public $id;
public $selfLink;
public function setStatus(Google_JobStatus $status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStatistics(Google_JobStatistics $statistics) {
$this->statistics = $statistics;
}
public function getStatistics() {
return $this->statistics;
}
public function setJobReference(Google_JobReference $jobReference) {
$this->jobReference = $jobReference;
}
public function getJobReference() {
return $this->jobReference;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setConfiguration(Google_JobConfiguration $configuration) {
$this->configuration = $configuration;
}
public function getConfiguration() {
return $this->configuration;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
}
class Google_JobConfiguration extends Google_Model {
protected $__loadType = 'Google_JobConfigurationLoad';
protected $__loadDataType = '';
public $load;
protected $__linkType = 'Google_JobConfigurationLink';
protected $__linkDataType = '';
public $link;
protected $__queryType = 'Google_JobConfigurationQuery';
protected $__queryDataType = '';
public $query;
protected $__copyType = 'Google_JobConfigurationTableCopy';
protected $__copyDataType = '';
public $copy;
protected $__extractType = 'Google_JobConfigurationExtract';
protected $__extractDataType = '';
public $extract;
public $properties;
public function setLoad(Google_JobConfigurationLoad $load) {
$this->load = $load;
}
public function getLoad() {
return $this->load;
}
public function setLink(Google_JobConfigurationLink $link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setQuery(Google_JobConfigurationQuery $query) {
$this->query = $query;
}
public function getQuery() {
return $this->query;
}
public function setCopy(Google_JobConfigurationTableCopy $copy) {
$this->copy = $copy;
}
public function getCopy() {
return $this->copy;
}
public function setExtract(Google_JobConfigurationExtract $extract) {
$this->extract = $extract;
}
public function getExtract() {
return $this->extract;
}
public function setProperties($properties) {
$this->properties = $properties;
}
public function getProperties() {
return $this->properties;
}
}
class Google_JobConfigurationExtract extends Google_Model {
public $destinationUri;
public $fieldDelimiter;
protected $__sourceTableType = 'Google_TableReference';
protected $__sourceTableDataType = '';
public $sourceTable;
public $printHeader;
public function setDestinationUri($destinationUri) {
$this->destinationUri = $destinationUri;
}
public function getDestinationUri() {
return $this->destinationUri;
}
public function setFieldDelimiter($fieldDelimiter) {
$this->fieldDelimiter = $fieldDelimiter;
}
public function getFieldDelimiter() {
return $this->fieldDelimiter;
}
public function setSourceTable(Google_TableReference $sourceTable) {
$this->sourceTable = $sourceTable;
}
public function getSourceTable() {
return $this->sourceTable;
}
public function setPrintHeader($printHeader) {
$this->printHeader = $printHeader;
}
public function getPrintHeader() {
return $this->printHeader;
}
}
class Google_JobConfigurationLink extends Google_Model {
public $createDisposition;
public $writeDisposition;
protected $__destinationTableType = 'Google_TableReference';
protected $__destinationTableDataType = '';
public $destinationTable;
public $sourceUri;
public function setCreateDisposition($createDisposition) {
$this->createDisposition = $createDisposition;
}
public function getCreateDisposition() {
return $this->createDisposition;
}
public function setWriteDisposition($writeDisposition) {
$this->writeDisposition = $writeDisposition;
}
public function getWriteDisposition() {
return $this->writeDisposition;
}
public function setDestinationTable(Google_TableReference $destinationTable) {
$this->destinationTable = $destinationTable;
}
public function getDestinationTable() {
return $this->destinationTable;
}
public function setSourceUri(/* array(Google_string) */ $sourceUri) {
$this->assertIsArray($sourceUri, 'Google_string', __METHOD__);
$this->sourceUri = $sourceUri;
}
public function getSourceUri() {
return $this->sourceUri;
}
}
class Google_JobConfigurationLoad extends Google_Model {
public $encoding;
public $fieldDelimiter;
protected $__destinationTableType = 'Google_TableReference';
protected $__destinationTableDataType = '';
public $destinationTable;
public $writeDisposition;
public $maxBadRecords;
public $skipLeadingRows;
public $sourceUris;
public $quote;
public $createDisposition;
public $schemaInlineFormat;
public $schemaInline;
protected $__schemaType = 'Google_TableSchema';
protected $__schemaDataType = '';
public $schema;
public function setEncoding($encoding) {
$this->encoding = $encoding;
}
public function getEncoding() {
return $this->encoding;
}
public function setFieldDelimiter($fieldDelimiter) {
$this->fieldDelimiter = $fieldDelimiter;
}
public function getFieldDelimiter() {
return $this->fieldDelimiter;
}
public function setDestinationTable(Google_TableReference $destinationTable) {
$this->destinationTable = $destinationTable;
}
public function getDestinationTable() {
return $this->destinationTable;
}
public function setWriteDisposition($writeDisposition) {
$this->writeDisposition = $writeDisposition;
}
public function getWriteDisposition() {
return $this->writeDisposition;
}
public function setMaxBadRecords($maxBadRecords) {
$this->maxBadRecords = $maxBadRecords;
}
public function getMaxBadRecords() {
return $this->maxBadRecords;
}
public function setSkipLeadingRows($skipLeadingRows) {
$this->skipLeadingRows = $skipLeadingRows;
}
public function getSkipLeadingRows() {
return $this->skipLeadingRows;
}
public function setSourceUris(/* array(Google_string) */ $sourceUris) {
$this->assertIsArray($sourceUris, 'Google_string', __METHOD__);
$this->sourceUris = $sourceUris;
}
public function getSourceUris() {
return $this->sourceUris;
}
public function setQuote($quote) {
$this->quote = $quote;
}
public function getQuote() {
return $this->quote;
}
public function setCreateDisposition($createDisposition) {
$this->createDisposition = $createDisposition;
}
public function getCreateDisposition() {
return $this->createDisposition;
}
public function setSchemaInlineFormat($schemaInlineFormat) {
$this->schemaInlineFormat = $schemaInlineFormat;
}
public function getSchemaInlineFormat() {
return $this->schemaInlineFormat;
}
public function setSchemaInline($schemaInline) {
$this->schemaInline = $schemaInline;
}
public function getSchemaInline() {
return $this->schemaInline;
}
public function setSchema(Google_TableSchema $schema) {
$this->schema = $schema;
}
public function getSchema() {
return $this->schema;
}
}
class Google_JobConfigurationQuery extends Google_Model {
protected $__defaultDatasetType = 'Google_DatasetReference';
protected $__defaultDatasetDataType = '';
public $defaultDataset;
protected $__destinationTableType = 'Google_TableReference';
protected $__destinationTableDataType = '';
public $destinationTable;
public $priority;
public $writeDisposition;
public $createDisposition;
public $query;
public function setDefaultDataset(Google_DatasetReference $defaultDataset) {
$this->defaultDataset = $defaultDataset;
}
public function getDefaultDataset() {
return $this->defaultDataset;
}
public function setDestinationTable(Google_TableReference $destinationTable) {
$this->destinationTable = $destinationTable;
}
public function getDestinationTable() {
return $this->destinationTable;
}
public function setPriority($priority) {
$this->priority = $priority;
}
public function getPriority() {
return $this->priority;
}
public function setWriteDisposition($writeDisposition) {
$this->writeDisposition = $writeDisposition;
}
public function getWriteDisposition() {
return $this->writeDisposition;
}
public function setCreateDisposition($createDisposition) {
$this->createDisposition = $createDisposition;
}
public function getCreateDisposition() {
return $this->createDisposition;
}
public function setQuery($query) {
$this->query = $query;
}
public function getQuery() {
return $this->query;
}
}
class Google_JobConfigurationTableCopy extends Google_Model {
public $createDisposition;
public $writeDisposition;
protected $__destinationTableType = 'Google_TableReference';
protected $__destinationTableDataType = '';
public $destinationTable;
protected $__sourceTableType = 'Google_TableReference';
protected $__sourceTableDataType = '';
public $sourceTable;
public function setCreateDisposition($createDisposition) {
$this->createDisposition = $createDisposition;
}
public function getCreateDisposition() {
return $this->createDisposition;
}
public function setWriteDisposition($writeDisposition) {
$this->writeDisposition = $writeDisposition;
}
public function getWriteDisposition() {
return $this->writeDisposition;
}
public function setDestinationTable(Google_TableReference $destinationTable) {
$this->destinationTable = $destinationTable;
}
public function getDestinationTable() {
return $this->destinationTable;
}
public function setSourceTable(Google_TableReference $sourceTable) {
$this->sourceTable = $sourceTable;
}
public function getSourceTable() {
return $this->sourceTable;
}
}
class Google_JobList extends Google_Model {
public $nextPageToken;
public $totalItems;
public $kind;
public $etag;
protected $__jobsType = 'Google_JobListJobs';
protected $__jobsDataType = 'array';
public $jobs;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setJobs(/* array(Google_JobListJobs) */ $jobs) {
$this->assertIsArray($jobs, 'Google_JobListJobs', __METHOD__);
$this->jobs = $jobs;
}
public function getJobs() {
return $this->jobs;
}
}
class Google_JobListJobs extends Google_Model {
protected $__statusType = 'Google_JobStatus';
protected $__statusDataType = '';
public $status;
public $kind;
protected $__statisticsType = 'Google_JobStatistics';
protected $__statisticsDataType = '';
public $statistics;
protected $__jobReferenceType = 'Google_JobReference';
protected $__jobReferenceDataType = '';
public $jobReference;
public $state;
protected $__configurationType = 'Google_JobConfiguration';
protected $__configurationDataType = '';
public $configuration;
public $id;
protected $__errorResultType = 'Google_ErrorProto';
protected $__errorResultDataType = '';
public $errorResult;
public function setStatus(Google_JobStatus $status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setStatistics(Google_JobStatistics $statistics) {
$this->statistics = $statistics;
}
public function getStatistics() {
return $this->statistics;
}
public function setJobReference(Google_JobReference $jobReference) {
$this->jobReference = $jobReference;
}
public function getJobReference() {
return $this->jobReference;
}
public function setState($state) {
$this->state = $state;
}
public function getState() {
return $this->state;
}
public function setConfiguration(Google_JobConfiguration $configuration) {
$this->configuration = $configuration;
}
public function getConfiguration() {
return $this->configuration;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setErrorResult(Google_ErrorProto $errorResult) {
$this->errorResult = $errorResult;
}
public function getErrorResult() {
return $this->errorResult;
}
}
class Google_JobReference extends Google_Model {
public $projectId;
public $jobId;
public function setProjectId($projectId) {
$this->projectId = $projectId;
}
public function getProjectId() {
return $this->projectId;
}
public function setJobId($jobId) {
$this->jobId = $jobId;
}
public function getJobId() {
return $this->jobId;
}
}
class Google_JobStatistics extends Google_Model {
public $endTime;
public $totalBytesProcessed;
public $startTime;
public function setEndTime($endTime) {
$this->endTime = $endTime;
}
public function getEndTime() {
return $this->endTime;
}
public function setTotalBytesProcessed($totalBytesProcessed) {
$this->totalBytesProcessed = $totalBytesProcessed;
}
public function getTotalBytesProcessed() {
return $this->totalBytesProcessed;
}
public function setStartTime($startTime) {
$this->startTime = $startTime;
}
public function getStartTime() {
return $this->startTime;
}
}
class Google_JobStatus extends Google_Model {
public $state;
protected $__errorsType = 'Google_ErrorProto';
protected $__errorsDataType = 'array';
public $errors;
protected $__errorResultType = 'Google_ErrorProto';
protected $__errorResultDataType = '';
public $errorResult;
public function setState($state) {
$this->state = $state;
}
public function getState() {
return $this->state;
}
public function setErrors(/* array(Google_ErrorProto) */ $errors) {
$this->assertIsArray($errors, 'Google_ErrorProto', __METHOD__);
$this->errors = $errors;
}
public function getErrors() {
return $this->errors;
}
public function setErrorResult(Google_ErrorProto $errorResult) {
$this->errorResult = $errorResult;
}
public function getErrorResult() {
return $this->errorResult;
}
}
class Google_ProjectList extends Google_Model {
public $nextPageToken;
public $totalItems;
public $kind;
public $etag;
protected $__projectsType = 'Google_ProjectListProjects';
protected $__projectsDataType = 'array';
public $projects;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setProjects(/* array(Google_ProjectListProjects) */ $projects) {
$this->assertIsArray($projects, 'Google_ProjectListProjects', __METHOD__);
$this->projects = $projects;
}
public function getProjects() {
return $this->projects;
}
}
class Google_ProjectListProjects extends Google_Model {
public $friendlyName;
public $kind;
public $id;
protected $__projectReferenceType = 'Google_ProjectReference';
protected $__projectReferenceDataType = '';
public $projectReference;
public function setFriendlyName($friendlyName) {
$this->friendlyName = $friendlyName;
}
public function getFriendlyName() {
return $this->friendlyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setProjectReference(Google_ProjectReference $projectReference) {
$this->projectReference = $projectReference;
}
public function getProjectReference() {
return $this->projectReference;
}
}
class Google_ProjectReference extends Google_Model {
public $projectId;
public function setProjectId($projectId) {
$this->projectId = $projectId;
}
public function getProjectId() {
return $this->projectId;
}
}
class Google_QueryRequest extends Google_Model {
public $timeoutMs;
public $kind;
public $dryRun;
protected $__defaultDatasetType = 'Google_DatasetReference';
protected $__defaultDatasetDataType = '';
public $defaultDataset;
public $maxResults;
public $query;
public function setTimeoutMs($timeoutMs) {
$this->timeoutMs = $timeoutMs;
}
public function getTimeoutMs() {
return $this->timeoutMs;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setDryRun($dryRun) {
$this->dryRun = $dryRun;
}
public function getDryRun() {
return $this->dryRun;
}
public function setDefaultDataset(Google_DatasetReference $defaultDataset) {
$this->defaultDataset = $defaultDataset;
}
public function getDefaultDataset() {
return $this->defaultDataset;
}
public function setMaxResults($maxResults) {
$this->maxResults = $maxResults;
}
public function getMaxResults() {
return $this->maxResults;
}
public function setQuery($query) {
$this->query = $query;
}
public function getQuery() {
return $this->query;
}
}
class Google_QueryResponse extends Google_Model {
public $kind;
protected $__rowsType = 'Google_TableRow';
protected $__rowsDataType = 'array';
public $rows;
protected $__jobReferenceType = 'Google_JobReference';
protected $__jobReferenceDataType = '';
public $jobReference;
public $jobComplete;
public $totalRows;
protected $__schemaType = 'Google_TableSchema';
protected $__schemaDataType = '';
public $schema;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setRows(/* array(Google_TableRow) */ $rows) {
$this->assertIsArray($rows, 'Google_TableRow', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setJobReference(Google_JobReference $jobReference) {
$this->jobReference = $jobReference;
}
public function getJobReference() {
return $this->jobReference;
}
public function setJobComplete($jobComplete) {
$this->jobComplete = $jobComplete;
}
public function getJobComplete() {
return $this->jobComplete;
}
public function setTotalRows($totalRows) {
$this->totalRows = $totalRows;
}
public function getTotalRows() {
return $this->totalRows;
}
public function setSchema(Google_TableSchema $schema) {
$this->schema = $schema;
}
public function getSchema() {
return $this->schema;
}
}
class Google_Table extends Google_Model {
public $kind;
public $lastModifiedTime;
public $description;
public $creationTime;
protected $__tableReferenceType = 'Google_TableReference';
protected $__tableReferenceDataType = '';
public $tableReference;
public $numRows;
public $numBytes;
public $etag;
public $friendlyName;
public $expirationTime;
public $id;
public $selfLink;
protected $__schemaType = 'Google_TableSchema';
protected $__schemaDataType = '';
public $schema;
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setLastModifiedTime($lastModifiedTime) {
$this->lastModifiedTime = $lastModifiedTime;
}
public function getLastModifiedTime() {
return $this->lastModifiedTime;
}
public function setDescription($description) {
$this->description = $description;
}
public function getDescription() {
return $this->description;
}
public function setCreationTime($creationTime) {
$this->creationTime = $creationTime;
}
public function getCreationTime() {
return $this->creationTime;
}
public function setTableReference(Google_TableReference $tableReference) {
$this->tableReference = $tableReference;
}
public function getTableReference() {
return $this->tableReference;
}
public function setNumRows($numRows) {
$this->numRows = $numRows;
}
public function getNumRows() {
return $this->numRows;
}
public function setNumBytes($numBytes) {
$this->numBytes = $numBytes;
}
public function getNumBytes() {
return $this->numBytes;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setFriendlyName($friendlyName) {
$this->friendlyName = $friendlyName;
}
public function getFriendlyName() {
return $this->friendlyName;
}
public function setExpirationTime($expirationTime) {
$this->expirationTime = $expirationTime;
}
public function getExpirationTime() {
return $this->expirationTime;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setSelfLink($selfLink) {
$this->selfLink = $selfLink;
}
public function getSelfLink() {
return $this->selfLink;
}
public function setSchema(Google_TableSchema $schema) {
$this->schema = $schema;
}
public function getSchema() {
return $this->schema;
}
}
class Google_TableDataList extends Google_Model {
public $pageToken;
public $kind;
public $etag;
protected $__rowsType = 'Google_TableRow';
protected $__rowsDataType = 'array';
public $rows;
public $totalRows;
public function setPageToken($pageToken) {
$this->pageToken = $pageToken;
}
public function getPageToken() {
return $this->pageToken;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setRows(/* array(Google_TableRow) */ $rows) {
$this->assertIsArray($rows, 'Google_TableRow', __METHOD__);
$this->rows = $rows;
}
public function getRows() {
return $this->rows;
}
public function setTotalRows($totalRows) {
$this->totalRows = $totalRows;
}
public function getTotalRows() {
return $this->totalRows;
}
}
class Google_TableFieldSchema extends Google_Model {
protected $__fieldsType = 'Google_TableFieldSchema';
protected $__fieldsDataType = 'array';
public $fields;
public $type;
public $mode;
public $name;
public function setFields(/* array(Google_TableFieldSchema) */ $fields) {
$this->assertIsArray($fields, 'Google_TableFieldSchema', __METHOD__);
$this->fields = $fields;
}
public function getFields() {
return $this->fields;
}
public function setType($type) {
$this->type = $type;
}
public function getType() {
return $this->type;
}
public function setMode($mode) {
$this->mode = $mode;
}
public function getMode() {
return $this->mode;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
}
class Google_TableList extends Google_Model {
public $nextPageToken;
protected $__tablesType = 'Google_TableListTables';
protected $__tablesDataType = 'array';
public $tables;
public $kind;
public $etag;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setTables(/* array(Google_TableListTables) */ $tables) {
$this->assertIsArray($tables, 'Google_TableListTables', __METHOD__);
$this->tables = $tables;
}
public function getTables() {
return $this->tables;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setEtag($etag) {
$this->etag = $etag;
}
public function getEtag() {
return $this->etag;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
class Google_TableListTables extends Google_Model {
public $friendlyName;
public $kind;
public $id;
protected $__tableReferenceType = 'Google_TableReference';
protected $__tableReferenceDataType = '';
public $tableReference;
public function setFriendlyName($friendlyName) {
$this->friendlyName = $friendlyName;
}
public function getFriendlyName() {
return $this->friendlyName;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setTableReference(Google_TableReference $tableReference) {
$this->tableReference = $tableReference;
}
public function getTableReference() {
return $this->tableReference;
}
}
class Google_TableReference extends Google_Model {
public $projectId;
public $tableId;
public $datasetId;
public function setProjectId($projectId) {
$this->projectId = $projectId;
}
public function getProjectId() {
return $this->projectId;
}
public function setTableId($tableId) {
$this->tableId = $tableId;
}
public function getTableId() {
return $this->tableId;
}
public function setDatasetId($datasetId) {
$this->datasetId = $datasetId;
}
public function getDatasetId() {
return $this->datasetId;
}
}
class Google_TableRow extends Google_Model {
protected $__fType = 'Google_TableRowF';
protected $__fDataType = 'array';
public $f;
public function setF(/* array(Google_TableRowF) */ $f) {
$this->assertIsArray($f, 'Google_TableRowF', __METHOD__);
$this->f = $f;
}
public function getF() {
return $this->f;
}
}
class Google_TableRowF extends Google_Model {
public $v;
public function setV($v) {
$this->v = $v;
}
public function getV() {
return $this->v;
}
}
class Google_TableSchema extends Google_Model {
protected $__fieldsType = 'Google_TableFieldSchema';
protected $__fieldsDataType = 'array';
public $fields;
public function setFields(/* array(Google_TableFieldSchema) */ $fields) {
$this->assertIsArray($fields, 'Google_TableFieldSchema', __METHOD__);
$this->fields = $fields;
}
public function getFields() {
return $this->fields;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/contrib/Google_BigqueryService.php | PHP | asf20 | 64,237 |
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
global $apiConfig;
$apiConfig = array(
// True if objects should be returned by the service classes.
// False if associative arrays should be returned (default behavior).
'use_objects' => false,
// The application_name is included in the User-Agent HTTP header.
'application_name' => SET_APP_NAME,
// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
'oauth2_client_id' => CLIENT_ID,
'oauth2_client_secret' => CLIENT_SECRET,
'oauth2_redirect_uri' => REDIRECT_URL,
// The developer key, you get this at https://code.google.com/apis/console
'developer_key' => DEV_KEY,
// Site name to show in the Google's OAuth 1 authentication screen.
'site_name' => HOST_FRONTEND,//www.example.org
'authClass' => 'Google_OAuth2',
'ioClass' => 'Google_CurlIO',
'cacheClass' => 'Google_FileCache',
// Don't change these unless you're working against a special development or testing environment.
'basePath' => 'https://www.googleapis.com',
// IO Class dependent configuration, you only have to configure the values
// for the class that was configured as the ioClass above
'ioFileCache_directory' =>
(function_exists('sys_get_temp_dir') ?
sys_get_temp_dir() . '/Google_Client' :
'/tmp/Google_Client'),
// Definition of service specific values like scopes, oauth token URLs, etc
'services' => array(
'analytics' => array('scope' => 'https://www.googleapis.com/auth/analytics.readonly'),
'calendar' => array(
'scope' => array(
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
)
),
'books' => array('scope' => 'https://www.googleapis.com/auth/books'),
'latitude' => array(
'scope' => array(
'https://www.googleapis.com/auth/latitude.all.best',
'https://www.googleapis.com/auth/latitude.all.city',
)
),
'moderator' => array('scope' => 'https://www.googleapis.com/auth/moderator'),
'oauth2' => array(
'scope' => array(
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email',
)
),
'plus' => array('scope' => 'https://www.googleapis.com/auth/plus.me'),
'siteVerification' => array('scope' => 'https://www.googleapis.com/auth/siteverification'),
'tasks' => array('scope' => 'https://www.googleapis.com/auth/tasks'),
'urlshortener' => array('scope' => 'https://www.googleapis.com/auth/urlshortener')
)
); | 123gosaigon | trunk/ 123gosaigon/site/libraries/libgoogle/config.php | PHP | asf20 | 3,347 |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class site
{
public $settings = array();
public function __construct()
{
if (!isset($this->CI))
{
$this->CI =& get_instance();
}
//$this->CI->load->library('user_agent');
//$this->get_site_info();
}
public function load($page, $data = NULL, $layout=FALSE)
{
$data['page'] = $page;
if($layout==TRUE){
$this->CI->load->view('html/skin_'.$layout, $data);
}else{
$this->CI->load->view('html/skin', $data);
}
}
public function load_login($page, $data = NULL, $layout=FALSE)
{
$data['page'] = $page;
if($layout==TRUE){
$this->CI->load->view('html/skin_login_'.$layout, $data);
}else{
$this->CI->load->view('html/skin_login', $data);
}
}
// Get Templates Active
public function get_default_template()
{
$this->CI->db->select('duongdan');
$this->CI->db->where('kichhoat', '1');
$query = $this->CI->db->get('giaodien', 1);
if ($query->num_rows() == 1)
{
$row = $query->row_array();
}
return $row['duongdan'];
}
public function get_default_language()
{
$this->CI->db->select('language');
$this->CI->db->where('is_default', '1');
$query = $this->CI->db->get($this->_table['languages'], 1);
if ($query->num_rows() == 1)
{
$row = $query->row_array();
}
return $row['language'];
}
public function get_site_info()
{
/*
$this->CI->db->select('name, value');
$query = $this->CI->db->get($this->_table['settings']);
if ($query->num_rows() > 0)
{
$result = $query->result_array();
foreach ($result as $row)
{
$this->settings[$row['name']] = $row['value'];
}
}
*/
}
public function check_site_status()
{
/*
$this->CI->db->select('name, value');
$this->CI->db->where('name', 'enabled');
$query = $this->CI->db->get($this->_table['settings'], 1);
if ($query->num_rows() == 1)
{
$result = $query->row_array();
if ($result['value'] == 0)
{
$data['offline_reason'] = $this->settings['offline_reason'];
$this->CI->load->view('admin/layout/pages/offline', $data);
die();
}
}
*/
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/libraries/site.php | PHP | asf20 | 2,897 |
<?php
class Facebook
{
private $CI;
public function __construct()
{
if (!isset($this->CI))
{
$this->CI =& get_instance();
}
}
public static function config(){
########## app ID and app SECRET (Replace with yours) #############
$config['appId'] = '215897145260007'; //Facebook App ID
$config['appSecret'] = '58add3fb7f9b1b226119de7ba4cec1a9'; // Facebook App Secret
$config['return_url'] = 'http://localhost/facebookconnect/'; //path to script folder
$config['fbPermissions'] = 'user_friends,email,public_profile'; // more permissions : https://developers.facebook.com/docs/authentication/permissions/
return $config;
}
public static function checkLogin($sesslogin){
if(!isset($sesslogin)){
return '<a rel="nofollow" class="login-social fblogin-button" onClick="javascript:CallAfterLogin();return false;" href="#" rel="facebook"></a>';
}else{
//echo 'Hi '. $_SESSION['user_name'].'! You are Logged in to facebook, <a href="?logout=1">Log Out</a>.';
return $sesslogin;
}
}
public static function channel(){
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
echo '<script src="//connect.facebook.net/en_US/all.js"></script>';
}
public static function logout(){
session_destroy();
}
public function processFace($content,$parentid){
self::config();
require_once('inc/facebook.php' );
/* Detect HTTP_X_REQUESTED_WITH header sent by all recent browsers that support AJAX requests. */
if ( !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' )
{
//initialize facebook sdk
$facebook = new Facebook(array(
'appId' => $appId,
'secret' => $appSecret,
));
$fbuser = $facebook->getUser();
if ($fbuser) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$me = $facebook->api('/me'); //user
$uid = $facebook->getUser();
}
catch (FacebookApiException $e)
{
//echo error_log($e);
$fbuser = null;
}
}
// redirect user to facebook login page if empty data or fresh login requires
if (!$fbuser){
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$return_url, false));
header('Location: '.$loginUrl);
}
//user details
$fullname = $me['first_name'].' '.$me['last_name'];
$email = $me['email'];
/* connect to mysql using mysqli */
$this->CI->load->model('member_model','member');
$this->CI->load->model('news_model','news');
//Check user id in our database
$UserCount = $this->CI->member->checkLogin($email);
$member_id=$UserCount->memberid;
if($UserCount)
{
//add comment
$this->CI->news->addComment($content,$parentid,$email,$fullname,$member_id);
login_user(true,$me['first_name'].' '.$me['last_name']);
trit('user exist');
}
else
{ // add user from face inte member
$avatar="https://graph.facebook.com/'.$uid.'/picture?type=small";
$this->CI->member->add($email,$fullname,$avatar);
//add comment Note: cho nay chua logic lam
$UserCount = $this->CI->member->checkLogin($email);
$member_id=$UserCount->memberid;
$this->CI->news->addComment($content,$parentid,$email,$fullname,$member_id);
trit('user no exist');
}
}
}
function login_user($loggedin,$user_name)
{
/*
function stores some session variables to imitate user login.
We will use these session variables to keep user logged in, until s/he clicks log-out link.
*/
$_SESSION['logged_in']=$loggedin;
$_SESSION['user_name']=$user_name;
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/Facebook.php | PHP | asf20 | 3,849 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/libraries/index.html | HTML | asf20 | 114 |
<?php
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
?><script src="//connect.facebook.net/en_US/all.js"></script> | 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/channel.php | PHP | asf20 | 256 |
.fblogin-button {
background: url(../img/facebook_signin.png) no-repeat 0 0;
width: 150px;
height: 22px;
display: inline-block;
text-indent: -1000px;
}
.fblogin-button:hover {
background: url(../img/facebook_signin.png) no-repeat 0 -24px;
}
.fblogin-button:active {
background: url(../img/facebook_signin.png) no-repeat 0 -48px;
} | 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/style/buttonstyle.css | CSS | asf20 | 349 |
<?php
session_start();
include_once("config.php"); //Include configuration file.
require_once('inc/facebook.php' ); //include fb sdk
/* Detect HTTP_X_REQUESTED_WITH header sent by all recent browsers that support AJAX requests. */
if ( !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' )
{
//initialize facebook sdk
$facebook = new Facebook(array(
'appId' => $appId,
'secret' => $appSecret,
));
$fbuser = $facebook->getUser();
if ($fbuser) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$me = $facebook->api('/me'); //user
$uid = $facebook->getUser();
}
catch (FacebookApiException $e)
{
//echo error_log($e);
$fbuser = null;
}
}
// redirect user to facebook login page if empty data or fresh login requires
if (!$fbuser){
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$return_url, false));
header('Location: '.$loginUrl);
}
//user details
$fullname = $me['first_name'].' '.$me['last_name'];
$email = $me['email'];
/* connect to mysql using mysqli */
$mysqli = new mysqli($hostname, $db_username, $db_password,$db_name);
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
//Check user id in our database
$UserCount = $mysqli->query("SELECT COUNT(id) as usercount FROM loginface WHERE fbid=$uid")->fetch_object()->usercount;
if($UserCount)
{
//User exist, Show welcome back message
echo 'Ajax Response :<br /><strong>Welcome back '. $me['first_name'] . ' '. $me['last_name'].'!</strong> ( Facebook ID : '.$uid.') [<a href="'.$return_url.'?logout=1">Log Out</a>]';
echo '<img src="https://graph.facebook.com/'.$uid.'/picture?type=small"/>';
//print user facebook data
echo '<pre>';
print_r($me);
echo '</pre>';
//User is now connected, log him in
login_user(true,$me['first_name'].' '.$me['last_name']);
}
else
{
//User is new, Show connected message and store info in our Database
echo 'Ajax Response :<br />Hi '. $me['first_name'] . ' '. $me['last_name'].' ('.$uid.')! <br /> Now that you are logged in to Facebook using jQuery Ajax [<a href="'.$return_url.'?logout=1">Log Out</a>].
<br />the information can be stored in database <br />';
//print user facebook data
echo '<pre>';
print_r($me);
echo '</pre>';
// Insert user into Database.
$mysqli->query("INSERT INTO loginface (fbid, fullname, email) VALUES ($uid, '$fullname','$email')");
}
$mysqli->close();
}
function login_user($loggedin,$user_name)
{
/*
function stores some session variables to imitate user login.
We will use these session variables to keep user logged in, until s/he clicks log-out link.
*/
$_SESSION['logged_in']=$loggedin;
$_SESSION['user_name']=$user_name;
}
?> | 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/process_facebook.php | PHP | asf20 | 2,922 |
<?php
/**
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
if (!function_exists('curl_init')) {
throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Facebook needs the JSON PHP extension.');
}
/**
* Thrown when an API call returns an exception.
*
* @author Naitik Shah <naitik@facebook.com>
*/
class FacebookApiException extends Exception
{
/**
* The result from the API server that represents the exception information.
*
* @var mixed
*/
protected $result;
/**
* Make a new API Exception with the given result.
*
* @param array $result The result from the API server
*/
public function __construct($result) {
$this->result = $result;
$code = 0;
if (isset($result['error_code']) && is_int($result['error_code'])) {
$code = $result['error_code'];
}
if (isset($result['error_description'])) {
// OAuth 2.0 Draft 10 style
$msg = $result['error_description'];
} else if (isset($result['error']) && is_array($result['error'])) {
// OAuth 2.0 Draft 00 style
$msg = $result['error']['message'];
} else if (isset($result['error_msg'])) {
// Rest server style
$msg = $result['error_msg'];
} else {
$msg = 'Unknown Error. Check getResult()';
}
parent::__construct($msg, $code);
}
/**
* Return the associated result object returned by the API server.
*
* @return array The result from the API server
*/
public function getResult() {
return $this->result;
}
/**
* Returns the associated type for the error. This will default to
* 'Exception' when a type is not available.
*
* @return string
*/
public function getType() {
if (isset($this->result['error'])) {
$error = $this->result['error'];
if (is_string($error)) {
// OAuth 2.0 Draft 10 style
return $error;
} else if (is_array($error)) {
// OAuth 2.0 Draft 00 style
if (isset($error['type'])) {
return $error['type'];
}
}
}
return 'Exception';
}
/**
* To make debugging easier.
*
* @return string The string representation of the error
*/
public function __toString() {
$str = $this->getType() . ': ';
if ($this->code != 0) {
$str .= $this->code . ': ';
}
return $str . $this->message;
}
}
/**
* Provides access to the Facebook Platform. This class provides
* a majority of the functionality needed, but the class is abstract
* because it is designed to be sub-classed. The subclass must
* implement the four abstract methods listed at the bottom of
* the file.
*
* @author Naitik Shah <naitik@facebook.com>
*/
abstract class BaseFacebook
{
/**
* Version.
*/
const VERSION = '3.2.3';
/**
* Signed Request Algorithm.
*/
const SIGNED_REQUEST_ALGORITHM = 'HMAC-SHA256';
/**
* Default options for curl.
*
* @var array
*/
public static $CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'facebook-php-3.2',
);
/**
* List of query parameters that get automatically dropped when rebuilding
* the current URL.
*
* @var array
*/
protected static $DROP_QUERY_PARAMS = array(
'code',
'state',
'signed_request',
);
/**
* Maps aliases to Facebook domains.
*
* @var array
*/
public static $DOMAIN_MAP = array(
'api' => 'https://api.facebook.com/',
'api_video' => 'https://api-video.facebook.com/',
'api_read' => 'https://api-read.facebook.com/',
'graph' => 'https://graph.facebook.com/',
'graph_video' => 'https://graph-video.facebook.com/',
'www' => 'https://www.facebook.com/',
);
/**
* The Application ID.
*
* @var string
*/
protected $appId;
/**
* The Application App Secret.
*
* @var string
*/
protected $appSecret;
/**
* The ID of the Facebook user, or 0 if the user is logged out.
*
* @var integer
*/
protected $user;
/**
* The data from the signed_request token.
*
* @var string
*/
protected $signedRequest;
/**
* A CSRF state variable to assist in the defense against CSRF attacks.
*
* @var string
*/
protected $state;
/**
* The OAuth access token received in exchange for a valid authorization
* code. null means the access token has yet to be determined.
*
* @var string
*/
protected $accessToken = null;
/**
* Indicates if the CURL based @ syntax for file uploads is enabled.
*
* @var boolean
*/
protected $fileUploadSupport = false;
/**
* Indicates if we trust HTTP_X_FORWARDED_* headers.
*
* @var boolean
*/
protected $trustForwarded = false;
/**
* Indicates if signed_request is allowed in query parameters.
*
* @var boolean
*/
protected $allowSignedRequest = true;
/**
* Initialize a Facebook Application.
*
* The configuration:
* - appId: the application ID
* - secret: the application secret
* - fileUpload: (optional) boolean indicating if file uploads are enabled
* - allowSignedRequest: (optional) boolean indicating if signed_request is
* allowed in query parameters or POST body. Should be
* false for non-canvas apps. Defaults to true.
*
* @param array $config The application configuration
*/
public function __construct($config) {
$this->setAppId($config['appId']);
$this->setAppSecret($config['secret']);
if (isset($config['fileUpload'])) {
$this->setFileUploadSupport($config['fileUpload']);
}
if (isset($config['trustForwarded']) && $config['trustForwarded']) {
$this->trustForwarded = true;
}
if (isset($config['allowSignedRequest'])
&& !$config['allowSignedRequest']) {
$this->allowSignedRequest = false;
}
$state = $this->getPersistentData('state');
if (!empty($state)) {
$this->state = $state;
}
}
/**
* Set the Application ID.
*
* @param string $appId The Application ID
*
* @return BaseFacebook
*/
public function setAppId($appId) {
$this->appId = $appId;
return $this;
}
/**
* Get the Application ID.
*
* @return string the Application ID
*/
public function getAppId() {
return $this->appId;
}
/**
* Set the App Secret.
*
* @param string $apiSecret The App Secret
*
* @return BaseFacebook
* @deprecated Use setAppSecret instead.
* @see setAppSecret()
*/
public function setApiSecret($apiSecret) {
$this->setAppSecret($apiSecret);
return $this;
}
/**
* Set the App Secret.
*
* @param string $appSecret The App Secret
*
* @return BaseFacebook
*/
public function setAppSecret($appSecret) {
$this->appSecret = $appSecret;
return $this;
}
/**
* Get the App Secret.
*
* @return string the App Secret
*
* @deprecated Use getAppSecret instead.
* @see getAppSecret()
*/
public function getApiSecret() {
return $this->getAppSecret();
}
/**
* Get the App Secret.
*
* @return string the App Secret
*/
public function getAppSecret() {
return $this->appSecret;
}
/**
* Set the file upload support status.
*
* @param boolean $fileUploadSupport The file upload support status.
*
* @return BaseFacebook
*/
public function setFileUploadSupport($fileUploadSupport) {
$this->fileUploadSupport = $fileUploadSupport;
return $this;
}
/**
* Get the file upload support status.
*
* @return boolean true if and only if the server supports file upload.
*/
public function getFileUploadSupport() {
return $this->fileUploadSupport;
}
/**
* Get the file upload support status.
*
* @return boolean true if and only if the server supports file upload.
*
* @deprecated Use getFileUploadSupport instead.
* @see getFileUploadSupport()
*/
public function useFileUploadSupport() {
return $this->getFileUploadSupport();
}
/**
* Sets the access token for api calls. Use this if you get
* your access token by other means and just want the SDK
* to use it.
*
* @param string $access_token an access token.
*
* @return BaseFacebook
*/
public function setAccessToken($access_token) {
$this->accessToken = $access_token;
return $this;
}
/**
* Extend an access token, while removing the short-lived token that might
* have been generated via client-side flow. Thanks to http://bit.ly/b0Pt0H
* for the workaround.
*/
public function setExtendedAccessToken() {
try {
// need to circumvent json_decode by calling _oauthRequest
// directly, since response isn't JSON format.
$access_token_response = $this->_oauthRequest(
$this->getUrl('graph', '/oauth/access_token'),
$params = array(
'client_id' => $this->getAppId(),
'client_secret' => $this->getAppSecret(),
'grant_type' => 'fb_exchange_token',
'fb_exchange_token' => $this->getAccessToken(),
)
);
}
catch (FacebookApiException $e) {
// most likely that user very recently revoked authorization.
// In any event, we don't have an access token, so say so.
return false;
}
if (empty($access_token_response)) {
return false;
}
$response_params = array();
parse_str($access_token_response, $response_params);
if (!isset($response_params['access_token'])) {
return false;
}
$this->destroySession();
$this->setPersistentData(
'access_token', $response_params['access_token']
);
}
/**
* Determines the access token that should be used for API calls.
* The first time this is called, $this->accessToken is set equal
* to either a valid user access token, or it's set to the application
* access token if a valid user access token wasn't available. Subsequent
* calls return whatever the first call returned.
*
* @return string The access token
*/
public function getAccessToken() {
if ($this->accessToken !== null) {
// we've done this already and cached it. Just return.
return $this->accessToken;
}
// first establish access token to be the application
// access token, in case we navigate to the /oauth/access_token
// endpoint, where SOME access token is required.
$this->setAccessToken($this->getApplicationAccessToken());
$user_access_token = $this->getUserAccessToken();
if ($user_access_token) {
$this->setAccessToken($user_access_token);
}
return $this->accessToken;
}
/**
* Determines and returns the user access token, first using
* the signed request if present, and then falling back on
* the authorization code if present. The intent is to
* return a valid user access token, or false if one is determined
* to not be available.
*
* @return string A valid user access token, or false if one
* could not be determined.
*/
protected function getUserAccessToken() {
// first, consider a signed request if it's supplied.
// if there is a signed request, then it alone determines
// the access token.
$signed_request = $this->getSignedRequest();
if ($signed_request) {
// apps.facebook.com hands the access_token in the signed_request
if (array_key_exists('oauth_token', $signed_request)) {
$access_token = $signed_request['oauth_token'];
$this->setPersistentData('access_token', $access_token);
return $access_token;
}
// the JS SDK puts a code in with the redirect_uri of ''
if (array_key_exists('code', $signed_request)) {
$code = $signed_request['code'];
if ($code && $code == $this->getPersistentData('code')) {
// short-circuit if the code we have is the same as the one presented
return $this->getPersistentData('access_token');
}
$access_token = $this->getAccessTokenFromCode($code, '');
if ($access_token) {
$this->setPersistentData('code', $code);
$this->setPersistentData('access_token', $access_token);
return $access_token;
}
}
// signed request states there's no access token, so anything
// stored should be cleared.
$this->clearAllPersistentData();
return false; // respect the signed request's data, even
// if there's an authorization code or something else
}
$code = $this->getCode();
if ($code && $code != $this->getPersistentData('code')) {
$access_token = $this->getAccessTokenFromCode($code);
if ($access_token) {
$this->setPersistentData('code', $code);
$this->setPersistentData('access_token', $access_token);
return $access_token;
}
// code was bogus, so everything based on it should be invalidated.
$this->clearAllPersistentData();
return false;
}
// as a fallback, just return whatever is in the persistent
// store, knowing nothing explicit (signed request, authorization
// code, etc.) was present to shadow it (or we saw a code in $_REQUEST,
// but it's the same as what's in the persistent store)
return $this->getPersistentData('access_token');
}
/**
* Retrieve the signed request, either from a request parameter or,
* if not present, from a cookie.
*
* @return string the signed request, if available, or null otherwise.
*/
public function getSignedRequest() {
if (!$this->signedRequest) {
if ($this->allowSignedRequest && !empty($_REQUEST['signed_request'])) {
$this->signedRequest = $this->parseSignedRequest(
$_REQUEST['signed_request']
);
} else if (!empty($_COOKIE[$this->getSignedRequestCookieName()])) {
$this->signedRequest = $this->parseSignedRequest(
$_COOKIE[$this->getSignedRequestCookieName()]);
}
}
return $this->signedRequest;
}
/**
* Get the UID of the connected user, or 0
* if the Facebook user is not connected.
*
* @return string the UID if available.
*/
public function getUser() {
if ($this->user !== null) {
// we've already determined this and cached the value.
return $this->user;
}
return $this->user = $this->getUserFromAvailableData();
}
/**
* Determines the connected user by first examining any signed
* requests, then considering an authorization code, and then
* falling back to any persistent store storing the user.
*
* @return integer The id of the connected Facebook user,
* or 0 if no such user exists.
*/
protected function getUserFromAvailableData() {
// if a signed request is supplied, then it solely determines
// who the user is.
$signed_request = $this->getSignedRequest();
if ($signed_request) {
if (array_key_exists('user_id', $signed_request)) {
$user = $signed_request['user_id'];
if($user != $this->getPersistentData('user_id')){
$this->clearAllPersistentData();
}
$this->setPersistentData('user_id', $signed_request['user_id']);
return $user;
}
// if the signed request didn't present a user id, then invalidate
// all entries in any persistent store.
$this->clearAllPersistentData();
return 0;
}
$user = $this->getPersistentData('user_id', $default = 0);
$persisted_access_token = $this->getPersistentData('access_token');
// use access_token to fetch user id if we have a user access_token, or if
// the cached access token has changed.
$access_token = $this->getAccessToken();
if ($access_token &&
$access_token != $this->getApplicationAccessToken() &&
!($user && $persisted_access_token == $access_token)) {
$user = $this->getUserFromAccessToken();
if ($user) {
$this->setPersistentData('user_id', $user);
} else {
$this->clearAllPersistentData();
}
}
return $user;
}
/**
* Get a Login URL for use with redirects. By default, full page redirect is
* assumed. If you are using the generated URL with a window.open() call in
* JavaScript, you can pass in display=popup as part of the $params.
*
* The parameters:
* - redirect_uri: the url to go to after a successful login
* - scope: comma separated list of requested extended perms
*
* @param array $params Provide custom parameters
* @return string The URL for the login flow
*/
public function getLoginUrl($params=array()) {
$this->establishCSRFTokenState();
$currentUrl = $this->getCurrentUrl();
// if 'scope' is passed as an array, convert to comma separated list
$scopeParams = isset($params['scope']) ? $params['scope'] : null;
if ($scopeParams && is_array($scopeParams)) {
$params['scope'] = implode(',', $scopeParams);
}
return $this->getUrl(
'www',
'dialog/oauth',
array_merge(
array(
'client_id' => $this->getAppId(),
'redirect_uri' => $currentUrl, // possibly overwritten
'state' => $this->state,
'sdk' => 'php-sdk-'.self::VERSION
),
$params
));
}
/**
* Get a Logout URL suitable for use with redirects.
*
* The parameters:
* - next: the url to go to after a successful logout
*
* @param array $params Provide custom parameters
* @return string The URL for the logout flow
*/
public function getLogoutUrl($params=array()) {
return $this->getUrl(
'www',
'logout.php',
array_merge(array(
'next' => $this->getCurrentUrl(),
'access_token' => $this->getUserAccessToken(),
), $params)
);
}
/**
* Get a login status URL to fetch the status from Facebook.
*
* @param array $params Provide custom parameters
* @return string The URL for the logout flow
*/
public function getLoginStatusUrl($params=array()) {
return $this->getLoginUrl(
array_merge(array(
'response_type' => 'code',
'display' => 'none',
), $params)
);
}
/**
* Make an API call.
*
* @return mixed The decoded response
*/
public function api(/* polymorphic */) {
$args = func_get_args();
if (is_array($args[0])) {
return $this->_restserver($args[0]);
} else {
return call_user_func_array(array($this, '_graph'), $args);
}
}
/**
* Constructs and returns the name of the cookie that
* potentially houses the signed request for the app user.
* The cookie is not set by the BaseFacebook class, but
* it may be set by the JavaScript SDK.
*
* @return string the name of the cookie that would house
* the signed request value.
*/
protected function getSignedRequestCookieName() {
return 'fbsr_'.$this->getAppId();
}
/**
* Constructs and returns the name of the cookie that potentially contain
* metadata. The cookie is not set by the BaseFacebook class, but it may be
* set by the JavaScript SDK.
*
* @return string the name of the cookie that would house metadata.
*/
protected function getMetadataCookieName() {
return 'fbm_'.$this->getAppId();
}
/**
* Get the authorization code from the query parameters, if it exists,
* and otherwise return false to signal no authorization code was
* discoverable.
*
* @return mixed The authorization code, or false if the authorization
* code could not be determined.
*/
protected function getCode() {
if (!isset($_REQUEST['code']) || !isset($_REQUEST['state'])) {
return false;
}
if ($this->state === $_REQUEST['state']) {
// CSRF state has done its job, so clear it
$this->state = null;
$this->clearPersistentData('state');
return $_REQUEST['code'];
}
self::errorLog('CSRF state token does not match one provided.');
return false;
}
/**
* Retrieves the UID with the understanding that
* $this->accessToken has already been set and is
* seemingly legitimate. It relies on Facebook's Graph API
* to retrieve user information and then extract
* the user ID.
*
* @return integer Returns the UID of the Facebook user, or 0
* if the Facebook user could not be determined.
*/
protected function getUserFromAccessToken() {
try {
$user_info = $this->api('/me');
return $user_info['id'];
} catch (FacebookApiException $e) {
return 0;
}
}
/**
* Returns the access token that should be used for logged out
* users when no authorization code is available.
*
* @return string The application access token, useful for gathering
* public information about users and applications.
*/
public function getApplicationAccessToken() {
return $this->appId.'|'.$this->appSecret;
}
/**
* Lays down a CSRF state token for this process.
*
* @return void
*/
protected function establishCSRFTokenState() {
if ($this->state === null) {
$this->state = md5(uniqid(mt_rand(), true));
$this->setPersistentData('state', $this->state);
}
}
/**
* Retrieves an access token for the given authorization code
* (previously generated from www.facebook.com on behalf of
* a specific user). The authorization code is sent to graph.facebook.com
* and a legitimate access token is generated provided the access token
* and the user for which it was generated all match, and the user is
* either logged in to Facebook or has granted an offline access permission.
*
* @param string $code An authorization code.
* @param string $redirect_uri Optional redirect URI. Default null
*
* @return mixed An access token exchanged for the authorization code, or
* false if an access token could not be generated.
*/
protected function getAccessTokenFromCode($code, $redirect_uri = null) {
if (empty($code)) {
return false;
}
if ($redirect_uri === null) {
$redirect_uri = $this->getCurrentUrl();
}
try {
// need to circumvent json_decode by calling _oauthRequest
// directly, since response isn't JSON format.
$access_token_response =
$this->_oauthRequest(
$this->getUrl('graph', '/oauth/access_token'),
$params = array('client_id' => $this->getAppId(),
'client_secret' => $this->getAppSecret(),
'redirect_uri' => $redirect_uri,
'code' => $code));
} catch (FacebookApiException $e) {
// most likely that user very recently revoked authorization.
// In any event, we don't have an access token, so say so.
return false;
}
if (empty($access_token_response)) {
return false;
}
$response_params = array();
parse_str($access_token_response, $response_params);
if (!isset($response_params['access_token'])) {
return false;
}
return $response_params['access_token'];
}
/**
* Invoke the old restserver.php endpoint.
*
* @param array $params Method call object
*
* @return mixed The decoded response object
* @throws FacebookApiException
*/
protected function _restserver($params) {
// generic application level parameters
$params['api_key'] = $this->getAppId();
$params['format'] = 'json-strings';
$result = json_decode($this->_oauthRequest(
$this->getApiUrl($params['method']),
$params
), true);
// results are returned, errors are thrown
if (is_array($result) && isset($result['error_code'])) {
$this->throwAPIException($result);
// @codeCoverageIgnoreStart
}
// @codeCoverageIgnoreEnd
$method = strtolower($params['method']);
if ($method === 'auth.expiresession' ||
$method === 'auth.revokeauthorization') {
$this->destroySession();
}
return $result;
}
/**
* Return true if this is video post.
*
* @param string $path The path
* @param string $method The http method (default 'GET')
*
* @return boolean true if this is video post
*/
protected function isVideoPost($path, $method = 'GET') {
if ($method == 'POST' && preg_match("/^(\/)(.+)(\/)(videos)$/", $path)) {
return true;
}
return false;
}
/**
* Invoke the Graph API.
*
* @param string $path The path (required)
* @param string $method The http method (default 'GET')
* @param array $params The query/post data
*
* @return mixed The decoded response object
* @throws FacebookApiException
*/
protected function _graph($path, $method = 'GET', $params = array()) {
if (is_array($method) && empty($params)) {
$params = $method;
$method = 'GET';
}
$params['method'] = $method; // method override as we always do a POST
if ($this->isVideoPost($path, $method)) {
$domainKey = 'graph_video';
} else {
$domainKey = 'graph';
}
$result = json_decode($this->_oauthRequest(
$this->getUrl($domainKey, $path),
$params
), true);
// results are returned, errors are thrown
if (is_array($result) && isset($result['error'])) {
$this->throwAPIException($result);
// @codeCoverageIgnoreStart
}
// @codeCoverageIgnoreEnd
return $result;
}
/**
* Make a OAuth Request.
*
* @param string $url The path (required)
* @param array $params The query/post data
*
* @return string The decoded response object
* @throws FacebookApiException
*/
protected function _oauthRequest($url, $params) {
if (!isset($params['access_token'])) {
$params['access_token'] = $this->getAccessToken();
}
if (isset($params['access_token']) && !isset($params['appsecret_proof'])) {
$params['appsecret_proof'] = $this->getAppSecretProof($params['access_token']);
}
// json_encode all params values that are not strings
foreach ($params as $key => $value) {
if (!is_string($value) && !($value instanceof CURLFile)) {
$params[$key] = json_encode($value);
}
}
return $this->makeRequest($url, $params);
}
/**
* Generate a proof of App Secret
* This is required for all API calls originating from a server
* It is a sha256 hash of the access_token made using the app secret
*
* @param string $access_token The access_token to be hashed (required)
*
* @return string The sha256 hash of the access_token
*/
protected function getAppSecretProof($access_token) {
return hash_hmac('sha256', $access_token, $this->getAppSecret());
}
/**
* Makes an HTTP request. This method can be overridden by subclasses if
* developers want to do fancier things or use something other than curl to
* make the request.
*
* @param string $url The URL to make the request to
* @param array $params The parameters to use for the POST body
* @param CurlHandler $ch Initialized curl handle
*
* @return string The response text
*/
protected function makeRequest($url, $params, $ch=null) {
if (!$ch) {
$ch = curl_init();
}
$opts = self::$CURL_OPTS;
if ($this->getFileUploadSupport()) {
$opts[CURLOPT_POSTFIELDS] = $params;
} else {
$opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
}
$opts[CURLOPT_URL] = $url;
// disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
// for 2 seconds if the server does not support this header.
if (isset($opts[CURLOPT_HTTPHEADER])) {
$existing_headers = $opts[CURLOPT_HTTPHEADER];
$existing_headers[] = 'Expect:';
$opts[CURLOPT_HTTPHEADER] = $existing_headers;
} else {
$opts[CURLOPT_HTTPHEADER] = array('Expect:');
}
curl_setopt_array($ch, $opts);
$result = curl_exec($ch);
$errno = curl_errno($ch);
// CURLE_SSL_CACERT || CURLE_SSL_CACERT_BADFILE
if ($errno == 60 || $errno == 77) {
self::errorLog('Invalid or no certificate authority found, '.
'using bundled information');
curl_setopt($ch, CURLOPT_CAINFO,
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'fb_ca_chain_bundle.crt');
$result = curl_exec($ch);
}
// With dual stacked DNS responses, it's possible for a server to
// have IPv6 enabled but not have IPv6 connectivity. If this is
// the case, curl will try IPv4 first and if that fails, then it will
// fall back to IPv6 and the error EHOSTUNREACH is returned by the
// operating system.
if ($result === false && empty($opts[CURLOPT_IPRESOLVE])) {
$matches = array();
$regex = '/Failed to connect to ([^:].*): Network is unreachable/';
if (preg_match($regex, curl_error($ch), $matches)) {
if (strlen(@inet_pton($matches[1])) === 16) {
self::errorLog('Invalid IPv6 configuration on server, '.
'Please disable or get native IPv6 on your server.');
self::$CURL_OPTS[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
$result = curl_exec($ch);
}
}
}
if ($result === false) {
$e = new FacebookApiException(array(
'error_code' => curl_errno($ch),
'error' => array(
'message' => curl_error($ch),
'type' => 'CurlException',
),
));
curl_close($ch);
throw $e;
}
curl_close($ch);
return $result;
}
/**
* Parses a signed_request and validates the signature.
*
* @param string $signed_request A signed token
*
* @return array The payload inside it or null if the sig is wrong
*/
protected function parseSignedRequest($signed_request) {
if (!$signed_request || strpos($signed_request, '.') === false) {
self::errorLog('Signed request was invalid!');
return null;
}
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
// decode the data
$sig = self::base64UrlDecode($encoded_sig);
$data = json_decode(self::base64UrlDecode($payload), true);
if (!isset($data['algorithm'])
|| strtoupper($data['algorithm']) !== self::SIGNED_REQUEST_ALGORITHM
) {
self::errorLog(
'Unknown algorithm. Expected ' . self::SIGNED_REQUEST_ALGORITHM);
return null;
}
// check sig
$expected_sig = hash_hmac('sha256', $payload,
$this->getAppSecret(), $raw = true);
if (strlen($expected_sig) !== strlen($sig)) {
self::errorLog('Bad Signed JSON signature!');
return null;
}
$result = 0;
for ($i = 0; $i < strlen($expected_sig); $i++) {
$result |= ord($expected_sig[$i]) ^ ord($sig[$i]);
}
if ($result == 0) {
return $data;
} else {
self::errorLog('Bad Signed JSON signature!');
return null;
}
}
/**
* Makes a signed_request blob using the given data.
*
* @param array $data The data array.
*
* @return string The signed request.
*/
protected function makeSignedRequest($data) {
if (!is_array($data)) {
throw new InvalidArgumentException(
'makeSignedRequest expects an array. Got: ' . print_r($data, true));
}
$data['algorithm'] = self::SIGNED_REQUEST_ALGORITHM;
$data['issued_at'] = time();
$json = json_encode($data);
$b64 = self::base64UrlEncode($json);
$raw_sig = hash_hmac('sha256', $b64, $this->getAppSecret(), $raw = true);
$sig = self::base64UrlEncode($raw_sig);
return $sig.'.'.$b64;
}
/**
* Build the URL for api given parameters.
*
* @param string $method The method name.
*
* @return string The URL for the given parameters
*/
protected function getApiUrl($method) {
static $READ_ONLY_CALLS =
array('admin.getallocation' => 1,
'admin.getappproperties' => 1,
'admin.getbannedusers' => 1,
'admin.getlivestreamvialink' => 1,
'admin.getmetrics' => 1,
'admin.getrestrictioninfo' => 1,
'application.getpublicinfo' => 1,
'auth.getapppublickey' => 1,
'auth.getsession' => 1,
'auth.getsignedpublicsessiondata' => 1,
'comments.get' => 1,
'connect.getunconnectedfriendscount' => 1,
'dashboard.getactivity' => 1,
'dashboard.getcount' => 1,
'dashboard.getglobalnews' => 1,
'dashboard.getnews' => 1,
'dashboard.multigetcount' => 1,
'dashboard.multigetnews' => 1,
'data.getcookies' => 1,
'events.get' => 1,
'events.getmembers' => 1,
'fbml.getcustomtags' => 1,
'feed.getappfriendstories' => 1,
'feed.getregisteredtemplatebundlebyid' => 1,
'feed.getregisteredtemplatebundles' => 1,
'fql.multiquery' => 1,
'fql.query' => 1,
'friends.arefriends' => 1,
'friends.get' => 1,
'friends.getappusers' => 1,
'friends.getlists' => 1,
'friends.getmutualfriends' => 1,
'gifts.get' => 1,
'groups.get' => 1,
'groups.getmembers' => 1,
'intl.gettranslations' => 1,
'links.get' => 1,
'notes.get' => 1,
'notifications.get' => 1,
'pages.getinfo' => 1,
'pages.isadmin' => 1,
'pages.isappadded' => 1,
'pages.isfan' => 1,
'permissions.checkavailableapiaccess' => 1,
'permissions.checkgrantedapiaccess' => 1,
'photos.get' => 1,
'photos.getalbums' => 1,
'photos.gettags' => 1,
'profile.getinfo' => 1,
'profile.getinfooptions' => 1,
'stream.get' => 1,
'stream.getcomments' => 1,
'stream.getfilters' => 1,
'users.getinfo' => 1,
'users.getloggedinuser' => 1,
'users.getstandardinfo' => 1,
'users.hasapppermission' => 1,
'users.isappuser' => 1,
'users.isverified' => 1,
'video.getuploadlimits' => 1);
$name = 'api';
if (isset($READ_ONLY_CALLS[strtolower($method)])) {
$name = 'api_read';
} else if (strtolower($method) == 'video.upload') {
$name = 'api_video';
}
return self::getUrl($name, 'restserver.php');
}
/**
* Build the URL for given domain alias, path and parameters.
*
* @param string $name The name of the domain
* @param string $path Optional path (without a leading slash)
* @param array $params Optional query parameters
*
* @return string The URL for the given parameters
*/
protected function getUrl($name, $path='', $params=array()) {
$url = self::$DOMAIN_MAP[$name];
if ($path) {
if ($path[0] === '/') {
$path = substr($path, 1);
}
$url .= $path;
}
if ($params) {
$url .= '?' . http_build_query($params, null, '&');
}
return $url;
}
/**
* Returns the HTTP Host
*
* @return string The HTTP Host
*/
protected function getHttpHost() {
if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$forwardProxies = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
if (!empty($forwardProxies)) {
return $forwardProxies[0];
}
}
return $_SERVER['HTTP_HOST'];
}
/**
* Returns the HTTP Protocol
*
* @return string The HTTP Protocol
*/
protected function getHttpProtocol() {
if ($this->trustForwarded && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
return 'https';
}
return 'http';
}
/*apache + variants specific way of checking for https*/
if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1)) {
return 'https';
}
/*nginx way of checking for https*/
if (isset($_SERVER['SERVER_PORT']) &&
($_SERVER['SERVER_PORT'] === '443')) {
return 'https';
}
return 'http';
}
/**
* Returns the base domain used for the cookie.
*
* @return string The base domain
*/
protected function getBaseDomain() {
// The base domain is stored in the metadata cookie if not we fallback
// to the current hostname
$metadata = $this->getMetadataCookie();
if (array_key_exists('base_domain', $metadata) &&
!empty($metadata['base_domain'])) {
return trim($metadata['base_domain'], '.');
}
return $this->getHttpHost();
}
/**
* Returns the Current URL, stripping it of known FB parameters that should
* not persist.
*
* @return string The current URL
*/
protected function getCurrentUrl() {
$protocol = $this->getHttpProtocol() . '://';
$host = $this->getHttpHost();
$currentUrl = $protocol.$host.$_SERVER['REQUEST_URI'];
$parts = parse_url($currentUrl);
$query = '';
if (!empty($parts['query'])) {
// drop known fb params
$params = explode('&', $parts['query']);
$retained_params = array();
foreach ($params as $param) {
if ($this->shouldRetainParam($param)) {
$retained_params[] = $param;
}
}
if (!empty($retained_params)) {
$query = '?'.implode($retained_params, '&');
}
}
// use port if non default
$port =
isset($parts['port']) &&
(($protocol === 'http://' && $parts['port'] !== 80) ||
($protocol === 'https://' && $parts['port'] !== 443))
? ':' . $parts['port'] : '';
// rebuild
return $protocol . $parts['host'] . $port . $parts['path'] . $query;
}
/**
* Returns true if and only if the key or key/value pair should
* be retained as part of the query string. This amounts to
* a brute-force search of the very small list of Facebook-specific
* params that should be stripped out.
*
* @param string $param A key or key/value pair within a URL's query (e.g.
* 'foo=a', 'foo=', or 'foo'.
*
* @return boolean
*/
protected function shouldRetainParam($param) {
foreach (self::$DROP_QUERY_PARAMS as $drop_query_param) {
if ($param === $drop_query_param ||
strpos($param, $drop_query_param.'=') === 0) {
return false;
}
}
return true;
}
/**
* Analyzes the supplied result to see if it was thrown
* because the access token is no longer valid. If that is
* the case, then we destroy the session.
*
* @param array $result A record storing the error message returned
* by a failed API call.
*/
protected function throwAPIException($result) {
$e = new FacebookApiException($result);
switch ($e->getType()) {
// OAuth 2.0 Draft 00 style
case 'OAuthException':
// OAuth 2.0 Draft 10 style
case 'invalid_token':
// REST server errors are just Exceptions
case 'Exception':
$message = $e->getMessage();
if ((strpos($message, 'Error validating access token') !== false) ||
(strpos($message, 'Invalid OAuth access token') !== false) ||
(strpos($message, 'An active access token must be used') !== false)
) {
$this->destroySession();
}
break;
}
throw $e;
}
/**
* Prints to the error log if you aren't in command line mode.
*
* @param string $msg Log message
*/
protected static function errorLog($msg) {
// disable error log if we are running in a CLI environment
// @codeCoverageIgnoreStart
if (php_sapi_name() != 'cli') {
error_log($msg);
}
// uncomment this if you want to see the errors on the page
// print 'error_log: '.$msg."\n";
// @codeCoverageIgnoreEnd
}
/**
* Base64 encoding that doesn't need to be urlencode()ed.
* Exactly the same as base64_encode except it uses
* - instead of +
* _ instead of /
* No padded =
*
* @param string $input base64UrlEncoded input
*
* @return string The decoded string
*/
protected static function base64UrlDecode($input) {
return base64_decode(strtr($input, '-_', '+/'));
}
/**
* Base64 encoding that doesn't need to be urlencode()ed.
* Exactly the same as base64_encode except it uses
* - instead of +
* _ instead of /
*
* @param string $input The input to encode
* @return string The base64Url encoded input, as a string.
*/
protected static function base64UrlEncode($input) {
$str = strtr(base64_encode($input), '+/', '-_');
$str = str_replace('=', '', $str);
return $str;
}
/**
* Destroy the current session
*/
public function destroySession() {
$this->accessToken = null;
$this->signedRequest = null;
$this->user = null;
$this->clearAllPersistentData();
// Javascript sets a cookie that will be used in getSignedRequest that we
// need to clear if we can
$cookie_name = $this->getSignedRequestCookieName();
if (array_key_exists($cookie_name, $_COOKIE)) {
unset($_COOKIE[$cookie_name]);
if (!headers_sent()) {
$base_domain = $this->getBaseDomain();
setcookie($cookie_name, '', 1, '/', '.'.$base_domain);
} else {
// @codeCoverageIgnoreStart
self::errorLog(
'There exists a cookie that we wanted to clear that we couldn\'t '.
'clear because headers was already sent. Make sure to do the first '.
'API call before outputing anything.'
);
// @codeCoverageIgnoreEnd
}
}
}
/**
* Parses the metadata cookie that our Javascript API set
*
* @return array an array mapping key to value
*/
protected function getMetadataCookie() {
$cookie_name = $this->getMetadataCookieName();
if (!array_key_exists($cookie_name, $_COOKIE)) {
return array();
}
// The cookie value can be wrapped in "-characters so remove them
$cookie_value = trim($_COOKIE[$cookie_name], '"');
if (empty($cookie_value)) {
return array();
}
$parts = explode('&', $cookie_value);
$metadata = array();
foreach ($parts as $part) {
$pair = explode('=', $part, 2);
if (!empty($pair[0])) {
$metadata[urldecode($pair[0])] =
(count($pair) > 1) ? urldecode($pair[1]) : '';
}
}
return $metadata;
}
/**
* Finds whether the given domain is allowed or not
*
* @param string $big The value to be checked against $small
* @param string $small The input string
*
* @return boolean Returns TRUE if $big matches $small
*/
protected static function isAllowedDomain($big, $small) {
if ($big === $small) {
return true;
}
return self::endsWith($big, '.'.$small);
}
/**
* Checks if $big string ends with $small string
*
* @param string $big The value to be checked against $small
* @param string $small The input string
*
* @return boolean TRUE if $big ends with $small
*/
protected static function endsWith($big, $small) {
$len = strlen($small);
if ($len === 0) {
return true;
}
return substr($big, -$len) === $small;
}
/**
* Each of the following four methods should be overridden in
* a concrete subclass, as they are in the provided Facebook class.
* The Facebook class uses PHP sessions to provide a primitive
* persistent store, but another subclass--one that you implement--
* might use a database, memcache, or an in-memory cache.
*
* @see Facebook
*/
/**
* Stores the given ($key, $value) pair, so that future calls to
* getPersistentData($key) return $value. This call may be in another request.
*
* @param string $key
* @param array $value
*
* @return void
*/
abstract protected function setPersistentData($key, $value);
/**
* Get the data for $key, persisted by BaseFacebook::setPersistentData()
*
* @param string $key The key of the data to retrieve
* @param boolean $default The default value to return if $key is not found
*
* @return mixed
*/
abstract protected function getPersistentData($key, $default = false);
/**
* Clear the data with $key from the persistent storage
*
* @param string $key
*
* @return void
*/
abstract protected function clearPersistentData($key);
/**
* Clear all data from the persistent storage
*
* @return void
*/
abstract protected function clearAllPersistentData();
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/inc/base_facebook.php | PHP | asf20 | 45,446 |
<?php
/**
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
require_once "base_facebook.php";
/**
* Extends the BaseFacebook class with the intent of using
* PHP sessions to store user ids and access tokens.
*/
class Facebook extends BaseFacebook
{
/**
* Cookie prefix
*/
const FBSS_COOKIE_NAME = 'fbss';
/**
* We can set this to a high number because the main session
* expiration will trump this.
*/
const FBSS_COOKIE_EXPIRE = 31556926; // 1 year
/**
* Stores the shared session ID if one is set.
*
* @var string
*/
protected $sharedSessionID;
/**
* Identical to the parent constructor, except that
* we start a PHP session to store the user ID and
* access token if during the course of execution
* we discover them.
*
* @param array $config the application configuration. Additionally
* accepts "sharedSession" as a boolean to turn on a secondary
* cookie for environments with a shared session (that is, your app
* shares the domain with other apps).
*
* @see BaseFacebook::__construct
*/
public function __construct($config) {
if ((function_exists('session_status')
&& session_status() !== PHP_SESSION_ACTIVE) || !session_id()) {
session_start();
}
parent::__construct($config);
if (!empty($config['sharedSession'])) {
$this->initSharedSession();
// re-load the persisted state, since parent
// attempted to read out of non-shared cookie
$state = $this->getPersistentData('state');
if (!empty($state)) {
$this->state = $state;
} else {
$this->state = null;
}
}
}
/**
* Supported keys for persistent data
*
* @var array
*/
protected static $kSupportedKeys =
array('state', 'code', 'access_token', 'user_id');
/**
* Initiates Shared Session
*/
protected function initSharedSession() {
$cookie_name = $this->getSharedSessionCookieName();
if (isset($_COOKIE[$cookie_name])) {
$data = $this->parseSignedRequest($_COOKIE[$cookie_name]);
if ($data && !empty($data['domain']) &&
self::isAllowedDomain($this->getHttpHost(), $data['domain'])) {
// good case
$this->sharedSessionID = $data['id'];
return;
}
// ignoring potentially unreachable data
}
// evil/corrupt/missing case
$base_domain = $this->getBaseDomain();
$this->sharedSessionID = md5(uniqid(mt_rand(), true));
$cookie_value = $this->makeSignedRequest(
array(
'domain' => $base_domain,
'id' => $this->sharedSessionID,
)
);
$_COOKIE[$cookie_name] = $cookie_value;
if (!headers_sent()) {
$expire = time() + self::FBSS_COOKIE_EXPIRE;
setcookie($cookie_name, $cookie_value, $expire, '/', '.'.$base_domain);
} else {
// @codeCoverageIgnoreStart
self::errorLog(
'Shared session ID cookie could not be set! You must ensure you '.
'create the Facebook instance before headers have been sent. This '.
'will cause authentication issues after the first request.'
);
// @codeCoverageIgnoreEnd
}
}
/**
* Provides the implementations of the inherited abstract
* methods. The implementation uses PHP sessions to maintain
* a store for authorization codes, user ids, CSRF states, and
* access tokens.
*/
/**
* {@inheritdoc}
*
* @see BaseFacebook::setPersistentData()
*/
protected function setPersistentData($key, $value) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to setPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key);
$_SESSION[$session_var_name] = $value;
}
/**
* {@inheritdoc}
*
* @see BaseFacebook::getPersistentData()
*/
protected function getPersistentData($key, $default = false) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to getPersistentData.');
return $default;
}
$session_var_name = $this->constructSessionVariableName($key);
return isset($_SESSION[$session_var_name]) ?
$_SESSION[$session_var_name] : $default;
}
/**
* {@inheritdoc}
*
* @see BaseFacebook::clearPersistentData()
*/
protected function clearPersistentData($key) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to clearPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key);
if (isset($_SESSION[$session_var_name])) {
unset($_SESSION[$session_var_name]);
}
}
/**
* {@inheritdoc}
*
* @see BaseFacebook::clearAllPersistentData()
*/
protected function clearAllPersistentData() {
foreach (self::$kSupportedKeys as $key) {
$this->clearPersistentData($key);
}
if ($this->sharedSessionID) {
$this->deleteSharedSessionCookie();
}
}
/**
* Deletes Shared session cookie
*/
protected function deleteSharedSessionCookie() {
$cookie_name = $this->getSharedSessionCookieName();
unset($_COOKIE[$cookie_name]);
$base_domain = $this->getBaseDomain();
setcookie($cookie_name, '', 1, '/', '.'.$base_domain);
}
/**
* Returns the Shared session cookie name
*
* @return string The Shared session cookie name
*/
protected function getSharedSessionCookieName() {
return self::FBSS_COOKIE_NAME . '_' . $this->getAppId();
}
/**
* Constructs and returns the name of the session key.
*
* @see setPersistentData()
* @param string $key The key for which the session variable name to construct.
*
* @return string The name of the session key.
*/
protected function constructSessionVariableName($key) {
$parts = array('fb', $this->getAppId(), $key);
if ($this->sharedSessionID) {
array_unshift($parts, $this->sharedSessionID);
}
return implode('_', $parts);
}
}
| 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/inc/facebook.php | PHP | asf20 | 6,534 |
<?php
########## app ID and app SECRET (Replace with yours) #############
$appId = '215897145260007'; //Facebook App ID
$appSecret = '58add3fb7f9b1b226119de7ba4cec1a9'; // Facebook App Secret
$return_url = 'http://localhost/facebookconnect/'; //path to script folder
$fbPermissions = 'user_friends,email,public_profile'; // more permissions : https://developers.facebook.com/docs/authentication/permissions/
########## MySql details (Replace with yours) #############
$db_username = "root"; //Database Username
$db_password = ""; //Database Password
$hostname = "localhost"; //Mysql Hostname
$db_name = 'demo'; //Database Name
###################################################################
?> | 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/config.php | PHP | asf20 | 714 |
<?php
session_start();
include_once("config.php");
if(isset($_GET["logout"]) && $_GET["logout"]==1)
{
//User clicked logout button, distroy all session variables.
session_destroy();
header('Location: '.$return_url);
}
?>
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en-gb" lang="en-gb" >
<head>
<!-- load jQuery from google repository -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<title>Ajax Facebook Connect With jQuery</title>
<link href="style/buttonstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
if(!isset($_SESSION['logged_in']))
{
echo '<div id="results">';
echo '<!-- results will be placed here -->';
echo '</div>';
echo '<div id="LoginButton">';
echo '<a href="#" rel="nofollow" class="fblogin-button" onClick="javascript:CallAfterLogin();return false;">Login with Facebook</a>';
echo '</div>';
}
else
{
echo 'Hi '. $_SESSION['user_name'].'! You are Logged in to facebook, <a href="?logout=1">Log Out</a>.';
}
?>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId: '<?php echo $appId; ?>',
cookie: true,xfbml: true,
channelUrl: '<?php echo $return_url; ?>channel.php',
oauth: true
});
};
(function() {
var e = document.createElement('script');
e.async = true;e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);}());
function CallAfterLogin(){
FB.login(function(response) {
if (response.status === "connected")
{
LodingAnimate(); //Animate login
FB.api('/me', function(data) {
if(data.email == null)
{
//Facbeook user email is empty, you can check something like this.
alert("You must allow us to access your email id!");
ResetAnimate();
}else{
AjaxResponse();
}
});
}
},
{scope:'<?php echo $fbPermissions; ?>'});
}
//functions
function AjaxResponse()
{
//Load data from the server and place the returned HTML into the matched element using jQuery Load().
$( "#results" ).load( "process_facebook.php" );
}
//Show loading Image
function LodingAnimate()
{
$("#LoginButton").hide(); //hide login button once user authorize the application
$("#results").html('<img src="img/ajax-loader.gif" /> Please Wait Connecting...'); //show loading image while we process user
}
//Reset User button
function ResetAnimate()
{
$("#LoginButton").show(); //Show login button
$("#results").html(''); //reset element html
}
</script>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/libraries/libface/index.php | PHP | asf20 | 2,726 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/hooks/index.html | HTML | asf20 | 114 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class welcome_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function get_all($num=20, $start=0)
{
$this->db->where('bl_active',1) ;
$query = $this->db->get('welcome', $num, $start) ;
return $query->result() ;
}
function count_all()
{
$this->db->where('bl_active',1) ;
$query = $this->db->get('welcome') ;
return $query->num_rows() ;
}
function get_id($id)
{
$this->db->where('id',$id) ;
$this->db->where('bl_active',1) ;
$query = $this->db->get('welcome', $num, $start) ;
return $query->row() ;
}
function save($table, $req, $wh='', $value=0)
{
if(!empty($value))
{
$this->db->where($wh, $value) ;
return $this->db->update($table, $req) ;
}
else
{
$this->db->insert($table, $req) ;
return $this->db->insert_id() ;
}
}
public function get_id($table, $id=0, $wh='' )
{
if(!empty($id)) $this->db->where($wh, $id) ;
$this->db->where('bl_active',1) ;
$query = $this->db->get($table) ;
return $query->row() ;
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/models/welcome_model.php | PHP | asf20 | 1,163 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/models/index.html | HTML | asf20 | 114 |
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class home_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
public function hotnews()
{
$this->db->where('bl_active', 1);
$this->db->where('is_home', 1);
$this->db->where('is_hot', 1);
$this->db->order_by('dt_create','asc');
$query = $this->db->get('news', 12, 0) ;
return $query->result() ;
}
//******************** Category ***************
/*public function category($catid=0)
{
$this->db->select('news.*, news_category.name_block');
if($catid) $this->db->where('news.cat_id', $catid);
$this->db->where('news.bl_active', 1);
$this->db->where('is_home', 1);
$this->db->order_by('dt_create','desc');
$this->db->join('news_category','news_category.cat_id=news.cat_id');
$query = $this->db->get('news', 3, 0) ;
return $query->result() ;
}*/
//get list hot category
public function category($catid=0,$num=7,$offset=0)
{
$arr_cat = $this->get_sub_category($catid) ; //trit($arr_cat);
$this->db->select('news.*,news_category.cat_name, name_block');
$this->db->where_in('news.cat_id', $arr_cat);
$this->db->where('news.bl_active', 1);
$this->db->where('is_home', 1);
$this->db->where('news.is_hot', 1);
$this->db->order_by('news.dt_create','desc');
$this->db->join('news_category','news_category.cat_id=news.cat_id');
$query = $this->db->get('news', $num,$offset) ;
return $query->result() ;
}
//get_sub category
private function get_sub_category($catid=0)
{
$this->db->select('news_category.cat_id');
$this->db->where('parent_id', $catid);
$this->db->where('bl_active', 1);
$this->db->order_by('nb_order','desc');
$query = $this->db->get('news_category') ;
$result = $query->result() ;
$arr = array($catid) ;
foreach ($result as $rs) :
array_push($arr, $rs->cat_id) ;
endforeach ;
return $arr ;
}
//***********************************
public function hoidonghuong_category($parentid=0){
$this->db->where('bl_active',1);
$query=$this->db->get('hoidonghuong_category');
return $query->result();
}
public function get_list_doanhnghiep_cat(){
$this->db->where('bl_active',1);
$this->db->order_by('nb_order','asc');
return $this->db->get('doanhnghiep_category')->result();
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/models/home_model.php | PHP | asf20 | 2,369 |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/* load the MX_Router class */
require APPPATH."third_party/MX/Router.php";
class MY_Router extends MX_Router {} | 123gosaigon | trunk/ 123gosaigon/site/core/MY_Router.php | PHP | asf20 | 191 |
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";
class MY_Loader extends MX_Loader {} | 123gosaigon | trunk/ 123gosaigon/site/core/MY_Loader.php | PHP | asf20 | 191 |
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html> | 123gosaigon | trunk/ 123gosaigon/site/core/index.html | HTML | asf20 | 114 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class home extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
//$this->load->model('home_model','home');
//$this->load->model('news_model','news');
}
public function index()
{
$data['title'] = "Tin tổng hợp" ;
$data['page'] = 'home/index' ;
$this->load->view('layout/skin', $data);
//$this->load->view('home/index');
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/controllers/home.php | PHP | asf20 | 500 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class sanpham extends CI_Controller
{
protected $_templates;
function __construct()
{
parent::__construct();
//$this->load->model('home_model','home');
//$this->load->model('news_model','news');
}
public function index()
{
$data['title'] = "Tin tổng hợp" ;
$data['page'] = 'sanpham/index' ;
$this->load->view('layout/skin', $data);
//$this->load->view('home/index');
}
}
?> | 123gosaigon | trunk/ 123gosaigon/site/controllers/sanpham.php | PHP | asf20 | 506 |