code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 4 991 | language stringclasses 9 values | license stringclasses 15 values | size int32 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/python
import gpod
import sys
if len(sys.argv) > 1:
db = gpod.Database(sys.argv[1])
else:
db = gpod.Database()
print db
for track in db[4:20]:
print track
print track['title']
for pl in db.Playlists:
print pl
for track in pl:
print " ", track
| neuschaefer/libgpod | bindings/python/examples/play_with_ipod_api.py | Python | lgpl-2.1 | 292 |
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "navigatorview.h"
#include "navigatortreemodel.h"
#include "navigatorwidget.h"
#include <coreplugin/editormanager/editormanager.h>
#include <nodeproperty.h>
#include <nodelistproperty.h>
#include <QHeaderView>
namespace QmlDesigner {
NavigatorView::NavigatorView(QObject* parent) :
AbstractView(parent),
m_blockSelectionChangedSignal(false),
m_widget(new NavigatorWidget),
m_treeModel(new NavigatorTreeModel(this))
{
m_widget->setTreeModel(m_treeModel.data());
connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));
connect(treeWidget(), SIGNAL(doubleClicked(QModelIndex)), this, SLOT(changeToComponent(QModelIndex)));
treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);
NameItemDelegate *idDelegate = new NameItemDelegate(this,m_treeModel.data());
IconCheckboxItemDelegate *showDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/eye_open.png",
":/qmldesigner/images/placeholder.png",m_treeModel.data());
#ifdef _LOCK_ITEMS_
IconCheckboxItemDelegate *lockDelegate = new IconCheckboxItemDelegate(this,":/qmldesigner/images/lock.png",
":/qmldesigner/images/hole.png",m_treeModel.data());
#endif
treeWidget()->setItemDelegateForColumn(0,idDelegate);
#ifdef _LOCK_ITEMS_
treeWidget()->setItemDelegateForColumn(1,lockDelegate);
treeWidget()->setItemDelegateForColumn(2,showDelegate);
#else
treeWidget()->setItemDelegateForColumn(1,showDelegate);
#endif
}
NavigatorView::~NavigatorView()
{
if (m_widget && !m_widget->parent())
delete m_widget.data();
}
QWidget *NavigatorView::widget()
{
return m_widget.data();
}
void NavigatorView::modelAttached(Model *model)
{
AbstractView::modelAttached(model);
m_treeModel->setView(this);
QTreeView *treeView = treeWidget();
treeView->expandAll();
treeView->header()->setResizeMode(0, QHeaderView::Stretch);
treeView->header()->resizeSection(1,26);
treeView->setRootIsDecorated(false);
treeView->setIndentation(20);
#ifdef _LOCK_ITEMS_
treeView->header()->resizeSection(2,20);
#endif
}
void NavigatorView::modelAboutToBeDetached(Model *model)
{
m_treeModel->clearView();
AbstractView::modelAboutToBeDetached(model);
}
void NavigatorView::importsChanged(const QList<Import> &/*addedImports*/, const QList<Import> &/*removedImports*/)
{
treeWidget()->update();
}
void NavigatorView::nodeCreated(const ModelNode & /*createdNode*/)
{
}
void NavigatorView::nodeRemoved(const ModelNode & /*removedNode*/, const NodeAbstractProperty & /*parentProperty*/, PropertyChangeFlags /*propertyChange*/)
{
}
void NavigatorView::propertiesRemoved(const QList<AbstractProperty> & /*propertyList*/)
{
}
void NavigatorView::variantPropertiesChanged(const QList<VariantProperty> & /*propertyList*/, PropertyChangeFlags /*propertyChange*/)
{
}
void NavigatorView::bindingPropertiesChanged(const QList<BindingProperty> & /*propertyList*/, PropertyChangeFlags /*propertyChange*/)
{
}
void NavigatorView::nodeAboutToBeRemoved(const ModelNode &removedNode)
{
if (m_treeModel->isInTree(removedNode))
m_treeModel->removeSubTree(removedNode);
}
void NavigatorView::nodeAboutToBeReparented(const ModelNode &/*node*/, const NodeAbstractProperty &/*newPropertyParent*/, const NodeAbstractProperty &/*oldPropertyParent*/, AbstractView::PropertyChangeFlags /*propertyChange*/)
{
}
void NavigatorView::nodeReparented(const ModelNode &node, const NodeAbstractProperty & /*newPropertyParent*/, const NodeAbstractProperty & /*oldPropertyParent*/, AbstractView::PropertyChangeFlags /*propertyChange*/)
{
bool blocked = blockSelectionChangedSignal(true);
if (m_treeModel->isInTree(node))
m_treeModel->removeSubTree(node);
if (node.isInHierarchy())
m_treeModel->addSubTree(node);
// make sure selection is in sync again
updateItemSelection();
blockSelectionChangedSignal(blocked);
}
void NavigatorView::nodeIdChanged(const ModelNode& node, const QString & /*newId*/, const QString & /*oldId*/)
{
if (m_treeModel->isInTree(node))
m_treeModel->updateItemRow(node);
}
void NavigatorView::propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList)
{
foreach (const AbstractProperty &property, propertyList) {
if (property.isNodeProperty()) {
NodeProperty nodeProperty(property.toNodeProperty());
m_treeModel->removeSubTree(nodeProperty.modelNode());
} else if (property.isNodeListProperty()) {
NodeListProperty nodeListProperty(property.toNodeListProperty());
foreach (const ModelNode &node, nodeListProperty.toModelNodeList()) {
m_treeModel->removeSubTree(node);
}
}
}
}
void NavigatorView::rootNodeTypeChanged(const QString & /*type*/, int /*majorVersion*/, int /*minorVersion*/)
{
if (m_treeModel->isInTree(rootModelNode()))
m_treeModel->updateItemRow(rootModelNode());
}
void NavigatorView::auxiliaryDataChanged(const ModelNode &node, const QString & /*name*/, const QVariant & /*data*/)
{
if (m_treeModel->isInTree(node))
{
// update model
m_treeModel->updateItemRow(node);
// repaint row (id and icon)
QModelIndex index = m_treeModel->indexForNode(node);
treeWidget()->update( index );
treeWidget()->update( index.sibling(index.row(),index.column()+1) );
}
}
void NavigatorView::scriptFunctionsChanged(const ModelNode &/*node*/, const QStringList &/*scriptFunctionList*/)
{
}
void NavigatorView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &/*propertyList*/)
{
}
void NavigatorView::instancesCompleted(const QVector<ModelNode> &/*completedNodeList*/)
{
}
void NavigatorView::instanceInformationsChange(const QVector<ModelNode> &/*nodeList*/)
{
}
void NavigatorView::instancesRenderImageChanged(const QVector<ModelNode> &/*nodeList*/)
{
}
void NavigatorView::instancesPreviewImageChanged(const QVector<ModelNode> &/*nodeList*/)
{
}
void NavigatorView::instancesChildrenChanged(const QVector<ModelNode> &/*nodeList*/)
{
}
void NavigatorView::rewriterBeginTransaction()
{
}
void NavigatorView::rewriterEndTransaction()
{
}
void NavigatorView::actualStateChanged(const ModelNode &/*node*/)
{
}
void NavigatorView::nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &node, int oldIndex)
{
if (m_treeModel->isInTree(node))
m_treeModel->updateItemRowOrder(listProperty, node, oldIndex);
}
void NavigatorView::changeToComponent(const QModelIndex &index)
{
if (index.isValid() && m_treeModel->data(index, Qt::UserRole).isValid()) {
ModelNode doubleClickNode = m_treeModel->nodeForIndex(index);
if (doubleClickNode.metaInfo().isComponent())
Core::EditorManager::instance()->openEditor(doubleClickNode.metaInfo().componentFileName());
}
}
void NavigatorView::changeSelection(const QItemSelection & /*newSelection*/, const QItemSelection &/*deselected*/)
{
if (m_blockSelectionChangedSignal)
return;
QSet<ModelNode> nodeSet;
foreach (const QModelIndex &index, treeWidget()->selectionModel()->selectedIndexes()) {
if (m_treeModel->data(index, Qt::UserRole).isValid())
nodeSet.insert(m_treeModel->nodeForIndex(index));
}
bool blocked = blockSelectionChangedSignal(true);
setSelectedModelNodes(nodeSet.toList());
blockSelectionChangedSignal(blocked);
}
void NavigatorView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeList*/, const QList<ModelNode> &/*lastSelectedNodeList*/)
{
updateItemSelection();
}
void NavigatorView::updateItemSelection()
{
QItemSelection itemSelection;
foreach (const ModelNode &node, selectedModelNodes()) {
const QModelIndex index = m_treeModel->indexForNode(node);
if (index.isValid()) {
const QModelIndex beginIndex(m_treeModel->index(index.row(), 0, index.parent()));
const QModelIndex endIndex(m_treeModel->index(index.row(), m_treeModel->columnCount(index.parent()) - 1, index.parent()));
if (beginIndex.isValid() && endIndex.isValid())
itemSelection.select(beginIndex, endIndex);
}
}
bool blocked = blockSelectionChangedSignal(true);
treeWidget()->selectionModel()->select(itemSelection, QItemSelectionModel::ClearAndSelect);
blockSelectionChangedSignal(blocked);
// make sure selected nodes a visible
foreach(const QModelIndex &selectedIndex, itemSelection.indexes()) {
if (selectedIndex.column() == 0)
expandRecursively(selectedIndex);
}
}
QTreeView *NavigatorView::treeWidget()
{
if (m_widget)
return m_widget->treeView();
return 0;
}
NavigatorTreeModel *NavigatorView::treeModel()
{
return m_treeModel.data();
}
// along the lines of QObject::blockSignals
bool NavigatorView::blockSelectionChangedSignal(bool block)
{
bool oldValue = m_blockSelectionChangedSignal;
m_blockSelectionChangedSignal = block;
return oldValue;
}
void NavigatorView::expandRecursively(const QModelIndex &index)
{
QModelIndex currentIndex = index;
while (currentIndex.isValid()) {
if (!treeWidget()->isExpanded(currentIndex))
treeWidget()->expand(currentIndex);
currentIndex = currentIndex.parent();
}
}
} // namespace QmlDesigner
| yinyunqiao/qtcreator | src/plugins/qmldesigner/components/navigator/navigatorview.cpp | C++ | lgpl-2.1 | 10,977 |
<?php
/*"******************************************************************************************************
* (c) 2004-2006 by MulchProductions, www.mulchprod.de *
* (c) 2007-2016 by Kajona, www.kajona.de *
* Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt *
********************************************************************************************************/
namespace Kajona\Search\System;
/**
* List of events managed by the search module.
* Please take care to not referencing this class directly! There may be scenarios where
* this class is not available (e.g. if module search is not installed).
*
* @package module_search
* @since 4.5
*/
interface SearchEventidentifier
{
/**
* Name of the event thrown as soon as record is indexed.
*
* Use this listener-identifier to add additional content to
* a search-document.
* The params-array contains two entries:
*
* @param \Kajona\System\System\Model $objInstance the record to be indexed
* @param SearchDocument $objSearchDocument the matching search document which may be extended
*
* @since 4.5
*
*/
const EVENT_SEARCH_OBJECTINDEXED = "core.search.objectindexed";
}
| kajona/kajonacms | module_search/system/SearchEventidentifier.php | PHP | lgpl-2.1 | 1,380 |
CATS.Model.Contest = Classify(CATS.Model.Entity, {
init: function () {
this.$$parent();
this.type = "contest";
this.name = null;
this.url = null;
this.problems_url = null;
this.full_name = null;
this.affiliation = null;
this.start_time = null;
this.finish_time = null;
this.freeze_time = null;
this.unfreeze_time = null;
this.is_open_registration = null;
this.scoring = null;//*: "acm", "school"
this.is_all_results_visible = true;
this.problems = [];
this.users = [];
this.prizes = [];
this.runs = [];
},
add_object: function (obj) {
if ($.inArray(obj.id, this[obj.type + "s"]) == -1)
this[obj.type + "s"].push(obj.id);
},
sort_runs: function () {
this.runs.sort(function (a, b) {
return CATS.App.runs[a].start_processing_time - CATS.App.runs[b].start_processing_time;
});
},
get_problem_index: function (p_id) {
for(var i = 0; i < this.problems.length; ++i)
if (this.problems[i] == p_id)
return i;
return null;
},
get_problems_stats: function () {
var stats = {};
for(var i = 0; i < this.problems.length; ++i) {
stats[this.problems[i]] = {runs: 0, sols: 0, points: 0, first_accept: this.compute_duration_minutes(), last_accept: 0};
}
for(var i = 0; i < this.runs.length; ++i) {
var run = CATS.App.runs[this.runs[i]];
stats[run.problem].runs++;
stats[run.problem].sols += run.status == "accepted" ? 1 : 0;
stats[run.problem].points += run.points;
if (run.status == 'accepted') {
var time = CATS.App.utils.get_time_diff(this.start_time, run.start_processing_time);
stats[run.problem].first_accept = Math.min(time, stats[run.problem].first_accept);
stats[run.problem].last_accept = Math.max(time, stats[run.problem].last_accept);
}
}
return stats;
},
compute_duration_minutes: function () {
return CATS.App.utils.get_time_diff(this.start_time, this.finish_time);
},
compute_current_duration_minutes: function () {
var time = new Date;
return CATS.App.utils.get_time_diff(
this.start_time,
this.start_time <= time && time <= this.finish_time ? time : this.finish_time
);
}
});
| Zimovik007/cats-score | app/models/contest.js | JavaScript | lgpl-2.1 | 2,514 |
/**
* Copyright (C) 2011 JTalks.org Team
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.jtalks.poulpe.model.dao.hibernate;
import org.hibernate.Session;
import org.jtalks.common.model.entity.Entity;
/**
* Class for querying the database and retrieving objects already stored there.
* It is used for ensuring that a sequence of actions in a test leads to
* expected result - by retrieving an object directly from the database passing
* any dao instances.
*
* @author Alexey Grigorev
*/
public class ObjectRetriever {
/**
* Retrieves the actual object stored in the database, clearing session's
* cache for ensuring the object is brand new.<br>
*
* The old object is needed here for 1) evicting it from cache 2) getting
* its id for retrieving.<br>
* <br>
*
* <b>Example of usage:</b><br>
*
* 1) Retrieving the branch
*
* <pre>
* private PoulpeBranch retrieveActualBranch() {
* return ObjectRetriever.retrieveUpdated(branch, session);
* }
* </pre>
*
* 2) Retrieving the section:
*
* <pre>
* private PoulpeSection retrieveActualSection() {
* return ObjectRetriever.retrieveUpdated(section, session);
* }
* </pre>
*
*
* @param object to retrieve
* @param session Hibernate session
* @return brand new retrieved object from the database
*/
public static <E extends Entity> E retrieveUpdated(E object, Session session) {
session.evict(object);
return retrieve(object, session);
}
/**
* Retrieves the actual object stored in the database.<br>
* <br>
*
* <b>Note</b>: it's not guaranteed that a retrieved object will be
* retrieved from the database, it may be retrieved from hibernate's cache.
* Consider using {@link #retrieveUpdated(Entity, Session)} for it clears
* cache before retrieving.
*
* @param object to retrieve
* @param session Hibernate session
*/
@SuppressWarnings("unchecked")
public static <E extends Entity> E retrieve(E object, Session session) {
return (E) session.get(object.getClass(), object.getId());
}
}
| jtalks-org/poulpe | poulpe-model/src/test/java/org/jtalks/poulpe/model/dao/hibernate/ObjectRetriever.java | Java | lgpl-2.1 | 2,999 |
// ---------------------------------------------------------------------
//
// Copyright (C) 2016 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
//check method mTmult of FullMatrix on larger size than full_matrix_02 where
//we interface to the external BLAS
#include "../tests.h"
#include <deal.II/lac/full_matrix.h>
template <typename Number>
void test()
{
FullMatrix<Number> A(2, 76), B(3, 76), C(2, 3), D(2, 3);
for (unsigned int i=0; i<A.m(); ++i)
for (unsigned int j=0; j<A.n(); ++j)
A(i,j) = random_value<double>();
for (unsigned int i=0; i<B.m(); ++i)
for (unsigned int j=0; j<B.n(); ++j)
B(i,j) = random_value<double>();
A.mTmult(C, B); // C = A * B^T
for (unsigned int i=0; i<A.m(); ++i)
for (unsigned int j=0; j<B.m(); ++j)
for (unsigned int k=0; k<A.n(); ++k)
D(i,j) += A(i,k) * B(j,k);
C.add(-1., D);
deallog << "Difference: " << filter_out_small_numbers(C.l1_norm(), std::numeric_limits<Number>::epsilon()*100.) << std::endl;
}
int main()
{
initlog();
test<double>();
test<float>();
test<long double>();
}
| naliboff/dealii | tests/full_matrix/full_matrix_10.cc | C++ | lgpl-2.1 | 1,591 |
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "private/qdeclarativedebugclient_p.h"
#include "private/qpacketprotocol_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
const int protocolVersion = 1;
const QString serverId = QLatin1String("QDeclarativeDebugServer");
const QString clientId = QLatin1String("QDeclarativeDebugClient");
class QDeclarativeDebugClientPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeDebugClient)
public:
QDeclarativeDebugClientPrivate();
QString name;
QDeclarativeDebugConnection *connection;
};
class QDeclarativeDebugConnectionPrivate : public QObject
{
Q_OBJECT
public:
QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c);
QDeclarativeDebugConnection *q;
QPacketProtocol *protocol;
bool gotHello;
QStringList serverPlugins;
QHash<QString, QDeclarativeDebugClient *> plugins;
void advertisePlugins();
public Q_SLOTS:
void connected();
void readyRead();
};
QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c)
: QObject(c), q(c), protocol(0), gotHello(false)
{
protocol = new QPacketProtocol(q, this);
QObject::connect(c, SIGNAL(connected()), this, SLOT(connected()));
QObject::connect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
}
void QDeclarativeDebugConnectionPrivate::advertisePlugins()
{
if (!q->isConnected())
return;
QPacket pack;
pack << serverId << 1 << plugins.keys();
protocol->send(pack);
q->flush();
}
void QDeclarativeDebugConnectionPrivate::connected()
{
QPacket pack;
pack << serverId << 0 << protocolVersion << plugins.keys();
protocol->send(pack);
q->flush();
}
void QDeclarativeDebugConnectionPrivate::readyRead()
{
if (!gotHello) {
QPacket pack = protocol->read();
QString name;
pack >> name;
bool validHello = false;
if (name == clientId) {
int op = -1;
pack >> op;
if (op == 0) {
int version = -1;
pack >> version;
if (version == protocolVersion) {
pack >> serverPlugins;
validHello = true;
}
}
}
if (!validHello) {
qWarning("QDeclarativeDebugConnection: Invalid hello message");
QObject::disconnect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
return;
}
gotHello = true;
QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
if (serverPlugins.contains(iter.key()))
newStatus = QDeclarativeDebugClient::Enabled;
iter.value()->statusChanged(newStatus);
}
}
while (protocol->packetsAvailable()) {
QPacket pack = protocol->read();
QString name;
pack >> name;
if (name == clientId) {
int op = -1;
pack >> op;
if (op == 1) {
// Service Discovery
QStringList oldServerPlugins = serverPlugins;
pack >> serverPlugins;
QHash<QString, QDeclarativeDebugClient *>::Iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
const QString pluginName = iter.key();
QDeclarativeDebugClient::Status newStatus = QDeclarativeDebugClient::Unavailable;
if (serverPlugins.contains(pluginName))
newStatus = QDeclarativeDebugClient::Enabled;
if (oldServerPlugins.contains(pluginName)
!= serverPlugins.contains(pluginName)) {
iter.value()->statusChanged(newStatus);
}
}
} else {
qWarning() << "QDeclarativeDebugConnection: Unknown control message id" << op;
}
} else {
QByteArray message;
pack >> message;
QHash<QString, QDeclarativeDebugClient *>::Iterator iter =
plugins.find(name);
if (iter == plugins.end()) {
qWarning() << "QDeclarativeDebugConnection: Message received for missing plugin" << name;
} else {
(*iter)->messageReceived(message);
}
}
}
}
QDeclarativeDebugConnection::QDeclarativeDebugConnection(QObject *parent)
: QTcpSocket(parent), d(new QDeclarativeDebugConnectionPrivate(this))
{
}
QDeclarativeDebugConnection::~QDeclarativeDebugConnection()
{
QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter) {
iter.value()->d_func()->connection = 0;
iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
}
}
bool QDeclarativeDebugConnection::isConnected() const
{
return state() == ConnectedState;
}
QDeclarativeDebugClientPrivate::QDeclarativeDebugClientPrivate()
: connection(0)
{
}
QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name,
QDeclarativeDebugConnection *parent)
: QObject(*(new QDeclarativeDebugClientPrivate), parent)
{
Q_D(QDeclarativeDebugClient);
d->name = name;
d->connection = parent;
if (!d->connection)
return;
if (d->connection->d->plugins.contains(name)) {
qWarning() << "QDeclarativeDebugClient: Conflicting plugin name" << name;
d->connection = 0;
} else {
d->connection->d->plugins.insert(name, this);
d->connection->d->advertisePlugins();
}
}
QDeclarativeDebugClient::~QDeclarativeDebugClient()
{
Q_D(const QDeclarativeDebugClient);
if (d->connection && d->connection->d) {
d->connection->d->plugins.remove(d->name);
d->connection->d->advertisePlugins();
}
}
QString QDeclarativeDebugClient::name() const
{
Q_D(const QDeclarativeDebugClient);
return d->name;
}
QDeclarativeDebugClient::Status QDeclarativeDebugClient::status() const
{
Q_D(const QDeclarativeDebugClient);
if (!d->connection
|| !d->connection->isConnected()
|| !d->connection->d->gotHello)
return NotConnected;
if (d->connection->d->serverPlugins.contains(d->name))
return Enabled;
return Unavailable;
}
void QDeclarativeDebugClient::sendMessage(const QByteArray &message)
{
Q_D(QDeclarativeDebugClient);
if (status() != Enabled)
return;
QPacket pack;
pack << d->name << message;
d->connection->d->protocol->send(pack);
d->connection->d->q->flush();
}
void QDeclarativeDebugClient::statusChanged(Status)
{
}
void QDeclarativeDebugClient::messageReceived(const QByteArray &)
{
}
QT_END_NAMESPACE
#include <qdeclarativedebugclient.moc>
| sicily/qt4.8.4 | src/declarative/debugger/qdeclarativedebugclient.cpp | C++ | lgpl-2.1 | 9,023 |
<?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: block.title.php 58983 2016-06-27 13:01:27Z jonnybradley $
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*
* smarty_block_title : add a title to a template.
*
* params:
* help: name of the doc page on doc.tiki.org
* admpage: admin panel name
* url: link on the title
*
* usage: {title help='Example' admpage='example'}{tr}Example{/tr}{/title}
*/
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function smarty_block_title($params, $content, $template, &$repeat)
{
global $prefs, $tiki_p_view_templates, $tiki_p_edit_templates, $tiki_p_admin;
if ( $repeat || empty($content) ) return;
$template->loadPlugin('smarty_function_icon');
$template->loadPlugin('smarty_modifier_sefurl');
$template->loadPlugin('smarty_modifier_escape');
if ( ! isset($params['help']) ) $params['help'] = '';
if ( ! isset($params['admpage']) ) $params['admpage'] = '';
if ( ! isset($params['actions']) ) $params['actions'] = '';
// Set the variable for the HTML title tag
$template->smarty->assign('headtitle', $content);
$class = '';
$current = current_object();
if ( ! isset($params['url']) ) {
$params['url'] = smarty_modifier_sefurl($current['object'], $current['type']);
}
$params['url'] = str_replace('"', '', $params['url']);
$metadata = '';
$coordinates = TikiLib::lib('geo')->get_coordinates($current['type'], $current['object']);
if ($coordinates) {
$class = ' geolocated primary';
$metadata = " data-geo-lat=\"{$coordinates['lat']}\" data-geo-lon=\"{$coordinates['lon']}\"";
if (isset($coordinates['zoom'])) {
$metadata .= " data-geo-zoom=\"{$coordinates['zoom']}\"";
}
}
$html = '<h1 class="pagetitle">';
$html .= '<a class="' . $class . '"' . $metadata . ' href="' . $params['url'] . '">' . smarty_modifier_escape($content) . "</a>\n";
if ($template->getTemplateVars('print_page') != 'y') {
if ( $prefs['feature_help'] == 'y' && $prefs['helpurl'] != '' && $params['help'] != '' ) {
$html .= '<a href="' ;
$html .= $prefs['helpurl'] . rawurlencode($params['help']) . '" class="tips btn btn-link" title="' . smarty_modifier_escape($content) . '|' . tra('Help page') . '" target="tikihelp">'
. smarty_function_icon(array('name' => 'help'), $template)
. "</a>\n";
}
if ($prefs['feature_edit_templates'] == 'y' && $tiki_p_edit_templates == 'y' && ($tpl = $template->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=' ;
$html .= $tpl . '" class="tips btn btn-link" title="' . tra('View or edit tpl') . '|' . htmlspecialchars($content) . '">'
. smarty_function_icon(array('name' => 'edit'), $template)
. "</a>\n";
} elseif ($prefs['feature_view_tpl'] == 'y' && $tiki_p_view_templates == 'y' && ($tpl = $template->getTemplateVars('mid'))) {
$html .= '<a href="tiki-edit_templates.php?template=' ;
$html .= $tpl . '" class="tips btn btn-link" title="' . tra('View tpl') . '|' . htmlspecialchars($content) . '">'
. smarty_function_icon(array('name' => 'view'), $template)
. "</a>\n";
}
if ( $tiki_p_admin == 'y' && $params['admpage'] != '' ) {
$html .= '<a class="tips btn btn-link" href="tiki-admin.php?page=' ;
$html .= $params['admpage'] . '" title="' . htmlspecialchars($content) . '|' . tra('Settings') . '">'
. smarty_function_icon(array('name' => 'settings'), $template)
. "</a>\n";
}
if ($params['actions'] != '') {
$html .= $params['actions'];
}
}
$html .= '</h1>';
return $html;
}
| lorddavy/TikiWiki-Improvement-Project | lib/smarty_tiki/block.title.php | PHP | lgpl-2.1 | 3,876 |
<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: tiki-xmlrpc_services.php 40028 2012-03-04 08:38:46Z pkdille $
include_once('tiki-setup.php');
require_once('lib/pear/XML/Server.php');
include_once('lib/blogs/bloglib.php');
if ($prefs['feature_xmlrpc'] != 'y') {
die;
}
// Build map using webservices
$map = array(
'blogger.newPost' => array('function' => 'newPost'),
'blogger.getUserInfo' => array('function' => 'getUserInfo'),
'blogger.getPost' => array('function' => 'getPost'),
'blogger.editPost' => array('function' => 'editPost'),
'blogger.deletePost' => array('function' => 'deletePost'),
'blogger.getRecentPosts' => array('function' => 'getRecentPosts'),
'blogger.getUserInfo' => array('function' => 'getUserInfo'),
'blogger.getUsersBlogs' => array('function' => 'getUserBlogs')
);
$s = new XML_RPC_Server($map);
function check_individual($user, $blogid, $permName)
{
global $userlib;
// If the user is admin he can do everything
if ($userlib->user_has_permission($user, 'tiki_p_blog_admin'))
return true;
// If no individual permissions for the object then ok
if (!$userlib->object_has_one_permission($blogid, 'blog'))
return true;
// If the object has individual permissions then check
// Now get all the permissions that are set for this type of permissions 'image gallery'
if ($userlib->object_has_permission($user, $blogId, 'blog', $permName)) {
return true;
} else {
return false;
}
}
/* Validates the user and returns user information */
function getUserInfo($params)
{
global $tikilib, $userlib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$usernamep = $params->getParam(1);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(2);
$password = $passwordp->scalarval();
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if ($ok) {
$myStruct = new XML_RPC_Value(
array(
'nickname' => new XML_RPC_Value($username),
'firstname' => new XML_RPC_Value('none'),
'lastname' => new XML_RPC_Value('none'),
'email' => new XML_RPC_Value('none'),
'userid' => new XML_RPC_Value('$username'),
'url' => new XML_RPC_Value('none')
),
'struct'
);
return new XML_RPC_Response($myStruct);
} else {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
}
/* Posts a new submission to the CMS */
function newPost($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$blogidp = $params->getParam(1);
$blogid = $blogidp->scalarval();
$usernamep = $params->getParam(2);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(3);
$password = $passwordp->scalarval();
$passp = $params->getParam(4);
$content = $passp->scalarval();
$passp = $params->getParam(5);
$publish = $passp->scalarval();
// Now check if the user is valid and if the user can post a submission
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if (!$ok) {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
// Get individual permissions for this weblog if they exist
if (!check_individual($username, $blogid, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post to this weblog due to individual restrictions for this weblog');
}
// If the blog is not public then check if the user is the owner
if (!$userlib->user_has_permission($username, 'tiki_p_blog_admin')) {
if (!$userlib->user_has_permission($username, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post');
}
require_once('lib/blogs/bloglib.php');
$blog_info = $bloglib->get_blog($blogid);
if ($blog_info['public'] != 'y') {
if ($username != $blog_info['user']) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post');
}
}
}
// User ok and can submit then submit the post
$id = $bloglib->blog_post($blogid, $content, $username);
return new XML_RPC_Response(new XML_RPC_Value("$id"));
}
// :TODO: editPost
function editPost($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$blogidp = $params->getParam(1);
$postid = $blogidp->scalarval();
$usernamep = $params->getParam(2);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(3);
$password = $passwordp->scalarval();
$passp = $params->getParam(4);
$content = $passp->scalarval();
$passp = $params->getParam(5);
$publish = $passp->scalarval();
// Now check if the user is valid and if the user can post a submission
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if (!$ok) {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
if (!check_individual($username, $blogid, 'tiki_p_blog_post')) {
return new XML_RPC_Response(
0,
101,
'User is not allowed to post to this weblog due to individual restrictions for this weblog therefor the user cannot edit a post'
);
}
if (!$userlib->user_has_permission($username, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post');
}
// Now get the post information
$post_data = $bloglib->get_post($postid);
if (!$post_data) {
return new XML_RPC_Response(0, 101, 'Post not found');
}
if ($post_data['user'] != $username) {
if (!$userlib->user_has_permission($username, 'tiki_p_blog_admin')) {
return new XML_RPC_Response(0, 101, 'Permission denied to edit that post since the post does not belong to the user');
}
}
$id = $bloglib->update_post($postid, $blogid, $content, $username);
return new XML_RPC_Response(new XML_RPC_Value(1, 'boolean'));
}
// :TODO: deletePost
function deletePost($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$blogidp = $params->getParam(1);
$postid = $blogidp->scalarval();
$usernamep = $params->getParam(2);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(3);
$password = $passwordp->scalarval();
$passp = $params->getParam(4);
$publish = $passp->scalarval();
// Now check if the user is valid and if the user can post a submission
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if (!$ok) {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
// Now get the post information
$post_data = $bloglib->get_post($postid);
if (!$post_data) {
return new XML_RPC_Response(0, 101, 'Post not found');
}
if ($post_data['user'] != $username) {
if (!$userlib->user_has_permission($username, 'tiki_p_blog_admin')) {
return new XML_RPC_Response(0, 101, 'Permission denied to edit that post');
}
}
$id = $bloglib->remove_post($postid);
return new XML_RPC_Response(new XML_RPC_Value(1, 'boolean'));
}
// :TODO: getTemplate
// :TODO: setTemplate
// :TODO: getPost
function getPost($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$blogidp = $params->getParam(1);
$postid = $blogidp->scalarval();
$usernamep = $params->getParam(2);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(3);
$password = $passwordp->scalarval();
// Now check if the user is valid and if the user can post a submission
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if (!$ok) {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
if (!check_individual($username, $blogid, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post to this weblog due to individual restrictions for this weblog');
}
if (!$userlib->user_has_permission($username, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post');
}
if (!$userlib->user_has_permission($username, 'tiki_p_read_blog')) {
return new XML_RPC_Response(0, 101, 'Permission denied to read this blog');
}
// Now get the post information
$post_data = $bloglib->get_post($postid);
if (!$post_data) {
return new XML_RPC_Response(0, 101, 'Post not found');
}
$dateCreated = $tikilib->get_iso8601_datetime($post_data['created']);
// added dateTime type for blogger compliant xml tag Joerg Knobloch <joerg@happypenguins.net>
$myStruct = new XML_RPC_Value(
array(
'userid' => new XML_RPC_Value($username),
'dateCreated' => new XML_RPC_Value($dateCreated, 'dateTime.iso8601'),
'content' => new XML_RPC_Value($post_data['data']),
'postid' => new XML_RPC_Value($post_data['postId'])
),
'struct'
);
// User ok and can submit then submit an article
return new XML_RPC_Response($myStruct);
}
// :TODO: getRecentPosts
function getRecentPosts($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$blogidp = $params->getParam(1);
$blogid = $blogidp->scalarval();
$usernamep = $params->getParam(2);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(3);
$password = $passwordp->scalarval();
$passp = $params->getParam(4);
$number = $passp->scalarval();
// Now check if the user is valid and if the user can post a submission
list($ok, $username, $e) = $userlib->validate_user($username, $password, '', '');
if (!$ok) {
return new XML_RPC_Response(0, 101, 'Invalid username or password');
}
if (!check_individual($username, $blogid, 'tiki_p_blog_post')) {
return new XML_RPC_Response(
0,
101,
'User is not allowed to post to this weblog due to individual restrictions for this weblog therefore the user cannot edit a post'
);
}
if (!$userlib->user_has_permission($username, 'tiki_p_blog_post')) {
return new XML_RPC_Response(0, 101, 'User is not allowed to post');
}
// Now get the post information
$posts = $bloglib->list_blog_posts($blogid, false, 0, $number, 'created_desc', '', '');
if (count($posts) == 0) {
return new XML_RPC_Response(0, 101, 'No posts');
}
$arrayval = array();
foreach ($posts['data'] as $post) {
$dateCreated = $tikilib->get_iso8601_datetime($post['created']);
$myStruct = new XML_RPC_Value(
array(
'userid' => new XML_RPC_Value($username),
'dateCreated' => new XML_RPC_Value($dateCreated, 'dateTime.iso8601'),
'content' => new XML_RPC_Value($post['data']),
'postid' => new XML_RPC_Value($post['postId'])
),
'struct'
);
$arrayval[] = $myStruct;
}
// User ok and can submit then submit an article
$myVal = new XML_RPC_Value($arrayval, 'array');
return new XML_RPC_Response($myVal);
}
// :TODO: tiki.tikiPost
/* Get the topics where the user can post a new */
function getUserBlogs($params)
{
global $tikilib, $userlib, $bloglib;
$appkeyp = $params->getParam(0);
$appkey = $appkeyp->scalarval();
$usernamep = $params->getParam(1);
$username = $usernamep->scalarval();
$passwordp = $params->getParam(2);
$password = $passwordp->scalarval();
$arrayVal = array();
global $bloglib; require_once('lib/blogs/bloglib.php');
$blogs = $bloglib->list_user_blogs($username, true);
$foo = parse_url($_SERVER['REQUEST_URI']);
$foo1 = $tikilib->httpPrefix() . str_replace('xmlrpc', 'tiki-view_blog', $foo['path']);
foreach ($blogs as $blog) {
$myStruct = new XML_RPC_Value(
array(
'blogName' => new XML_RPC_Value($blog['title']),
'url' => new XML_RPC_Value($foo1 . '?blogId=' . $blog['blogId']),
'blogid' => new XML_RPC_Value($blog['blogId'])
),
'struct'
);
$arrayVal[] = $myStruct;
}
$myVal = new XML_RPC_Value($arrayVal, 'array');
return new XML_RPC_Response($myVal);
}
| railfuture/tiki-website | tiki-xmlrpc_services.php | PHP | lgpl-2.1 | 11,971 |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2017, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.wildfly.extension.undertow;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.function.Consumer;
import javax.security.jacc.PolicyContext;
import javax.security.jacc.PolicyContextException;
import io.undertow.Version;
import org.jboss.as.controller.PathAddress;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.security.SecurityConstants;
import org.wildfly.extension.undertow.logging.UndertowLogger;
import org.wildfly.extension.undertow.security.jacc.HttpServletRequestPolicyContextHandler;
/**
* @author <a href="mailto:tomaz.cerar@redhat.com">Tomaz Cerar</a> (c) 2013 Red Hat Inc.
* @author Stuart Douglas
*/
@SuppressWarnings("ALL")
public class UndertowService implements Service<UndertowService> {
@Deprecated
public static final ServiceName UNDERTOW = ServiceName.JBOSS.append("undertow");
@Deprecated
public static final ServiceName SERVLET_CONTAINER = UNDERTOW.append(Constants.SERVLET_CONTAINER);
@Deprecated
public static final ServiceName SERVER = UNDERTOW.append(Constants.SERVER);
/**
* service name under which default server is bound.
*/
public static final ServiceName DEFAULT_SERVER = UNDERTOW.append("default-server");
/**
* service name under which default host of default server is bound.
*/
public static final ServiceName DEFAULT_HOST = DEFAULT_SERVER.append("default-host");
/**
* The base name for listener/handler/filter services.
*/
public static final ServiceName HANDLER = UNDERTOW.append(Constants.HANDLER);
public static final ServiceName FILTER = UNDERTOW.append(Constants.FILTER);
/**
* The base name for web deployments.
*/
static final ServiceName WEB_DEPLOYMENT_BASE = UNDERTOW.append("deployment");
private final String defaultContainer;
private final String defaultServer;
private final String defaultVirtualHost;
private final Set<Server> registeredServers = new CopyOnWriteArraySet<>();
private final List<UndertowEventListener> listeners = Collections.synchronizedList(new LinkedList<UndertowEventListener>());
private final String instanceId;
private volatile boolean statisticsEnabled;
private final Set<Consumer<Boolean>> statisticsChangeListenters = new HashSet<>();
protected UndertowService(String defaultContainer, String defaultServer, String defaultVirtualHost, String instanceId, boolean statisticsEnabled) {
this.defaultContainer = defaultContainer;
this.defaultServer = defaultServer;
this.defaultVirtualHost = defaultVirtualHost;
this.instanceId = instanceId;
this.statisticsEnabled = statisticsEnabled;
}
public static ServiceName deploymentServiceName(final String serverName, final String virtualHost, final String contextPath) {
return WEB_DEPLOYMENT_BASE.append(serverName).append(virtualHost).append("".equals(contextPath) ? "/" : contextPath);
}
@Deprecated
public static ServiceName virtualHostName(final String server, final String virtualHost) {
return SERVER.append(server).append(virtualHost);
}
public static ServiceName locationServiceName(final String server, final String virtualHost, final String locationName) {
return virtualHostName(server, virtualHost).append(Constants.LOCATION, locationName);
}
public static ServiceName accessLogServiceName(final String server, final String virtualHost) {
return virtualHostName(server, virtualHost).append(Constants.ACCESS_LOG);
}
public static ServiceName ssoServiceName(final String server, final String virtualHost) {
return virtualHostName(server, virtualHost).append("single-sign-on");
}
public static ServiceName consoleRedirectServiceName(final String server, final String virtualHost) {
return virtualHostName(server, virtualHost).append("console", "redirect");
}
public static ServiceName filterRefName(final String server, final String virtualHost, final String locationName, final String filterName) {
return virtualHostName(server, virtualHost).append(Constants.LOCATION, locationName).append("filter-ref").append(filterName);
}
public static ServiceName filterRefName(final String server, final String virtualHost, final String filterName) {
return SERVER.append(server).append(virtualHost).append("filter-ref").append(filterName);
}
public static ServiceName getFilterRefServiceName(final PathAddress address, String name) {
final PathAddress oneUp = address.subAddress(0, address.size() - 1);
final PathAddress twoUp = oneUp.subAddress(0, oneUp.size() - 1);
final PathAddress threeUp = twoUp.subAddress(0, twoUp.size() - 1);
ServiceName serviceName;
if (address.getLastElement().getKey().equals(Constants.FILTER_REF)) {
if (oneUp.getLastElement().getKey().equals(Constants.HOST)) { //adding reference
String host = oneUp.getLastElement().getValue();
String server = twoUp.getLastElement().getValue();
serviceName = UndertowService.filterRefName(server, host, name);
} else {
String location = oneUp.getLastElement().getValue();
String host = twoUp.getLastElement().getValue();
String server = threeUp.getLastElement().getValue();
serviceName = UndertowService.filterRefName(server, host, location, name);
}
} else if (address.getLastElement().getKey().equals(Constants.HOST)) {
String host = address.getLastElement().getValue();
String server = oneUp.getLastElement().getValue();
serviceName = UndertowService.filterRefName(server, host, name);
} else {
String location = address.getLastElement().getValue();
String host = oneUp.getLastElement().getValue();
String server = twoUp.getLastElement().getValue();
serviceName = UndertowService.filterRefName(server, host, location, name);
}
return serviceName;
}
@Deprecated
public static ServiceName listenerName(String listenerName) {
return UNDERTOW.append(Constants.LISTENER).append(listenerName);
}
@Override
public void start(StartContext context) throws StartException {
UndertowLogger.ROOT_LOGGER.serverStarting(Version.getVersionString());
// Register the active request PolicyContextHandler
try {
PolicyContext.registerHandler(SecurityConstants.WEB_REQUEST_KEY,
new HttpServletRequestPolicyContextHandler(), true);
} catch (PolicyContextException pce) {
UndertowLogger.ROOT_LOGGER.failedToRegisterPolicyContextHandler(SecurityConstants.WEB_REQUEST_KEY, pce);
}
}
@Override
public void stop(StopContext context) {
// Remove PolicyContextHandler
Set handlerKeys = PolicyContext.getHandlerKeys();
handlerKeys.remove(SecurityConstants.WEB_REQUEST_KEY);
UndertowLogger.ROOT_LOGGER.serverStopping(Version.getVersionString());
fireEvent(new EventInvoker() {
@Override
public void invoke(UndertowEventListener listener) {
listener.onShutdown();
}
});
}
@Override
public UndertowService getValue() throws IllegalStateException, IllegalArgumentException {
return this;
}
protected void registerServer(final Server server) {
registeredServers.add(server);
fireEvent(new EventInvoker() {
@Override
public void invoke(UndertowEventListener listener) {
listener.onServerStart(server);
}
});
}
protected void unregisterServer(final Server server) {
registeredServers.remove(server);
fireEvent(new EventInvoker() {
@Override
public void invoke(UndertowEventListener listener) {
listener.onServerStop(server);
}
});
}
public String getDefaultContainer() {
return defaultContainer;
}
public String getDefaultServer() {
return defaultServer;
}
public String getDefaultVirtualHost() {
return defaultVirtualHost;
}
public Set<Server> getServers() {
return Collections.unmodifiableSet(registeredServers);
}
public String getInstanceId() {
return instanceId;
}
public boolean isStatisticsEnabled() {
return statisticsEnabled;
}
public synchronized void setStatisticsEnabled(boolean statisticsEnabled) {
this.statisticsEnabled = statisticsEnabled;
for(Consumer<Boolean> listener: statisticsChangeListenters) {
listener.accept(statisticsEnabled);
}
}
public synchronized void registerStatisticsListener(Consumer<Boolean> listener) {
statisticsChangeListenters.add(listener);
}
public synchronized void unregisterStatisticsListener(Consumer<Boolean> listener) {
statisticsChangeListenters.remove(listener);
}
/**
* Registers custom Event listener to server
*
* @param listener event listener to register
*/
public void registerListener(UndertowEventListener listener) {
this.listeners.add(listener);
}
public void unregisterListener(UndertowEventListener listener) {
this.listeners.remove(listener);
}
protected void fireEvent(EventInvoker invoker) {
synchronized (listeners) {
for (UndertowEventListener listener : listeners) {
invoker.invoke(listener);
}
}
}
}
| tomazzupan/wildfly | undertow/src/main/java/org/wildfly/extension/undertow/UndertowService.java | Java | lgpl-2.1 | 11,053 |
require File.dirname(__FILE__) + '/../test_helper'
class BaseTest < Test::Unit::TestCase
def setup
@ship = Shipping::Base.new(
:zip => 97202,
:state => "OR",
:sender_zip => 10001,
:sender_state => "New York",
:weight => 2
)
end
def test_ups
ups = @ship.ups
assert_instance_of Shipping::UPS, ups
assert_equal ups.zip, @ship.zip
end
def test_fedex
fedex = @ship.fedex
assert_instance_of Shipping::FedEx, fedex
assert_equal fedex.zip, @ship.zip
end
end | simplelogica/shipping | test/base/base_test.rb | Ruby | lgpl-2.1 | 488 |
/////////////////////////////////////////////////////////////////////////
//
// simpletest.cpp --a part of libdecodeqr
//
// Copyright(C) 2007 NISHI Takao <zophos@koka-in.org>
// JMA (Japan Medical Association)
// NaCl (Network Applied Communication Laboratory Ltd.)
//
// This is free software with ABSOLUTELY NO WARRANTY.
// You can redistribute and/or modify it under the terms of LGPL.
//
// $Id$
//
#include <stdio.h>
#include <highgui.h>
#include "../../libdecodeqr/decodeqr.h"
int main(int argc,char *argv[])
{
cvNamedWindow("src",1);
//
// load image
//
IplImage *src=cvLoadImage(argv[1],1);
cvShowImage("src",src);
//
// show version info
//
printf("libdecodeqr version %s\n",qr_decoder_version());
//
// initialize
//
QrDecoderHandle decoder=qr_decoder_open();
//
// do decode using default parameter
//
short stat=qr_decoder_decode_image(decoder,src);
printf("STATUS=%04x\n",stat);
//
// get QR code header
//
QrCodeHeader header;
if(qr_decoder_get_header(decoder,&header)){
//
// get QR code text
// To null terminate, a buffer size is larger than body size.
//
char *buf=new char[header.byte_size+1];
qr_decoder_get_body(decoder,(unsigned char *)buf,header.byte_size+1);
printf("%s\n",buf);
}
//
// finalize
//
qr_decoder_close(decoder);
puts("");
puts("Hit any key to end.");
cvWaitKey(0);
cvDestroyAllWindows();
cvReleaseImage(&src);
return(0);
}
| iMoritz/libdecodeqr | examples/simple/simpletest.cpp | C++ | lgpl-2.1 | 1,604 |
/*
* eXist Open Source Native XML Database
* Copyright (C) 2001-04 Wolfgang M. Meier (wolfgang@exist-db.org)
* and others (see http://exist-db.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
package org.exist.xupdate;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.exist.EXistException;
import org.exist.dom.DocumentSet;
import org.exist.security.PermissionDeniedException;
import org.exist.source.Source;
import org.exist.source.StringSource;
import org.exist.storage.DBBroker;
import org.exist.storage.XQueryPool;
import org.exist.storage.txn.Txn;
import org.exist.util.LockException;
import org.exist.xquery.CompiledXQuery;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQuery;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.Sequence;
/**
* @author wolf
*/
public class Conditional extends Modification {
private List modifications = new ArrayList(5);
/**
* @param broker
* @param docs
* @param selectStmt
* @param namespaces
*/
public Conditional(DBBroker broker, DocumentSet docs, String selectStmt,
Map namespaces, Map variables) {
super(broker, docs, selectStmt, namespaces, variables);
}
public void addModification(Modification mod) {
modifications.add(mod);
}
/* (non-Javadoc)
* @see org.exist.xupdate.Modification#process()
*/
public long process(Txn transaction) throws PermissionDeniedException, LockException,
EXistException, XPathException {
LOG.debug("Processing xupdate:if ...");
XQuery xquery = broker.getXQueryService();
XQueryPool pool = xquery.getXQueryPool();
Source source = new StringSource(selectStmt);
CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
XQueryContext context;
if(compiled == null)
context = xquery.newContext(getAccessContext());
else
context = compiled.getContext();
//context.setBackwardsCompatibility(true);
context.setStaticallyKnownDocuments(docs);
declareNamespaces(context);
declareVariables(context);
if(compiled == null)
try {
compiled = xquery.compile(context, source);
} catch (IOException e) {
throw new EXistException("An exception occurred while compiling the query: " + e.getMessage());
}
Sequence seq = null;
try {
seq = xquery.execute(compiled, null);
} finally {
pool.returnCompiledXQuery(source, compiled);
}
if(seq.effectiveBooleanValue()) {
long mods = 0;
for (int i = 0; i < modifications.size(); i++) {
mods += ((Modification)modifications.get(i)).process(transaction);
broker.flush();
}
if (LOG.isDebugEnabled())
LOG.debug(mods + " modifications processed.");
return mods;
} else
return 0;
}
/* (non-Javadoc)
* @see org.exist.xupdate.Modification#getName()
*/
public String getName() {
return "if";
}
}
| orbeon/eXist-1.4.x | src/org/exist/xupdate/Conditional.java | Java | lgpl-2.1 | 3,555 |
package org.zanata.rest.service;
import java.util.List;
import org.zanata.rest.dto.resource.AbstractResourceMeta;
import org.zanata.rest.dto.resource.Resource;
import org.zanata.rest.dto.resource.TextFlow;
import org.zanata.rest.dto.resource.TextFlowTarget;
import org.zanata.rest.dto.resource.TranslationsResource;
class ResourceTestUtil
{
static void clearRevs(AbstractResourceMeta doc)
{
doc.setRevision(null);
if (doc instanceof Resource)
{
Resource res = (Resource) doc;
final List<TextFlow> textFlows = res.getTextFlows();
if (textFlows != null)
for (TextFlow tf : textFlows)
{
tf.setRevision(null);
}
}
}
static void clearRevs(TranslationsResource doc)
{
doc.setRevision(null);
for (TextFlowTarget tft : doc.getTextFlowTargets())
{
tft.setTextFlowRevision(null);
}
}
}
| google-code-export/flies | server/zanata-war/src/test/java/org/zanata/rest/service/ResourceTestUtil.java | Java | lgpl-2.1 | 944 |
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <qtest.h>
#include <QSignalSpy>
#include <QtGui/QGraphicsWidget>
#include <private/qgraphicsitem_p.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <private/qdeclarativerectangle_p.h>
#include <private/qdeclarativetext_p.h>
#include <QtDeclarative/private/qdeclarativeanchors_p_p.h>
Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor)
Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine)
class tst_qdeclarativeanchors : public QObject
{
Q_OBJECT
public:
tst_qdeclarativeanchors() {}
template<typename T>
T *findItem(QGraphicsObject *parent, const QString &id);
QGraphicsObject *findObject(QGraphicsObject *parent, const QString &objectName);
private slots:
void basicAnchors();
void basicAnchorsQGraphicsWidget();
void loops();
void illegalSets();
void illegalSets_data();
void reset();
void reset_data();
void resetConvenience();
void nullItem();
void nullItem_data();
void crash1();
void centerIn();
void fill();
void margins();
};
/*
Find an item with the specified id.
*/
template<typename T>
T *tst_qdeclarativeanchors::findItem(QGraphicsObject *parent, const QString &objectName)
{
const QMetaObject &mo = T::staticMetaObject;
QList<QGraphicsItem *> children = parent->childItems();
for (int i = 0; i < children.count(); ++i) {
QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(children.at(i)->toGraphicsObject());
if (item) {
if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
return static_cast<T*>(item);
}
item = findItem<T>(item, objectName);
if (item)
return static_cast<T*>(item);
}
}
return 0;
}
QGraphicsObject *tst_qdeclarativeanchors::findObject(QGraphicsObject *parent, const QString &objectName)
{
QList<QGraphicsItem *> children = parent->childItems();
for (int i = 0; i < children.count(); ++i) {
QGraphicsObject *item = children.at(i)->toGraphicsObject();
if (item) {
if (objectName.isEmpty() || item->objectName() == objectName) {
return item;
}
item = findObject(item, objectName);
if (item)
return item;
}
}
return 0;
}
void tst_qdeclarativeanchors::basicAnchors()
{
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchors.qml"));
qApp->processEvents();
//sibling horizontal
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
//parent horizontal
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
//vertical
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
//stretch
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect15"))->width(), 96.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect16"))->width(), 192.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect17"))->width(), 192.0);
//vertical stretch
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect18"))->height(), 40.0);
//more parent horizontal
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
//centerIn
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
//margins
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->width(), 86.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect23"))->height(), 10.0);
// offsets
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
QCOMPARE(findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
//baseline
QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
QCOMPARE(text1->y(), text2->y());
delete view;
}
void tst_qdeclarativeanchors::basicAnchorsQGraphicsWidget()
{
QDeclarativeView *view = new QDeclarativeView;
view->setSource(QUrl::fromLocalFile(SRCDIR "/data/anchorsqgraphicswidget.qml"));
qApp->processEvents();
//sibling horizontal
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect1"))->x(), 26.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect2"))->x(), 122.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect3"))->x(), 74.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect4"))->x(), 16.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect5"))->x(), 112.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect6"))->x(), 64.0);
//parent horizontal
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect7"))->x(), 0.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect8"))->x(), 240.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect9"))->x(), 120.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect10"))->x(), -10.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect11"))->x(), 230.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect12"))->x(), 110.0);
//vertical
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect13"))->y(), 20.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect14"))->y(), 155.0);
//stretch
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect15"))->x(), 26.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect15"))->property("width").toReal(), 96.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect16"))->x(), 26.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect16"))->property("width").toReal(), 192.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect17"))->x(), -70.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect17"))->property("width").toReal(), 192.0);
//vertical stretch
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect18"))->y(), 20.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect18"))->property("height").toReal(), 40.0);
//more parent horizontal
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect19"))->x(), 115.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect20"))->x(), 235.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect21"))->x(), -5.0);
//centerIn
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect22"))->x(), 69.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect22"))->y(), 5.0);
//margins
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->x(), 31.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->y(), 5.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->property("width").toReal(), 86.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect23"))->property("height").toReal(), 10.0);
// offsets
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect24"))->x(), 26.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect25"))->y(), 60.0);
QCOMPARE(findObject(view->rootObject(), QLatin1String("rect26"))->y(), 5.0);
//baseline
QDeclarativeText *text1 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text1"));
QDeclarativeText *text2 = findItem<QDeclarativeText>(view->rootObject(), QLatin1String("text2"));
QCOMPARE(text1->y(), text2->y());
delete view;
}
// mostly testing that we don't crash
void tst_qdeclarativeanchors::loops()
{
{
QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop1.qml"));
QString expect = source.toString() + ":6:5: QML Text: Possible anchor loop detected on horizontal anchor.";
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QDeclarativeView *view = new QDeclarativeView;
view->setSource(source);
qApp->processEvents();
delete view;
}
{
QUrl source(QUrl::fromLocalFile(SRCDIR "/data/loop2.qml"));
QString expect = source.toString() + ":8:3: QML Image: Possible anchor loop detected on horizontal anchor.";
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QDeclarativeView *view = new QDeclarativeView;
view->setSource(source);
qApp->processEvents();
delete view;
}
}
void tst_qdeclarativeanchors::illegalSets()
{
QFETCH(QString, qml);
QFETCH(QString, warning);
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1());
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
component.setData(QByteArray("import Qt 4.7\n" + qml.toUtf8()), QUrl::fromLocalFile(""));
if (!component.isReady())
qWarning() << "Test errors:" << component.errors();
QVERIFY(component.isReady());
QObject *o = component.create();
delete o;
}
void tst_qdeclarativeanchors::illegalSets_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("warning");
QTest::newRow("H - too many anchors")
<< "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }"
<< "file::2:23: QML Rectangle: Cannot specify left, right, and hcenter anchors.";
foreach (const QString &side, QStringList() << "left" << "right") {
QTest::newRow("H - anchor to V")
<< QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side)
<< "file::2:13: QML Rectangle: Cannot anchor a horizontal edge to a vertical edge.";
QTest::newRow("H - anchor to non parent/sibling")
<< QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
<< "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("H - anchor to self")
<< QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
<< "file::2:1: QML Rectangle: Cannot anchor item to self.";
}
QTest::newRow("V - too many anchors")
<< "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }"
<< "file::2:23: QML Rectangle: Cannot specify top, bottom, and vcenter anchors.";
QTest::newRow("V - too many anchors with baseline")
<< "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }"
<< "file::2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.";
foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") {
QTest::newRow("V - anchor to H")
<< QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side)
<< "file::2:13: QML Rectangle: Cannot anchor a vertical edge to a horizontal edge.";
QTest::newRow("V - anchor to non parent/sibling")
<< QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
<< "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("V - anchor to self")
<< QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
<< "file::2:1: QML Rectangle: Cannot anchor item to self.";
}
QTest::newRow("centerIn - anchor to non parent/sibling")
<< "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }"
<< "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("fill - anchor to non parent/sibling")
<< "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }"
<< "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling.";
}
void tst_qdeclarativeanchors::reset()
{
QFETCH(QString, side);
QFETCH(QDeclarativeAnchorLine::AnchorLine, anchorLine);
QFETCH(QDeclarativeAnchors::Anchor, usedAnchor);
QDeclarativeItem *baseItem = new QDeclarativeItem;
QDeclarativeAnchorLine anchor;
anchor.item = baseItem;
anchor.anchorLine = anchorLine;
QDeclarativeItem *item = new QDeclarativeItem;
const QMetaObject *meta = item->anchors()->metaObject();
QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor)));
QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), true);
QVERIFY(p.reset(item->anchors()));
QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), false);
delete item;
delete baseItem;
}
void tst_qdeclarativeanchors::reset_data()
{
QTest::addColumn<QString>("side");
QTest::addColumn<QDeclarativeAnchorLine::AnchorLine>("anchorLine");
QTest::addColumn<QDeclarativeAnchors::Anchor>("usedAnchor");
QTest::newRow("left") << "left" << QDeclarativeAnchorLine::Left << QDeclarativeAnchors::LeftAnchor;
QTest::newRow("top") << "top" << QDeclarativeAnchorLine::Top << QDeclarativeAnchors::TopAnchor;
QTest::newRow("right") << "right" << QDeclarativeAnchorLine::Right << QDeclarativeAnchors::RightAnchor;
QTest::newRow("bottom") << "bottom" << QDeclarativeAnchorLine::Bottom << QDeclarativeAnchors::BottomAnchor;
QTest::newRow("hcenter") << "horizontalCenter" << QDeclarativeAnchorLine::HCenter << QDeclarativeAnchors::HCenterAnchor;
QTest::newRow("vcenter") << "verticalCenter" << QDeclarativeAnchorLine::VCenter << QDeclarativeAnchors::VCenterAnchor;
QTest::newRow("baseline") << "baseline" << QDeclarativeAnchorLine::Baseline << QDeclarativeAnchors::BaselineAnchor;
}
void tst_qdeclarativeanchors::resetConvenience()
{
QDeclarativeItem *baseItem = new QDeclarativeItem;
QDeclarativeItem *item = new QDeclarativeItem;
//fill
item->anchors()->setFill(baseItem);
QVERIFY(item->anchors()->fill() == baseItem);
item->anchors()->resetFill();
QVERIFY(item->anchors()->fill() == 0);
//centerIn
item->anchors()->setCenterIn(baseItem);
QVERIFY(item->anchors()->centerIn() == baseItem);
item->anchors()->resetCenterIn();
QVERIFY(item->anchors()->centerIn() == 0);
delete item;
delete baseItem;
}
void tst_qdeclarativeanchors::nullItem()
{
QFETCH(QString, side);
QDeclarativeAnchorLine anchor;
QDeclarativeItem *item = new QDeclarativeItem;
const QMetaObject *meta = item->anchors()->metaObject();
QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML Item: Cannot anchor to a null item.");
QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor)));
delete item;
}
void tst_qdeclarativeanchors::nullItem_data()
{
QTest::addColumn<QString>("side");
QTest::newRow("left") << "left";
QTest::newRow("top") << "top";
QTest::newRow("right") << "right";
QTest::newRow("bottom") << "bottom";
QTest::newRow("hcenter") << "horizontalCenter";
QTest::newRow("vcenter") << "verticalCenter";
QTest::newRow("baseline") << "baseline";
}
void tst_qdeclarativeanchors::crash1()
{
QUrl source(QUrl::fromLocalFile(SRCDIR "/data/crash1.qml"));
QString expect = source.toString() + ":4:5: QML Text: Possible anchor loop detected on fill.";
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
// QT-3245 ... anchor loop detection needs improving.
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QTest::ignoreMessage(QtWarningMsg, expect.toLatin1());
QDeclarativeView *view = new QDeclarativeView(source);
qApp->processEvents();
delete view;
}
void tst_qdeclarativeanchors::fill()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/fill.qml"));
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
QCOMPARE(rect->x(), 0.0 + 10.0);
QCOMPARE(rect->y(), 0.0 + 30.0);
QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
//Alter Offsets (tests QTBUG-6631)
rect->anchors()->setLeftMargin(20.0);
rect->anchors()->setRightMargin(0.0);
rect->anchors()->setBottomMargin(0.0);
rect->anchors()->setTopMargin(10.0);
QCOMPARE(rect->x(), 0.0 + 20.0);
QCOMPARE(rect->y(), 0.0 + 10.0);
QCOMPARE(rect->width(), 200.0 - 20.0);
QCOMPARE(rect->height(), 200.0 - 10.0);
delete view;
}
void tst_qdeclarativeanchors::centerIn()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/centerin.qml"));
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QCOMPARE(rect->x(), 75.0 + 10);
QCOMPARE(rect->y(), 75.0 + 30);
//Alter Offsets (tests QTBUG-6631)
rect->anchors()->setHorizontalCenterOffset(-20.0);
rect->anchors()->setVerticalCenterOffset(-10.0);
QCOMPARE(rect->x(), 75.0 - 20.0);
QCOMPARE(rect->y(), 75.0 - 10.0);
delete view;
}
void tst_qdeclarativeanchors::margins()
{
QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile(SRCDIR "/data/margins.qml"));
qApp->processEvents();
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("filler"));
QCOMPARE(rect->x(), 5.0);
QCOMPARE(rect->y(), 6.0);
QCOMPARE(rect->width(), 200.0 - 5.0 - 10.0);
QCOMPARE(rect->height(), 200.0 - 6.0 - 10.0);
rect->anchors()->setTopMargin(0.0);
rect->anchors()->setMargins(20.0);
QCOMPARE(rect->x(), 5.0);
QCOMPARE(rect->y(), 20.0);
QCOMPARE(rect->width(), 200.0 - 5.0 - 20.0);
QCOMPARE(rect->height(), 200.0 - 20.0 - 20.0);
delete view;
}
QTEST_MAIN(tst_qdeclarativeanchors)
#include "tst_qdeclarativeanchors.moc"
| igor-sfdc/qt-wk | tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp | C++ | lgpl-2.1 | 22,712 |
/*
* Copyright (c) 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.
*/
package hosm.odk.collect.android.picasa;
import java.util.List;
import com.google.api.client.util.Key;
/**
* @author Yaniv Inbar
*/
public class AlbumFeed extends Feed {
@Key("entry")
public List<PhotoEntry> photos;
}
| hotosm/Geo-Data-Collect | HOSMCollect/src/hosm/odk/collect/android/picasa/AlbumFeed.java | Java | lgpl-3.0 | 820 |
//
// Tests for System.Web.UI.WebControls.ImageMap.cs
//
// Author:
// Hagit Yidov (hagity@mainsoft.com
//
// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using NUnit.Framework;
using System;
using System.IO;
using System.Globalization;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MonoTests.stand_alone.WebHarness;
using MonoTests.SystemWeb.Framework;
using System.Threading;
using System.Collections;
namespace MonoTests.System.Web.UI.WebControls {
[TestFixture]
public class TreeNodeBindingCollectionTest {
[Test]
public void TreeNodeBindingCollection_Method_Add () {
TreeView tv = new TreeView ();
Assert.AreEqual (0, tv.DataBindings.Count, "BeforeAdd");
TreeNodeBinding tnb = new TreeNodeBinding ();
tnb.DataMember = "TreeNodeBinding";
tv.DataBindings.Add (tnb);
Assert.AreEqual (1, tv.DataBindings.Count, "AfterAdd1");
Assert.AreEqual ("TreeNodeBinding", tv.DataBindings[0].DataMember, "AfterAdd2");
}
[Test]
public void TreeNodeBindingCollection_Method_Clear () {
TreeView tv = new TreeView ();
tv.DataBindings.Add (new TreeNodeBinding ());
tv.DataBindings.Add (new TreeNodeBinding ());
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (3, tv.DataBindings.Count, "BeforeClear");
tv.DataBindings.Clear ();
Assert.AreEqual (0, tv.DataBindings.Count, "AfterClear");
}
[Test]
public void TreeNodeBindingCollection_Method_Contains () {
TreeView tv = new TreeView ();
TreeNodeBinding tnb = new TreeNodeBinding ();
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (false, tv.DataBindings.Contains (tnb), "BeforeContains");
tv.DataBindings.Add (tnb);
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (true, tv.DataBindings.Contains (tnb), "AfterContains");
}
[Test]
public void TreeNodeBindingCollection_Method_CopyTo () {
TreeView tv = new TreeView ();
TreeNodeBinding[] bindingArray = new TreeNodeBinding[10];
tv.DataBindings.Add (new TreeNodeBinding ());
TreeNodeBinding tnb = new TreeNodeBinding ();
tnb.DataMember = "TreeNodeBinding";
tv.DataBindings.Add (tnb);
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (3, tv.DataBindings.Count, "BeforeCopyTo");
tv.DataBindings.CopyTo (bindingArray, 3);
Assert.AreEqual ("TreeNodeBinding", bindingArray[4].DataMember, "AfterCopyTo");
}
[Test]
public void TreeNodeBindingCollection_Method_IndexOf () {
TreeView tv = new TreeView ();
TreeNodeBinding tnb = new TreeNodeBinding ();
tv.DataBindings.Add (new TreeNodeBinding ());
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (-1, tv.DataBindings.IndexOf (tnb), "BeforeIndexOf");
tv.DataBindings.Add (tnb);
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (2, tv.DataBindings.IndexOf (tnb), "AfterIndexOf");
}
[Test]
public void TreeNodeBindingCollection_Method_Insert () {
TreeView tv = new TreeView ();
tv.DataBindings.Add (new TreeNodeBinding ());
tv.DataBindings.Add (new TreeNodeBinding ());
Assert.AreEqual (2, tv.DataBindings.Count, "BeforeInsert");
TreeNodeBinding tnb = new TreeNodeBinding ();
tnb.DataMember = "TreeNodeBinding";
tv.DataBindings.Insert (1, tnb);
Assert.AreEqual (3, tv.DataBindings.Count, "AfterInsert1");
Assert.AreEqual ("TreeNodeBinding", tv.DataBindings[1].DataMember, "AfterInsert2");
}
[Test]
public void TreeNodeBindingCollection_Method_Remove () {
TreeView tv = new TreeView ();
TreeNodeBinding tnb1 = new TreeNodeBinding ();
tnb1.DataMember = "first";
TreeNodeBinding tnb2 = new TreeNodeBinding ();
tnb2.DataMember = "second";
TreeNodeBinding tnb3 = new TreeNodeBinding ();
tnb3.DataMember = "third";
tv.DataBindings.Add (tnb1);
tv.DataBindings.Add (tnb2);
tv.DataBindings.Add (tnb3);
Assert.AreEqual (3, tv.DataBindings.Count, "BeforeRemove1");
Assert.AreEqual ("second", tv.DataBindings[1].DataMember, "BeforeRemove2");
tv.DataBindings.Remove (tnb2);
Assert.AreEqual (2, tv.DataBindings.Count, "AfterRemove1");
Assert.AreEqual ("third", tv.DataBindings[1].DataMember, "AfterRemove2");
}
[Test]
public void TreeNodeBindingCollection_Method_RemoveAt () {
TreeView tv = new TreeView ();
TreeNodeBinding tnb1 = new TreeNodeBinding ();
tnb1.DataMember = "first";
TreeNodeBinding tnb2 = new TreeNodeBinding ();
tnb2.DataMember = "second";
TreeNodeBinding tnb3 = new TreeNodeBinding ();
tnb3.DataMember = "third";
tv.DataBindings.Add (tnb1);
tv.DataBindings.Add (tnb2);
tv.DataBindings.Add (tnb3);
Assert.AreEqual (3, tv.DataBindings.Count, "BeforeRemove1");
Assert.AreEqual ("second", tv.DataBindings[1].DataMember, "BeforeRemove2");
tv.DataBindings.RemoveAt (1);
Assert.AreEqual (2, tv.DataBindings.Count, "AfterRemove1");
Assert.AreEqual ("third", tv.DataBindings[1].DataMember, "AfterRemove2");
}
}
}
#endif
| edwinspire/VSharp | class/System.Web/Test/System.Web.UI.WebControls/TreeNodeBindingCollectionTest.cs | C# | lgpl-3.0 | 6,051 |
<?php
/**
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
declare(strict_types=1);
namespace Phing\Test\Task\Optional\PHPStan;
use Phing\Task\Ext\Phpstan\PHPStanTask;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
class PHPStanTaskUnitTest extends TestCase
{
public function testItHasValidDefaults(): void
{
$task = new PHPStanTask();
$assert = new PHPStanTaskAssert();
$assert->assertDefaults($task);
}
}
| phingofficial/phing | tests/Phing/Task/Optional/PHPStan/PHPStanTaskUnitTest.php | PHP | lgpl-3.0 | 1,370 |
package org.red5.server.messaging;
/*
* RED5 Open Source Flash Server - http://www.osflash.org/red5
*
* Copyright (c) 2006-2009 by respective authors (see below). All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* Input Endpoint for a consumer to connect.
*
* @author The Red5 Project (red5@osflash.org)
* @author Steven Gong (steven.gong@gmail.com)
*/
public interface IMessageInput {
/**
* Pull message from this input endpoint. Return
* w/o waiting.
* @return The pulled message or <tt>null</tt> if message is
* not available.
* @throws IOException on error
*/
IMessage pullMessage() throws IOException;
/**
* Pull message from this input endpoint. Wait
* <tt>wait</tt> milliseconds if message is not available.
* @param wait milliseconds to wait when message is not
* available.
* @return The pulled message or <tt>null</tt> if message is
* not available.
*/
IMessage pullMessage(long wait);
/**
* Connect to a consumer.
*
* @param consumer Consumer
* @param paramMap Parameters map
* @return <tt>true</tt> when successfully subscribed,
* <tt>false</tt> otherwise.
*/
boolean subscribe(IConsumer consumer, Map<String, Object> paramMap);
/**
* Disconnect from a consumer.
*
* @param consumer Consumer to disconnect
* @return <tt>true</tt> when successfully unsubscribed,
* <tt>false</tt> otherwise.
*/
boolean unsubscribe(IConsumer consumer);
/**
* Getter for consumers list.
*
* @return Consumers.
*/
List<IConsumer> getConsumers();
/**
* Send OOB Control Message to all providers on the other side of pipe.
*
* @param consumer
* The consumer that sends the message
* @param oobCtrlMsg
* Out-of-band control message
*/
void sendOOBControlMessage(IConsumer consumer, OOBControlMessage oobCtrlMsg);
}
| OpenCorrelate/red5load | red5/src/main/java/org/red5/server/messaging/IMessageInput.java | Java | lgpl-3.0 | 2,754 |
/*
* This file is part of Gaia Sky, which is released under the Mozilla Public License 2.0.
* See the file LICENSE.md in the project root for full license details.
*/
package gaiasky.interafce.minimap;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.FrameBuffer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.utils.Scaling;
import gaiasky.util.Constants;
import gaiasky.util.I18n;
import gaiasky.util.coord.Coordinates;
import gaiasky.util.math.Vector2d;
import gaiasky.util.math.Vector3d;
public class SolarNeighbourhoodMinimapScale extends AbstractMinimapScale {
private Image topProjection;
private Image sideProjection;
public SolarNeighbourhoodMinimapScale(){
super();
camp = new float[4];
}
@Override
public void updateLocal() {
}
@Override
public void initialize(OrthographicCamera ortho, SpriteBatch sb, ShapeRenderer sr, BitmapFont font, int side, int sideshort) {
super.initialize(ortho, sb, sr, font, side, sideshort, Constants.PC_TO_U, Constants.U_TO_PC, 500, 100000 * Constants.AU_TO_U * Constants.U_TO_PC);
Texture texTop = new Texture(Gdx.files.internal("img/minimap/solar_neighbourhood_top_s.jpg"));
texTop.setFilter(TextureFilter.Linear, TextureFilter.Linear);
topProjection = new Image(texTop);
topProjection.setScaling(Scaling.fit);
topProjection.setSize(side, side);
Texture texSide = new Texture(Gdx.files.internal("img/minimap/solar_neighbourhood_side_s.jpg"));
texSide.setFilter(TextureFilter.Linear, TextureFilter.Linear);
sideProjection = new Image(texSide);
sideProjection.setScaling(Scaling.fit);
sideProjection.setSize(side, sideshort);
trans = Coordinates.eqToGal();
}
public float[] position(Vector3d pos, float[] out) {
Vector3d p = aux3d1.set(pos).mul(trans);
Vector2d pos2d = aux2d1;
pos2d.set(p.z, p.y).scl(from);
float cx = u2Px(pos2d.x, side2);
float cy = u2Px(pos2d.y, sideshort2);
out[0] = cx;
out[1] = cy;
pos2d.set(-p.x, p.z).scl(from);
cx = u2Px(pos2d.x, side2);
cy = u2Px(pos2d.y, side2);
out[2] = cx;
out[3] = cy;
return out;
}
@Override
public void renderSideProjection(FrameBuffer fb) {
ortho.setToOrtho(true, side, sideshort);
sr.setProjectionMatrix(ortho.combined);
sb.setProjectionMatrix(ortho.combined);
fb.begin();
// Clear
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT | (Gdx.graphics.getBufferFormat().coverageSampling ? GL20.GL_COVERAGE_BUFFER_BIT_NV : 0));
// Background
sb.begin();
sideProjection.draw(sb, 1);
sb.end();
Gdx.gl.glEnable(GL30.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
// Grid
sr.begin(ShapeType.Line);
sr.setColor(textyc);
sr.getColor().a *= 0.6f;
sr.line(0, sideshort2, side, sideshort2);
sr.line(side2, 0, side2, side);
sr.setColor(textbc);
sr.getColor().a *= 0.3f;
sr.circle(side2, sideshort2, side2);
sr.circle(side2, sideshort2, side2 / 2f);
sr.end();
sr.begin(ShapeType.Filled);
sr.setColor(sunc);
sr.circle(side2, sideshort2, px(suns));
renderCameraSide();
sr.end();
// Fonts
sb.begin();
font.setColor(sunc);
font.draw(sb, I18n.txt("gui.minimap.sun"), side2 + px(7), sideshort2);
font.setColor(textgc);
font.draw(sb, "To\nGalactic\nCenter", side - px(50), sideshort2 + px(15));
font.draw(sb, "To\nOuter\nGalaxy", 0, sideshort2 + px(15));
font.draw(sb, "Galactic\nNorth Pole", side2 - px(30), sideshort);
font.draw(sb, "Galactic\nSouth Pole", side2 - px(30), px(30));
sb.end();
fb.end();
}
@Override
public void renderTopProjection(FrameBuffer fb) {
ortho.setToOrtho(true, side, side);
sr.setProjectionMatrix(ortho.combined);
sb.setProjectionMatrix(ortho.combined);
fb.begin();
// Clear
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT | (Gdx.graphics.getBufferFormat().coverageSampling ? GL20.GL_COVERAGE_BUFFER_BIT_NV : 0));
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
// Background
sb.begin();
topProjection.draw(sb, 1);
sb.end();
Gdx.gl.glEnable(GL30.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
// Grid
sr.begin(ShapeType.Line);
sr.setColor(textyc);
sr.getColor().a *= 0.6f;
sr.line(0, side2, side, side2);
sr.line(side2, 0, side2, side);
sr.setColor(textbc);
sr.getColor().a *= 0.3f;
sr.circle(side2, side2, side2);
sr.circle(side2, side2, side2 * 3f / 4f);
sr.circle(side2, side2, side2 / 2f);
sr.circle(side2, side2, side2 / 4f);
sr.end();
sr.begin(ShapeType.Filled);
sr.setColor(sunc);
sr.circle(side2, side2, px(suns));
renderCameraTop();
sr.end();
// Fonts
sb.begin();
font.setColor(1, 1, 0, 1);
font.draw(sb, I18n.txt("gui.minimap.sun"), side2 + px(10), side2 + px(10));
font.setColor(textgc);
font.draw(sb, "Hyades", side2 + px(5), side2 - px(5));
font.draw(sb, "Pleiades", side2, side2 - px(20));
font.draw(sb, "Taurus", side2 - px(30), side2 - px(40));
font.draw(sb, "Near\nPerseus", side2 - px(70), side2 - px(50));
font.draw(sb, "Far\nPerseus", side2 - px(50), side2 - px(85));
font.draw(sb, "Orion", side2 + px(20), side2 - px(85));
font.draw(sb, "Cepheus", side2 - px(110), side2 - px(30));
font.draw(sb, "Coalsack", side2 + px(30), side2 + px(30));
font.draw(sb, "Ophiucus", side2, side2 + px(45));
font.draw(sb, "Near\nAquila", side2 - px(50), side2 + px(55));
font.draw(sb, "Serpens", side2 - px(70), side2 + px(85));
font.setColor(textrc);
font.draw(sb, "ORI OB1", side2 + px(30), side2 - px(70));
font.draw(sb, "VEL OB2", side2 + px(65), side2 - px(15));
font.setColor(textmc);
font.draw(sb, "0°", side2 - px(15), side - px(5));
font.draw(sb, "270°", side - px(30), side2 + px(5));
font.draw(sb, "180°", side2 + px(3), px(15));
font.draw(sb, "90°", px(5), side2 + px(5));
font.setColor(textbc);
font.draw(sb, "250pc", side2 + px(15), side2 + side2 / 2f + px(10));
font.draw(sb, "500pc", side2 + px(25), side);
sb.end();
fb.end();
}
@Override
public String getName() {
return I18n.txt("gui.minimap.solarneighbourhood");
}
}
| ari-zah/gaiasandbox | core/src/gaiasky/interafce/minimap/SolarNeighbourhoodMinimapScale.java | Java | lgpl-3.0 | 7,387 |
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// Package ethapi implements the general Ethereum API functions.
package ethapi
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
)
// Backend interface provides the common API services (that are provided by
// both full and light clients) with access to necessary functions.
type Backend interface {
// general Ethereum API
Downloader() *downloader.Downloader
ProtocolVersion() int
SuggestPrice(ctx context.Context) (*big.Int, error)
ChainDb() ethdb.Database
EventMux() *event.TypeMux
AccountManager() *accounts.Manager
// BlockChain API
SetHead(number uint64)
HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)
BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *types.Header, error)
GetBlock(ctx context.Context, blockHash common.Hash) (*types.Block, error)
GetReceipts(ctx context.Context, blockHash common.Hash) (types.Receipts, error)
GetTd(blockHash common.Hash) *big.Int
GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error)
// TxPool API
SendTx(ctx context.Context, signedTx *types.Transaction) error
RemoveTx(txHash common.Hash)
GetPoolTransactions() (types.Transactions, error)
GetPoolTransaction(txHash common.Hash) *types.Transaction
GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
Stats() (pending int, queued int)
TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
ChainConfig() *params.ChainConfig
CurrentBlock() *types.Block
}
func GetAPIs(apiBackend Backend) []rpc.API {
nonceLock := new(AddrLocker)
return []rpc.API{
{
Namespace: "eth",
Version: "1.0",
Service: NewPublicEthereumAPI(apiBackend),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicBlockChainAPI(apiBackend),
Public: true,
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicTransactionPoolAPI(apiBackend, nonceLock),
Public: true,
}, {
Namespace: "txpool",
Version: "1.0",
Service: NewPublicTxPoolAPI(apiBackend),
Public: true,
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPublicDebugAPI(apiBackend),
Public: true,
}, {
Namespace: "debug",
Version: "1.0",
Service: NewPrivateDebugAPI(apiBackend),
}, {
Namespace: "eth",
Version: "1.0",
Service: NewPublicAccountAPI(apiBackend.AccountManager()),
Public: true,
}, {
Namespace: "personal",
Version: "1.0",
Service: NewPrivateAccountAPI(apiBackend, nonceLock),
Public: false,
},
}
}
| am2rican5/go-ethereum | internal/ethapi/backend.go | GO | lgpl-3.0 | 3,996 |
$(function() {
var paging = $('.lazyloading-paging').hide();
if (!paging.length) {
return;
}
var loading = $('<div><i class="icon16 loading"></i>Loading...</div>').hide().insertBefore(paging);
var win = $(window);
var product_list = $('#product-list .product-list');
var current = paging.find('li.selected');
var next = current.next();
win.lazyLoad('stop');
if (next.length) {
win.lazyLoad({
container: $('#main'),
load: function() {
win.lazyLoad('sleep');
var url = next.find('a').attr('href');
if (!url) {
win.lazyLoad('stop');
}
loading.show();
$.get(url, function(html) {
var tmp = $('<div></div>').html(html);
product_list.append(tmp.find('#product-list .product-list').children());
var tmp_paging = tmp.find('.lazyloading-paging').hide();
paging.replaceWith(tmp_paging);
paging = tmp_paging;
current = paging.find('li.selected');
next = current.next();
if (next.length) {
win.lazyLoad('wake');
} else {
win.lazyLoad('stop');
}
loading.hide();
tmp.remove();
});
}
});
}
}); | dmitriyzhdankin/avantmarketcomua | wa-apps/shop/themes/default/lazyloading.js | JavaScript | lgpl-3.0 | 1,548 |
( function($) {
var Drawer = ( function($) {
Drawer = function(options) {
var that = this;
that.$wrapper = options["$wrapper"];
if (that.$wrapper && that.$wrapper.length) {
// DOM
that.$block = that.$wrapper.find(".drawer-body");
that.$body = $(window.top.document).find("body");
that.$window = $(window.top);
// VARS
that.options = (options["options"] || false);
that.direction = getDirection(options["direction"]);
that.animation_time = 333;
that.hide_class = "is-hide";
// DYNAMIC VARS
that.is_visible = false;
that.is_locked = false;
// HELPERS
that.onBgClick = (options["onBgClick"] || false);
that.onOpen = (options["onOpen"] || function() {});
that.onClose = (options["onClose"] || function() {});
// INIT
that.initClass();
} else {
log("Error: bad data for drawer");
}
function getDirection(direction) {
var result = "right",
direction_array = ["left", "right"];
if (direction_array.indexOf(direction) !== -1) {
result = direction;
}
return result;
}
};
Drawer.prototype.initClass = function() {
var that = this;
// save link on drawer
that.$wrapper.data("drawer", that);
//
that.render();
// Delay binding close events so that drawer does not close immidiately
// from the same click that opened it.
setTimeout( function() {
that.bindEvents();
}, 0);
};
Drawer.prototype.bindEvents = function() {
var that = this,
$document = $(document),
$block = (that.$block) ? that.$block : that.$wrapper;
that.$wrapper.on("close", close);
// Click on background, default nothing
that.$wrapper.on("click", ".drawer-background", function(event) {
if (typeof that.onBgClick === "function") {
that.onBgClick(event);
} else {
event.stopPropagation();
}
});
$document.on("keyup", function(event) {
var escape_code = 27;
if (event.keyCode === escape_code) {
that.close();
}
});
$block.on("click", ".js-close-drawer", close);
//
function close() {
var result = that.close();
if (result === true) {
$document.off("click", close);
$document.off("wa_before_load", close);
}
}
};
Drawer.prototype.render = function() {
var that = this;
var direction_class = (that.direction === "left" ? "left" : "right");
that.$wrapper.addClass(direction_class).addClass(that.hide_class).show();
try {
that.show();
} catch(e) {
log("Error: " + e.message);
}
//
that.onOpen(that.$wrapper, that);
};
Drawer.prototype.close = function() {
var that = this,
result = null;
if (that.is_visible) {
//
result = that.onClose(that);
//
if (result !== false) {
if (!that.is_locked) {
that.is_locked = true;
that.$wrapper.addClass(that.hide_class);
setTimeout( function() {
that.$wrapper.remove();
that.is_locked = false;
}, that.animation_time);
}
}
}
return result;
};
Drawer.prototype.hide = function() {
var that = this;
if (!that.is_locked) {
that.is_locked = true;
that.$wrapper.addClass(that.hide_class);
setTimeout( function() {
$("<div />").append(that.$wrapper.hide());
that.is_visible = false;
that.is_locked = false;
}, that.animation_time);
}
};
Drawer.prototype.show = function() {
var that = this,
is_exist = $.contains(document, that.$wrapper[0]);
if (!is_exist) {
that.$body.append(that.$wrapper);
}
if (!that.is_locked) {
that.is_locked = true;
setTimeout( function() {
that.$wrapper.removeClass(that.hide_class);
that.is_locked = false;
}, 100);
}
that.is_visible = true;
};
return Drawer;
})($);
$.waDrawer = function(plugin_options) {
plugin_options = ( typeof plugin_options === "object" ? plugin_options : {});
var options = $.extend(true, {}, plugin_options),
result = false;
options["$wrapper"] = getWrapper(options);
if (options["$wrapper"]) {
result = new Drawer(options);
}
return result;
};
function getWrapper(options) {
var result = false;
if (options["html"]) {
result = $(options["html"]);
} else if (options["wrapper"]) {
result = options["wrapper"];
} else {
// result = generateDrawer(options["header"], options["content"], options["footer"]);
}
return result;
function generateDrawer($header, $content, $footer) {
var result = false;
var wrapper_class = "drawer",
bg_class = "drawer-background",
block_class = "drawer-body",
header_class = "drawer-header",
content_class = "drawer-content",
footer_class = "drawer-footer";
var $wrapper = $("<div />").addClass(wrapper_class),
$bg = $("<div />").addClass(bg_class),
$body = $("<div />").addClass(block_class),
$header_w = ( $header ? $("<div />").addClass(header_class).append($header) : false ),
$content_w = ( $content ? $("<div />").addClass(content_class).append($content) : false ),
$footer_w = ( $footer ? $("<div />").addClass(footer_class).append($footer) : false );
if ($header_w || $content_w || $footer_w) {
if ($header_w) {
$body.append($header_w)
}
if ($content_w) {
$body.append($content_w)
}
if ($footer_w) {
$body.append($footer_w)
}
result = $wrapper.append($bg).append($body);
}
return result;
}
}
function log(data) {
if (console && console.log) {
console.log(data);
}
}
})(jQuery);
| webasyst/webasyst-framework | wa-apps/ui/js/drawer.js | JavaScript | lgpl-3.0 | 7,494 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.redline.jenkins;
import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import org.kohsuke.stapler.DataBoundConstructor;
/**
*
* @author rfriedman
*/
public class Thresholds extends AbstractDescribableImpl<Thresholds> {
public final int errorFailedThreshold;
public final int errorUnstableThreshold;
public final int responseTimeFailedThreshold;
public final int responseTimeUnstableThreshold;
/**
* Gather all the inputs required to define cloud settings data to launch
* tests.
*
* @param errorFailedThreshold Error Threshold for error $
* @param errorUnstableThreshold Unstable Threshold for error $
* @param responseTimeFailedThreshold Error threshold for time in ms
* @param responseTimeUnstableThreshold Unstable threshold for time in ms
*/
@DataBoundConstructor
public Thresholds(
int errorFailedThreshold,
int errorUnstableThreshold,
int responseTimeFailedThreshold,
int responseTimeUnstableThreshold
) {
this.errorFailedThreshold = errorFailedThreshold;
this.errorUnstableThreshold = errorUnstableThreshold;
this.responseTimeFailedThreshold = responseTimeFailedThreshold;
this.responseTimeUnstableThreshold = responseTimeUnstableThreshold;
}
public int getErrorFailedThreshold() {
return errorFailedThreshold;
}
public boolean checkErrorFailed(int value){
return this.errorFailedThreshold > 0 && value < this.errorFailedThreshold;
}
public int getErrorUnstableThreshold() {
return errorUnstableThreshold;
}
public boolean checkErrorUnstable(int value){
return this.errorUnstableThreshold > 0 && value < this.errorUnstableThreshold;
}
public int getResponseTimeFailedThreshold() {
return responseTimeFailedThreshold;
}
public boolean checkResponseTimeFailed(int value){
return this.responseTimeFailedThreshold > 0 && value > this.responseTimeFailedThreshold;
}
public int getResponseTimeUnstableThreshold() {
return responseTimeUnstableThreshold;
}
public boolean checkResponseTimeUnstable(int value){
return this.responseTimeUnstableThreshold > 0 && value > this.responseTimeUnstableThreshold;
}
@Extension
public static class DescriptorImpl extends Descriptor<Thresholds> {
@Override
public String getDisplayName(){
return "";
}
}
}
| redline13/redline-jenkins-plugin | src/main/java/com/redline/jenkins/Thresholds.java | Java | lgpl-3.0 | 2,768 |
using LKCamelot.library;
using LKCamelot.model;
namespace LKCamelot.script.item
{
public class ToughLeather : BaseArmor
{
public override string Name { get { return "Tough Leather"; } }
public override int DamBase { get { return 0; } }
public override int ACBase { get { return 117; } }
public override int StrReq { get { return 345; } }
public override int DexReq { get { return 0; } }
public override int InitMinHits { get { return 750; } }
public override int InitMaxHits { get { return 750; } }
public override Class ClassReq { get { return 0; } }
public override ArmorType ArmorType { get { return ArmorType.Armor; } }
public ToughLeather() : base (5)
{
}
public ToughLeather(Serial serial) : base (serial)
{
}
}
}
| hsnks100/LakingServer | FileReader/bin/Debug/item/armor/ToughLeather.cs | C# | lgpl-3.0 | 760 |
/*
* JSmart Framework - Java Web Development Framework
* Copyright (c) 2015, Jeferson Albino da Silva, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jsmartframework.web.config;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
public final class UploadConfig {
private String location;
private long maxFileSize;
private long maxRequestSize;
private int fileSizeThreshold;
@XmlValue
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
@XmlAttribute
public long getMaxFileSize() {
return maxFileSize;
}
public void setMaxFileSize(long maxFileSize) {
this.maxFileSize = maxFileSize;
}
@XmlAttribute
public long getMaxRequestSize() {
return maxRequestSize;
}
public void setMaxRequestSize(long maxRequestSize) {
this.maxRequestSize = maxRequestSize;
}
@XmlAttribute
public int getFileSizeThreshold() {
return fileSizeThreshold;
}
public void setFileSizeThreshold(int fileSizeThreshold) {
this.fileSizeThreshold = fileSizeThreshold;
}
}
| jefalbino/jsmart5 | src/main/java/com/jsmartframework/web/config/UploadConfig.java | Java | lgpl-3.0 | 1,881 |
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
void myProcessing(const QString &)
{
}
int main()
{
QWidget myWidget;
{
// RECORD
//! [0]
QPicture picture;
QPainter painter;
painter.begin(&picture); // paint in picture
painter.drawEllipse(10,20, 80,70); // draw an ellipse
painter.end(); // painting done
picture.save("drawing.pic"); // save picture
//! [0]
}
{
// REPLAY
//! [1]
QPicture picture;
picture.load("drawing.pic"); // load picture
QPainter painter;
painter.begin(&myImage); // paint in myImage
painter.drawPicture(0, 0, picture); // draw the picture at (0,0)
painter.end(); // painting done
//! [1]
}
QPicture myPicture;
{
// FORMATS
//! [2]
QStringList list = QPicture::inputFormatList();
foreach (const QString &string, list)
myProcessing(string);
//! [2]
}
{
// OUTPUT
//! [3]
QStringList list = QPicture::outputFormatList();
foreach (const QString &string, list)
myProcessing(string);
//! [3]
}
{
// PIC READ
//! [4]
QPictureIO iio;
QPixmap pixmap;
iio.setFileName("vegeburger.pic");
if (iio.read()) { // OK
QPicture picture = iio.picture();
QPainter painter(&pixmap);
painter.drawPicture(0, 0, picture);
}
//! [4]
}
{
QPixmap pixmap;
// PIC WRITE
//! [5]
QPictureIO iio;
QPicture picture;
QPainter painter(&picture);
painter.drawPixmap(0, 0, pixmap);
iio.setPicture(picture);
iio.setFileName("vegeburger.pic");
iio.setFormat("PIC");
if (iio.write())
return true; // returned true if written successfully
//! [5]
}
}
// SVG READ
//! [6]
void readSVG(QPictureIO *picture)
{
// read the picture using the picture->ioDevice()
}
//! [6]
// SVG WRITE
//! [7]
void writeSVG(QPictureIO *picture)
{
// write the picture using the picture->ioDevice()
}
//! [7]
// USE SVG
void foo() {
//! [8]
// add the SVG picture handler
// ...
//! [8]
QPictureIO::defineIOHandler("SVG", 0, 0, readSVG, writeSVG);
// ...
}
| ssangkong/NVRAM_KWU | qt-everywhere-opensource-src-4.7.4/doc/src/snippets/picture/picture.cpp | C++ | lgpl-3.0 | 4,382 |
package es.uvigo.esei.sing.bdbm.gui.command.dialogs;
import java.awt.Component;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import es.uvigo.ei.sing.yaacli.Option;
import es.uvigo.ei.sing.yaacli.Parameters;
import es.uvigo.esei.sing.bdbm.cli.commands.TBLASTXCommand;
import es.uvigo.esei.sing.bdbm.controller.BDBMController;
import es.uvigo.esei.sing.bdbm.gui.command.CommandDialog;
import es.uvigo.esei.sing.bdbm.gui.command.ParameterValuesReceiver;
import es.uvigo.esei.sing.bdbm.persistence.entities.NucleotideDatabase;
import es.uvigo.esei.sing.bdbm.persistence.entities.NucleotideSearchEntry;
import es.uvigo.esei.sing.bdbm.persistence.entities.NucleotideSearchEntry.NucleotideQuery;
public class TBLASTXCommandDialog extends CommandDialog {
private static final long serialVersionUID = 1L;
public TBLASTXCommandDialog(
BDBMController controller,
TBLASTXCommand command
) {
this(controller, command, null);
}
public TBLASTXCommandDialog(
BDBMController controller,
TBLASTXCommand command,
Parameters defaultParameters
) {
super(controller, command, defaultParameters);
this.pack();
}
@Override
protected <T> Component createComponentForOption(
final Option<T> option,
final ParameterValuesReceiver receiver
) {
if (option.equals(TBLASTXCommand.OPTION_DATABASE)) {
final JComboBox<NucleotideDatabase> cmbDatabases = new JComboBox<>(
this.controller.listNucleotideDatabases()
);
final ActionListener alDatabases = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final Object item = cmbDatabases.getSelectedItem();
if (item == null) {
receiver.setValue(option, (String) null);
} else if (item instanceof NucleotideDatabase) {
final NucleotideDatabase database = (NucleotideDatabase) item;
final File dbDirectory = database.getDirectory();
receiver.setValue(
option, new File(dbDirectory, database.getName()).getAbsolutePath()
);
}
}
};
alDatabases.actionPerformed(null);
cmbDatabases.addActionListener(alDatabases);
return cmbDatabases;
} else if (option.equals(TBLASTXCommand.OPTION_QUERY)) {
final JPanel panel = new JPanel(new GridLayout(2, 1));
final JComboBox<NucleotideSearchEntry> cmbSearchEntries = new JComboBox<>(
this.controller.listNucleotideSearchEntries()
);
final JComboBox<NucleotideQuery> cmbQueries = new JComboBox<>();
final ActionListener alQueries = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final Object item = cmbQueries.getSelectedItem();
if (item == null) {
receiver.setValue(option, (String) null);
} else if (item instanceof NucleotideQuery) {
receiver.setValue(option, ((NucleotideQuery) item).getBaseFile().getAbsolutePath());
}
}
};
final ActionListener alSearchEntries = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final NucleotideSearchEntry searchEntry =
(NucleotideSearchEntry) cmbSearchEntries.getSelectedItem();
if (searchEntry != null && !searchEntry.listQueries().isEmpty()) {
cmbQueries.setModel(
new DefaultComboBoxModel<>(
new Vector<NucleotideQuery>(searchEntry.listQueries())
)
);
} else {
cmbQueries.setModel(new DefaultComboBoxModel<NucleotideQuery>());
}
alQueries.actionPerformed(null);
}
};
alSearchEntries.actionPerformed(null);
cmbSearchEntries.addActionListener(alSearchEntries);
cmbQueries.addActionListener(alQueries);
panel.add(cmbSearchEntries);
panel.add(cmbQueries);
return panel;
} else {
return super.createComponentForOption(option, receiver);
}
}
}
| mrjato/BDBM | gui/es/uvigo/esei/sing/bdbm/gui/command/dialogs/TBLASTXCommandDialog.java | Java | lgpl-3.0 | 3,998 |
/*
* LuoYing is a program used to make 3D RPG game.
* Copyright (c) 2014-2016 Huliqing <31703299@qq.com>
*
* This file is part of LuoYing.
*
* LuoYing is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LuoYing is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with LuoYing. If not, see <http://www.gnu.org/licenses/>.
*/
package name.huliqing.luoying.object.effect;
import name.huliqing.luoying.object.Loader;
import name.huliqing.luoying.object.sound.Sound;
import name.huliqing.luoying.object.sound.SoundManager;
/**
*
* @author huliqing
*/
public class SoundWrap {
private Effect effect;
// xml上配置的声音id
String soundId;
// xml上配置的声音的开始时间
float startTime;
// 缓存的声音控制器
Sound sound;
// 声音的实际开始时间,受效果速度的影响。
float trueStartTime;
// 表示声音播放是否已经开始
boolean started;
public SoundWrap(Effect effect) {
this.effect = effect;
}
public void update(float tpf, float effectTimeUsed) {
if (started) {
return;
}
if (effectTimeUsed >= trueStartTime) {
if (sound == null) {
sound = Loader.load(soundId);
effect.attachChild(sound);
}
SoundManager.getInstance().addAndPlay(sound);
started = true;
}
}
public void cleanup() {
if (sound != null) {
SoundManager.getInstance().removeAndStopLoop(sound);
}
started = false;
}
}
| guyue123/ly | ly-kernel/src/name/huliqing/luoying/object/effect/SoundWrap.java | Java | lgpl-3.0 | 2,117 |
/*
* Copyright (C) 2015-2017 PÂRIS Quentin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.phoenicis.javafx.views.mainwindow.engines;
import javafx.application.Platform;
import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import org.phoenicis.engines.Engine;
import org.phoenicis.engines.dto.EngineCategoryDTO;
import org.phoenicis.engines.dto.EngineDTO;
import org.phoenicis.engines.dto.EngineSubCategoryDTO;
import org.phoenicis.javafx.collections.ConcatenatedList;
import org.phoenicis.javafx.collections.MappedList;
import org.phoenicis.javafx.components.common.control.DetailsPanel;
import org.phoenicis.javafx.components.common.widgets.utils.ListWidgetType;
import org.phoenicis.javafx.components.engine.control.EngineInformationPanel;
import org.phoenicis.javafx.components.engine.control.EngineSidebar;
import org.phoenicis.javafx.components.engine.control.EngineSubCategoryPanel;
import org.phoenicis.javafx.settings.JavaFxSettingsManager;
import org.phoenicis.javafx.utils.StringBindings;
import org.phoenicis.javafx.themes.ThemeManager;
import org.phoenicis.javafx.views.mainwindow.ui.MainWindowView;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import static org.phoenicis.configuration.localisation.Localisation.tr;
/**
* "Engines" tab
*/
public class EnginesView extends MainWindowView<EngineSidebar> {
private final EnginesFilter filter;
private final JavaFxSettingsManager javaFxSettingsManager;
private final Map<String, Engine> engines;
private final ObservableList<EngineCategoryDTO> engineCategories;
private final ObservableList<Tab> engineSubCategoryTabs;
private final DetailsPanel engineDetailsPanel;
private final ObjectProperty<ListWidgetType> selectedListWidget;
private final ObjectProperty<EngineDTO> engineDTO;
private final ObjectProperty<Engine> engine;
private TabPane availableEngines;
private Consumer<EngineDTO> setOnInstallEngine;
private Consumer<EngineDTO> setOnDeleteEngine;
private Consumer<EngineCategoryDTO> onSelectEngineCategory;
private String enginesPath;
/**
* constructor
*
* @param themeManager
* @param enginesPath
* @param javaFxSettingsManager
*/
public EnginesView(ThemeManager themeManager, String enginesPath, JavaFxSettingsManager javaFxSettingsManager) {
super(tr("Engines"), themeManager);
this.enginesPath = enginesPath;
this.javaFxSettingsManager = javaFxSettingsManager;
this.filter = new EnginesFilter(enginesPath);
this.engines = new HashMap<>();
this.engineCategories = FXCollections.observableArrayList();
this.selectedListWidget = new SimpleObjectProperty<>();
this.engineDTO = new SimpleObjectProperty<>();
this.engine = new SimpleObjectProperty<>();
this.filter.selectedEngineCategoryProperty().addListener((Observable invalidation) -> {
final EngineCategoryDTO engineCategory = this.filter.getSelectedEngineCategory();
if (engineCategory != null) {
Optional.ofNullable(onSelectEngineCategory).ifPresent(listener -> listener.accept(engineCategory));
}
});
final EngineSidebar engineSidebar = createEngineSidebar();
setSidebar(engineSidebar);
this.engineDetailsPanel = createEngineDetailsPanel();
this.engineSubCategoryTabs = createEngineSubCategoryTabs(engineSidebar);
this.availableEngines = createEngineVersion();
}
/**
* sets the consumer which shall be executed if an engine is selected
*
* @param engineCategory
*/
public void setOnSelectEngineCategory(Consumer<EngineCategoryDTO> engineCategory) {
this.onSelectEngineCategory = engineCategory;
}
/**
* sets the consumer which shall be executed if an engine is installed
*
* @param onInstallEngine
*/
public void setOnInstallEngine(Consumer<EngineDTO> onInstallEngine) {
this.setOnInstallEngine = onInstallEngine;
}
/**
* sets the consumer which shall be executed if an engine is deleted
*
* @param onDeleteEngine
*/
public void setOnDeleteEngine(Consumer<EngineDTO> onDeleteEngine) {
this.setOnDeleteEngine = onDeleteEngine;
}
private TabPane createEngineVersion() {
final TabPane availableEngines = new TabPane();
availableEngines.getStyleClass().add("rightPane");
availableEngines.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
Bindings.bindContent(availableEngines.getTabs(), this.engineSubCategoryTabs);
return availableEngines;
}
private ObservableList<Tab> createEngineSubCategoryTabs(EngineSidebar sidebar) {
// initialize the engines sub category panels
final MappedList<List<EngineSubCategoryPanel>, EngineCategoryDTO> engineSubCategoryPanelGroups = new MappedList<>(
this.engineCategories, engineCategory -> engineCategory.getSubCategories().stream()
.map(engineSubCategory -> {
final EngineSubCategoryPanel engineSubCategoryPanel = new EngineSubCategoryPanel();
engineSubCategoryPanel.setEngineCategory(engineCategory);
engineSubCategoryPanel.setEngineSubCategory(engineSubCategory);
engineSubCategoryPanel.setEnginesPath(this.enginesPath);
engineSubCategoryPanel.setFilter(this.filter);
engineSubCategoryPanel.setEngine(this.engines.get(engineCategory.getName().toLowerCase()));
engineSubCategoryPanel.selectedListWidgetProperty()
.bind(sidebar.selectedListWidgetProperty());
engineSubCategoryPanel.setOnEngineSelect(this::showEngineDetails);
return engineSubCategoryPanel;
}).collect(Collectors.toList()));
final ConcatenatedList<EngineSubCategoryPanel> engineSubCategoryPanels = ConcatenatedList
.create(engineSubCategoryPanelGroups);
final FilteredList<EngineSubCategoryPanel> filteredEngineSubCategoryPanels = engineSubCategoryPanels
// sort the engine sub category panels alphabetically
.sorted(Comparator
.comparing(engineSubCategoryPanel -> engineSubCategoryPanel.getEngineSubCategory().getName()))
// filter the engine sub category panels, so that only the visible panels remain
.filtered(this.filter::filter);
filteredEngineSubCategoryPanels.predicateProperty().bind(
Bindings.createObjectBinding(() -> this.filter::filter,
this.filter.searchTermProperty(),
this.filter.showInstalledProperty(),
this.filter.showNotInstalledProperty()));
// map the panels to tabs
return new MappedList<>(filteredEngineSubCategoryPanels,
engineSubCategoryPanel -> new Tab(engineSubCategoryPanel.getEngineSubCategory().getDescription(),
engineSubCategoryPanel));
}
private EngineSidebar createEngineSidebar() {
final EngineSidebar sidebar = new EngineSidebar(this.filter, this.engineCategories, this.selectedListWidget);
sidebar.setJavaFxSettingsManager(this.javaFxSettingsManager);
// set the default selection
sidebar.setSelectedListWidget(javaFxSettingsManager.getEnginesListType());
// save changes to the list widget selection to the hard drive
sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
javaFxSettingsManager.setEnginesListType(newValue);
javaFxSettingsManager.save();
}
});
return sidebar;
}
/**
* inits the view with the given engines
*
* @param engineCategoryDTOS
*/
public void populate(List<EngineCategoryDTO> engineCategoryDTOS, Map<String, Engine> newEngines) {
this.engines.clear();
this.engines.putAll(newEngines);
Platform.runLater(() -> {
this.engineCategories.setAll(engineCategoryDTOS);
closeDetailsView();
setCenter(this.availableEngines);
});
}
/**
* updates available versions for a certain engine
*
* @param engineCategoryDTO engine
* @param versions available versions for the engine
*/
public void updateVersions(EngineCategoryDTO engineCategoryDTO, List<EngineSubCategoryDTO> versions) {
Platform.runLater(() -> {
EngineCategoryDTO newEngineCategoryDTO = new EngineCategoryDTO.Builder(engineCategoryDTO)
.withSubCategories(versions)
.build();
this.engineCategories.remove(engineCategoryDTO);
this.engineCategories.add(newEngineCategoryDTO);
});
}
private DetailsPanel createEngineDetailsPanel() {
final EngineInformationPanel engineInformationPanel = new EngineInformationPanel();
engineInformationPanel.engineDTOProperty().bind(engineDTO);
engineInformationPanel.engineProperty().bind(engine);
engineInformationPanel.setOnEngineInstall(this::installEngine);
engineInformationPanel.setOnEngineDelete(this::deleteEngine);
final DetailsPanel detailsPanel = new DetailsPanel();
detailsPanel.titleProperty().bind(StringBindings
.map(engineDTO, engine -> engine.getCategory() + " " + engine.getSubCategory()));
detailsPanel.setContent(engineInformationPanel);
detailsPanel.setOnClose(this::closeDetailsView);
detailsPanel.prefWidthProperty().bind(content.widthProperty().divide(3));
return detailsPanel;
}
/**
* shows details for a given engine
*
* @param engineDTO
*/
private void showEngineDetails(EngineDTO engineDTO, Engine engine) {
this.engineDTO.setValue(engineDTO);
this.engine.setValue(engine);
showDetailsView(engineDetailsPanel);
}
/**
* installs given engine
*
* @param engineDTO
*/
private void installEngine(EngineDTO engineDTO) {
this.setOnInstallEngine.accept(engineDTO);
}
/**
* deletes given engine
*
* @param engineDTO
*/
private void deleteEngine(EngineDTO engineDTO) {
this.setOnDeleteEngine.accept(engineDTO);
}
}
| madoar/POL-POM-5 | phoenicis-javafx/src/main/java/org/phoenicis/javafx/views/mainwindow/engines/EnginesView.java | Java | lgpl-3.0 | 11,687 |
def itemTemplate():
return ['object/tangible/wearables/armor/padded/shared_armor_padded_s01_helmet.iff']
def customItemName():
return 'Padded Armor Helmet'
def customItemStackCount():
return 1
def customizationAttributes():
return []
def customizationValues():
return []
def itemStats():
stats = ['armor_efficiency_kinetic','5000','6800']
stats += ['armor_efficiency_energy','3000','4800']
stats += ['special_protection_heat','4000','5800']
stats += ['special_protection_cold','4000','5800']
stats += ['special_protection_acid','4000','5800']
stats += ['special_protection_electricity','4000','5800']
return stats
| agry/NGECore2 | scripts/loot/lootItems/armor/padded/padded_armor_helmet.py | Python | lgpl-3.0 | 644 |
/*******************************************************************************
* Gisgraphy Project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Copyright 2008 Gisgraphy project
* David Masclet <davidmasclet@gisgraphy.com>
*
*
*******************************************************************************/
package com.gisgraphy.importer.dto;
import com.vividsolutions.jts.geom.Point;
/**
* Represents a house number with an associated street in the Karlsruhe schema.
*
* @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
*/
public class InterpolationMember implements Comparable<InterpolationMember>{
/**
* id of the node
*/
private String id;
/**
* the ordered sequence of nodes
*/
private int sequenceId;
/**
* the gis location of the member (middle point or location )
*/
private Point location;
/**
* the number of the house. It is a string because of latin that is can have bis ter or a letter (3c)
*/
private String houseNumber;
/**
* the name of the street
*/
private String streetname;
public InterpolationMember(String id, int sequenceId, Point location, String houseNumber, String streetname) {
super();
this.id = id;
this.sequenceId = sequenceId;
this.location = location;
this.houseNumber = houseNumber;
this.streetname = streetname;
}
public InterpolationMember() {
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the sequenceId
*/
public int getSequenceId() {
return sequenceId;
}
/**
* @param sequenceId the sequenceId to set
*/
public void setSequenceId(int sequenceId) {
this.sequenceId = sequenceId;
}
/**
* @return the location
*/
public Point getLocation() {
return location;
}
/**
* @param location the location to set
*/
public void setLocation(Point location) {
this.location = location;
}
/**
* @return the streetname
*/
public String getStreetname() {
return streetname;
}
/**
* @param streetname the streetname to set
*/
public void setStreetname(String streetname) {
this.streetname = streetname;
}
/**
* @return the houseNumber
*/
public String getHouseNumber() {
return houseNumber;
}
/**
* @param houseNumber the houseNumber to set
*/
public void setHouseNumber(String houseNumber) {
this.houseNumber = houseNumber;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((houseNumber == null) ? 0 : houseNumber.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((location == null) ? 0 : location.hashCode());
result = prime * result + sequenceId;
result = prime * result + ((streetname == null) ? 0 : streetname.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InterpolationMember other = (InterpolationMember) obj;
if (houseNumber == null) {
if (other.houseNumber != null)
return false;
} else if (!houseNumber.equals(other.houseNumber))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (location == null) {
if (other.location != null)
return false;
} else if (!location.equals(other.location))
return false;
if (sequenceId != other.sequenceId)
return false;
if (streetname == null) {
if (other.streetname != null)
return false;
} else if (!streetname.equals(other.streetname))
return false;
return true;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("InterpolationMember [");
if (id != null) {
builder.append("id=");
builder.append(id);
builder.append(", ");
}
builder.append("sequenceId=");
builder.append(sequenceId);
builder.append(", ");
if (location != null) {
builder.append("location=");
builder.append(location);
builder.append(", ");
}
if (houseNumber != null) {
builder.append("houseNumber=");
builder.append(houseNumber);
builder.append(", ");
}
if (streetname != null) {
builder.append("streetname=");
builder.append(streetname);
}
builder.append("]");
return builder.toString();
}
public int compareTo(InterpolationMember o) {
return sequenceId - o.sequenceId;
}
}
| delphiprogramming/gisgraphy | src/main/java/com/gisgraphy/importer/dto/InterpolationMember.java | Java | lgpl-3.0 | 5,480 |
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package shhclient
import (
"context"
ethereum "github.com/expanse-org/go-expanse"
"github.com/expanse-org/go-expanse/common/hexutil"
"github.com/expanse-org/go-expanse/rpc"
whisper "github.com/expanse-org/go-expanse/whisper/whisperv6"
)
// Client defines typed wrappers for the Whisper v6 RPC API.
type Client struct {
c *rpc.Client
}
// Dial connects a client to the given URL.
func Dial(rawurl string) (*Client, error) {
c, err := rpc.Dial(rawurl)
if err != nil {
return nil, err
}
return NewClient(c), nil
}
// NewClient creates a client that uses the given RPC client.
func NewClient(c *rpc.Client) *Client {
return &Client{c}
}
// Version returns the Whisper sub-protocol version.
func (sc *Client) Version(ctx context.Context) (string, error) {
var result string
err := sc.c.CallContext(ctx, &result, "shh_version")
return result, err
}
// Info returns diagnostic information about the whisper node.
func (sc *Client) Info(ctx context.Context) (whisper.Info, error) {
var info whisper.Info
err := sc.c.CallContext(ctx, &info, "shh_info")
return info, err
}
// SetMaxMessageSize sets the maximal message size allowed by this node. Incoming
// and outgoing messages with a larger size will be rejected. Whisper message size
// can never exceed the limit imposed by the underlying P2P protocol (10 Mb).
func (sc *Client) SetMaxMessageSize(ctx context.Context, size uint32) error {
var ignored bool
return sc.c.CallContext(ctx, &ignored, "shh_setMaxMessageSize", size)
}
// SetMinimumPoW (experimental) sets the minimal PoW required by this node.
// This experimental function was introduced for the future dynamic adjustment of
// PoW requirement. If the node is overwhelmed with messages, it should raise the
// PoW requirement and notify the peers. The new value should be set relative to
// the old value (e.g. double). The old value could be obtained via shh_info call.
func (sc *Client) SetMinimumPoW(ctx context.Context, pow float64) error {
var ignored bool
return sc.c.CallContext(ctx, &ignored, "shh_setMinPoW", pow)
}
// MarkTrustedPeer marks specific peer trusted, which will allow it to send historic (expired) messages.
// Note This function is not adding new nodes, the node needs to exists as a peer.
func (sc *Client) MarkTrustedPeer(ctx context.Context, enode string) error {
var ignored bool
return sc.c.CallContext(ctx, &ignored, "shh_markTrustedPeer", enode)
}
// NewKeyPair generates a new public and private key pair for message decryption and encryption.
// It returns an identifier that can be used to refer to the key.
func (sc *Client) NewKeyPair(ctx context.Context) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_newKeyPair")
}
// AddPrivateKey stored the key pair, and returns its ID.
func (sc *Client) AddPrivateKey(ctx context.Context, key []byte) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_addPrivateKey", hexutil.Bytes(key))
}
// DeleteKeyPair delete the specifies key.
func (sc *Client) DeleteKeyPair(ctx context.Context, id string) (string, error) {
var ignored bool
return id, sc.c.CallContext(ctx, &ignored, "shh_deleteKeyPair", id)
}
// HasKeyPair returns an indication if the node has a private key or
// key pair matching the given ID.
func (sc *Client) HasKeyPair(ctx context.Context, id string) (bool, error) {
var has bool
return has, sc.c.CallContext(ctx, &has, "shh_hasKeyPair", id)
}
// PublicKey return the public key for a key ID.
func (sc *Client) PublicKey(ctx context.Context, id string) ([]byte, error) {
var key hexutil.Bytes
return []byte(key), sc.c.CallContext(ctx, &key, "shh_getPublicKey", id)
}
// PrivateKey return the private key for a key ID.
func (sc *Client) PrivateKey(ctx context.Context, id string) ([]byte, error) {
var key hexutil.Bytes
return []byte(key), sc.c.CallContext(ctx, &key, "shh_getPrivateKey", id)
}
// NewSymmetricKey generates a random symmetric key and returns its identifier.
// Can be used encrypting and decrypting messages where the key is known to both parties.
func (sc *Client) NewSymmetricKey(ctx context.Context) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_newSymKey")
}
// AddSymmetricKey stores the key, and returns its identifier.
func (sc *Client) AddSymmetricKey(ctx context.Context, key []byte) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_addSymKey", hexutil.Bytes(key))
}
// GenerateSymmetricKeyFromPassword generates the key from password, stores it, and returns its identifier.
func (sc *Client) GenerateSymmetricKeyFromPassword(ctx context.Context, passwd string) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_generateSymKeyFromPassword", passwd)
}
// HasSymmetricKey returns an indication if the key associated with the given id is stored in the node.
func (sc *Client) HasSymmetricKey(ctx context.Context, id string) (bool, error) {
var found bool
return found, sc.c.CallContext(ctx, &found, "shh_hasSymKey", id)
}
// GetSymmetricKey returns the symmetric key associated with the given identifier.
func (sc *Client) GetSymmetricKey(ctx context.Context, id string) ([]byte, error) {
var key hexutil.Bytes
return []byte(key), sc.c.CallContext(ctx, &key, "shh_getSymKey", id)
}
// DeleteSymmetricKey deletes the symmetric key associated with the given identifier.
func (sc *Client) DeleteSymmetricKey(ctx context.Context, id string) error {
var ignored bool
return sc.c.CallContext(ctx, &ignored, "shh_deleteSymKey", id)
}
// Post a message onto the network.
func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) (string, error) {
var hash string
return hash, sc.c.CallContext(ctx, &hash, "shh_post", message)
}
// SubscribeMessages subscribes to messages that match the given criteria. This method
// is only supported on bi-directional connections such as websockets and IPC.
// NewMessageFilter uses polling and is supported over HTTP.
func (sc *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
return sc.c.ShhSubscribe(ctx, ch, "messages", criteria)
}
// NewMessageFilter creates a filter within the node. This filter can be used to poll
// for new messages (see FilterMessages) that satisfy the given criteria. A filter can
// timeout when it was polled for in whisper.filterTimeout.
func (sc *Client) NewMessageFilter(ctx context.Context, criteria whisper.Criteria) (string, error) {
var id string
return id, sc.c.CallContext(ctx, &id, "shh_newMessageFilter", criteria)
}
// DeleteMessageFilter removes the filter associated with the given id.
func (sc *Client) DeleteMessageFilter(ctx context.Context, id string) error {
var ignored bool
return sc.c.CallContext(ctx, &ignored, "shh_deleteMessageFilter", id)
}
// FilterMessages retrieves all messages that are received between the last call to
// this function and match the criteria that where given when the filter was created.
func (sc *Client) FilterMessages(ctx context.Context, id string) ([]*whisper.Message, error) {
var messages []*whisper.Message
return messages, sc.c.CallContext(ctx, &messages, "shh_getFilterMessages", id)
}
| expanse-org/go-expanse | whisper/shhclient/client.go | GO | lgpl-3.0 | 8,032 |
# coding:utf-8
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
# admin.autodiscover()
autourl = ['filemanage',
# (r'^test/$','views.test.test'),
]
urlpatterns = patterns(*tuple(autourl))
| sdgdsffdsfff/yunwei | filemanager/urls.py | Python | lgpl-3.0 | 295 |
package jason.asunit;
public interface Condition {
public boolean test(TestArch arch);
}
| jason-lang/jason | src/test/java/jason/asunit/Condition.java | Java | lgpl-3.0 | 94 |
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.foundation.expressions.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import orgomg.cwm.foundation.expressions.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ExpressionsFactoryImpl extends EFactoryImpl implements ExpressionsFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static ExpressionsFactory init() {
try {
ExpressionsFactory theExpressionsFactory = (ExpressionsFactory)EPackage.Registry.INSTANCE.getEFactory("http:///orgomg/cwm/foundation/expressions.ecore");
if (theExpressionsFactory != null) {
return theExpressionsFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new ExpressionsFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExpressionsFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case ExpressionsPackage.EXPRESSION_NODE: return createExpressionNode();
case ExpressionsPackage.CONSTANT_NODE: return createConstantNode();
case ExpressionsPackage.ELEMENT_NODE: return createElementNode();
case ExpressionsPackage.FEATURE_NODE: return createFeatureNode();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExpressionNode createExpressionNode() {
ExpressionNodeImpl expressionNode = new ExpressionNodeImpl();
return expressionNode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConstantNode createConstantNode() {
ConstantNodeImpl constantNode = new ConstantNodeImpl();
return constantNode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ElementNode createElementNode() {
ElementNodeImpl elementNode = new ElementNodeImpl();
return elementNode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FeatureNode createFeatureNode() {
FeatureNodeImpl featureNode = new FeatureNodeImpl();
return featureNode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExpressionsPackage getExpressionsPackage() {
return (ExpressionsPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static ExpressionsPackage getPackage() {
return ExpressionsPackage.eINSTANCE;
}
} //ExpressionsFactoryImpl
| dresden-ocl/dresdenocl | plugins/org.dresdenocl.tools.CWM/src/orgomg/cwm/foundation/expressions/impl/ExpressionsFactoryImpl.java | Java | lgpl-3.0 | 3,227 |
package org.molgenis.js;
import org.molgenis.js.nashorn.NashornScriptEngine;
import org.springframework.stereotype.Service;
import javax.script.ScriptException;
import static java.util.Objects.requireNonNull;
/**
* Executes a JavaScript
*/
@Service
class JsScriptExecutor
{
private final NashornScriptEngine jsScriptEngine;
public JsScriptExecutor(NashornScriptEngine jsScriptEngine)
{
this.jsScriptEngine = requireNonNull(jsScriptEngine);
}
/**
* Executes the given JavaScript, e.g. 'var product = 2 * 3; return product;'
*
* @param jsScript JavaScript
* @return value of which the type depends on the JavaScript type of the returned variable
*/
Object executeScript(String jsScript)
{
String jsScriptWithFunction = "(function (){" + jsScript + "})();";
try
{
return jsScriptEngine.eval(jsScriptWithFunction);
}
catch (ScriptException e)
{
throw new org.molgenis.script.core.ScriptException(e);
}
}
}
| ChaoPang/molgenis | molgenis-js/src/main/java/org/molgenis/js/JsScriptExecutor.java | Java | lgpl-3.0 | 950 |
// <copyright file="LocaleTests.cs" company="Allors bvba">
// Copyright (c) Allors bvba. All rights reserved.
// Licensed under the LGPL license. See LICENSE file in the project root for full license information.
// </copyright>
namespace Tests
{
using Allors;
using Allors.Domain;
using Allors.Meta;
using Xunit;
public class LocaleTests : DomainTest
{
[Fact]
public void GivenLocale_WhenDeriving_ThenRequiredRelationsMustExist()
{
var builder = new LocaleBuilder(this.Session);
builder.Build();
Assert.True(this.Session.Derive(false).HasErrors);
this.Session.Rollback();
builder.WithLanguage(new Languages(this.Session).FindBy(M.Language.IsoCode, "en"));
builder.Build();
Assert.True(this.Session.Derive(false).HasErrors);
this.Session.Rollback();
builder.WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE"));
builder.Build();
Assert.False(this.Session.Derive(false).HasErrors);
}
[Fact]
public void GivenLocale_WhenDeriving_ThenNameIsSet()
{
var locale = new LocaleBuilder(this.Session)
.WithLanguage(new Languages(this.Session).FindBy(M.Language.IsoCode, "en"))
.WithCountry(new Countries(this.Session).FindBy(M.Country.IsoCode, "BE"))
.Build();
this.Session.Derive();
Assert.Equal("en-BE", locale.Name);
}
[Fact]
public void GivenLocaleWhenValidatingThenRequiredRelationsMustExist()
{
var dutch = new Languages(this.Session).LanguageByCode["nl"];
var netherlands = new Countries(this.Session).CountryByIsoCode["NL"];
var builder = new LocaleBuilder(this.Session);
builder.Build();
Assert.True(this.Session.Derive(false).HasErrors);
builder.WithLanguage(dutch).Build();
Assert.True(this.Session.Derive(false).HasErrors);
builder.WithCountry(netherlands).Build();
Assert.False(this.Session.Derive(false).HasErrors);
}
[Fact]
public void GivenLocaleWhenValidatingThenNameIsSet()
{
var locale = new Locales(this.Session).FindBy(M.Locale.Name, Locales.DutchNetherlandsName);
Assert.Equal("nl-NL", locale.Name);
}
}
}
| Allors/allors2 | Core/Database/Domain.Tests/Domain/Localization/LocaleTests.cs | C# | lgpl-3.0 | 2,463 |
// Copyright (C) 2000-2007, Luca Padovani <padovani@sti.uniurb.it>.
//
// This file is part of GtkMathView, a flexible, high-quality rendering
// engine for MathML documents.
//
// GtkMathView is free software; you can redistribute it and/or modify it
// either under the terms of the GNU Lesser General Public License version
// 3 as published by the Free Software Foundation (the "LGPL") or, at your
// option, under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation (the "GPL"). If you do not
// alter this notice, a recipient may use your version of this file under
// either the GPL or the LGPL.
//
// GtkMathView is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LGPL or
// the GPL for more details.
//
// You should have received a copy of the LGPL and of the GPL along with
// this program in the files COPYING-LGPL-3 and COPYING-GPL-2; if not, see
// <http://www.gnu.org/licenses/>.
#include <config.h>
#include <cassert>
#include "AbstractLogger.hh"
#include "MathMLAttributeSignatures.hh"
#include "MathMLActionElement.hh"
#include "MathMLOperatorElement.hh"
#include "FormattingContext.hh"
#include "MathGraphicDevice.hh"
#include "ValueConversion.hh"
MathMLActionElement::MathMLActionElement(const SmartPtr<class MathMLNamespaceContext>& context)
: MathMLLinearContainerElement(context)
{
selection = 0;
}
MathMLActionElement::~MathMLActionElement()
{ }
AreaRef
MathMLActionElement::format(FormattingContext& ctxt)
{
if (dirtyLayout())
{
ctxt.push(this);
if (SmartPtr<Value> value = GET_ATTRIBUTE_VALUE(MathML, Action, selection))
selection = ToInteger(value) - 1;
else
selection = 0;
if (SmartPtr<Value> vAction = GET_ATTRIBUTE_VALUE(MathML, Action, actiontype))
{
String action = ToString(vAction);
if (action == "toggle")
{
// nothing to do, selecting the element is just fine
// but we want to have cycling
selection %= getSize();
}
else
getLogger()->out(LOG_WARNING, "action `%s' is not supported (ignored)", action.c_str());
}
else
getLogger()->out(LOG_WARNING, "no action specified for `maction' element");
AreaRef res;
if (selection < getSize())
if (SmartPtr<MathMLElement> elem = getChild(selection))
res = elem->format(ctxt);
if (!res) res = ctxt.MGD()->dummy(ctxt);
assert(res);
setArea(ctxt.MGD()->wrapper(ctxt, res));
ctxt.pop();
resetDirtyLayout();
}
return getArea();
}
SmartPtr<MathMLOperatorElement>
MathMLActionElement::getCoreOperator()
{
if (selection < getSize())
if (SmartPtr<MathMLElement> elem = getChild(selection))
return elem->getCoreOperator();
return nullptr;
}
| khaledhosny/libmathview | src/engine/MathMLActionElement.cc | C++ | lgpl-3.0 | 2,861 |
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
class CommandBlock extends Solid{
protected $id = self::COMMAND_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function canBeActivated() : bool {
return true;
}
public function getName() : string{
return "Command Block";
}
public function getHardness() {
return -1;
}
}
| Rocky-Software/Rocky | src/pocketmine/block/CommandBlock.php | PHP | lgpl-3.0 | 1,096 |
<?php
/*
* This file is part of Webasyst framework.
*
* Licensed under the terms of the GNU Lesser General Public License (LGPL).
* http://www.webasyst.com/framework/license/
*
* @link http://www.webasyst.com/
* @author Webasyst LLC
* @copyright 2011 Webasyst LLC
* @package wa-system
* @subpackage controller
*/
abstract class waViewActions extends waController
{
use waActionTemplatePathBuilder;
protected $action;
protected $template;
/**
* @depecated
* Use getTemplateDir to set directory of your templates
* @see getTemplateDir
* @var string
*/
protected $template_folder = 'templates/actions/';
/**
* Is relative template path ($this->template), so we can use auto mechanism of choosing template folder (waActionTemplatePathBuilder)
* Relative means relative from template dir of current application (plugin)
* @var bool
*/
protected $is_relative = false;
/**
* @var waLayout
*/
protected $layout;
/**
* @var waSmarty3View
*/
protected $view;
/**
* @var waTheme
*/
protected $theme;
/**
* @var waSystem
*/
protected $system;
public function __construct(waSystem $system = null)
{
if ($system) {
$this->system = $system;
} else {
$this->system = waSystem::getInstance();
}
$this->view = waSystem::getInstance()->getView();
}
public function setLayout(waLayout $layout)
{
$this->layout = $layout;
}
protected function preExecute()
{
}
public function execute($action, $params = null)
{
$method = $action.'Action';
if (method_exists($this, $method)) {
$this->$method($params);
} else {
throw new waException('Action '.$method.' not found', 404);
}
}
public function postExecute()
{
}
public function run($params = null)
{
$action = $params;
if (!$action) {
$action = 'default';
}
if ($action != 'logout') {
wa()->getUser()->updateLastPage();
}
if ($this->getRequest()->isMobile() && method_exists($this, $action."MobileAction")) {
$action = $action."Mobile";
}
$this->action = $action;
$this->preExecute();
$this->execute($this->action);
$this->postExecute();
$this->display();
}
protected function getTemplate()
{
if ($this->template === null) {
$template = ucfirst($this->action);
} else {
// If path contains / or : then it's a full path to template
if (strpbrk($this->template, '/:') !== false) {
return $this->template;
}
// otherwise it's a template name and we need to figure out its directory
$template = $this->template;
}
$pluginRoot = $this->getPluginRoot();
preg_match("/([A-Z][^A-Z]+)/", get_class($this), $match);
if ($pluginRoot) {
$old_style_match = $match;
$match = array();
preg_match("/Plugin([A-Z][^A-Z]+)/", get_class($this), $match);
}
$app_id = $this->getAppId();
$template_path = strtolower($match[1])."/".$match[1].$template;
$full_template = $this->buildTemplatePath($this->view, $app_id, $template_path, $pluginRoot);
if (!$pluginRoot || file_exists(wa()->getAppPath().'/'.$full_template)) {
return $full_template;
}
// There used to be a bug that made this class look for plugin templates in the wrong place.
// The bug was fixed, and the path calculated above should go for all modern uses.
// But for compatibility with older plugins we still check for a template in old place.
$template_path = strtolower($old_style_match[1])."/".$old_style_match[1].$template;
$full_template2 = $this->buildTemplatePath($this->view, $app_id, $template_path, $pluginRoot);
if (file_exists(wa()->getAppPath().'/'.$full_template2)) {
return $full_template2;
}
return $full_template;
}
/**
* Set custom template
*
* @param string $template
* Template path
*
* @param bool $is_relative
* Is relative from template dir of current application (plugin)
*/
public function setTemplate($template, $is_relative = false)
{
$this->template = $template;
// TODO: not implement case when we set relative template path, see how implemented in waViewAction
$this->is_relative = $is_relative;
}
protected function setThemeTemplate($template)
{
$this->template = 'file:'.$template;
return $this->view->setThemeTemplate($this->getTheme(), $template);
}
/**
* Return current theme
*
* @return waTheme
* @throws waException
*/
public function getTheme()
{
if ($this->theme == null) {
$this->theme = new waTheme(waRequest::getTheme());
}
return $this->theme;
}
public function display()
{
if ($this->layout && $this->layout instanceof waLayout) {
$this->layout->setBlock('content', $this->view->fetch($this->getTemplate()));
$this->layout->display();
} else {
waSystem::getInstance()->getResponse()->sendHeaders();
$this->view->display($this->getTemplate());
}
}
/**
* @inheritDoc
*/
protected function getTemplateDir()
{
return $this->template_folder;
}
/**
* @inheritDoc
*/
protected function getLegacyTemplateDir()
{
return 'templates/actions-legacy/';
}
}
// EOF
| webasyst/webasyst-framework | wa-system/controller/waViewActions.class.php | PHP | lgpl-3.0 | 5,831 |
import _ from 'underscore';
import State from 'components/navigator/models/state';
export default State.extend({
defaults: {
page: 1,
maxResultsReached: false,
query: {},
facets: ['facetMode', 'severities', 'resolutions'],
isContext: false,
allFacets: [
'facetMode',
'issues',
'severities',
'resolutions',
'statuses',
'createdAt',
'rules',
'tags',
'projectUuids',
'moduleUuids',
'directories',
'fileUuids',
'assignees',
'reporters',
'authors',
'languages',
'actionPlans'
],
facetsFromServer: [
'severities',
'statuses',
'resolutions',
'actionPlans',
'projectUuids',
'directories',
'rules',
'moduleUuids',
'tags',
'assignees',
'reporters',
'authors',
'fileUuids',
'languages',
'createdAt'
],
transform: {
'resolved': 'resolutions',
'assigned': 'assignees',
'planned': 'actionPlans',
'createdBefore': 'createdAt',
'createdAfter': 'createdAt',
'createdInLast': 'createdAt'
}
},
getFacetMode: function () {
var query = this.get('query');
return query.facetMode || 'count';
},
toJSON: function () {
return _.extend({ facetMode: this.getFacetMode() }, this.attributes);
}
});
| sulabh-msft/sonarqube | server/sonar-web/src/main/js/apps/issues/models/state.js | JavaScript | lgpl-3.0 | 1,371 |
/*
* SonarAnalyzer for .NET
* Copyright (C) 2015-2016 SonarSource SA
* mailto:contact@sonarsource.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
using System.Collections.Immutable;
using System.Linq;
using Microsoft.CodeAnalysis;
using SonarAnalyzer.Common;
using SonarAnalyzer.Helpers;
using System.Collections.Generic;
namespace SonarAnalyzer.Rules.Common
{
public abstract class OptionalParameterBase : SonarDiagnosticAnalyzer
{
protected const string DiagnosticId = "S2360";
protected const string Title = "Optional parameters should not be used";
protected const string Description =
"The overloading mechanism should be used in place of optional parameters for several reasons. " +
"Optional parameter values are baked into the method call site code, thus, if a default " +
"value has been changed, all referencing assemblies need to be rebuilt, otherwise the original values will be used. The " +
"Common Language Specification (CLS) allows compilers to ignore default parameter values, and thus require the caller to " +
"explicitly specify the values. The concept of optional argument exists only in VB.Net and C#. In all other languages " +
"like C++ or Java, the overloading mechanism is the only way to get the same behavior. " +
"Optional parameters prevent muddying the definition of the function contract. Here is a simple " +
"example: if there are two optional parameters, when one is defined, is the second one still optional or mandatory?";
protected const string MessageFormat = "Use the overloading mechanism instead of the optional parameters.";
protected const string Category = SonarAnalyzer.Common.Category.Design;
protected const Severity RuleSeverity = Severity.Major;
protected const bool IsActivatedByDefault = true;
protected static readonly DiagnosticDescriptor Rule =
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category,
RuleSeverity.ToDiagnosticSeverity(), IsActivatedByDefault,
helpLinkUri: DiagnosticId.GetHelpLink(),
description: Description);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } }
protected abstract GeneratedCodeRecognizer GeneratedCodeRecognizer { get; }
}
public abstract class OptionalParameterBase<TLanguageKindEnum, TMethodSyntax, TParameterSyntax> : OptionalParameterBase
where TLanguageKindEnum : struct
where TMethodSyntax : SyntaxNode
where TParameterSyntax: SyntaxNode
{
protected override void Initialize(SonarAnalysisContext context)
{
context.RegisterSyntaxNodeActionInNonGenerated(
GeneratedCodeRecognizer,
c =>
{
var method = (TMethodSyntax)c.Node;
var symbol = c.SemanticModel.GetDeclaredSymbol(method);
if (symbol == null ||
!symbol.IsPublicApi() ||
symbol.IsInterfaceImplementationOrMemberOverride())
{
return;
}
var parameters = GetParameters(method);
foreach (var parameter in parameters.Where(p => IsOptional(p) && !HasAllowedAttribute(p, c.SemanticModel)))
{
var location = GetReportLocation(parameter);
c.ReportDiagnostic(Diagnostic.Create(Rule, location));
}
},
SyntaxKindsOfInterest.ToArray());
}
private static bool HasAllowedAttribute(TParameterSyntax parameterSyntax, SemanticModel semanticModel)
{
var parameterSymbol = semanticModel.GetDeclaredSymbol(parameterSyntax) as IParameterSymbol;
return parameterSymbol == null ||
parameterSymbol.GetAttributes().Any(attr => attr.AttributeClass.IsAny(KnownType.CallerInfoAttributes));
}
protected abstract IEnumerable<TParameterSyntax> GetParameters(TMethodSyntax method);
protected abstract bool IsOptional(TParameterSyntax parameter);
protected abstract Location GetReportLocation(TParameterSyntax parameter);
public abstract ImmutableArray<TLanguageKindEnum> SyntaxKindsOfInterest { get; }
}
}
| tvsonar/sonarlint-roslyn-analyzer | src/SonarAnalyzer.Common/Rules/OptionalParameterBase.cs | C# | lgpl-3.0 | 5,213 |
package adcom1
// APIFramework represents API frameworks either supported by a placement or required by an ad.
type APIFramework int
// API frameworks either supported by a placement or required by an ad.
//
// Values of 500+ hold vendor-specific codes.
const (
APIVPAID1 APIFramework = 1 // VPAID 1.0
APIVPAID2 APIFramework = 2 // VPAID 2.0
APIMRAID1 APIFramework = 3 // MRAID 1.0
APIORMMA APIFramework = 4 // ORMMA
APIMRAID2 APIFramework = 5 // MRAID 2.0
APIMRAID3 APIFramework = 6 // MRAID 3.0
APIOMID1 APIFramework = 7 // OMID 1.0
)
| mxmCherry/go-rtb | adcom1/api_framework.go | GO | unlicense | 548 |
package crazypants.enderio.machines.machine.generator.combustion;
import javax.annotation.Nonnull;
import com.enderio.core.common.network.MessageTileEntity;
import com.enderio.core.common.network.NetworkUtil;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
public class PacketCombustionTank extends MessageTileEntity<TileCombustionGenerator> {
public NBTTagCompound nbtRoot;
public PacketCombustionTank() {
}
public PacketCombustionTank(@Nonnull TileCombustionGenerator tile) {
super(tile);
nbtRoot = new NBTTagCompound();
if (tile.getCoolantTank().getFluidAmount() > 0) {
NBTTagCompound tankRoot = new NBTTagCompound();
tile.getCoolantTank().writeToNBT(tankRoot);
nbtRoot.setTag("coolantTank", tankRoot);
}
if (tile.getFuelTank().getFluidAmount() > 0) {
NBTTagCompound tankRoot = new NBTTagCompound();
tile.getFuelTank().writeToNBT(tankRoot);
nbtRoot.setTag("fuelTank", tankRoot);
}
}
@Override
public void toBytes(ByteBuf buf) {
super.toBytes(buf);
NetworkUtil.writeNBTTagCompound(nbtRoot, buf);
}
@Override
public void fromBytes(ByteBuf buf) {
super.fromBytes(buf);
nbtRoot = NetworkUtil.readNBTTagCompound(buf);
}
public static class Handler implements IMessageHandler<PacketCombustionTank, IMessage> {
@Override
public IMessage onMessage(PacketCombustionTank message, MessageContext ctx) {
TileCombustionGenerator tile = message.getTileEntity(message.getWorld(ctx));
if (tile != null) {
if (message.nbtRoot.hasKey("coolantTank")) {
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("coolantTank");
tile.getCoolantTank().readFromNBT(tankRoot);
} else {
tile.getCoolantTank().setFluid(null);
}
if (message.nbtRoot.hasKey("fuelTank")) {
NBTTagCompound tankRoot = message.nbtRoot.getCompoundTag("fuelTank");
tile.getFuelTank().readFromNBT(tankRoot);
} else {
tile.getFuelTank().setFluid(null);
}
}
return null;
}
}
}
| HenryLoenwind/EnderIO | enderio-machines/src/main/java/crazypants/enderio/machines/machine/generator/combustion/PacketCombustionTank.java | Java | unlicense | 2,318 |
GoogleElectionMap.shapeReady({name:"23_03",type:"state",state:"23_03",bounds:[],centroid:[],shapes:[
{points:[
{x:30.7337437360944,y: 29.4749206150606}
,
{x:30.7337582665663,y: 29.4744813215764}
,
{x:30.7337486793531,y: 29.4741262248318}
,
{x:30.733830562916,y: 29.4738380667479}
,
{x:30.7340080361753,y: 29.473327820204}
,
{x:30.7341651878043,y: 29.4730517736908}
,
{x:30.7344520513946,y: 29.4725116240948}
,
{x:30.7348409855116,y: 29.4716351886096}
,
{x:30.7351955311194,y: 29.4708009063601}
,
{x:30.7355230909151,y: 29.470284457395}
,
{x:30.7356461458813,y: 29.4702005296548}
,
{x:30.7357896998111,y: 29.4700986083796}
,
{x:30.7361318864607,y: 29.4700270493557}
,
{x:30.7368097530362,y: 29.4699861094456}
,
{x:30.7377482316251,y: 29.4699937683244}
,
{x:30.7384815604343,y: 29.4700492232038}
,
{x:30.7389134276977,y: 29.4700801118416}
,
{x:30.7392218783081,y: 29.4700747192928}
,
{x:30.7395645031246,y: 29.4700153232616}
,
{x:30.7399344083467,y: 29.4698838849901}
,
{x:30.7404890366786,y: 29.469572570395}
,
{x:30.7408929605935,y: 29.4693030177812}
,
{x:30.7413516785204,y: 29.4689855286123}
,
{x:30.7416668608143,y: 29.4688711551074}
,
{x:30.7420026581117,y: 29.4684933258493}
,
{x:30.7421416020257,y: 29.4681985365659}
,
{x:30.7423497370518,y: 29.4676867259306}
,
{x:30.7424565146772,y: 29.4673082910482}
,
{x:30.7425000289238,y: 29.4670354957972}
,
{x:30.7425056652583,y: 29.4668461382614}
,
{x:30.7424668409555,y: 29.4666789364439}
,
{x:30.7422670459396,y: 29.4660545177651}
,
{x:30.7419648424728,y: 29.4653461667668}
,
{x:30.7416691866977,y: 29.4647324511917}
,
{x:30.7414450472983,y: 29.4644420870476}
,
{x:30.7412406086227,y: 29.4642688023198}
,
{x:30.7401905455219,y: 29.4635336424456}
,
{x:30.7397409112532,y: 29.4630715614163}
,
{x:30.7395507834021,y: 29.4629322724499}
,
{x:30.7382444639931,y: 29.4622795741388}
,
{x:30.7371792803851,y: 29.4616884641447}
,
{x:30.7363487337865,y: 29.4612145021051}
,
{x:30.7355495073343,y: 29.4609072956145}
,
{x:30.7358250611577,y: 29.4599354368675}
,
{x:30.7359917766136,y: 29.4593078718213}
,
{x:30.7361455887816,y: 29.4587580729151}
,
{x:30.7363879130626,y: 29.4583529220415}
,
{x:30.7366881858206,y: 29.4576367148205}
,
{x:30.7368929145404,y: 29.4570370062853}
,
{x:30.7370588700427,y: 29.4566983819849}
,
{x:30.7372942325628,y: 29.4565265937063}
,
{x:30.7376252334876,y: 29.4561994085593}
,
{x:30.7378424223598,y: 29.4556886294292}
,
{x:30.7382262022104,y: 29.4545891766355}
,
{x:30.7383731022319,y: 29.4542505131024}
,
{x:30.7388826905544,y: 29.4536013932698}
,
{x:30.7390678373166,y: 29.4532016805322}
,
{x:30.7392468618439,y: 29.4527130501728}
,
{x:30.7394001329191,y: 29.452363284033}
,
{x:30.7394900722483,y: 29.4519522710418}
,
{x:30.7395355120611,y: 29.4515633960248}
,
{x:30.7394854055327,y: 29.4512965801288}
,
{x:30.739371884094,y: 29.4510018549404}
,
{x:30.7393531799295,y: 29.4508684597027}
,
{x:30.7394045117693,y: 29.4506574087628}
,
{x:30.7394938650466,y: 29.4504742161552}
,
{x:30.7398250373363,y: 29.4500692321482}
,
{x:30.740226527166,y: 29.4494754609916}
,
{x:30.7405069043938,y: 29.4490703761509}
,
{x:30.7400177748161,y: 29.4491805500574}
,
{x:30.7387601153286,y: 29.449422569003}
,
{x:30.7380931343112,y: 29.4495657247787}
,
{x:30.7374705771966,y: 29.449714522576}
,
{x:30.7371592040349,y: 29.4498250380094}
,
{x:30.7369628582897,y: 29.4489026698636}
,
{x:30.7366615293747,y: 29.4479919447956}
,
{x:30.7365395755887,y: 29.4475420370496}
,
{x:30.7363906374871,y: 29.447523067697}
,
{x:30.7361748456451,y: 29.4475004117503}
,
{x:30.7360036366457,y: 29.4474222784614}
,
{x:30.7358201509829,y: 29.4471829781191}
,
{x:30.7355735289301,y: 29.4468101922278}
,
{x:30.735370466963,y: 29.4464170241559}
,
{x:30.7354162353409,y: 29.4462653285985}
,
{x:30.735716420475,y: 29.4455713484906}
,
{x:30.7373803948223,y: 29.4453079378134}
,
{x:30.7388856789663,y: 29.4450330792086}
,
{x:30.7388169907413,y: 29.4445884134864}
,
{x:30.7391086302998,y: 29.4437615183476}
,
{x:30.7378591490194,y: 29.444292021291}
,
{x:30.7375795499263,y: 29.4443970441259}
,
{x:30.7374621985322,y: 29.4444031352381}
,
{x:30.737262746987,y: 29.4442437051023}
,
{x:30.7372359846121,y: 29.4433274026637}
,
{x:30.7368001953099,y: 29.4424882910357}
,
{x:30.7365862524853,y: 29.4424108540421}
,
{x:30.7364591654842,y: 29.4424106372243}
,
{x:30.7362022374827,y: 29.4424728463009}
,
{x:30.7360390036726,y: 29.442472628165}
,
{x:30.7361072257927,y: 29.4417523643756}
,
{x:30.7362794302522,y: 29.4408444995286}
,
{x:30.7366378276657,y: 29.4405015804495}
,
{x:30.7391084162232,y: 29.439785218456}
,
{x:30.7412172181524,y: 29.439402996603}
,
{x:30.7415026306487,y: 29.4390004546775}
,
{x:30.7423050705707,y: 29.438280152704}
,
{x:30.7421676801541,y: 29.4381139448919}
,
{x:30.7419315746239,y: 29.438081676141}
,
{x:30.7415719415553,y: 29.4380244976538}
,
{x:30.7411969521894,y: 29.4364980974541}
,
{x:30.7455262798143,y: 29.4349367234314}
,
{x:30.7454644699524,y: 29.4348990626453}
,
{x:30.7434187266449,y: 29.4335745864446}
,
{x:30.7406584030479,y: 29.4318847584242}
,
{x:30.7384461601571,y: 29.4304243161169}
,
{x:30.7357737849628,y: 29.4288494352676}
,
{x:30.7331430312176,y: 29.4272931140216}
,
{x:30.73312542294,y: 29.427260050583}
,
{x:30.7330799198185,y: 29.4271746058677}
,
{x:30.7330712458675,y: 29.4270892577748}
,
{x:30.7330517060069,y: 29.4268971764162}
,
{x:30.7332300230628,y: 29.4265595060341}
,
{x:30.7333435244158,y: 29.4263888708761}
,
{x:30.7343528226002,y: 29.4257258251609}
,
{x:30.7358127749672,y: 29.4248199480257}
,
{x:30.7364616132564,y: 29.4243334632074}
,
{x:30.7366660075708,y: 29.4236715481926}
,
{x:30.7367512272029,y: 29.4233952286899}
,
{x:30.7366843374453,y: 29.4233542542525}
,
{x:30.7353990383438,y: 29.4228393171567}
,
{x:30.7351118187787,y: 29.4228212005417}
,
{x:30.73500225186,y: 29.4228142902166}
,
{x:30.7342033253787,y: 29.4230714129566}
,
{x:30.73367698799,y: 29.4231911687554}
,
{x:30.7333292322704,y: 29.42323019218}
,
{x:30.7331412796385,y: 29.4232292234641}
,
{x:30.7328593930546,y: 29.4232032885458}
,
{x:30.731640415284,y: 29.4230338598676}
,
{x:30.730453868302,y: 29.4227707529317}
,
{x:30.7297147626786,y: 29.4226278751322}
,
{x:30.7287707549539,y: 29.4224515611718}
,
{x:30.7287776886447,y: 29.4224034296635}
,
{x:30.7280650308892,y: 29.4224622009933}
,
{x:30.7275062974059,y: 29.4225965259462}
,
{x:30.7269966198536,y: 29.422741919035}
,
{x:30.7269674740754,y: 29.4227550999955}
,
{x:30.7270318936572,y: 29.422603694839}
,
{x:30.7270598544851,y: 29.4225156594833}
,
{x:30.727146379139,y: 29.4223664301708}
,
{x:30.7272667082426,y: 29.4222066551446}
,
{x:30.727423907376,y: 29.4220363458895}
,
{x:30.7274671751401,y: 29.4219537084898}
,
{x:30.7275442095132,y: 29.4218738864323}
,
{x:30.727655046024,y: 29.4217861924436}
,
{x:30.7278767190654,y: 29.4216054549384}
,
{x:30.7279752795676,y: 29.4215096861137}
,
{x:30.7279726615412,y: 29.4212316099489}
,
{x:30.7280051743655,y: 29.4205334788643}
,
{x:30.7280403583748,y: 29.4200493677364}
,
{x:30.7280446891821,y: 29.4199300720758}
,
{x:30.727952746346,y: 29.419627897962}
,
{x:30.7279577239146,y: 29.4194610587148}
,
{x:30.7280342650715,y: 29.4192421973075}
,
{x:30.72820404981,y: 29.4190007250843}
,
{x:30.7284181785548,y: 29.418731338193}
,
{x:30.7285680130932,y: 29.418356383696}
,
{x:30.7286541108598,y: 29.4179436360357}
,
{x:30.7287994567796,y: 29.4173709649866}
,
{x:30.7288804574012,y: 29.4171080083002}
,
{x:30.7289332306787,y: 29.4168554682499}
,
{x:30.7289903399727,y: 29.4163617942551}
,
{x:30.7289786525612,y: 29.4161500493829}
,
{x:30.7289506742527,y: 29.4160200587721}
,
{x:30.7288666112848,y: 29.4157143382592}
,
{x:30.7288630234007,y: 29.4154299764237}
,
{x:30.7289345564532,y: 29.4151050000654}
,
{x:30.7290772404869,y: 29.4148128906473}
,
{x:30.7291941702515,y: 29.414651818156}
,
{x:30.7294157781056,y: 29.4144419623028}
,
{x:30.729597143231,y: 29.4142144002844}
,
{x:30.7296780628307,y: 29.4140274966577}
,
{x:30.7297343494422,y: 29.4138813462987}
,
{x:30.7298112856656,y: 29.4134567887334}
,
{x:30.7299737566905,y: 29.4126527352428}
,
{x:30.7300706000678,y: 29.412358131041}
,
{x:30.7301785764019,y: 29.4116515855356}
,
{x:30.7303288528371,y: 29.4114975886515}
,
{x:30.730452317884,y: 29.411338818064}
,
{x:30.7305811603619,y: 29.4111519717049}
,
{x:30.7306806797498,y: 29.4109145282342}
,
{x:30.7307491214927,y: 29.4106859961449}
,
{x:30.7307440311447,y: 29.4101712300579}
,
{x:30.7307282316302,y: 29.4100305171762}
,
{x:30.7307447629516,y: 29.4097867498468}
,
{x:30.7308909017426,y: 29.4092947353471}
,
{x:30.7310254729272,y: 29.4086106754117}
,
{x:30.7311658592945,y: 29.4080015104806}
,
{x:30.7312771492001,y: 29.4074622357346}
,
{x:30.7313653496698,y: 29.4072799555832}
,
{x:30.7314247050485,y: 29.407040975026}
,
{x:30.731435828596,y: 29.4068299931534}
,
{x:30.7314106113617,y: 29.406545315689}
,
{x:30.7313457759283,y: 29.4063608306648}
,
{x:30.7312391878276,y: 29.4061354631855}
,
{x:30.7310284431496,y: 29.4057120946044}
,
{x:30.7310384973009,y: 29.4056758810444}
,
{x:30.7310420428853,y: 29.4056734302509}
,
{x:30.7311649476767,y: 29.4055884838249}
,
{x:30.7313438644594,y: 29.4053944124492}
,
{x:30.7315054801169,y: 29.4051430684889}
,
{x:30.7316059972201,y: 29.4049602233563}
,
{x:30.7316760373083,y: 29.4047772966778}
,
{x:30.7317069526441,y: 29.4045675639953}
,
{x:30.7316724495034,y: 29.4044148847414}
,
{x:30.7316987469361,y: 29.4043310272223}
,
{x:30.7320132449941,y: 29.4038282677363}
,
{x:30.7321146721101,y: 29.4032181408042}
,
{x:30.7322381790278,y: 29.4024707236474}
,
{x:30.7323309792735,y: 29.4018414858947}
,
{x:30.7322853555342,y: 29.4012752069567}
,
{x:30.7321638227537,y: 29.40109558632}
,
{x:30.7320118379297,y: 29.4009197203433}
,
{x:30.7319468405862,y: 29.4007593080992}
,
{x:30.7319557458559,y: 29.4006333967044}
,
{x:30.7319951223603,y: 29.4004961021312}
,
{x:30.7320954343258,y: 29.4003398553316}
,
{x:30.7322000312708,y: 29.4002217751093}
,
{x:30.7322828780818,y: 29.4001036488691}
,
{x:30.7323570802729,y: 29.3999511602741}
,
{x:30.7324358055263,y: 29.399695646405}
,
{x:30.732471144491,y: 29.399375175207}
,
{x:30.7325367875318,y: 29.3991425327781}
,
{x:30.7327373372062,y: 29.3988719959889}
,
{x:30.7327681946768,y: 29.398635468793}
,
{x:30.7328431930837,y: 29.3980365211652}
,
{x:30.7329114981892,y: 29.3978625093322}
,
{x:30.7330654648884,y: 29.3977812809144}
,
{x:30.7331438475188,y: 29.3977280058781}
,
{x:30.7331830659477,y: 29.3976861053986}
,
{x:30.7332092917617,y: 29.3976136532079}
,
{x:30.7331926690207,y: 29.3971900683178}
,
{x:30.7331977931336,y: 29.396774163638}
,
{x:30.7331635146992,y: 29.3965031889163}
,
{x:30.7331202956336,y: 29.39636193337}
,
{x:30.7330770942221,y: 29.396213047361}
,
{x:30.7330251452101,y: 29.3960908570079}
,
{x:30.7329817980535,y: 29.3960182840716}
,
{x:30.7329689389761,y: 29.3959228735119}
,
{x:30.7330214033613,y: 29.3957817931135}
,
{x:30.7331347571971,y: 29.3956370049979}
,
{x:30.7334118160231,y: 29.3952359650217}
,
{x:30.7337755764967,y: 29.394852121998}
,
{x:30.7339368550701,y: 29.3946616201353}
,
{x:30.7342722225742,y: 29.3943950931066}
,
{x:30.7344291047702,y: 29.3942274697061}
,
{x:30.7346252531711,y: 29.3939950440335}
,
{x:30.7346951558955,y: 29.3938349067947}
,
{x:30.7347390113719,y: 29.3936556501883}
,
{x:30.7347525623744,y: 29.3934153012405}
,
{x:30.7348400836751,y: 29.3931521774434}
,
{x:30.7348882468717,y: 29.392995823555}
,
{x:30.7348798061697,y: 29.3928775349749}
,
{x:30.7349106567083,y: 29.3926868179713}
,
{x:30.7349459912611,y: 29.3924350649739}
,
{x:30.7349724665977,y: 29.3922596045483}
,
{x:30.7350162073598,y: 29.3921413989231}
,
{x:30.7350642379614,y: 29.3920499071963}
,
{x:30.7351557133695,y: 29.3919737405356}
,
{x:30.7352601795982,y: 29.3919204844525}
,
{x:30.7353689684882,y: 29.3918786789406}
,
{x:30.7354820788351,y: 29.3918483258012}
,
{x:30.7357342539947,y: 29.3918449939408}
,
{x:30.7358172216207,y: 29.3918459706098}
,
{x:30.7359608674845,y: 29.3918476610477}
,
{x:30.7361223017821,y: 29.3918531439838}
,
{x:30.7361492648989,y: 29.3909717991161}
,
{x:30.7361628921851,y: 29.3907200187137}
,
{x:30.7362460677994,y: 29.3904759694585}
,
{x:30.7364158869453,y: 29.3900604888871}
,
{x:30.7367064587319,y: 29.3895083841157}
,
{x:30.7368666804594,y: 29.3891636924934}
,
{x:30.7370897286574,y: 29.3885848819216}
,
{x:30.7372120813362,y: 29.3883370751517}
,
{x:30.7373736914701,y: 29.3880397276274}
,
{x:30.737619042892,y: 29.3876259368193}
,
{x:30.7377884073655,y: 29.3873764806622}
,
{x:30.7379458510552,y: 29.3869770131204}
,
{x:30.7380161098829,y: 29.3867587836825}
,
{x:30.7383446439709,y: 29.3865205362579}
,
{x:30.7385380033517,y: 29.3862910440277}
,
{x:30.7385943623703,y: 29.3861765377117}
,
{x:30.7386180860088,y: 29.3860325345592}
,
{x:30.7386282805399,y: 29.3858485454466}
,
{x:30.7385984580431,y: 29.3856839962993}
,
{x:30.7383941908826,y: 29.3849698933518}
,
{x:30.7382247284306,y: 29.3843054984266}
,
{x:30.73799021255,y: 29.3835380386987}
,
{x:30.7377383717043,y: 29.3827108248403}
,
{x:30.7374075054814,y: 29.3818738659019}
,
{x:30.7373905114762,y: 29.381843993739}
,
{x:30.7372074948858,y: 29.3815222856306}
,
{x:30.7369292292685,y: 29.3810102407829}
,
{x:30.7368378184757,y: 29.3807465984936}
,
{x:30.7368071907278,y: 29.3805249978369}
,
{x:30.7366756233385,y: 29.3801834025026}
,
{x:30.7367152384436,y: 29.3799893661398}
,
{x:30.7368069807393,y: 29.3798030461026}
,
{x:30.7370204908151,y: 29.379582712816}
,
{x:30.7372993040296,y: 29.3793168335935}
,
{x:30.7375212874628,y: 29.3791802518014}
,
{x:30.737682224169,y: 29.3791234784438}
,
{x:30.7381428130245,y: 29.3791443048569}
,
{x:30.7384858859347,y: 29.3791393146416}
,
{x:30.7386380806311,y: 29.3791335568585}
,
{x:30.7387252510581,y: 29.3790988977107}
,
{x:30.7388080335237,y: 29.3790153254861}
,
{x:30.7389258266404,y: 29.3788366671819}
,
{x:30.7390915578488,y: 29.378604817387}
,
{x:30.7392572188339,y: 29.37839961019}
,
{x:30.7394445015091,y: 29.3782363133086}
,
{x:30.7396926015186,y: 29.3780807489263}
,
{x:30.7399797437526,y: 29.3779519024796}
,
{x:30.7405755496939,y: 29.377774181953}
,
{x:30.7410928799071,y: 29.3776952648698}
,
{x:30.7418101361952,y: 29.3776053175386}
,
{x:30.7426055628594,y: 29.3775345491701}
,
{x:30.7431226598909,y: 29.3775469721388}
,
{x:30.7438268895987,y: 29.3776265787945}
,
{x:30.7442635614139,y: 29.3777150507872}
,
{x:30.7446606172503,y: 29.3777021951003}
,
{x:30.7448083962501,y: 29.3776910622892}
,
{x:30.7448954228917,y: 29.3776455550354}
,
{x:30.7450565926903,y: 29.3774936189912}
,
{x:30.7451311940447,y: 29.3772044929267}
,
{x:30.7450884544839,y: 29.3769189472961}
,
{x:30.7450846822872,y: 29.3766905695448}
,
{x:30.7451331428591,y: 29.3764280364316}
,
{x:30.7452509592861,y: 29.3762341480517}
,
{x:30.745577714722,y: 29.3758998331251}
,
{x:30.7460614195613,y: 29.375360285136}
,
{x:30.7466799709122,y: 29.374763899622}
,
{x:30.7471503162123,y: 29.3743499258152}
,
{x:30.7476467671322,y: 29.3739207749355}
,
{x:30.7478819591519,y: 29.3737042709532}
,
{x:30.7479691520653,y: 29.3735902517267}
,
{x:30.7480043397519,y: 29.3734190406798}
,
{x:30.7480613504983,y: 29.3732098089896}
,
{x:30.748127078842,y: 29.3729891758341}
,
{x:30.7483758138594,y: 29.3725671626624}
,
{x:30.7486331899291,y: 29.3721641966158}
,
{x:30.7488992458774,y: 29.3717650530788}
,
{x:30.7489952473424,y: 29.3716015691299}
,
{x:30.7491449055692,y: 29.371462066139}
,
{x:30.7492452072002,y: 29.3713936156567}
,
{x:30.7493737062256,y: 29.3713212028548}
,
{x:30.7497153063203,y: 29.3712650545796}
,
{x:30.7502105031874,y: 29.3712292000183}
,
{x:30.7506012363277,y: 29.3711957194385}
,
{x:30.7508600332519,y: 29.3711441123492}
,
{x:30.7509067987681,y: 29.3711347868122}
,
{x:30.7511041016956,y: 29.3710498489401}
,
{x:30.7512215562393,y: 29.3709967836654}
,
{x:30.7513522046017,y: 29.3708790370912}
,
{x:30.7514693622704,y: 29.3707188711231}
,
{x:30.7516273969964,y: 29.3705172857026}
,
{x:30.7518313673989,y: 29.370257106385}
,
{x:30.7521351101112,y: 29.3699246667849}
,
{x:30.7523064086644,y: 29.3698227077797}
,
{x:30.7524890590904,y: 29.3697621509414}
,
{x:30.7526455900965,y: 29.3697205753309}
,
{x:30.7528411083326,y: 29.3697285529759}
,
{x:30.7530714628188,y: 29.3697061460675}
,
{x:30.7532541031477,y: 29.3696493933947}
,
{x:30.7534542163257,y: 29.3695546122179}
,
{x:30.7538671541143,y: 29.3694982876135}
,
{x:30.7545103988575,y: 29.3694385839522}
,
{x:30.7548929738372,y: 29.3693593628357}
,
{x:30.7549190273763,y: 29.3693670239887}
,
{x:30.7549969756719,y: 29.3694775473016}
,
{x:30.7551834912847,y: 29.3696149153148}
,
{x:30.7556043953959,y: 29.3698592886608}
,
{x:30.7559168614569,y: 29.370023531305}
,
{x:30.7564378747642,y: 29.3701995756894}
,
{x:30.7568504853495,y: 29.3702802647081}
,
{x:30.757158946336,y: 29.3703036682679}
,
{x:30.7575023061997,y: 29.3702700424736}
,
{x:30.7584498960001,y: 29.3701385586821}
,
{x:30.759349676437,y: 29.3700107882149}
,
{x:30.7596451471473,y: 29.3700151316287}
,
{x:30.7602404773084,y: 29.3700047928204}
,
{x:30.7610830762164,y: 29.370169982998}
,
{x:30.7617347439102,y: 29.3702244449345}
,
{x:30.7619014945663,y: 29.3702922226078}
,
{x:30.7654172654264,y: 29.3699963309716}
,
{x:30.767813226812,y: 29.370013741085}
,
{x:30.7695122796071,y: 29.3692764513148}
,
{x:30.7715062721839,y: 29.3676201261079}
,
{x:30.7723375730886,y: 29.3668417051197}
,
{x:30.7730377808078,y: 29.3661855825875}
,
{x:30.7739290760942,y: 29.365513243719}
,
{x:30.7747421363417,y: 29.3651028616835}
,
{x:30.7756043334981,y: 29.3647756490932}
,
{x:30.7769020096993,y: 29.3644389261436}
,
{x:30.7770530874953,y: 29.3642855478207}
,
{x:30.7771253446836,y: 29.3639930204959}
,
{x:30.7774566557014,y: 29.3627160379801}
,
{x:30.7777395821559,y: 29.3621328756977}
,
{x:30.7779904724819,y: 29.3616683535709}
,
{x:30.7781350678152,y: 29.3615111641694}
,
{x:30.7783280344741,y: 29.3614220167217}
,
{x:30.7785826701407,y: 29.3613395574601}
,
{x:30.7787086434748,y: 29.3613074265354}
,
{x:30.7790668935957,y: 29.3613694493816}
,
{x:30.7799235585381,y: 29.3615278485162}
,
{x:30.7804063921102,y: 29.3616241998184}
,
{x:30.7807647771096,y: 29.3616247927567}
,
{x:30.7812321912911,y: 29.3615008031108}
,
{x:30.7814040039387,y: 29.3614552263432}
,
{x:30.781856099009,y: 29.3613535973595}
,
{x:30.7822223611869,y: 29.3613132505057}
,
{x:30.7830247860193,y: 29.3613350423348}
,
{x:30.7836481056298,y: 29.361315587066}
,
{x:30.7843650470065,y: 29.3612348569461}
,
{x:30.7851832548815,y: 29.3611611121652}
,
{x:30.7855182655113,y: 29.3611616546356}
,
{x:30.7864997951265,y: 29.3612246652754}
,
{x:30.7871308044873,y: 29.3612529807925}
,
{x:30.7875595205921,y: 29.3611512957522}
,
{x:30.7881596647867,y: 29.3610362329043}
,
{x:30.7884947315042,y: 29.3610094683427}
,
{x:30.789406142996,y: 29.361072345648}
,
{x:30.7898890539711,y: 29.3611345375935}
,
{x:30.7903810060778,y: 29.3614439614725}
,
{x:30.7906147302524,y: 29.3611569033453}
,
{x:30.7910551943976,y: 29.3606178307465}
,
{x:30.79129762087,y: 29.3604029289061}
,
{x:30.7915489238545,y: 29.3602290369328}
,
{x:30.7918066526939,y: 29.3599619050984}
,
{x:30.7920625476914,y: 29.3595795118515}
,
{x:30.7922445866749,y: 29.359389367837}
,
{x:30.7923385770418,y: 29.3592936547689}
,
{x:30.7924772882672,y: 29.3591523998279}
,
{x:30.7926618572118,y: 29.3589644461283}
,
{x:30.7928195166183,y: 29.3588038945235}
,
{x:30.7928737123318,y: 29.3587487053455}
,
{x:30.7928117784167,y: 29.3583958060077}
,
{x:30.7927484702357,y: 29.35791226186}
,
{x:30.7923955267057,y: 29.3575831536306}
,
{x:30.792181569991,y: 29.3574091536899}
,
{x:30.7920693354373,y: 29.3572728619897}
,
{x:30.7920159883517,y: 29.3571601307398}
,
{x:30.7920001647318,y: 29.357038070931}
,
{x:30.7920004339109,y: 29.3569066495358}
,
{x:30.7923070919291,y: 29.3562875703723}
,
{x:30.7929772613393,y: 29.3551656213066}
,
{x:30.7935063169847,y: 29.3540975142403}
,
{x:30.79380779042,y: 29.3533845496297}
,
{x:30.7939743117642,y: 29.353168901251}
,
{x:30.7942028645286,y: 29.3528819501541}
,
{x:30.7942392728394,y: 29.3528362393276}
,
{x:30.7942680580058,y: 29.3528000991441}
,
{x:30.7934508548656,y: 29.3523889413037}
,
{x:30.7916790764323,y: 29.3516257953084}
,
{x:30.7911652309366,y: 29.3513949974534}
,
{x:30.7906888396364,y: 29.3512716993268}
,
{x:30.7904100513784,y: 29.3512858500455}
,
{x:30.7900027689059,y: 29.3513415293774}
,
{x:30.7898467108654,y: 29.3513725363888}
,
{x:30.7888075583169,y: 29.351579004178}
,
{x:30.7878481404717,y: 29.3517839914195}
,
{x:30.7869098942928,y: 29.3520228930446}
,
{x:30.7863584649854,y: 29.3519224066284}
,
{x:30.7853078616417,y: 29.3521741649938}
,
{x:30.7838980609101,y: 29.3525379761701}
,
{x:30.7827775575029,y: 29.3529022480908}
,
{x:30.782220223391,y: 29.3529717380207}
,
{x:30.7821452572774,y: 29.3529528398099}
,
{x:30.782005636805,y: 29.3527115515788}
,
{x:30.7817446915707,y: 29.3523701687644}
,
{x:30.7817291442926,y: 29.3523442587521}
,
{x:30.7814937863889,y: 29.3519520206608}
,
{x:30.7814364895761,y: 29.3517335241072}
,
{x:30.7813450892239,y: 29.3513416018931}
,
{x:30.7813928969105,y: 29.3508895648768}
,
{x:30.7812375453797,y: 29.3500927516535}
,
{x:30.781163875518,y: 29.3499304391011}
,
{x:30.7811375686122,y: 29.3498724843451}
,
{x:30.7810740260361,y: 29.3499147215959}
,
{x:30.7809398943209,y: 29.3500038896142}
,
{x:30.7796424672598,y: 29.3508442261857}
,
{x:30.7782663122209,y: 29.3517226150426}
,
{x:30.7767742511451,y: 29.3526719960471}
,
{x:30.776077113018,y: 29.3530982032959}
,
{x:30.7753900876378,y: 29.3535184858109}
,
{x:30.7740174939536,y: 29.3543794016875}
,
{x:30.7723747557972,y: 29.3553819276219}
,
{x:30.770982564273,y: 29.3562763620861}
,
{x:30.7708920172997,y: 29.3563337790756}
,
{x:30.7696759332259,y: 29.3571051124148}
,
{x:30.7684865037308,y: 29.3578445568199}
,
{x:30.7672283470136,y: 29.3585701291526}
,
{x:30.7659121757543,y: 29.359354683622}
,
{x:30.764769809711,y: 29.3598454895488}
,
{x:30.7636060994296,y: 29.3602940049392}
,
{x:30.7622389091915,y: 29.3606858203342}
,
{x:30.7611506647812,y: 29.3609326232647}
,
{x:30.7598749415049,y: 29.3611556089939}
,
{x:30.7582993795534,y: 29.3612888568164}
,
{x:30.7575552945067,y: 29.3613485938891}
,
{x:30.756225734844,y: 29.3613457013267}
,
{x:30.7556392013859,y: 29.3613065538191}
,
{x:30.7549399732111,y: 29.3612685981177}
,
{x:30.7546783084081,y: 29.3612647328919}
,
{x:30.754721055628,y: 29.3606677764028}
,
{x:30.7549033965718,y: 29.3605337823473}
,
{x:30.755659653414,y: 29.3605903979431}
,
{x:30.7559415408687,y: 29.3579465879956}
,
{x:30.7562961907527,y: 29.3547689696778}
,
{x:30.7564863625842,y: 29.352537181496}
,
{x:30.7565234097806,y: 29.3521024018179}
,
{x:30.7566257289137,y: 29.351117745586}
,
{x:30.7569134067253,y: 29.3483492128994}
,
{x:30.7570139543885,y: 29.3471134966203}
,
{x:30.7570864340523,y: 29.3464840206851}
,
{x:30.7571047353247,y: 29.3462508651017}
,
{x:30.7570169090141,y: 29.34587760157}
,
{x:30.7564611905936,y: 29.3445396317368}
,
{x:30.7563553087912,y: 29.3442984752342}
,
{x:30.755391065438,y: 29.3425071267847}
,
{x:30.7553613840775,y: 29.3424353340629}
,
{x:30.7542535532485,y: 29.3428214049508}
,
{x:30.7532052026818,y: 29.3429596735358}
,
{x:30.7521288473353,y: 29.3430050239641}
,
{x:30.7505538860449,y: 29.343096502284}
,
{x:30.7503666396718,y: 29.3430730892604}
,
{x:30.7491080779195,y: 29.3428008180106}
,
{x:30.7483672750609,y: 29.3426607456986}
,
{x:30.7481626442108,y: 29.3426915810616}
,
{x:30.7468367919717,y: 29.3428920571962}
,
{x:30.7467793248216,y: 29.3424658056268}
,
{x:30.7467254611971,y: 29.3422617829535}
,
{x:30.746723597945,y: 29.3420639028842}
,
{x:30.7467529608148,y: 29.3418108267424}
,
{x:30.7467726903911,y: 29.3416589834266}
,
{x:30.7469378210624,y: 29.3414957495561}
,
{x:30.747473872561,y: 29.3407476398693}
,
{x:30.7475221315459,y: 29.3406311048313}
,
{x:30.7474299014491,y: 29.3405882705726}
,
{x:30.7473167170912,y: 29.3405206022219}
,
{x:30.7471536956464,y: 29.3403730530864}
,
{x:30.7469967936844,y: 29.3402048190445}
,
{x:30.7468880634606,y: 29.3401292380347}
,
{x:30.7467764807316,y: 29.340091386335}
,
{x:30.7464978469141,y: 29.3400479636974}
,
{x:30.7463740113836,y: 29.3400289639718}
,
{x:30.7463367106194,y: 29.3399992773488}
,
{x:30.7462900966839,y: 29.3399641891005}
,
{x:30.7462555676482,y: 29.3398832964474}
,
{x:30.7462118455638,y: 29.339815869752}
,
{x:30.7461557692157,y: 29.3397511245247}
,
{x:30.7460873397651,y: 29.3396890607403}
,
{x:30.7460468634979,y: 29.3396458940476}
,
{x:30.7460249285587,y: 29.3396000519561}
,
{x:30.7460244410615,y: 29.339521890185}
,
{x:30.7460239196277,y: 29.339438338318}
,
{x:30.7460233994455,y: 29.3393547873112}
,
{x:30.7460230965501,y: 29.3393062733176}
,
{x:30.7460040878829,y: 29.3392334816341}
,
{x:30.7459542858313,y: 29.3391822185488}
,
{x:30.745916904684,y: 29.3391390539483}
,
{x:30.7459135605328,y: 29.3390986221965}
,
{x:30.7459411266002,y: 29.3390555287819}
,
{x:30.7460301961871,y: 29.3389821332138}
,
{x:30.7461442044374,y: 29.3388886489935}
,
{x:30.7461657283339,y: 29.338831946397}
,
{x:30.7461683255041,y: 29.3387889519221}
,
{x:30.7461403079633,y: 29.3387592741237}
,
{x:30.7460474283108,y: 29.3387430009631}
,
{x:30.7456577906453,y: 29.3387479615677}
,
{x:30.7453856921938,y: 29.3387557463476}
,
{x:30.7453206648597,y: 29.3387421980792}
,
{x:30.7452794950207,y: 29.3387294536112}
,
{x:30.7452638495689,y: 29.3386890043546}
,
{x:30.7452327360722,y: 29.3386458464794}
,
{x:30.7452092172996,y: 29.3382468459252}
,
{x:30.7451932932396,y: 29.3381470861343}
,
{x:30.7451588883695,y: 29.3380607899988}
,
{x:30.7451246860393,y: 29.3380176271504}
,
{x:30.7450564736422,y: 29.3379717392822}
,
{x:30.7450130388273,y: 29.3379366565487}
,
{x:30.7448674842756,y: 29.3378745278423}
,
{x:30.7447961586136,y: 29.3378232447753}
,
{x:30.7446565512364,y: 29.3377098965363}
,
{x:30.7444828140231,y: 29.3375668617469}
,
{x:30.7444456270306,y: 29.3375452620424}
,
{x:30.7444039864647,y: 29.3375374500047}
,
{x:30.7444428391824,y: 29.3372875201343}
,
{x:30.7444687798473,y: 29.3372110757915}
,
{x:30.7445494294482,y: 29.3371424349883}
,
{x:30.744482509557,y: 29.3369603641336}
,
{x:30.7441178371403,y: 29.3362078474437}
,
{x:30.7442980185639,y: 29.336121603846}
,
{x:30.7455510939202,y: 29.3357072086061}
,
{x:30.7455156179142,y: 29.3356258768488}
,
{x:30.7451095573962,y: 29.3350004894022}
,
{x:30.7447909330195,y: 29.33437520216}
,
{x:30.7446037457423,y: 29.3342682954474}
,
{x:30.7444636957762,y: 29.3342427323874}
,
{x:30.7439507491885,y: 29.3342370596295}
,
{x:30.7434841867812,y: 29.3341857018577}
,
{x:30.7431571109171,y: 29.334068454337}
,
{x:30.742952552322,y: 29.3339716744725}
,
{x:30.7425200248304,y: 29.3337577558171}
,
{x:30.7420054928805,y: 29.3334675129522}
,
{x:30.7413564669114,y: 29.3330856270145}
,
{x:30.7408126370899,y: 29.3327445010346}
,
{x:30.7407246337082,y: 29.3326427709301}
,
{x:30.7403378603789,y: 29.3322612005825}
,
{x:30.7399327072862,y: 29.3317322665631}
,
{x:30.739937254461,y: 29.3317305168911}
,
{x:30.7397590476326,y: 29.331515751476}
,
{x:30.7393412450791,y: 29.3311450938444}
,
{x:30.7386324950694,y: 29.3307352436735}
,
{x:30.7382250832987,y: 29.3304096000468}
,
{x:30.7379957975295,y: 29.330158321857}
,
{x:30.7378318265414,y: 29.3300552010306}
,
{x:30.7375226124345,y: 29.3298654419017}
,
{x:30.7370071880047,y: 29.3295765889744}
,
{x:30.7362808196747,y: 29.3292050767706}
,
{x:30.7355828677653,y: 29.3287349322408}
,
{x:30.7350816599726,y: 29.3283967567538}
,
{x:30.7347961199117,y: 29.3281289128637}
,
{x:30.7347354295666,y: 29.328009546154}
,
{x:30.73469362635,y: 29.3278449860643}
,
{x:30.7346710631515,y: 29.3274995403848}
,
{x:30.7346668313439,y: 29.3273227200513}
,
{x:30.7346293668181,y: 29.3272938624029}
,
{x:30.7339069130173,y: 29.3272307381037}
,
{x:30.7337287015977,y: 29.3271933741849}
,
{x:30.7334426425208,y: 29.3271270095128}
,
{x:30.7333723981079,y: 29.3270734140515}
,
{x:30.7332788097936,y: 29.3269745399706}
,
{x:30.7331946824733,y: 29.3268469017896}
,
{x:30.7330920969061,y: 29.3265999816862}
,
{x:30.7330087874387,y: 29.3261598395143}
,
{x:30.7329766307325,y: 29.3258966124941}
,
{x:30.7329207325857,y: 29.3257402477247}
,
{x:30.7327711085063,y: 29.3255384632229}
,
{x:30.7325699899343,y: 29.3252913434497}
,
{x:30.7320297264056,y: 29.3255410814267}
,
{x:30.7317384077231,y: 29.3256926343336}
,
{x:30.7316209941149,y: 29.3257335169115}
,
{x:30.7315271704191,y: 29.3257251030846}
,
{x:30.7309272881819,y: 29.3255500899217}
,
{x:30.7305679204876,y: 29.3254509523715}
,
{x:30.7303952571132,y: 29.3254425317309}
,
{x:30.7302365917722,y: 29.3255081724647}
,
{x:30.7294105110572,y: 29.3259268274364}
,
{x:30.7291964202599,y: 29.3260419418632}
,
{x:30.7291355149775,y: 29.3260955314203}
,
{x:30.7290689492338,y: 29.3261769382358}
,
{x:30.7290068453729,y: 29.3262873303829}
,
{x:30.7289337955435,y: 29.3264171678806}
,
{x:30.7288267475657,y: 29.3266007443198}
,
{x:30.7286632785574,y: 29.3267486310602}
,
{x:30.7284352063182,y: 29.326921803498}
,
{x:30.7282732920474,y: 29.3270367811024}
,
{x:30.7280678679376,y: 29.3270913818589}
,
{x:30.7279060766244,y: 29.3270802250751}
,
{x:30.7262699677944,y: 29.3268315823306}
,
{x:30.7244074525342,y: 29.3265068842204}
,
{x:30.7229312305521,y: 29.3262531250678}
,
{x:30.7220903164735,y: 29.3261261661513}
,
{x:30.7219968585862,y: 29.3261205858408}
,
{x:30.7218598089202,y: 29.3261039994856}
,
{x:30.721665439592,y: 29.3261840611073}
,
{x:30.7213094170683,y: 29.326711562026}
,
{x:30.7211841537558,y: 29.3269306261982}
,
{x:30.7210841325118,y: 29.3271498560074}
,
{x:30.7209530554319,y: 29.3272099888608}
,
{x:30.7207910489853,y: 29.3271824069341}
,
{x:30.7205043762391,y: 29.3271492057472}
,
{x:30.7202926397625,y: 29.3270722510316}
,
{x:30.7202305580825,y: 29.3269845051606}
,
{x:30.7201498427018,y: 29.3268748207459}
,
{x:30.7201128352268,y: 29.326743267685}
,
{x:30.7201006509487,y: 29.3266501003283}
,
{x:30.7200386154101,y: 29.326551398174}
,
{x:30.7198953264306,y: 29.3265238447271}
,
{x:30.7196148067347,y: 29.3265235398451}
,
{x:30.7194216946198,y: 29.3264794947966}
,
{x:30.71919157201,y: 29.3263148657088}
,
{x:30.7189367078568,y: 29.3262309980443}
,
{x:30.7187696297012,y: 29.3260170320211}
,
{x:30.7187021398582,y: 29.3258031929176}
,
{x:30.718727898599,y: 29.3256113923381}
,
{x:30.7189228653834,y: 29.3251512299178}
,
{x:30.7193433680631,y: 29.3243240978148}
,
{x:30.7193688666224,y: 29.324187104375}
,
{x:30.7192777759291,y: 29.3237156538793}
,
{x:30.7191632105652,y: 29.3229701571301}
,
{x:30.7190736898631,y: 29.322219231421}
,
{x:30.7190066665523,y: 29.3219561043548}
,
{x:30.7189267886027,y: 29.3217806540975}
,
{x:30.7187661833809,y: 29.3215996472574}
,
{x:30.7186114041289,y: 29.321495371276}
,
{x:30.7175571799035,y: 29.3211162040862}
,
{x:30.7162669439504,y: 29.3207038970301}
,
{x:30.7152931004809,y: 29.3203686044518}
,
{x:30.7151502010732,y: 29.3203520055347}
,
{x:30.7150850862479,y: 29.3203554076002}
,
{x:30.7149449191635,y: 29.3203627284207}
,
{x:30.7147267941324,y: 29.3204282190162}
,
{x:30.7140280234631,y: 29.320717740219}
,
{x:30.7136789291139,y: 29.3208049548973}
,
{x:30.713460866423,y: 29.320837544114}
,
{x:30.7131429804567,y: 29.320897387492}
,
{x:30.7124098029648,y: 29.3209372053009}
,
{x:30.7112837678363,y: 29.3209183138745}
,
{x:30.7110085508025,y: 29.3209012669105}
,
{x:30.7108960203677,y: 29.3208736096049}
,
{x:30.7105210028173,y: 29.3207521762374}
,
{x:30.709821755367,y: 29.3204618067782}
,
{x:30.7087419718068,y: 29.3199811866014}
,
{x:30.7086097484335,y: 29.3197269397822}
,
{x:30.7084883478743,y: 29.3194935034573}
,
{x:30.7082492180996,y: 29.3190889283516}
,
{x:30.7079833384622,y: 29.3186457951446}
,
{x:30.7077240268507,y: 29.3181855455374}
,
{x:30.7074063049932,y: 29.3176452219941}
,
{x:30.7072572472211,y: 29.3173650889749}
,
{x:30.7071307990909,y: 29.3171535291298}
,
{x:30.7070400305603,y: 29.3169962954602}
,
{x:30.7069428047422,y: 29.3168190613558}
,
{x:30.7068222350379,y: 29.3164311585921}
,
{x:30.7066519672921,y: 29.3159961357525}
,
{x:30.7065745354366,y: 29.3157332907168}
,
{x:30.7065358608177,y: 29.3155875928805}
,
{x:30.7065166346055,y: 29.3154761990966}
,
{x:30.7064844759111,y: 29.3153305158723}
,
{x:30.7063907215384,y: 29.3148168957674}
,
{x:30.7061934492787,y: 29.3140103163957}
,
{x:30.7061035933899,y: 29.3135380656257}
,
{x:30.7059662989554,y: 29.3129476971219}
,
{x:30.7058589281234,y: 29.3125248962629}
,
{x:30.7058462269085,y: 29.3124106627132}
,
{x:30.7058465012048,y: 29.3123154915819}
,
{x:30.7058823043634,y: 29.3122039454528}
,
{x:30.705981842366,y: 29.312075958228}
,
{x:30.7061124781994,y: 29.3119620411261}
,
{x:30.7064257935094,y: 29.3117609695875}
,
{x:30.7067042067512,y: 29.311613117293}
,
{x:30.7069260222749,y: 29.3115108218886}
,
{x:30.7071174769694,y: 29.3113932310155}
,
{x:30.7072132957945,y: 29.3113020769074}
,
{x:30.7073135789343,y: 29.3111690582258}
,
{x:30.7073964881889,y: 29.3110359997304}
,
{x:30.7074316400677,y: 29.3108952231287}
,
{x:30.7074497812083,y: 29.3107143131317}
,
{x:30.7074409874419,y: 29.3104910268609}
,
{x:30.7074237662417,y: 29.3100537981188}
,
{x:30.7074122304915,y: 29.3097609042412}
,
{x:30.7074351869283,y: 29.3095762066503}
,
{x:30.7074668116918,y: 29.3093658233372}
,
{x:30.7075412657199,y: 29.3091289539042}
,
{x:30.7077942413001,y: 29.308649967312}
,
{x:30.7079815714777,y: 29.3083264914988}
,
{x:30.7080033888951,y: 29.3082888162339}
,
{x:30.7079989921706,y: 29.3082831309487}
,
{x:30.7077187452455,y: 29.3079987819046}
,
{x:30.70759562353,y: 29.3077919747417}
,
{x:30.7074427515095,y: 29.3076883693843}
,
{x:30.7073957854429,y: 29.3076314684217}
,
{x:30.7075741607026,y: 29.3070587213046}
,
{x:30.7075330570489,y: 29.3070121599473}
,
{x:30.7071327771124,y: 29.3069028456866}
,
{x:30.7070448119368,y: 29.3067632392474}
,
{x:30.7069684654605,y: 29.306680456671}
,
{x:30.7067800265428,y: 29.3066542232661}
,
{x:30.7065445785201,y: 29.3065865788852}
,
{x:30.7065211185236,y: 29.3065503834788}
,
{x:30.7065153760653,y: 29.3064987362158}
,
{x:30.7064981339884,y: 29.3063489591286}
,
{x:30.7054139496604,y: 29.3064291728587}
,
{x:30.7052195159211,y: 29.3064390682213}
,
{x:30.7050781613972,y: 29.3064284282418}
,
{x:30.7048544675772,y: 29.3063711335432}
,
{x:30.7044895836032,y: 29.3062463997605}
,
{x:30.7039604571852,y: 29.3058786184479}
,
{x:30.7030135719433,y: 29.3053395091112}
,
{x:30.702813565454,y: 29.3052409565852}
,
{x:30.7025252254854,y: 29.3051318795368}
,
{x:30.7021015150169,y: 29.3049811901194}
,
{x:30.7013490783784,y: 29.3044321779834}
,
{x:30.7003026060799,y: 29.3037121055232}
,
{x:30.6999794132811,y: 29.3034377142261}
,
{x:30.6999031362012,y: 29.3033342737967}
,
{x:30.6998622649332,y: 29.3032102589976}
,
{x:30.6998220007304,y: 29.3028797091292}
,
{x:30.6996591704507,y: 29.3021616252133}
,
{x:30.6995660127907,y: 29.3017896474038}
,
{x:30.6994785333288,y: 29.3014899711599}
,
{x:30.6993790293735,y: 29.3012728827119}
,
{x:30.6992556894628,y: 29.30114868143}
,
{x:30.6991085896555,y: 29.3010915501394}
,
{x:30.6988435388163,y: 29.3010806224035}
,
{x:30.698719864171,y: 29.3010700157152}
,
{x:30.6986324640787,y: 29.3007445219622}
,
{x:30.6985757834025,y: 29.2999905329298}
,
{x:30.6984935436732,y: 29.2999128948568}
,
{x:30.6981581896974,y: 29.2997727209571}
,
{x:30.6966449425557,y: 29.2995524104811}
,
{x:30.6947842586399,y: 29.2992781871842}
,
{x:30.6929651439281,y: 29.2990594694444}
,
{x:30.692367507658,y: 29.2990306716592}
,
{x:30.6918606813475,y: 29.2989239870829}
,
{x:30.6918432209452,y: 29.2989202229161}
,
{x:30.6914235086081,y: 29.2988297620114}
,
{x:30.6911172202449,y: 29.2987360044786}
,
{x:30.6904016686797,y: 29.2984335201914}
,
{x:30.690134725973,y: 29.2982597605607}
,
{x:30.6899813191462,y: 29.2981812813682}
,
{x:30.689527524889,y: 29.2979037111907}
,
{x:30.688956910502,y: 29.2975286356476}
,
{x:30.6883863640148,y: 29.2971072513265}
,
{x:30.6875988678031,y: 29.2965998488486}
,
{x:30.6869979127833,y: 29.296249187072}
,
{x:30.6864248564529,y: 29.2959449895977}
,
{x:30.6857934630225,y: 29.2955650413313}
,
{x:30.6853790750247,y: 29.2952028451179}
,
{x:30.6850620558663,y: 29.2949458266948}
,
{x:30.6848535044963,y: 29.294781811946}
,
{x:30.6847700862075,y: 29.2947376708581}
,
{x:30.6845804667734,y: 29.2946571761378}
,
{x:30.684069418304,y: 29.2944747037729}
,
{x:30.6835078431314,y: 29.294217043825}
,
{x:30.6828573929822,y: 29.2938689333466}
,
{x:30.6824404794193,y: 29.29365562395}
,
{x:30.6817515123163,y: 29.2934703776698}
,
{x:30.6808567243827,y: 29.2932699702521}
,
{x:30.680256671586,y: 29.2930560536766}
,
{x:30.6802655132506,y: 29.2930075595939}
,
{x:30.6804369255024,y: 29.2920671336757}
,
{x:30.6806172566386,y: 29.2909280863509}
,
{x:30.6808607246447,y: 29.2899090944632}
,
{x:30.6810943553994,y: 29.2887959142321}
,
{x:30.6812403125376,y: 29.2881518924889}
,
{x:30.6812840701598,y: 29.2880581121433}
,
{x:30.6813618465488,y: 29.2879516067685}
,
{x:30.6817701263415,y: 29.2874319079783}
,
{x:30.68258648872,y: 29.2864308201692}
,
{x:30.6836405810388,y: 29.2851782793301}
,
{x:30.684388369759,y: 29.2842322428753}
,
{x:30.6849563458666,y: 29.2835333222564}
,
{x:30.686124904199,y: 29.2819988323916}
,
{x:30.6868860844426,y: 29.2810248680536}
,
{x:30.6873935734159,y: 29.2803613525194}
,
{x:30.6879790764136,y: 29.2796127985835}
,
{x:30.6887790895345,y: 29.2786431744143}
,
{x:30.6891790635232,y: 29.2781668820863}
,
{x:30.6906727619676,y: 29.2764104049146}
,
{x:30.6934484471574,y: 29.2731530378031}
,
{x:30.6948980892584,y: 29.2714659969721}
,
{x:30.6959798181164,y: 29.2701144670935}
,
{x:30.696089980495,y: 29.2699983771351}
,
{x:30.6960798422641,y: 29.2699675786894}
,
{x:30.6953983213861,y: 29.2699768812014}
,
{x:30.6950637506969,y: 29.2700750818248}
,
{x:30.6944162330232,y: 29.2702981758152}
,
{x:30.693981765987,y: 29.2704113701814}
,
{x:30.6934344578574,y: 29.2705128844275}
,
{x:30.6928132679915,y: 29.2706408704569}
,
{x:30.6923127394006,y: 29.2707453771453}
,
{x:30.6921378556566,y: 29.2707269276371}
,
{x:30.6919130216077,y: 29.270570451207}
,
{x:30.6917000244132,y: 29.2704592553655}
,
{x:30.6915303915461,y: 29.2704054196459}
,
{x:30.691330191959,y: 29.2703820520404}
,
{x:30.6911342877946,y: 29.2703777798827}
,
{x:30.6909339950263,y: 29.2703849495961}
,
{x:30.6908295995908,y: 29.2703541687275}
,
{x:30.6907252719954,y: 29.2703004836377}
,
{x:30.6906341567163,y: 29.2701972035246}
,
{x:30.6905258922471,y: 29.2700060859631}
,
{x:30.6904653110006,y: 29.2698837910571}
,
{x:30.6903350478079,y: 29.2697689686102}
,
{x:30.6901480719882,y: 29.2696921865664}
,
{x:30.6898827662211,y: 29.2696037703863}
,
{x:30.6897437503102,y: 29.269504196057}
,
{x:30.6896528447977,y: 29.2693322039333}
,
{x:30.6895490989738,y: 29.2690876540856}
,
{x:30.6894411158992,y: 29.2688049202762}
,
{x:30.6893936553377,y: 29.2686635680411}
,
{x:30.6893156151056,y: 29.2685565014364}
,
{x:30.6891547405347,y: 29.2684874134163}
,
{x:30.6886371623736,y: 29.2683220589421}
,
{x:30.6878758426007,y: 29.2681370434656}
,
{x:30.6873974149937,y: 29.2679832281252}
,
{x:30.6872364493463,y: 29.267944676681}
,
{x:30.687127715465,y: 29.267910064841}
,
{x:30.6869884590059,y: 29.2678906508027}
,
{x:30.6868709125656,y: 29.2678903743773}
,
{x:30.6867227748322,y: 29.2679281988687}
,
{x:30.6866267968963,y: 29.267992867222}
,
{x:30.6865433654191,y: 29.2682255274346}
,
{x:30.6864732290912,y: 29.2683818721519}
,
{x:30.6863595788813,y: 29.2685304799034}
,
{x:30.6862460808688,y: 29.2686294625207}
,
{x:30.6861545259332,y: 29.2686712369096}
,
{x:30.6860543813245,y: 29.2686748177005}
,
{x:30.6859891826993,y: 29.2686403081181}
,
{x:30.6859023101517,y: 29.2685752090346}
,
{x:30.6857633706284,y: 29.2684527267876}
,
{x:30.6856938420725,y: 29.2684105718752}
,
{x:30.6855850603379,y: 29.2683912281353}
,
{x:30.6854456747289,y: 29.2684138027887}
,
{x:30.6853411182529,y: 29.2684364597009}
,
{x:30.6849881481465,y: 29.2685425094134}
,
{x:30.6847921893341,y: 29.2685573144052}
,
{x:30.6847051874219,y: 29.2685342048716}
,
{x:30.6846096676901,y: 29.2684499967532}
,
{x:30.6844188862808,y: 29.2681976015275}
,
{x:30.6842633470055,y: 29.2678116831964}
,
{x:30.6841163635102,y: 29.2674754108385}
,
{x:30.6840080669308,y: 29.2672995563062}
,
{x:30.6839039470833,y: 29.2671809719127}
,
{x:30.6838214663763,y: 29.267104429708}
,
{x:30.6837215001171,y: 29.2670507500874}
,
{x:30.6835519249107,y: 29.2669816353913}
,
{x:30.6834128003626,y: 29.2669202265457}
,
{x:30.6833389680456,y: 29.2668627914798}
,
{x:30.6832565815584,y: 29.2667557102342}
,
{x:30.683226485307,y: 29.2666334848854}
,
{x:30.6832271472114,y: 29.2664197166291}
,
{x:30.6831752003285,y: 29.2663241592349}
,
{x:30.6829194558209,y: 29.2659647223928}
,
{x:30.6827328949538,y: 29.2657581420173}
,
{x:30.6825721949,y: 29.2656356046921}
,
{x:30.6824330616917,y: 29.2655780127494}
,
{x:30.6822937511234,y: 29.2655776802802}
,
{x:30.6820456505421,y: 29.2655618190206}
,
{x:30.6818845598136,y: 29.2655652507649}
,
{x:30.6818191625925,y: 29.2655956335764}
,
{x:30.6818102656497,y: 29.2656566887828}
,
{x:30.6818447018876,y: 29.2657827427829}
,
{x:30.6818705381968,y: 29.2658744208438}
,
{x:30.6818224357097,y: 29.2659430168204}
,
{x:30.6817396251129,y: 29.2659733579564}
,
{x:30.6816351413098,y: 29.2659731080442}
,
{x:30.6815131837143,y: 29.2659919025944}
,
{x:30.6814433734229,y: 29.2660413607826}
,
{x:30.6813166822227,y: 29.2661822983172}
,
{x:30.6811288759709,y: 29.266376531919}
,
{x:30.6809760625875,y: 29.2665174060241}
,
{x:30.6808147200244,y: 29.2666010008397}
,
{x:30.6806448262923,y: 29.2666349492399}
,
{x:30.6805012679099,y: 29.2666002485982}
,
{x:30.6803708286493,y: 29.2665464927231}
,
{x:30.6802318510071,y: 29.2664392736303}
,
{x:30.680088495194,y: 29.2663396792631}
,
{x:30.6799493148722,y: 29.2662973540885}
,
{x:30.679714273376,y: 29.2662815186977}
,
{x:30.6793979427773,y: 29.2663195749086}
,
{x:30.6792787552057,y: 29.2663339127925}
,
{x:30.6791045553956,y: 29.266352579183}
,
{x:30.6789043423364,y: 29.2663368272544}
,
{x:30.6787387414332,y: 29.2663898701309}
,
{x:30.6785948841156,y: 29.266450600255}
,
{x:30.678420551291,y: 29.2665112558816}
,
{x:30.678220242068,y: 29.2665260406369}
,
{x:30.6778938010764,y: 29.2665023469464}
,
{x:30.6773891553283,y: 29.2663866056054}
,
{x:30.6769932154053,y: 29.2663131160788}
,
{x:30.6768147578326,y: 29.2663012309606}
,
{x:30.6766231673325,y: 29.2663122171385}
,
{x:30.6763835435212,y: 29.266368894707}
,
{x:30.6762049903785,y: 29.2663875464769}
,
{x:30.6759917045426,y: 29.2663755755042}
,
{x:30.6757610046343,y: 29.2663635617631}
,
{x:30.6755824390761,y: 29.2663860304632}
,
{x:30.6753340828195,y: 29.2664503199629}
,
{x:30.6751859067556,y: 29.2664995830381}
,
{x:30.6751030321435,y: 29.2665490060531}
,
{x:30.6750025255243,y: 29.2666670973621}
,
{x:30.6749062633051,y: 29.2668195548812}
,
{x:30.6748045401381,y: 29.2670300710742}
,
{x:30.6746562679598,y: 29.2673991771745}
,
{x:30.674581698515,y: 29.2675745908315}
,
{x:30.6744942153239,y: 29.2677041657961}
,
{x:30.6743719755476,y: 29.2678107515181}
,
{x:30.6741930047038,y: 29.2679591892325}
,
{x:30.6740229114051,y: 29.2680542060217}
,
{x:30.6737745264503,y: 29.268126126068}
,
{x:30.6735914458112,y: 29.2681982065781}
,
{x:30.6734126194879,y: 29.2683008353399}
,
{x:30.6732555738751,y: 29.2683996997865}
,
{x:30.6731246247615,y: 29.2685062632996}
,
{x:30.6730116946517,y: 29.2686574002585}
,
{x:30.6729136151661,y: 29.268855027617}
,
{x:30.6728225425801,y: 29.269032310423}
,
{x:30.6726563719543,y: 29.2692609408697}
,
{x:30.6725165670697,y: 29.2694132895622}
,
{x:30.6723987013067,y: 29.2695122504454}
,
{x:30.672276652969,y: 29.269557757869}
,
{x:30.6721765077615,y: 29.2695613281731}
,
{x:30.6717610013451,y: 29.2695821831629}
,
{x:30.6717608352965,y: 29.2696338167827}
,
{x:30.6717723347143,y: 29.2701799086415}
,
{x:30.6719538601972,y: 29.2714235216327}
,
{x:30.6720574094859,y: 29.2721905889968}
,
{x:30.672200676507,y: 29.2729693724596}
,
{x:30.6726350275716,y: 29.2738882920346}
,
{x:30.6730041321347,y: 29.2744933552792}
,
{x:30.6731546898383,y: 29.2749856145299}
,
{x:30.6731208187716,y: 29.2754470876488}
,
{x:30.6731515794253,y: 29.2761374595053}
,
{x:30.6730711814238,y: 29.2765675715043}
,
{x:30.6729771666345,y: 29.2768579787798}
,
{x:30.6728548419878,y: 29.2771160216391}
,
{x:30.6726978513103,y: 29.2772259194707}
,
{x:30.6723651037051,y: 29.2774126200159}
,
{x:30.6719194961228,y: 29.2775715560104}
,
{x:30.6715053341353,y: 29.2776754503874}
,
{x:30.6709972158586,y: 29.2777020287371}
,
{x:30.6704139066606,y: 29.2776788719139}
,
{x:30.6701316333067,y: 29.277678324634}
,
{x:30.6697928345608,y: 29.2777107185217}
,
{x:30.669447611977,y: 29.2778147097536}
,
{x:30.669158827571,y: 29.2779243155893}
,
{x:30.6687318999088,y: 29.2780942380746}
,
{x:30.6684806379628,y: 29.2782534887921}
,
{x:30.6681812528746,y: 29.2786010137503}
,
{x:30.6679523140959,y: 29.2789079603764}
,
{x:30.6676056225103,y: 29.2797060229613}
,
{x:30.6673221640432,y: 29.2802563154486}
,
{x:30.6670069032207,y: 29.2810158749101}
,
{x:30.6669118664672,y: 29.2814729114895}
,
{x:30.6669429041752,y: 29.2816437553439}
,
{x:30.6670116490342,y: 29.2817871368454}
,
{x:30.6670801924055,y: 29.2820351893484}
,
{x:30.6670609900513,y: 29.2822279642743}
,
{x:30.6669915412282,y: 29.282442666315}
,
{x:30.6664370147236,y: 29.2835983509145}
,
{x:30.6663361011986,y: 29.2838515434019}
,
{x:30.6662981217458,y: 29.284016730302}
,
{x:30.6661908338236,y: 29.2843194890414}
,
{x:30.6660586083476,y: 29.2845340454292}
,
{x:30.6657753497172,y: 29.2849465831074}
,
{x:30.6654291561014,y: 29.2854360979256}
,
{x:30.6652719126867,y: 29.2855954985904}
,
{x:30.6650644495713,y: 29.2857547818112}
,
{x:30.6648570590239,y: 29.2858754996909}
,
{x:30.6646434316179,y: 29.2859741666246}
,
{x:30.6643294079644,y: 29.2860505623527}
,
{x:30.6639274622124,y: 29.2861432763524}
,
{x:30.6637075689082,y: 29.2862309043082}
,
{x:30.6634685848475,y: 29.2863365807296}
,
{x:30.6626197957879,y: 29.2870546502039}
,
{x:30.6621482909988,y: 29.2873620117183}
,
{x:30.6618842688851,y: 29.2875211299798}
,
{x:30.6618744399425,y: 29.2875219276777}
,
{x:30.6617394903085,y: 29.2875962993103}
,
{x:30.6615547129352,y: 29.2877512125007}
,
{x:30.6612959937063,y: 29.2879803866164}
,
{x:30.660844835998,y: 29.2884841986065}
,
{x:30.6606228142321,y: 29.2887911289045}
,
{x:30.6605117835625,y: 29.2889526843743}
,
{x:30.6604266384064,y: 29.2890851743454}
,
{x:30.6603009561566,y: 29.2891981445491}
,
{x:30.6601441752508,y: 29.2893020811664}
,
{x:30.6599025699943,y: 29.2894474686277}
,
{x:30.659718520244,y: 29.2895582195221}
,
{x:30.6594880601905,y: 29.2897625301871}
,
{x:30.6592622792746,y: 29.2899322317927}
,
{x:30.6590515144454,y: 29.2900773333261}
,
{x:30.6587671452709,y: 29.2902001136101}
,
{x:30.6584898545437,y: 29.2903251122912}
,
{x:30.6583679471043,y: 29.2903668762934}
,
{x:30.658242186376,y: 29.2904668797761}
,
{x:30.6581755102574,y: 29.2905540862919}
,
{x:30.6581567850608,y: 29.2906511202363}
,
{x:30.6581526591712,y: 29.2908064402968}
,
{x:30.6581632586495,y: 29.2909747399562}
,
{x:30.6581704397885,y: 29.2910459506479}
,
{x:30.658229272389,y: 29.2911237634883}
,
{x:30.6583949813135,y: 29.2912568571439}
,
{x:30.6585422115679,y: 29.2913996127865}
,
{x:30.6586783523711,y: 29.2915488140007}
,
{x:30.6587517063442,y: 29.291714037303}
,
{x:30.6588580349854,y: 29.2919667183691}
,
{x:30.6588651006668,y: 29.2920799988933}
,
{x:30.6588647218424,y: 29.2922159129508}
,
{x:30.6588643149284,y: 29.2923615341979}
,
{x:30.6588411840838,y: 29.2927142068684}
,
{x:30.6587739047589,y: 29.2930149902438}
,
{x:30.6587175795952,y: 29.2933578684912}
,
{x:30.658716638471,y: 29.293396518405}
,
{x:30.6587134072101,y: 29.2935293690491}
,
{x:30.6587571170156,y: 29.2937365874798}
,
{x:30.6589038873504,y: 29.2940476234527}
,
{x:30.6593340692064,y: 29.2946473954921}
,
{x:30.6598120811744,y: 29.2953087827978}
,
{x:30.6602127740615,y: 29.2959052559209}
,
{x:30.660540236858,y: 29.2962911976767}
,
{x:30.6606872741826,y: 29.296514869566}
,
{x:30.6608452528481,y: 29.2967871131863}
,
{x:30.6609738809058,y: 29.2969945581936}
,
{x:30.6611063195883,y: 29.2971599449422}
,
{x:30.6612794552224,y: 29.2972930757115}
,
{x:30.6615743188135,y: 29.2974621226948}
,
{x:30.6619394617967,y: 29.2975828114139}
,
{x:30.6623600212389,y: 29.2976907013002}
,
{x:30.6626330401681,y: 29.2977529016279}
,
{x:30.6627990008724,y: 29.2978148219129}
,
{x:30.6628689324154,y: 29.297892673907}
,
{x:30.6629277546139,y: 29.2979834413948}
,
{x:30.6629385650842,y: 29.2980805548888}
,
{x:30.66291605287,y: 29.2982131803506}
,
{x:30.662815710975,y: 29.2984556314884}
,
{x:30.6627979218589,y: 29.2986141344242}
,
{x:30.6627494794106,y: 29.2987854965465}
,
{x:30.6626963258988,y: 29.2993321893942}
,
{x:30.6626765772941,y: 29.2998077845056}
,
{x:30.6626428650143,y: 29.2999888920214}
,
{x:30.6625870155794,y: 29.300166701933}
,
{x:30.6624386534821,y: 29.3004316224352}
,
{x:30.6623015469139,y: 29.3006286221172}
,
{x:30.6620941765568,y: 29.3008739644814}
,
{x:30.6619424090558,y: 29.3010320947507}
,
{x:30.6618535747587,y: 29.3011224484958}
,
{x:30.6616354761164,y: 29.3012415688703}
,
{x:30.6611549206757,y: 29.3015023341145}
,
{x:30.6609405820791,y: 29.3015955777697}
,
{x:30.6607299247562,y: 29.3016920663317}
,
{x:30.660545222412,y: 29.301746563993}
,
{x:30.6602571185239,y: 29.3018201907031}
,
{x:30.6599468319916,y: 29.3019066988071}
,
{x:30.6596992355041,y: 29.3020127908879}
,
{x:30.6594255514065,y: 29.3022061696776}
,
{x:30.6590150121377,y: 29.3024994716766}
,
{x:30.6587930990077,y: 29.3026573998568}
,
{x:30.6585822937948,y: 29.3028024163825}
,
{x:30.6584304770808,y: 29.3029702429814}
,
{x:30.6583191749181,y: 29.3031672989789}
,
{x:30.6582227393932,y: 29.3033288057935}
,
{x:30.658081329319,y: 29.3037231390495}
,
{x:30.6579882117499,y: 29.3040108353274}
,
{x:30.6578915716205,y: 29.3042402820877}
,
{x:30.6577837701944,y: 29.3044988167941}
,
{x:30.6575777340311,y: 29.3048994359971}
,
{x:30.6574403500057,y: 29.3051740623154}
,
{x:30.6573366066492,y: 29.305306425432}
,
{x:30.6571663452973,y: 29.3054644860513}
,
{x:30.6570257363486,y: 29.3055805696637}
,
{x:30.6569497962084,y: 29.3056657908525}
,
{x:30.6569437883305,y: 29.3056643658391}
,
{x:30.6565664970262,y: 29.305981332436}
,
{x:30.6563491218168,y: 29.3062086507502}
,
{x:30.6562241641574,y: 29.3063670780158}
,
{x:30.6560097331654,y: 29.30665247658}
,
{x:30.6558365551314,y: 29.3068829638379}
,
{x:30.6555737426912,y: 29.3071319145109}
,
{x:30.6553471589438,y: 29.3072775820652}
,
{x:30.6550882404024,y: 29.3074325973449}
,
{x:30.6545346856126,y: 29.3077854494324}
,
{x:30.6541594987535,y: 29.3080075901395}
,
{x:30.6538329642187,y: 29.3081789056314}
,
{x:30.6536426379265,y: 29.3082827531167}
,
{x:30.6535331394561,y: 29.3083483066293}
,
{x:30.6534700204634,y: 29.3083860948636}
,
{x:30.6532756178901,y: 29.3085696012458}
,
{x:30.6531620665646,y: 29.3087250172904}
,
{x:30.6530430271509,y: 29.3089134515917}
,
{x:30.6529615010952,y: 29.3091586209931}
,
{x:30.6528958334667,y: 29.309498216179}
,
{x:30.6528624109566,y: 29.3098567768431}
,
{x:30.6528183062803,y: 29.3101869923924}
,
{x:30.6528281766002,y: 29.3104748850185}
,
{x:30.6528275724699,y: 29.3106683669074}
,
{x:30.652880914823,y: 29.3108289649855}
,
{x:30.6529176612588,y: 29.3108808240385}
,
{x:30.6529613284742,y: 29.3109424488783}
,
{x:30.6533257938929,y: 29.3114814439746}
,
{x:30.6537174519505,y: 29.3119355716633}
,
{x:30.6538567882476,y: 29.3121483191418}
,
{x:30.6539262573963,y: 29.3123184000416}
,
{x:30.6540117627613,y: 29.3125262782155}
,
{x:30.6540755512746,y: 29.3127907232266}
,
{x:30.6540860101936,y: 29.3128898518185}
,
{x:30.6542780555081,y: 29.3134661113287}
,
{x:30.6543162108615,y: 29.3136014558057}
,
{x:30.6544005425284,y: 29.3139006038843}
,
{x:30.6543998157609,y: 29.3141318319967}
,
{x:30.6543993250106,y: 29.3142875578685}
,
{x:30.6543769385526,y: 29.3145564762183}
,
{x:30.6543222563102,y: 29.3148205849308}
,
{x:30.6542679006018,y: 29.3149808767821}
,
{x:30.6541917212661,y: 29.3152307666957}
,
{x:30.6541211192442,y: 29.3154193261079}
,
{x:30.6540872769931,y: 29.3155282612638}
,
{x:30.6540694943757,y: 29.3155254130676}
,
{x:30.6538279029047,y: 29.316134452197}
,
{x:30.6538145399488,y: 29.3161681389758}
,
{x:30.6535602616267,y: 29.3165963839932}
,
{x:30.653244024627,y: 29.3169502099466}
,
{x:30.6529617044917,y: 29.3171685568887}
,
{x:30.6523268055662,y: 29.3176923502773}
,
{x:30.6516960390256,y: 29.3180971275223}
,
{x:30.650929597297,y: 29.3187274227773}
,
{x:30.6502675919587,y: 29.3192816231846}
,
{x:30.6497751083785,y: 29.3197995092682}
,
{x:30.6493489914349,y: 29.3202091545826}
,
{x:30.6491738348229,y: 29.3203483438699}
,
{x:30.6488658134544,y: 29.3205041277063}
,
{x:30.6486324478698,y: 29.3206754788207}
,
{x:30.6483910015109,y: 29.3209058781197}
,
{x:30.648102458158,y: 29.3211481152197}
,
{x:30.6479873377223,y: 29.3213030785108}
,
{x:30.6478548368085,y: 29.3213983956375}
,
{x:30.6475840765165,y: 29.3214886856593}
,
{x:30.6473939298501,y: 29.3215730761618}
,
{x:30.6472799819917,y: 29.3216542198689}
,
{x:30.6471205927026,y: 29.3217952340954}
,
{x:30.6469548627282,y: 29.3219576720792}
,
{x:30.6468182349609,y: 29.3220360609118}
,
{x:30.6467132093236,y: 29.3220527968744}
,
{x:30.6465927709099,y: 29.322055135721}
,
{x:30.6465000739344,y: 29.3220765181981}
,
{x:30.6463763785596,y: 29.3221236193281}
,
{x:30.646244129419,y: 29.3222566337264}
,
{x:30.6461729128325,y: 29.3223590558138}
,
{x:30.6460926021822,y: 29.3224511365283}
,
{x:30.6460092816126,y: 29.3225063706343}
,
{x:30.6459149945434,y: 29.32254101941}
,
{x:30.6457575369946,y: 29.3225695673716}
,
{x:30.6456308088612,y: 29.3226124989527}
,
{x:30.6454823623365,y: 29.3226905447798}
,
{x:30.6454578008106,y: 29.3227074567836}
,
{x:30.6453493126115,y: 29.3227821628812}
,
{x:30.6449995826711,y: 29.323051748846}
,
{x:30.644801685543,y: 29.3231377456508}
,
{x:30.6444276597215,y: 29.3232774041177}
,
{x:30.6442668826944,y: 29.3233472966229}
,
{x:30.6441771498564,y: 29.323409274389}
,
{x:30.6441275405033,y: 29.3234767792329}
,
{x:30.644034531491,y: 29.3236009828696}
,
{x:30.643885696715,y: 29.3238062014807}
,
{x:30.6437493758541,y: 29.3239573396582}
,
{x:30.6436069920313,y: 29.324070578205}
,
{x:30.6432788636678,y: 29.3243402243283}
,
{x:30.6431209490611,y: 29.3244831827652}
,
{x:30.6428606257437,y: 29.3247936100259}
,
{x:30.642813929624,y: 29.3249179453385}
,
{x:30.6427737510479,y: 29.3250853804225}
,
{x:30.6427534575676,y: 29.3252711720371}
,
{x:30.6428031949836,y: 29.3254022614126}
,
{x:30.6428706506127,y: 29.3255593938544}
,
{x:30.642904346411,y: 29.3256487828443}
,
{x:30.6429164101501,y: 29.3257435218172}
,
{x:30.6429161715113,y: 29.3258219907166}
,
{x:30.6428812329929,y: 29.3259540243063}
,
{x:30.6428470945681,y: 29.3261979042795}
,
{x:30.6428404661622,y: 29.3263467062874}
,
{x:30.6428601350385,y: 29.3264833397556}
,
{x:30.6429347190848,y: 29.3268313188685}
,
{x:30.6429835500994,y: 29.3270208657736}
,
{x:30.6430137382841,y: 29.3272482412065}
,
{x:30.6430592017414,y: 29.3275297759468}
,
{x:30.6430802088369,y: 29.3277300659885}
,
{x:30.6430700802079,y: 29.3280141475428}
,
{x:30.6430349016515,y: 29.3284118001299}
,
{x:30.6430339543815,y: 29.3287229645526}
,
{x:30.6430271349492,y: 29.3289339982511}
,
{x:30.6430236183558,y: 29.3290746894117}
,
{x:30.6429732202414,y: 29.3293992409852}
,
{x:30.6429478312303,y: 29.3296237485994}
,
{x:30.6429030213904,y: 29.3301404265722}
,
{x:30.6428739070229,y: 29.3305732689067}
,
{x:30.6428170809171,y: 29.3309789734873}
,
{x:30.6427071916842,y: 29.3315685184324}
,
{x:30.6426351779002,y: 29.3318903002385}
,
{x:30.6426348552813,y: 29.3319958239833}
,
{x:30.6426407009143,y: 29.3321040718035}
,
{x:30.6427018187736,y: 29.3323152950974}
,
{x:30.6427507911609,y: 29.3324588391253}
,
{x:30.6427846135082,y: 29.3325076390046}
,
{x:30.6428431234756,y: 29.3325619205961}
,
{x:30.6429571316802,y: 29.3326461227934}
,
{x:30.6431697161723,y: 29.332811777311}
,
{x:30.6432712818649,y: 29.3329257065458}
,
{x:30.6432772511198,y: 29.3329933680432}
,
{x:30.6432769453329,y: 29.3330934792153}
,
{x:30.6432548570857,y: 29.3332476441428}
,
{x:30.6432047832292,y: 29.3334639615644}
,
{x:30.6431294668432,y: 29.3336587582975}
,
{x:30.6430615721886,y: 29.3338396534798}
,
{x:30.6429775916704,y: 29.3340342288662}
,
{x:30.64293095317,y: 29.3341369144045}
,
{x:30.6428965176058,y: 29.3342883385564}
,
{x:30.6428743270459,y: 29.3344749715574}
,
{x:30.6428739714555,y: 29.3345913170343}
,
{x:30.6428860005663,y: 29.3346968748741}
,
{x:30.642916444549,y: 29.3348403646539}
,
{x:30.6429346184136,y: 29.3349567633197}
,
{x:30.6429187623809,y: 29.3350920048731}
,
{x:30.6428965548948,y: 29.3352840483389}
,
{x:30.6428619190272,y: 29.3355004089041}
,
{x:30.6428273834111,y: 29.3356843000294}
,
{x:30.6427960509578,y: 29.3358303207172}
,
{x:30.6428331765351,y: 29.3361020820469}
,
{x:30.6427955844025,y: 29.3363239076718}
,
{x:30.6427952861089,y: 29.3364456963941}
,
{x:30.6428258949056,y: 29.3365540352463}
,
{x:30.6428657856153,y: 29.336654280882}
,
{x:30.6429396047947,y: 29.336768148868}
,
{x:30.6430041892659,y: 29.3368711662959}
,
{x:30.6430471347383,y: 29.3369849518598}
,
{x:30.6430839329334,y: 29.3370878954954}
,
{x:30.6431360686784,y: 29.3372314762286}
,
{x:30.6432158604588,y: 29.3374292598251}
,
{x:30.6432773521868,y: 29.3375349751834}
,
{x:30.643372773301,y: 29.3376543145792}
,
{x:30.64348055172,y: 29.337770979825}
,
{x:30.6435851445922,y: 29.3379282332671}
,
{x:30.64368349799,y: 29.3381125340566}
,
{x:30.6437294757934,y: 29.338250685085}
,
{x:30.6437907935262,y: 29.3384294740767}
,
{x:30.6438705845014,y: 29.3386299631196}
,
{x:30.6439135230565,y: 29.3387491608934}
,
{x:30.6439746732871,y: 29.3389983161647}
,
{x:30.6440144064547,y: 29.3391662212411}
,
{x:30.644090859596,y: 29.3394722525276}
,
{x:30.6441584019689,y: 29.3396321130321}
,
{x:30.6442381988526,y: 29.3398326020132}
,
{x:30.6442687634465,y: 29.3399625929482}
,
{x:30.6442899352008,y: 29.3401466865064}
,
{x:30.6443170757682,y: 29.3404174025758}
,
{x:30.6443471483243,y: 29.3407530803801}
,
{x:30.6443800709016,y: 29.3411889036865}
,
{x:30.6444319019366,y: 29.3414650990744}
,
{x:30.6445146059696,y: 29.3417440822745}
,
{x:30.6446128654222,y: 29.3419743922369}
,
{x:30.6447759103306,y: 29.3422292326049}
,
{x:30.6449390933707,y: 29.3424272377514}
,
{x:30.6450435553949,y: 29.342568617645}
,
{x:30.6452190839276,y: 29.3427476948252}
,
{x:30.645410048,y: 29.3429295189391}
,
{x:30.6456562808598,y: 29.3431709438839}
,
{x:30.6458290263914,y: 29.3432986806402}
,
{x:30.6459861916009,y: 29.3434208797856}
,
{x:30.6461680875114,y: 29.3435350280892}
,
{x:30.6464147584405,y: 29.3436791177719}
,
{x:30.6466152408873,y: 29.3437743742272}
,
{x:30.646769435879,y: 29.3438559739624}
,
{x:30.6469852784503,y: 29.3439810371606}
,
{x:30.6471701603317,y: 29.3441330758283}
,
{x:30.6474844867182,y: 29.3443828813661}
,
{x:30.6477370059963,y: 29.3446460484647}
,
{x:30.6481066881464,y: 29.3449825933663}
,
{x:30.6485257012235,y: 29.3453517427298}
,
{x:30.6490370460021,y: 29.3458402018695}
,
{x:30.6494686005843,y: 29.3461471427805}
,
{x:30.6496534438071,y: 29.3463181181608}
,
{x:30.6497611695575,y: 29.3464537066694}
,
{x:30.6498164490149,y: 29.3465675068246}
,
{x:30.6498805581884,y: 29.3468382774534}
,
{x:30.6499322144638,y: 29.3471441912237}
,
{x:30.6499594931597,y: 29.3473309770725}
,
{x:30.6499530669787,y: 29.3474202568788}
,
{x:30.6498226534016,y: 29.347666149729}
,
{x:30.6496116222006,y: 29.3480227703312}
,
{x:30.6493786223068,y: 29.3483733152941}
,
{x:30.649341283819,y: 29.3484679159237}
,
{x:30.649340956869,y: 29.3485815574693}
,
{x:30.6493336264492,y: 29.3489819920386}
,
{x:30.6493661694508,y: 29.3494799427743}
,
{x:30.6493811929834,y: 29.3496260961545}
,
{x:30.6494180330622,y: 29.3497046632709}
,
{x:30.6494734609588,y: 29.3497643405302}
,
{x:30.6495349572147,y: 29.3498619144489}
,
{x:30.6496486614869,y: 29.3500651549839}
,
{x:30.6498851992717,y: 29.350520364764}
,
{x:30.6500047567095,y: 29.3508372636344}
,
{x:30.6500474735888,y: 29.3510213713968}
,
{x:30.6500255248172,y: 29.3511349542818}
,
{x:30.6499478500945,y: 29.3512916799689}
,
{x:30.649798723553,y: 29.3515889128899}
,
{x:30.6496898461649,y: 29.3518537857429}
,
{x:30.649527604788,y: 29.3524134448498}
,
{x:30.6494025209404,y: 29.3529407366026}
,
{x:30.6493212915977,y: 29.3532570943525}
,
{x:30.6493147219101,y: 29.3533923665287}
,
{x:30.6493420312918,y: 29.3535629047915}
,
{x:30.6493999648212,y: 29.3538255229725}
,
{x:30.6494669619694,y: 29.3541585161003}
,
{x:30.6495485689133,y: 29.3547810685986}
,
{x:30.649563107478,y: 29.3550949803742}
,
{x:30.6495594310774,y: 29.3552979047516}
,
{x:30.6495374085504,y: 29.3554358421122}
,
{x:30.6494252249762,y: 29.3559550538331}
,
{x:30.6493650091253,y: 29.3566244473217}
,
{x:30.6493564299285,y: 29.3568909983252}
,
{x:30.6493433401347,y: 29.3571398993568}
,
{x:30.6492902966765,y: 29.3573183421417}
,
{x:30.6492496828902,y: 29.3574724658566}
,
{x:30.6491688676755,y: 29.3576400111397}
,
{x:30.6490540704711,y: 29.3578074658336}
,
{x:30.6489052920482,y: 29.3579748307921}
,
{x:30.6487862205231,y: 29.3581022892808}
,
{x:30.6485823007963,y: 29.3582106349428}
,
{x:30.648178042951,y: 29.3584031152399}
,
{x:30.6472761600769,y: 29.3589132779369}
,
{x:30.6468287721792,y: 29.3591869019585}
,
{x:30.646135536451,y: 29.3595963302709}
,
{x:30.6455030537889,y: 29.3600579212773}
,
{x:30.6454001676126,y: 29.3601381389315}
,
{x:30.6451724032365,y: 29.3603757315345}
,
{x:30.6449307390272,y: 29.3606050784459}
,
{x:30.6448161215125,y: 29.3607075922572}
,
{x:30.6446768716238,y: 29.360782980465}
,
{x:30.644515971476,y: 29.3608664287839}
,
{x:30.6443070960585,y: 29.3609217770431}
,
{x:30.6441510502442,y: 29.3609899133979}
,
{x:30.6440426177645,y: 29.3610897370806}
,
{x:30.6439680779556,y: 29.3612194176889}
,
{x:30.6438829776417,y: 29.3613242251779}
,
{x:30.6437842918067,y: 29.3613851650841}
,
{x:30.6435621296421,y: 29.361435120834}
,
{x:30.6432973771865,y: 29.3615004773135}
,
{x:30.6431063719246,y: 29.3615878870488}
,
{x:30.6428542614439,y: 29.3617548725996}
,
{x:30.6426375160407,y: 29.3619139316076}
,
{x:30.6425663440581,y: 29.3619516208397}
,
{x:30.6424736293809,y: 29.36196219266}
,
{x:30.6423406203819,y: 29.3619633816348}
,
{x:30.6421028775681,y: 29.3620010749021}
,
{x:30.6419110374271,y: 29.3620661941824}
,
{x:30.6417858173281,y: 29.3621200982254}
,
{x:30.6415364904027,y: 29.3622814776486}
,
{x:30.6410653175998,y: 29.3625846701518}
,
{x:30.6408113485307,y: 29.3626976273246}
,
{x:30.6402017941173,y: 29.3629842475667}
,
{x:30.6397177443256,y: 29.3632642301557}
,
{x:30.6395660882632,y: 29.3633476883307}
,
{x:30.6389056836704,y: 29.3635788121212}
,
{x:30.6379793036634,y: 29.3639060420305}
,
{x:30.6370761336571,y: 29.3642119608561}
,
{x:30.6362843086392,y: 29.3644803075831}
,
{x:30.6352198799535,y: 29.3649697683598}
,
{x:30.6346844678759,y: 29.3652469602986}
,
{x:30.6346007701006,y: 29.3653333143566}
,
{x:30.634532571923,y: 29.3654034767581}
,
{x:30.6344576655813,y: 29.36551221395}
,
{x:30.6344449886392,y: 29.3656013924214}
,
{x:30.6344422224557,y: 29.3656208527196}
,
{x:30.6344047152288,y: 29.3657738434628}
,
{x:30.6343735509328,y: 29.3658576422731}
,
{x:30.6342712180161,y: 29.3659737099865}
,
{x:30.6339921724356,y: 29.3662759899946}
,
{x:30.6336789047874,y: 29.3666512358695}
,
{x:30.63348312311,y: 29.366933474853}
,
{x:30.6333594791411,y: 29.3671663307764}
,
{x:30.6333184204234,y: 29.3672969543654}
,
{x:30.6332714944836,y: 29.3674781275626}
,
{x:30.6332213737093,y: 29.3676917641529}
,
{x:30.6331790700907,y: 29.3678761071473}
,
{x:30.633092495662,y: 29.3680423700106}
,
{x:30.6329367895278,y: 29.3682227793675}
,
{x:30.6323128420536,y: 29.3685644489338}
,
{x:30.6319035130934,y: 29.3687898007237}
,
{x:30.6315149545501,y: 29.369113970892}
,
{x:30.6313225957074,y: 29.3693104599042}
,
{x:30.6312197228292,y: 29.3695012186629}
,
{x:30.6311799075381,y: 29.3696258802459}
,
{x:30.6311561233977,y: 29.3697285084166}
,
{x:30.6311496954389,y: 29.3697562465196}
,
{x:30.6311011259692,y: 29.3699658190441}
,
{x:30.6308696765867,y: 29.3701607862021}
,
{x:30.6305947027685,y: 29.3704219853143}
,
{x:30.6303031124898,y: 29.3708614734442}
,
{x:30.6299009176773,y: 29.3710930861393}
,
{x:30.6298212582089,y: 29.3713041360899}
,
{x:30.6298108101932,y: 29.3714314905215}
,
{x:30.62985909781,y: 29.3718542018016}
,
{x:30.6299705081591,y: 29.3722841255726}
,
{x:30.6300281242571,y: 29.372451676931}
,
{x:30.6300072778392,y: 29.3726146557436}
,
{x:30.6300416926645,y: 29.3728450711671}
,
{x:30.6299150598829,y: 29.3731826555008}
,
{x:30.6297184456437,y: 29.3735275958816}
,
{x:30.6296973534643,y: 29.3737141858356}
,
{x:30.6296999172351,y: 29.3738044038326}
,
{x:30.6297036012744,y: 29.3739340238983}
,
{x:30.6297138963622,y: 29.3741153408329}
,
{x:30.6298130918628,y: 29.374413927253}
,
{x:30.6299298709271,y: 29.3746979898694}
,
{x:30.6301635833362,y: 29.3750320293508}
,
{x:30.6305158420098,y: 29.3753135779092}
,
{x:30.6305567905764,y: 29.3753496619893}
,
{x:30.6305789065257,y: 29.3753433415386}
,
{x:30.6308169286514,y: 29.3755293537938}
,
{x:30.6310034678386,y: 29.3756894026131}
,
{x:30.6311571055955,y: 29.3758508641394}
,
{x:30.6312655393327,y: 29.3760376267176}
,
{x:30.6313169789912,y: 29.3761602197014}
,
{x:30.6314384798714,y: 29.3764579440551}
,
{x:30.6315589218502,y: 29.3768631624071}
,
{x:30.6316972455065,y: 29.3772908361543}
,
{x:30.6317321659719,y: 29.3775162036236}
,
{x:30.6318374981979,y: 29.3777352941851}
,
{x:30.6320935061682,y: 29.3780507358212}
,
{x:30.6322159279995,y: 29.3782494001633}
,
{x:30.6323083877567,y: 29.3785773135223}
,
{x:30.6323100740557,y: 29.3787183457497}
,
{x:30.6323764288396,y: 29.3788561133987}
,
{x:30.6324866987575,y: 29.3790107631}
,
{x:30.6327547295649,y: 29.3793755989621}
,
{x:30.6331070300075,y: 29.3797392984873}
,
{x:30.6332147855641,y: 29.3799077421923}
,
{x:30.6333218920105,y: 29.3802744966207}
,
{x:30.6334419704433,y: 29.3806605223126}
,
{x:30.6335901480945,y: 29.3810426496931}
,
{x:30.6336900014651,y: 29.3812986298253}
,
{x:30.6338407446616,y: 29.3815026774931}
,
{x:30.6340721051363,y: 29.3816983699323}
,
{x:30.6342909389445,y: 29.3818455625397}
,
{x:30.6344091813392,y: 29.3819204737212}
,
{x:30.6345654249097,y: 29.3819409196871}
,
{x:30.6347873447504,y: 29.3819156482218}
,
{x:30.6350349329266,y: 29.3818486338051}
,
{x:30.6352433669451,y: 29.3818180614831}
,
{x:30.6354486499112,y: 29.3817980720634}
,
{x:30.6357539021304,y: 29.3817946243023}
,
{x:30.6360397486826,y: 29.3818291364482}
,
{x:30.6364077300521,y: 29.3820144610081}
,
{x:30.636567303245,y: 29.3821442039521}
,
{x:30.6366581251556,y: 29.3822242167902}
,
{x:30.6367538557838,y: 29.3823085546451}
,
{x:30.6368342375655,y: 29.3824852929662}
,
{x:30.6368770837697,y: 29.3826276267019}
,
{x:30.6370796598319,y: 29.3828417628081}
,
{x:30.6372933225092,y: 29.3830875382888}
,
{x:30.6373179355369,y: 29.383115850907}
,
{x:30.637409081028,y: 29.3832206944641}
,
{x:30.6375599180245,y: 29.3835716154448}
,
{x:30.6376623360753,y: 29.3837997259562}
,
{x:30.6377428299374,y: 29.3839372425114}
,
{x:30.6378138503903,y: 29.3840323805612}
,
{x:30.6379610413181,y: 29.3841606265475}
,
{x:30.6381473481245,y: 29.3842400150095}
,
{x:30.6383394916056,y: 29.3843005414494}
,
{x:30.6397028300369,y: 29.3845810071797}
,
{x:30.6404365159176,y: 29.384696277679}
,
{x:30.6406728020498,y: 29.3847098706213}
,
{x:30.6410222309286,y: 29.3847539568207}
,
{x:30.6412829146182,y: 29.3848365958878}
,
{x:30.6415187475099,y: 29.3849924549638}
,
{x:30.6419263136179,y: 29.3853341725099}
,
{x:30.642296937598,y: 29.3855834162491}
,
{x:30.6423563495762,y: 29.3856321003033}
,
{x:30.6424224808272,y: 29.3856847579798}
,
{x:30.6426927198475,y: 29.3857074415155}
,
{x:30.6428753411639,y: 29.385720503723}
,
{x:30.6430031628915,y: 29.385781214779}
,
{x:30.6431637461903,y: 29.3859294782302}
,
{x:30.6433172200196,y: 29.3861140464073}
,
{x:30.6435184595747,y: 29.3863129187921}
,
{x:30.6436313747458,y: 29.3864166991545}
,
{x:30.6443396435291,y: 29.3869739097183}
,
{x:30.6446383007898,y: 29.3871868744228}
,
{x:30.6450453357558,y: 29.3877053402216}
,
{x:30.6451236666034,y: 29.3878478253706}
,
{x:30.6452583370344,y: 29.3881525996564}
,
{x:30.6453720581591,y: 29.3883754202396}
,
{x:30.645437132076,y: 29.3886554752193}
,
{x:30.6455030652514,y: 29.3889426060955}
,
{x:30.6455609338977,y: 29.3892091402026}
,
{x:30.6455995556286,y: 29.3893870240751}
,
{x:30.645653334687,y: 29.3895565792863}
,
{x:30.6458850296933,y: 29.3899882779843}
,
{x:30.6459387319178,y: 29.390177728864}
,
{x:30.6459127191383,y: 29.3905746780104}
,
{x:30.6458130666576,y: 29.3909451680403}
,
{x:30.6457136063732,y: 29.3911491875962}
,
{x:30.6456299111749,y: 29.391319919146}
,
{x:30.6455247643738,y: 29.3915063773774}
,
{x:30.6449949783358,y: 29.3920566202378}
,
{x:30.6444736136997,y: 29.3925280005967}
,
{x:30.644170389511,y: 29.3926748285141}
,
{x:30.6441083438514,y: 29.3927515471378}
,
{x:30.6440407843459,y: 29.3928350848392}
,
{x:30.6440189601177,y: 29.393039777492}
,
{x:30.6440071072428,y: 29.3934952682072}
,
{x:30.6440510600461,y: 29.3938304726238}
,
{x:30.6441625543984,y: 29.3943292288597}
,
{x:30.6441607679973,y: 29.3948724156734}
,
{x:30.6441407555932,y: 29.3949844735595}
,
{x:30.6440666304886,y: 29.3950661812857}
,
{x:30.6438402981098,y: 29.3951602395478}
,
{x:30.6435194493503,y: 29.3952500481108}
,
{x:30.6431877050921,y: 29.3953531859648}
,
{x:30.6428787636293,y: 29.3954164076056}
,
{x:30.6425093804087,y: 29.3954369376399}
,
{x:30.6422729778818,y: 29.3954492138909}
,
{x:30.6421596663828,y: 29.3954661429498}
,
{x:30.6420265047891,y: 29.3955304402841}
,
{x:30.6418459228896,y: 29.3957131917084}
,
{x:30.6413003005346,y: 29.3962527006309}
,
{x:30.6411761004007,y: 29.3963726883795}
,
{x:30.6411704717709,y: 29.3964848311087}
,
{x:30.6411562776725,y: 29.3967675806476}
,
{x:30.6411299676056,y: 29.3970174794295}
,
{x:30.6409551745028,y: 29.3973990706}
,
{x:30.6408786613694,y: 29.3977851188958}
,
{x:30.6407613507387,y: 29.3988578041801}
,
{x:30.6407605730663,y: 29.3990953978799}
,
{x:30.6408125481317,y: 29.3992641597076}
,
{x:30.6414314828029,y: 29.400070649583}
,
{x:30.6415537459882,y: 29.4001629637475}
,
{x:30.6417720332602,y: 29.4003398539378}
,
{x:30.641929466007,y: 29.4003862793317}
,
{x:30.6423979016243,y: 29.4005098948927}
,
{x:30.6433243507097,y: 29.400630873749}
,
{x:30.6440993437707,y: 29.4007831966136}
,
{x:30.6449057381602,y: 29.4009424020241}
,
{x:30.6458752499291,y: 29.4012103873168}
,
{x:30.6459599915398,y: 29.40127906445}
,
{x:30.6462034443936,y: 29.4014268210358}
,
{x:30.6463703811858,y: 29.4015975447647}
,
{x:30.6468729288822,y: 29.402196251485}
,
{x:30.6468927798993,y: 29.4024036319763}
,
{x:30.6469705709553,y: 29.402580631272}
,
{x:30.6470870119333,y: 29.4028455706219}
,
{x:30.6473391680706,y: 29.4032474535283}
,
{x:30.6475352808287,y: 29.4035950875671}
,
{x:30.6478220706826,y: 29.4041340935966}
,
{x:30.6479275488647,y: 29.4044092434844}
,
{x:30.6480138364085,y: 29.404838590807}
,
{x:30.6481132596416,y: 29.4053332986833}
,
{x:30.6482316758917,y: 29.405868411849}
,
{x:30.6483525221498,y: 29.4065448854444}
,
{x:30.6484364499922,y: 29.4070462868388}
,
{x:30.648469551562,y: 29.407502662605}
,
{x:30.6485531343805,y: 29.4078596636128}
,
{x:30.6486135123798,y: 29.4081175497889}
,
{x:30.6487399244391,y: 29.4084184003966}
,
{x:30.6488539259942,y: 29.4086421903119}
,
{x:30.6490006814054,y: 29.4088072561922}
,
{x:30.6491974633073,y: 29.4089065928262}
,
{x:30.6494273906834,y: 29.4090418038513}
,
{x:30.6496379543002,y: 29.4091539167016}
,
{x:30.6498265627698,y: 29.4093159145321}
,
{x:30.6499397933756,y: 29.4094767905019}
,
{x:30.6500457055251,y: 29.4097190889895}
,
{x:30.6501190875178,y: 29.4099493504771}
,
{x:30.6501488267788,y: 29.4102408992547}
,
{x:30.6501760311061,y: 29.410909539045}
,
{x:30.6502480953731,y: 29.4111610824968}
,
{x:30.650409753549,y: 29.411439914198}
,
{x:30.650617344111,y: 29.411877645311}
,
{x:30.6508274194216,y: 29.4122000310729}
,
{x:30.6510246665945,y: 29.4124125900975}
,
{x:30.6511881757053,y: 29.4125105132274}
,
{x:30.6514214256446,y: 29.4125695147433}
,
{x:30.6516832041336,y: 29.4127079313092}
,
{x:30.6518265043648,y: 29.4128151891311}
,
{x:30.6519652666284,y: 29.4130080915054}
,
{x:30.6520967947901,y: 29.4132870798713}
,
{x:30.6522305920708,y: 29.4134972985928}
,
{x:30.6523968640921,y: 29.4140211702947}
,
{x:30.6524720187528,y: 29.4143744478391}
,
{x:30.6526034114279,y: 29.4145569116859}
,
{x:30.6527839072806,y: 29.4148257528932}
,
{x:30.6531934490364,y: 29.4153579068457}
,
{x:30.6533336703057,y: 29.4155496700953}
,
{x:30.6533828507683,y: 29.4157283814246}
,
{x:30.6534712549544,y: 29.4160733440959}
,
{x:30.6535731759168,y: 29.4164906989202}
,
{x:30.6536683978928,y: 29.4167315432543}
,
{x:30.6538246294773,y: 29.4170322572149}
,
{x:30.654154966267,y: 29.4176037611003}
,
{x:30.6545124370175,y: 29.4180869705696}
,
{x:30.6546741847908,y: 29.4183300870329}
,
{x:30.6547764950577,y: 29.4185331425348}
,
{x:30.6549080918527,y: 29.4188557685313}
,
{x:30.6550257506052,y: 29.419235242245}
,
{x:30.6550644609977,y: 29.4194114653088}
,
{x:30.6551479781378,y: 29.4197916554427}
,
{x:30.655181371091,y: 29.4201405489978}
,
{x:30.6551815356442,y: 29.4206314508041}
,
{x:30.6551357457189,y: 29.4209033335615}
,
{x:30.6550142155319,y: 29.4210794509756}
,
{x:30.654838984713,y: 29.4212377800486}
,
{x:30.6545362353872,y: 29.4213487195899}
,
{x:30.6542470982085,y: 29.4214067614293}
,
{x:30.6540384045563,y: 29.4215238317596}
,
{x:30.6535529342993,y: 29.4218989885596}
,
{x:30.6530300118535,y: 29.42236972682}
,
{x:30.6520839538165,y: 29.4232653545233}
,
{x:30.6514770608979,y: 29.4239047871635}
,
{x:30.6513891786869,y: 29.4240633459787}
,
{x:30.6513684525396,y: 29.4242338470558}
,
{x:30.6514014447622,y: 29.4244162564241}
,
{x:30.6514681526476,y: 29.4245634682967}
,
{x:30.6515818977825,y: 29.4247108057064}
,
{x:30.6518896737293,y: 29.4251115607391}
,
{x:30.6520901697229,y: 29.4254414516191}
,
{x:30.6521634021482,y: 29.425647493553}
,
{x:30.6522096375851,y: 29.4258887509317}
,
{x:30.6522208229794,y: 29.4265651284022}
,
{x:30.6522653699257,y: 29.4273121711249}
,
{x:30.6523437479075,y: 29.4279887287955}
,
{x:30.6524632493706,y: 29.4284242642927}
,
{x:30.6525297792776,y: 29.4286244059429}
,
{x:30.6526433881807,y: 29.4288129119944}
,
{x:30.652763520215,y: 29.4290602480147}
,
{x:30.6528834555036,y: 29.4293663960396}
,
{x:30.6532508468288,y: 29.4300260842696}
,
{x:30.6535986912562,y: 29.4305034000663}
,
{x:30.6537192766919,y: 29.4306154674526}
,
{x:30.6543226436742,y: 29.4310464173665}
,
{x:30.6555498443385,y: 29.4318201460541}
,
{x:30.6565674946053,y: 29.4324535046202}
,
{x:30.6575881644132,y: 29.433207679901}
,
{x:30.6581486272816,y: 29.4338178356625}
,
{x:30.6582517389019,y: 29.4339461059612}
,
{x:30.6585415240731,y: 29.4345518989369}
,
{x:30.6592329998714,y: 29.4358304607612}
,
{x:30.65925916614,y: 29.4358943705798}
,
{x:30.6592737400321,y: 29.4359299668026}
,
{x:30.6592978375183,y: 29.4361633020996}
,
{x:30.6593720427261,y: 29.4364962969059}
,
{x:30.6594653398154,y: 29.4366718498133}
,
{x:30.6595345298425,y: 29.4368020409152}
,
{x:30.6596587975414,y: 29.4369500828801}
,
{x:30.6598164567018,y: 29.4370502540705}
,
{x:30.6600368873449,y: 29.4371575387621}
,
{x:30.6602583082709,y: 29.437258098755}
,
{x:30.6604931693231,y: 29.4373586944807}
,
{x:30.6607273085859,y: 29.437489415964}
,
{x:30.6609424293987,y: 29.4376480467065}
,
{x:30.6610494274936,y: 29.4378012356855}
,
{x:30.6610891023902,y: 29.4379895355181}
,
{x:30.6611016138605,y: 29.4382600984369}
,
{x:30.6611833079167,y: 29.438650376287}
,
{x:30.6613149627917,y: 29.438754670305}
,
{x:30.6614894047457,y: 29.4388374625979}
,
{x:30.6618113869848,y: 29.4390088566253}
,
{x:30.662274393406,y: 29.4392100244815}
,
{x:30.6624087363526,y: 29.4392280195231}
,
{x:30.6625565808009,y: 29.4392284059043}
,
{x:30.6627447062882,y: 29.4392406587545}
,
{x:30.6628857303516,y: 29.4392704326973}
,
{x:30.6630198514177,y: 29.4393531178347}
,
{x:30.6631067904637,y: 29.4394768476997}
,
{x:30.6631734465787,y: 29.4396358112499}
,
{x:30.6632064218775,y: 29.4398182109596}
,
{x:30.6632258340302,y: 29.4400358617793}
,
{x:30.6632049447366,y: 29.4402475260048}
,
{x:30.6631506171471,y: 29.4404120541635}
,
{x:30.6629345373069,y: 29.4407114246989}
,
{x:30.6628693026543,y: 29.4408550140923}
,
{x:30.6628448358919,y: 29.4410108971565}
,
{x:30.6628656324364,y: 29.4411961183853}
,
{x:30.6629831829735,y: 29.4413960107921}
,
{x:30.6631270455734,y: 29.4415152146668}
,
{x:30.6632848959058,y: 29.4415636972129}
,
{x:30.6635395157609,y: 29.4416267344512}
,
{x:30.6637410710671,y: 29.4416789949838}
,
{x:30.663857533179,y: 29.4417276431754}
,
{x:30.6640312362697,y: 29.4418732860933}
,
{x:30.6641599263936,y: 29.4419966917991}
,
{x:30.6642064419106,y: 29.4421497202526}
,
{x:30.6642593722971,y: 29.4423909804862}
,
{x:30.664258661867,y: 29.4425968153109}
,
{x:30.6641439096995,y: 29.4427867067744}
,
{x:30.6639991219619,y: 29.4429481719677}
,
{x:30.663867302522,y: 29.4430545189097}
,
{x:30.6637126755602,y: 29.4430717594887}
,
{x:30.6630612895135,y: 29.443091976982}
,
{x:30.6629361044554,y: 29.4431366953631}
,
{x:30.6628245738799,y: 29.443198340837}
,
{x:30.6628242469752,y: 29.4432929222009}
,
{x:30.6628251897807,y: 29.443379789006}
,
{x:30.6628783213346,y: 29.4435154331023}
,
{x:30.6629446379794,y: 29.4435981038194}
,
{x:30.6630887192929,y: 29.4437057391162}
,
{x:30.6632443341989,y: 29.4437892635106}
,
{x:30.6635084038608,y: 29.4438420138157}
,
{x:30.6637567666725,y: 29.4438667137938}
,
{x:30.6639572050447,y: 29.443906540422}
,
{x:30.664127173436,y: 29.4439410265971}
,
{x:30.6642428089784,y: 29.4440251326859}
,
{x:30.6643130819946,y: 29.4441091202238}
,
{x:30.6643782391978,y: 29.4442151484306}
,
{x:30.6644080840957,y: 29.4443299059605}
,
{x:30.6643674362336,y: 29.4444943316079}
,
{x:30.6643313210683,y: 29.4446649248707}
,
{x:30.6643594754696,y: 29.4447714004739}
,
{x:30.6644042002131,y: 29.4448811587795}
,
{x:30.6644818741418,y: 29.4449782685469}
,
{x:30.664707422264,y: 29.4451071368439}
,
{x:30.6648737124957,y: 29.4452309125132}
,
{x:30.6649018309695,y: 29.4453509070136}
,
{x:30.6649011924748,y: 29.4455353266084}
,
{x:30.6648958387767,y: 29.4457486250138}
,
{x:30.6648462211144,y: 29.4458924548372}
,
{x:30.6647198178244,y: 29.4460068066327}
,
{x:30.6645942842819,y: 29.4461022815845}
,
{x:30.6645266602764,y: 29.4461908354095}
,
{x:30.6645341102049,y: 29.4462894515714}
,
{x:30.6645818990672,y: 29.4463572004838}
,
{x:30.66469805181,y: 29.4464698799382}
,
{x:30.6647530665431,y: 29.4465935238189}
,
{x:30.6648171530673,y: 29.4472021847075}
,
{x:30.6647501650678,y: 29.4476078040881}
,
{x:30.6646837246112,y: 29.4478634566318}
,
{x:30.6645693350894,y: 29.4480464881484}
,
{x:30.6644708440198,y: 29.4482025303971}
,
{x:30.664299032854,y: 29.4483344030365}
,
{x:30.6638864451609,y: 29.4486434238856}
,
{x:30.6636508332329,y: 29.4488526054237}
,
{x:30.6631864585221,y: 29.4494209443505}
,
{x:30.663085145714,y: 29.4495662342215}
,
{x:30.6630241147296,y: 29.4497204517858}
,
{x:30.6629985011747,y: 29.4498350655334}
,
{x:30.6630032342807,y: 29.4499188830978}
,
{x:30.66303313206,y: 29.4500115886628}
,
{x:30.663080781391,y: 29.4500647292645}
,
{x:30.6631893283137,y: 29.4500906474153}
,
{x:30.663390539502,y: 29.4501139794764}
,
{x:30.6635364653199,y: 29.4501717041998}
,
{x:30.6636260281518,y: 29.4502680148964}
,
{x:30.6637283947063,y: 29.4504005230657}
,
{x:30.6637744404581,y: 29.4505309771481}
,
{x:30.6638159622234,y: 29.4506486129212}
,
{x:30.6638603637798,y: 29.4507601864008}
,
{x:30.6640241084749,y: 29.4508742469913}
,
{x:30.6643256906276,y: 29.4510734797859}
,
{x:30.6644762597988,y: 29.4512326375362}
,
{x:30.6645814489278,y: 29.4514005039159}
,
{x:30.664691462878,y: 29.4516257188775}
,
{x:30.6647862642394,y: 29.4518773589424}
,
{x:30.6649508529653,y: 29.4523320600907}
,
{x:30.6651457075007,y: 29.4527780149642}
,
{x:30.6654962193786,y: 29.4533699072277}
,
{x:30.6656264680595,y: 29.4536771592674}
,
{x:30.6656812745428,y: 29.4538360870267}
,
{x:30.6657616086467,y: 29.4539068665463}
,
{x:30.6658871134155,y: 29.4540218689062}
,
{x:30.6661032292538,y: 29.4541547480397}
,
{x:30.6661783730898,y: 29.4542652102465}
,
{x:30.6662232402977,y: 29.4543888259356}
,
{x:30.6662576433491,y: 29.4546138632003}
,
{x:30.6662920311198,y: 29.454843309871}
,
{x:30.6663419531336,y: 29.4549625288234}
,
{x:30.6669039736078,y: 29.4557610890169}
,
{x:30.6672026504717,y: 29.4562239811902}
,
{x:30.6672627815751,y: 29.4563171712181}
,
{x:30.6680870949326,y: 29.4557499982054}
,
{x:30.6686312499387,y: 29.4553750041236}
,
{x:30.6689772562692,y: 29.4553572680804}
,
{x:30.6691950724861,y: 29.4554123185288}
,
{x:30.6694926403127,y: 29.4554243331104}
,
{x:30.6698594341337,y: 29.455318331562}
,
{x:30.6701799946718,y: 29.4550774442133}
,
{x:30.6704709926412,y: 29.4548433362258}
,
{x:30.670692414518,y: 29.4545522028463}
,
{x:30.6709090392155,y: 29.4541812106426}
,
{x:30.6709396347749,y: 29.453998074008}
,
{x:30.6707955670218,y: 29.4536796805759}
,
{x:30.6706076220552,y: 29.4534375042002}
,
{x:30.6705379611527,y: 29.4532333092309}
,
{x:30.6704454651598,y: 29.4529621771724}
,
{x:30.670358292102,y: 29.4525950906924}
,
{x:30.6702873988776,y: 29.4520472936876}
,
{x:30.670439596962,y: 29.4517960503422}
,
{x:30.6707343691409,y: 29.4513305207085}
,
{x:30.671558722477,y: 29.4507422248461}
,
{x:30.6732752119501,y: 29.4493140546535}
,
{x:30.675059601436,y: 29.4478075457775}
,
{x:30.6753626008703,y: 29.4476453834405}
,
{x:30.6756392988783,y: 29.447594221326}
,
{x:30.6770250070267,y: 29.4476088789136}
,
{x:30.6792599458493,y: 29.447626973039}
,
{x:30.6810840821623,y: 29.4476188408368}
,
{x:30.6844207175004,y: 29.4475285083295}
,
{x:30.6864137609874,y: 29.4474975957992}
,
{x:30.6880805102863,y: 29.4474077670462}
,
{x:30.6904199167375,y: 29.447363329535}
,
{x:30.6905119188097,y: 29.4473628828833}
,
{x:30.6904987199102,y: 29.4471396544407}
,
{x:30.6905007650512,y: 29.4469370719749}
,
{x:30.6905204376225,y: 29.4468384612132}
,
{x:30.6905857061235,y: 29.4473625253889}
,
{x:30.6924288136733,y: 29.4476969306015}
,
{x:30.6927250328776,y: 29.4439923277971}
,
{x:30.6927542494091,y: 29.4439240573917}
,
{x:30.6928151979875,y: 29.4436094923445}
,
{x:30.6928573552092,y: 29.4433919318404}
,
{x:30.6932527400592,y: 29.442673082801}
,
{x:30.6933609510233,y: 29.4425613901067}
,
{x:30.6948868110616,y: 29.4415691513366}
,
{x:30.695082459056,y: 29.441475323663}
,
{x:30.6952173611613,y: 29.4414167098526}
,
{x:30.6954463049102,y: 29.4413995300811}
,
{x:30.6957695676075,y: 29.4414370598676}
,
{x:30.6958480037069,y: 29.4414479622446}
,
{x:30.6963066483138,y: 29.4415117124245}
,
{x:30.6966298902753,y: 29.4416258926897}
,
{x:30.6973268542102,y: 29.4419653762094}
,
{x:30.6979539853737,y: 29.4425451064621}
,
{x:30.6986230248279,y: 29.4432336784674}
,
{x:30.699029488046,y: 29.4437716934718}
,
{x:30.6991327968597,y: 29.444044751111}
,
{x:30.6991562777067,y: 29.4441702915691}
,
{x:30.6992063413934,y: 29.4446171200082}
,
{x:30.699261762189,y: 29.4448667774826}
,
{x:30.6993993047003,y: 29.4450537094153}
,
{x:30.6997146759426,y: 29.4452310265755}
,
{x:30.7000274266555,y: 29.4453558406742}
,
{x:30.7003976570961,y: 29.4456469795411}
,
{x:30.7007378464052,y: 29.4458936239402}
,
{x:30.7010151350118,y: 29.4461935725518}
,
{x:30.7011907383861,y: 29.4463255375255}
,
{x:30.7013865212772,y: 29.4466037411274}
,
{x:30.7016171899811,y: 29.4467013142274}
,
{x:30.7019443508823,y: 29.4473204346187}
,
{x:30.7019912279795,y: 29.4474027798146}
,
{x:30.7023275517321,y: 29.4474033909266}
,
{x:30.7025226163238,y: 29.4474037444247}
,
{x:30.7026976487403,y: 29.4473746123697}
,
{x:30.7029134286534,y: 29.4472689891706}
,
{x:30.7032771548486,y: 29.4471695213363}
,
{x:30.703607035173,y: 29.4471112172116}
,
{x:30.7038422883151,y: 29.4470992894778}
,
{x:30.7040185465796,y: 29.4471709829918}
,
{x:30.704257055427,y: 29.4473620555418}
,
{x:30.7044845680591,y: 29.4475721708787}
,
{x:30.7046258785256,y: 29.4477725970087}
,
{x:30.7046922361991,y: 29.4479434970848}
,
{x:30.7046913761534,y: 29.4481083942214}
,
{x:30.7046822703425,y: 29.4485677428096}
,
{x:30.704666700565,y: 29.4489799728062}
,
{x:30.7046316345669,y: 29.4492626071607}
,
{x:30.7046037797473,y: 29.4494510253291}
,
{x:30.7045958926601,y: 29.4496807049769}
,
{x:30.7046421569825,y: 29.4498397995547}
,
{x:30.7046954363789,y: 29.450059779969}
,
{x:30.7047946095084,y: 29.4502758807347}
,
{x:30.7047669796233,y: 29.4504230780583}
,
{x:30.7046789879153,y: 29.4505407303844}
,
{x:30.7045975771012,y: 29.450687842374}
,
{x:30.7045564502022,y: 29.4508468008421}
,
{x:30.7045285424316,y: 29.4510529008522}
,
{x:30.7044778943947,y: 29.4517890667625}
,
{x:30.7043995227698,y: 29.452713698839}
,
{x:30.7043104930643,y: 29.4530610893518}
,
{x:30.704215029748,y: 29.4533495699624}
,
{x:30.7039843398522,y: 29.4538086698763}
,
{x:30.7038039213168,y: 29.4541078596835}
,
{x:30.7036705737055,y: 29.4543486978061}
,
{x:30.7035241848989,y: 29.4545501160526}
,
{x:30.7033327390564,y: 29.454772324649}
,
{x:30.7031335473723,y: 29.454952801118}
,
{x:30.7029818388382,y: 29.4551634863345}
,
{x:30.7028778998836,y: 29.4553394812007}
,
{x:30.7028270919166,y: 29.4554645672946}
,
{x:30.7028208901394,y: 29.4556731700231}
,
{x:30.7028329186725,y: 29.4559490227836}
,
{x:30.7028165058973,y: 29.4560741664648}
,
{x:30.7027843340206,y: 29.4561737880427}
,
{x:30.7027041624548,y: 29.4563637356516}
,
{x:30.7025867642939,y: 29.4565999858187}
,
{x:30.7024401851288,y: 29.45685705416}
,
{x:30.7023602603312,y: 29.4569913738685}
,
{x:30.7023040856631,y: 29.457139639981}
,
{x:30.7022584948775,y: 29.4572879243143}
,
{x:30.7020852956903,y: 29.4575889996506}
,
{x:30.7019522629641,y: 29.4577742367404}
,
{x:30.7017768682324,y: 29.4579686786891}
,
{x:30.7015910742911,y: 29.4581190599144}
,
{x:30.7013339399942,y: 29.4582484609605}
,
{x:30.7011960170912,y: 29.458336328345}
,
{x:30.701132469552,y: 29.4583501335995}
,
{x:30.7009771896883,y: 29.458338577479}
,
{x:30.7008202142662,y: 29.4583316092994}
,
{x:30.7007330060883,y: 29.4583471622385}
,
{x:30.7006376426888,y: 29.458377141843}
,
{x:30.7005607801293,y: 29.4584117885533}
,
{x:30.7004891408554,y: 29.458462670884}
,
{x:30.7004015074028,y: 29.4585436631463}
,
{x:30.7003325424185,y: 29.4585875947671}
,
{x:30.6987305441166,y: 29.4588159407391}
,
{x:30.6977902350101,y: 29.4591548457751}
,
{x:30.6973619702117,y: 29.4593591733583}
,
{x:30.6971199566945,y: 29.4595032906273}
,
{x:30.6969133796894,y: 29.4596473085308}
,
{x:30.6967738619845,y: 29.4597643730898}
,
{x:30.6966497234821,y: 29.4598995124416}
,
{x:30.6965565411735,y: 29.4600211714927}
,
{x:30.6962146652577,y: 29.4605213998049}
,
{x:30.6961215031339,y: 29.4606385472578}
,
{x:30.6960026059931,y: 29.4607511372002}
,
{x:30.6958838313339,y: 29.4608321427367}
,
{x:30.6957239554106,y: 29.4608860008203}
,
{x:30.6955538285585,y: 29.4609263034404}
,
{x:30.6951674242839,y: 29.460952677246}
,
{x:30.6946521513875,y: 29.461001371739}
,
{x:30.6943120681754,y: 29.4610323332727}
,
{x:30.6938636146767,y: 29.4611127247694}
,
{x:30.6935644675915,y: 29.4612114388891}
,
{x:30.6933734231119,y: 29.4613284002291}
,
{x:30.6930170536646,y: 29.4615713949275}
,
{x:30.6925056927869,y: 29.4619314164061}
,
{x:30.6923559754802,y: 29.4620168668465}
,
{x:30.6917684232762,y: 29.4626163467341}
,
{x:30.6915285260184,y: 29.4627017336672}
,
{x:30.6902981882436,y: 29.4634773466065}
,
{x:30.6900692616212,y: 29.4636273487277}
,
{x:30.6899039350838,y: 29.463673297567}
,
{x:30.6896046004061,y: 29.4636622861836}
,
{x:30.6891435874499,y: 29.4635700810493}
,
{x:30.6888497444202,y: 29.4635273117353}
,
{x:30.688713842942,y: 29.4635373862192}
,
{x:30.6885851061805,y: 29.4638502134958}
,
{x:30.6885261740178,y: 29.4640969265207}
,
{x:30.6885586509384,y: 29.4642857445103}
,
{x:30.6887145420212,y: 29.4647361622289}
,
{x:30.6887963997991,y: 29.4650267176142}
,
{x:30.6888286465683,y: 29.4652808757941}
,
{x:30.6887100832462,y: 29.4653657861386}
,
{x:30.6886293855804,y: 29.4653603374386}
,
{x:30.6883725050193,y: 29.4653235250323}
,
{x:30.6876107999569,y: 29.4650316031836}
,
{x:30.6872049379577,y: 29.4649218862035}
,
{x:30.6871218021313,y: 29.4649795431589}
,
{x:30.6871463509653,y: 29.4650742239518}
,
{x:30.6873531006344,y: 29.4652198390204}
,
{x:30.6881150488776,y: 29.4654464275371}
,
{x:30.6883055014938,y: 29.465512147896}
,
{x:30.6888353996065,y: 29.4657092221378}
,
{x:30.689390318506,y: 29.4658627810562}
,
{x:30.6898040864845,y: 29.4660741361433}
,
{x:30.6901350259614,y: 29.4662635457217}
,
{x:30.6904488428936,y: 29.4666053806306}
,
{x:30.6907047340655,y: 29.4669180613727}
,
{x:30.6909689430284,y: 29.46722349932}
,
{x:30.6915639155732,y: 29.4677691623937}
,
{x:30.691858197374,y: 29.4680543962372}
,
{x:30.6921516198208,y: 29.4683525191938}
,
{x:30.6926642184945,y: 29.4685595613048}
,
{x:30.6933056218359,y: 29.4686870003236}
,
{x:30.6935830092968,y: 29.4687073649181}
,
{x:30.6938040267257,y: 29.4686532302756}
,
{x:30.6939513818482,y: 29.4686138334648}
,
{x:30.6941892793124,y: 29.468589484742}
,
{x:30.6949028580848,y: 29.4685461870213}
,
{x:30.6954966957862,y: 29.4684558610745}
,
{x:30.6960121528949,y: 29.4683377768554}
,
{x:30.6961482772872,y: 29.468253721379}
,
{x:30.6962900760561,y: 29.4681647169341}
,
{x:30.6964261129946,y: 29.468105453613}
,
{x:30.6967321056655,y: 29.4679969041474}
,
{x:30.6979559166034,y: 29.467592430478}
,
{x:30.6989929105664,y: 29.4671826367304}
,
{x:30.6992023321583,y: 29.4671681158937}
,
{x:30.7003851981039,y: 29.4670957159988}
,
{x:30.7015507112815,y: 29.4671075412542}
,
{x:30.7017094619338,y: 29.4670086227543}
,
{x:30.7017642647044,y: 29.4670335778614}
,
{x:30.701861270975,y: 29.4674714926644}
,
{x:30.7019288653435,y: 29.4679091721559}
,
{x:30.7020233059581,y: 29.4679066765408}
,
{x:30.7020944752988,y: 29.4678838035487}
,
{x:30.7019750044868,y: 29.4671181422229}
,
{x:30.7019640715434,y: 29.4670040725924}
,
{x:30.7019983007663,y: 29.466919828739}
,
{x:30.7021005532919,y: 29.4667960227356}
,
{x:30.7021854826521,y: 29.4667763237587}
,
{x:30.7024112982914,y: 29.4668415210297}
,
{x:30.70233441587,y: 29.4670716079033}
,
{x:30.7024863351548,y: 29.467185060388}
,
{x:30.7026824238144,y: 29.4671281335198}
,
{x:30.7027571258306,y: 29.4669841211866}
,
{x:30.7026445696723,y: 29.4667768768352}
,
{x:30.7025971815319,y: 29.4666929528761}
,
{x:30.7028852320609,y: 29.4665311381069}
,
{x:30.7032947388011,y: 29.4662689579388}
,
{x:30.7038849366153,y: 29.4656515588085}
,
{x:30.7042322647596,y: 29.4653485081209}
,
{x:30.7051711977616,y: 29.4649204565736}
,
{x:30.7069970836683,y: 29.4643677367407}
,
{x:30.709836134673,y: 29.4636310188986}
,
{x:30.7108074273879,y: 29.4634248641412}
,
{x:30.7108596408836,y: 29.4637864429141}
,
{x:30.711613704273,y: 29.4637109983185}
,
{x:30.7116291456416,y: 29.4634184717708}
,
{x:30.7137528746818,y: 29.4632133248494}
,
{x:30.7168660179733,y: 29.4628309984375}
,
{x:30.717253881503,y: 29.4628164775875}
,
{x:30.7181210609199,y: 29.4632466477184}
,
{x:30.7188284425329,y: 29.4635359842708}
,
{x:30.7198997893529,y: 29.4641403280867}
,
{x:30.7213712052103,y: 29.4651748320721}
,
{x:30.7218168755432,y: 29.46564922015}
,
{x:30.7226082459001,y: 29.4665166962296}
,
{x:30.7227344741349,y: 29.4667390924294}
,
{x:30.7227933316756,y: 29.4668947519677}
,
{x:30.7231129435805,y: 29.4677546187832}
,
{x:30.7232413417392,y: 29.4679637341128}
,
{x:30.7234242745479,y: 29.4686367731042}
,
{x:30.723643215256,y: 29.4691557467159}
,
{x:30.7241990480982,y: 29.4708164454472}
,
{x:30.7245529805969,y: 29.4718470482748}
,
{x:30.7245866164139,y: 29.4720990848744}
,
{x:30.7246117765405,y: 29.4724178175175}
,
{x:30.7246116207272,y: 29.4727142862205}
,
{x:30.7246162202975,y: 29.4729802784966}
,
{x:30.7244679546098,y: 29.4732942492989}
,
{x:30.7241589120584,y: 29.4735830452777}
,
{x:30.7237752015288,y: 29.4739193846238}
,
{x:30.7235774296451,y: 29.4739935025204}
,
{x:30.7232549610094,y: 29.4741974209273}
,
{x:30.7228457371117,y: 29.4744940682179}
,
{x:30.722653223099,y: 29.4745677709662}
,
{x:30.7220693956025,y: 29.4745889724878}
,
{x:30.7213085563474,y: 29.4745258639372}
,
{x:30.7210343083402,y: 29.47445787377}
,
{x:30.7208059331211,y: 29.4744357951197}
,
{x:30.7206023700937,y: 29.4744268194984}
,
{x:30.7204087603523,y: 29.474400428601}
,
{x:30.7202450036183,y: 29.4743261533875}
,
{x:30.7202153250804,y: 29.4742389821331}
,
{x:30.7201856362231,y: 29.4741605241032}
,
{x:30.7201459895999,y: 29.4741038364935}
,
{x:30.7201314100429,y: 29.4740149434042}
,
{x:30.7202783107054,y: 29.4738992327876}
,
{x:30.7204544213395,y: 29.4737714688315}
,
{x:30.7210005966214,y: 29.4735646763424}
,
{x:30.7213035763895,y: 29.473438700611}
,
{x:30.7214823453188,y: 29.4733953511632}
,
{x:30.7216313892554,y: 29.4732909663605}
,
{x:30.7216761797939,y: 29.4731864531617}
,
{x:30.7216762586545,y: 29.4731123840579}
,
{x:30.721636643658,y: 29.4730208384288}
,
{x:30.7215473745955,y: 29.4729423049532}
,
{x:30.7214035039197,y: 29.472863707431}
,
{x:30.7212893034622,y: 29.4728897121059}
,
{x:30.721160199088,y: 29.4729244119099}
,
{x:30.7209168932654,y: 29.4729807570216}
,
{x:30.7205196779523,y: 29.4730499835835}
,
{x:30.7203210322388,y: 29.4731107352706}
,
{x:30.7199584451002,y: 29.4732584151319}
,
{x:30.719705071113,y: 29.4733975110218}
,
{x:30.7193125836727,y: 29.4736017743195}
,
{x:30.718959860324,y: 29.4737581585197}
,
{x:30.7187909194877,y: 29.473849426335}
,
{x:30.7187014397854,y: 29.4739233692366}
,
{x:30.7186218822321,y: 29.4740016807279}
,
{x:30.7184578431161,y: 29.4741278013523}
,
{x:30.7182440297019,y: 29.474327910481}
,
{x:30.7180949272189,y: 29.4744191961397}
,
{x:30.7179756770004,y: 29.4744713131355}
,
{x:30.7178763342509,y: 29.4744929631225}
,
{x:30.7177224002571,y: 29.4744971151689}
,
{x:30.717553625461,y: 29.474466397902}
,
{x:30.7174096067941,y: 29.4744792742118}
,
{x:30.7172506254362,y: 29.4745313353856}
,
{x:30.7171015342964,y: 29.4746051892273}
,
{x:30.7169524177951,y: 29.4746921097259}
,
{x:30.7167884084427,y: 29.474774652565}
,
{x:30.7165746164929,y: 29.4749268208059}
,
{x:30.7164204284749,y: 29.4750660011734}
,
{x:30.7161319671021,y: 29.4753095352138}
,
{x:30.7157241865043,y: 29.4756138778256}
,
{x:30.7153263338645,y: 29.4759051568454}
,
{x:30.7148836974384,y: 29.4762268508466}
,
{x:30.7144708224699,y: 29.4765529316554}
,
{x:30.7139086113975,y: 29.4770268733406}
,
{x:30.7134658828319,y: 29.4773441723012}
,
{x:30.7129484071379,y: 29.4777615260256}
,
{x:30.7125002781409,y: 29.4782573684415}
,
{x:30.7123507845081,y: 29.4784749130438}
,
{x:30.7123296227399,y: 29.4790514569387}
,
{x:30.7122643060392,y: 29.4793562692779}
,
{x:30.7121991381307,y: 29.4795957397335}
,
{x:30.7122187576389,y: 29.4797090304003}
,
{x:30.712288152156,y: 29.4797919124964}
,
{x:30.7124221311085,y: 29.4798879731454}
,
{x:30.7125711040624,y: 29.479949211085}
,
{x:30.7128492880198,y: 29.4800193817736}
,
{x:30.7131424345206,y: 29.4800677980586}
,
{x:30.7135747818418,y: 29.4801033812643}
,
{x:30.713863073826,y: 29.4800995133068}
,
{x:30.7143104548098,y: 29.4800784891082}
,
{x:30.7148772868486,y: 29.4799792498585}
,
{x:30.7158719130662,y: 29.4797021054946}
,
{x:30.7166910624913,y: 29.4794485644764}
,
{x:30.716855028195,y: 29.4794401027368}
,
{x:30.7170538280136,y: 29.4793968441654}
,
{x:30.7178838637626,y: 29.4791759372729}
,
{x:30.7188033318402,y: 29.4789246515021}
,
{x:30.7190269667497,y: 29.4788727083527}
,
{x:30.7197228110315,y: 29.4786341359971}
,
{x:30.7202247657874,y: 29.4784823973773}
,
{x:30.7207564608509,y: 29.4783742621098}
,
{x:30.720860790239,y: 29.4783700594543}
,
{x:30.7210148552277,y: 29.4783180045742}
,
{x:30.7211440547356,y: 29.4782876963768}
,
{x:30.7212683119749,y: 29.4782355960507}
,
{x:30.7214869441134,y: 29.4781923476562}
,
{x:30.7216906680929,y: 29.4781534340554}
,
{x:30.7220484440049,y: 29.4780668175529}
,
{x:30.7227688873709,y: 29.4779589420727}
,
{x:30.7231067551234,y: 29.4779027915831}
,
{x:30.7232657341377,y: 29.4778943088899}
,
{x:30.7234644546121,y: 29.47789024147}
,
{x:30.723901700688,y: 29.4778124478315}
,
{x:30.7245625212511,y: 29.4777175503826}
,
{x:30.7251786362965,y: 29.4776182281416}
,
{x:30.7255810801814,y: 29.4775883154997}
,
{x:30.7262518395949,y: 29.4775326535395}
,
{x:30.7264484678494,y: 29.4774631910835}
,
{x:30.727337845953,y: 29.4773755101239}
,
{x:30.7279429803921,y: 29.4773113281959}
,
{x:30.7287959964379,y: 29.4771878198608}
,
{x:30.729099133577,y: 29.4771316235934}
,
{x:30.7302670065355,y: 29.4769285759332}
,
{x:30.7306844812784,y: 29.4768507724164}
,
{x:30.7317381675594,y: 29.4766519399887}
,
{x:30.7329162383788,y: 29.476444625922}
,
{x:30.7338707516295,y: 29.4762980132633}
,
{x:30.7339277944618,y: 29.4762931084359}
,
{x:30.7339215241429,y: 29.4762704909233}
,
{x:30.7338021753613,y: 29.4756932696787}
,
{x:30.7337474032827,y: 29.475388567666}
,
{x:30.7337437360944,y: 29.4749206150606}
]}
]})
| amounir86/amounir86-2011-elections | voter-info/shapes/old_json/23_03.js | JavaScript | unlicense | 95,900 |
var
blog_previews_container = $('#blog .preview-container-shift'),
blog_previews = $('#blog-posts'),
blog_belt = $('.blog-belt'),
post_section = $('.post-section');
blog_return = $('.blog-return'),
post_poster = $('.post-poster'),
post_content = $('.post-content');
total_number = blog_previews.data('total-number'),
pager_size = blog_previews.data('pager-number'),
shown_pages = 1,
loading_offset = 200; // Loading starts px from bottom
animating_blog = blog_opened = false,
page_folders_number = Math.ceil(total_number / pager_size);
$(document).ready(function() {
// Show category posts
$(blog_previews_container).on('click', '.hashtag', function(event) {
load_tag($(this).text());
});
// Infinite scroll
$(blog_previews_container).on('scroll', function(event) {
if (!$(blog_previews_container).hasClass('prevent-scroll-load')) {
load_if_nesessary();
}
});
$(window).on('load', function () {
shown_posts = $('.post-section .post-preview');
var shown_posts_size = $(shown_posts).size();
if ( shown_posts_size < 5 ) {
load_new_posts(5 - shown_posts);
}
load_if_nesessary();
})
// If not enough posts
function load_if_nesessary() {
var top_offset = $(blog_previews_container).scrollTop(),
blog_height = $(blog_previews).outerHeight();
if ( top_offset + loading_offset + win_height > blog_height) {
load_new_posts(5, $(blog_previews).data('cat'))
}
}
// Sliding 2 post
$('#blog-posts').on('click', '.post-link, .post-name span', function(event) {
if (animating_work) return;
var that = $(this).parents('.post-preview'),
newTitle = that.data('name'),
newUrl = that.data('url'),
newPoster = that.data('poster'),
newDate = that.data('date'),
newHash = newUrl.split('/');
animating_blog = blog_opened = true;
window.location.hash = newHash[newHash.length - 1];
setTimeout(function(){
$('aside .blog-return').show();
animating_blog = false;
}, 800);
blog_belt.addClass('slided');
// Put title
$('.post-title .title-text').text(newTitle);
$('.post-title .date').text(newDate.toLowerCase());
// Load content
$('.post-content').load(newUrl, function(){
$(this).find('a').each(function(index, el) {
$(el).attr('target', '_blank');
});
post_poster.css('background-image', 'url(../../blog-posters/'+ newPoster +')');
});
});
blog_return.click(function() {
window.location.hash = '#blog';
blog_slide_back();
});
});
// Add n posts
function load_new_posts(num, category, tag_name) {
if (!category) return;
if ( shown_pages < page_folders_number ) {
shown_pages++;
var cat = '.cat-' + category;
if (category == 'all') cat = '';
var tag = '';
if (tag_name) tag = '.tag-' + tag_name;
$('#ccc').load( window.location.origin + '/pagination/page' + shown_pages +' .lang-' + lang + cat + tag, function(){
$('.post-section').append($('#ccc').html());
var loaded_size = $('#ccc .post-preview').size();
$('#ccc').empty();
if ( loaded_size < num ) {
var rest = num - loaded_size;
load_new_posts(rest, category, tag_name);
}
});
} else {
blog_previews_container.addClass('prevent-scroll-load')
}
}
function load_cat(cat) {
if (!cat) return
blog_previews_container.addClass('prevent-scroll-load');
shown_pages = 1;
$('.post-section').empty();
$(shown_posts).each(function(index, el) {
if ( $(el).hasClass('cat-' + cat) ) {
$('.post-section').append($(el));
}
});
$('.dropy__title .hsh').text('');
load_new_posts(total_number, cat);
}
function load_tag(tag) {
if (!tag) return
blog_previews_container.addClass('prevent-scroll-load');
shown_pages = 1;
$('.post-section').empty();
$(shown_posts).each(function(index, el) {
if ( $(el).hasClass('tag-' + tag) ) {
$('.post-section').append($(el));
}
});
$('.dropy__title .hsh').text('#' + tag);
load_new_posts(total_number, 'all', tag);
}
function blog_slide_back () {
if ( !animating_blog && blog_opened ) {
animating_blog = true;
blog_opened = false;
$('.blog-belt').removeClass('slided');
$('aside .blog-return').hide();
setTimeout(function(){
animating_blog = false;
post_poster.css('background-image', 'none');
$('.post-content').empty();
}, 800);
}
}
| const-int/const-int.github.io | assets/js/sections/section-blog.js | JavaScript | unlicense | 4,911 |
#include <cmath>
#include <cstdio>
#include <cstring>
#define MAXR 100
#define MAXC 100
#define Neg(v) memset((v), -1, sizeof(v))
const int MAX_X = MAXR * 2;
const int MAX_Y = MAXC * 2;
int R, C;
int Q, x, y;
char grid[MAXR][MAXC + 1];
double curr;
double ans[MAX_X + 1][MAX_Y + 1];
// memo[x][y]: coordinates of the position that has the answer for (x, y)
int memo[MAX_X + 1][MAX_Y + 1][2];
const double pi = acos(-1);
const double a1 = pi / 4; // area of one "closed" corner from a tile
const double a2 = 4 - pi/2; // area of the "middle section" of a tile
bool is_odd(int n) { return n % 2 != 0; }
bool is_valid(int r, int c)
{
return r >= 0 && r <= 2*R && c >= 0 && c <= 2*C;
}
bool should_visit(int r, int c)
{
return is_valid(r, c) && memo[r][c][0] < 0;
}
void dfs(int r, int c)
{
memo[r][c][0] = x;
memo[r][c][1] = y;
if (is_odd(r) && is_odd(c)) {
curr += a2;
if (grid[r/2][c/2] == '0') {
if (should_visit(r - 1, c + 1)) dfs(r-1, c+1);
if (should_visit(r + 1, c - 1)) dfs(r+1, c-1);
}
else {
if (should_visit(r - 1, c - 1)) dfs(r-1, c-1);
if (should_visit(r + 1, c + 1)) dfs(r+1, c+1);
}
return;
}
if (is_valid(r-1, c-1)) {
int p = (r-1) / 2, q = (c-1)/2;
if (grid[p][q] == '0') curr += a1;
else if (should_visit(r-1, c-1)) dfs(r-1, c-1);
}
if (is_valid(r-1, c+1)) {
int p = (r-1) / 2, q = (c+1)/2;
if (grid[p][q] == '1') curr += a1;
else if (should_visit(r-1, c+1)) dfs(r-1, c+1);
}
if (is_valid(r+1, c-1)) {
int p = (r+1) / 2, q = (c-1)/2;
if (grid[p][q] == '1') curr += a1;
else if (should_visit(r+1, c-1)) dfs(r+1, c-1);
}
if (is_valid(r+1, c+1)) {
int p = (r+1) / 2, q = (c+1)/2;
if (grid[p][q] == '0') curr += a1;
else if (should_visit(r+1, c+1)) dfs(r+1, c+1);
}
}
int main()
{
int T;
scanf("%d", &T);
int ncase = 0;
while (T--) {
scanf("%d%d", &R, &C);
for (int i = 0; i < R; ++i) scanf("%s", grid[i]);
printf("Case %d:\n", ++ncase);
Neg(memo);
scanf("%d", &Q);
while (Q--) {
scanf("%d%d", &x, &y);
if (is_odd(x + y)) { puts("0"); continue; }
if (memo[x][y][0] >= 0) {
int ax = memo[x][y][0];
int ay = memo[x][y][1];
printf("%.8lf\n", ans[ax][ay]);
continue;
}
curr = 0.0;
dfs(x, y);
ans[x][y] = curr;
printf("%.8lf\n", curr);
}
}
return 0;
}
| lbv/pc-code | solved/r-t/truchet-tiling/lightoj/truchet.cpp | C++ | unlicense | 2,677 |
/*
* Copyright 2015 RONDHUIT Co.,LTD.
*
* 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.
*/
package org.nlp4l.lucene;
import java.io.IOException;
import org.apache.lucene.index.IndexReader;
/**
* 連接頻度FLR法にしたがい複合名詞CNのスコアを計算する。ただし、CNの単独出現数はdocFreqを使用する近似を行っている。
* くわしくは、{@link #score(String)}を参照のこと。
*
* @see LRCompoundNounScorer#score(String)
* @since 0.3
*/
public class ConcatFreqDFLRCompoundNounScorer extends
ConcatFreqLRCompoundNounScorer {
public ConcatFreqDFLRCompoundNounScorer(IndexReader reader, String delimiter,
String fieldNameCn, String fieldNameLn2, String fieldNameRn2) {
super(reader, delimiter, fieldNameCn, fieldNameLn2, fieldNameRn2);
}
/**
* 複合名詞CNのスコアを、以下の計算式から計算する。f(CN)はdocFreq(CN)で近似している。<br/><br/>
* \begin{align*}
* FLR(CN) & =f(CN) \times LR(CN) \\
* & \approx docFreq(CN) \times LR(CN)
* \end{align*}
*
* <br/><br/>
* その他の記号については{@link LRCompoundNounScorer#score(String)}を参照のこと。<br/><br/>
* <ul>
* <li>複合名詞CNの単独出現数:f(CN)</li>
* <li>連接頻度LR法{@link ConcatFreqLRCompoundNounScorer}によるスコア:LR(CN)</li>
* <li>複合名詞CNを単独で含む文書数:docFreq(CN)</li>
* </ul>
*
* @param compNoun 複合名詞CN
* @see LRCompoundNounScorer#score(String)
*
*/
public double score(String compNoun) throws IOException {
return LuceneUtil.getTermDocFreq(searcher, fieldNameCn, compNoun) * super.score(compNoun);
}
}
| gazimahmud/nlp4l | src/main/java/org/nlp4l/lucene/ConcatFreqDFLRCompoundNounScorer.java | Java | apache-2.0 | 2,211 |
/*
* Copyright (C) 2017 TypeFox and others.
*
* 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
*/
// tslint:disable:no-any
import * as request from 'request';
const ChangesStream = require('changes-stream');
export interface IChangeStream {
on(event: 'data', cb: (change: { id: string }) => void): void;
destroy(): void;
}
export interface Author {
name: string;
email: string;
}
export interface Maintainer {
username: string;
email: string;
}
export interface Dependencies {
[name: string]: string | undefined;
}
export interface NodePackage {
name?: string;
version?: string;
description?: string;
publisher?: Maintainer;
author?: string | Author;
maintainers?: Maintainer[];
keywords?: string[];
dependencies?: Dependencies;
[property: string]: any;
}
export interface PublishedNodePackage extends NodePackage {
name: string;
version: string;
}
export namespace PublishedNodePackage {
export function is(pck: NodePackage | undefined): pck is PublishedNodePackage {
return !!pck && !!pck.name && !!pck.version;
}
}
export interface ViewResult {
'dist-tags': {
[tag: string]: string
}
'versions': {
[version: string]: NodePackage
},
'readme': string;
[key: string]: any
}
export function sortByKey(object: { [key: string]: any }) {
return Object.keys(object).sort().reduce((sorted, key) => {
sorted[key] = object[key];
return sorted;
}, {} as { [key: string]: any });
}
export class NpmRegistryConfig {
/**
* Default: 'false'
*/
readonly next: boolean;
/**
* Default: https://registry.npmjs.org/.
*/
readonly registry: string;
}
export class NpmRegistryOptions {
/**
* Default: false.
*/
readonly watchChanges: boolean;
}
export class NpmRegistry {
static defaultConfig: NpmRegistryConfig = {
next: false,
registry: 'https://registry.npmjs.org/'
};
readonly config: NpmRegistryConfig = { ...NpmRegistry.defaultConfig };
protected readonly options: NpmRegistryOptions;
protected changes: undefined | IChangeStream;
protected readonly index = new Map<string, Promise<ViewResult>>();
constructor(options?: Partial<NpmRegistryOptions>) {
this.options = {
watchChanges: false,
...options
};
this.resetIndex();
}
updateConfig(config?: Partial<NpmRegistryConfig>) {
const oldRegistry = this.config.registry;
Object.assign(this.config, config);
const newRegistry = this.config.registry;
if (oldRegistry !== newRegistry) {
this.resetIndex();
}
}
protected resetIndex(): void {
this.index.clear();
if (this.options.watchChanges && this.config.registry === NpmRegistry.defaultConfig.registry) {
if (this.changes) {
this.changes.destroy();
}
// invalidate index with NPM registry web hooks
// see: https://github.com/npm/registry-follower-tutorial
const db = 'https://replicate.npmjs.com';
this.changes = new ChangesStream({ db }) as IChangeStream;
this.changes.on('data', change => this.invalidate(change.id));
}
}
protected invalidate(name: string): void {
if (this.index.delete(name)) {
this.view(name);
}
}
view(name: string): Promise<ViewResult> {
const indexed = this.index.get(name);
if (indexed) {
return indexed;
}
const result = this.doView(name);
this.index.set(name, result);
result.catch(() => this.index.delete(name));
return result;
}
protected doView(name: string): Promise<ViewResult> {
let url = this.config.registry;
if (name[0] === '@') {
url += '@' + encodeURIComponent(name.substr(1));
} else {
url += encodeURIComponent(name);
}
const headers: {
[header: string]: string
} = {};
return new Promise((resolve, reject) => {
request({
url, headers
}, (err, response, body) => {
if (err) {
reject(err);
} else if (response.statusCode !== 200) {
reject(new Error(`${response.statusCode}: ${response.statusMessage} for ${url}`));
} else {
const data = JSON.parse(body);
resolve(data);
}
});
});
}
}
| epatpol/theia-1 | dev-packages/application-package/src/npm-registry.ts | TypeScript | apache-2.0 | 4,807 |
function refreshHzBarChart(){
console.log("entered refreshHzBarChart");
d3.json('../../data/team24/files.json', function(error, data) {
if (error) throw error;
var chartWidth = 600,
barHeight = 14,
groupHeight = barHeight * data.series.length ,
gapBetweenGroups = 125,
spaceForLabels = 400,
spaceForLegend = 200;
// Zip the series data together (first values, second values, etc.)
var zippedData = [];
for (var i=0; i<data.labels.length; i++) {
for (var j=0; j<data.series.length; j++) {
zippedData.push(data.series[j].value[i]);
}
}
var mylabels = [];
for(var i=0; i<data["series"].length; i++){
mylabels.push(data["series"][i]["name"].toUpperCase());
}
var colorbar = ['#31a354','#dd1c77', '#2c7fb8', '#F1C40F' , '#AF7AC5', '#3498DB', '#5D6D7E']
var chartHeight = barHeight * zippedData.length + gapBetweenGroups * data.labels.length;
var x = d3.scale.linear()
.domain([0, d3.max(zippedData)])
.range([0, chartWidth-100]);
var y = d3.scale.linear()
.range([chartHeight + gapBetweenGroups, 0]);
var yAxis = d3.svg.axis()
.scale(y)
.tickFormat('')
.tickSize(0)
.orient("left");
// Specify the chart area and dimensions
var chart = d3.select("#hzBarChart .panel-body").append("svg")
.attr("width", spaceForLabels + chartWidth + spaceForLegend)
.attr("height", chartHeight);
// Create bars
var bar = chart.selectAll("g")
.data(zippedData)
.enter().append("g")
.attr("transform", function(d, i) {
return "translate(" + spaceForLabels + "," + (i * barHeight + gapBetweenGroups * (0.5 + Math.floor(i/data.series.length))) + ")";
});
// Create rectangles of the correct width
bar.append("rect")
.attr("fill", function(d,i) { return colorbar[i % data.series.length]; })
.attr("class", "bar")
.attr("width", x)
.attr("height", barHeight - 1);
// console.log(barHeight - 1);
bar.append('rect')
.attr("x", function(d) {
if(x(d) < 6) return x(d) + 220; else if(x(d) < 80) return x(d) + 220; else if(x(d) < 300) return x(d) + 220 ; else return x(d) - 65; })
.attr("y", 1)
.attr('width', 65)
.attr('height', barHeight-2)
.attr('fill', 'white')
// Add text label in bar
bar.append("text")
.attr("x", function(d) { if(x(d) < 6) return x(d) + 220; else if(x(d)<80) return x(d)+220; else if(x(d) < 160) return x(d)+ i +220; else if(x(d) < 300) return x(d)+ i + 120; else return x(d) + 80;})
.attr("y", barHeight / 2)
.attr("fill", function(d,i) { return colorbar[i % data.series.length]; })
.attr("dy", ".35em")
.text(function(d, i) { return d + " " + mylabels[i % data.series.length]; });
// Draw labels
bar.append("text")
.attr("class", "label")
.attr("x", function(d) { return - 30; })
.attr("y", groupHeight /2)
.attr("dy", ".35em")
.text(function(d,i) {
if (i % data.series.length === 0)
return data.labels[Math.floor(i/data.series.length)];
else
return ""});
chart.append("g")
.attr("class", "y axis")
.attr("transform", "translate(" + spaceForLabels + ", " + -gapBetweenGroups/2 + ")")
.call(yAxis);
// Draw legend
var legendRectSize = 18,
legendSpacing = 4;
var legend = chart.selectAll('.legend')
.data(data.series)
.enter()
.append('g')
.attr('transform', function (d, i) {
var height = legendRectSize + legendSpacing;
var offset = -gapBetweenGroups/2;
var horz = spaceForLabels + chartWidth + 10 - legendRectSize;
var vert = i * height - offset;
return 'translate(' + horz + ',' + vert + ')';
});
legend.append('rect')
.attr('width', legendRectSize)
.attr('height', legendRectSize)
.style('fill', function (d, i) { return colorbar[i % data.series.length]; })
.style('stroke', function (d, i) { return colorbar[i % data.series.length]; });
legend.append('text')
.attr('class', 'legend')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.text(function (d,i) { return mylabels[i % data.series.length]; });
});
}
| USCDataScience/polar.usc.edu | js/team24/nerCompare.js | JavaScript | apache-2.0 | 4,520 |
using System;
using System.Text;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using TfsAdvanced.Models.Infrastructure;
namespace TfsAdvanced.Infrastructure
{
public class AuthenticationTokenProvider
{
private readonly HttpContext context;
public AuthenticationTokenProvider(IHttpContextAccessor context)
{
this.context = context.HttpContext;
}
public AuthenticationToken GetToken()
{
byte[] value;
if (context.Session.TryGetValue("AuthToken", out value))
{
var token = JsonConvert.DeserializeObject<AuthenticationToken>(ASCIIEncoding.ASCII.GetString(value));
return token;
}
throw new Exception("Unable to get token from session.");
}
}
}
| BertCotton/TfsAdvanced | src/TfsAdvanced/Infrastructure/AuthenticationTokenProvider.cs | C# | apache-2.0 | 859 |
var Manager;
(function ($) {
$(function () {
Manager = new AjaxSolr.Manager({
solrUrl: 'http://evolvingweb.ca/solr/reuters/'
});
Manager.addWidget(new AjaxSolr.ResultWidget({
id: 'result',
target: '#docs'
}));
Manager.addWidget(new AjaxSolr.PagerWidget({
id: 'pager',
target: '#pager',
prevLabel: '<',
nextLabel: '>',
innerWindow: 1,
renderHeader: function (perPage, offset, total) {
$('#pager-header').html($('<span></span>').text('displaying ' + Math.min(total, offset + 1) + ' to ' + Math.min(total, offset + perPage) + ' of ' + total));
}
}));
var fields = [ 'topics', 'organisations', 'exchanges' ];
for (var i = 0, l = fields.length; i < l; i++) {
Manager.addWidget(new AjaxSolr.TagcloudWidget({
id: fields[i],
target: '#' + fields[i],
field: fields[i]
}));
}
Manager.addWidget(new AjaxSolr.CurrentSearchWidget({
id: 'currentsearch',
target: '#selection'
}));
Manager.addWidget(new AjaxSolr.AutocompleteWidget({
id: 'text',
target: '#search',
fields: [ 'topics', 'organisations', 'exchanges' ]
}));
Manager.addWidget(new AjaxSolr.CountryCodeWidget({
id: 'countries',
target: '#countries',
field: 'countryCodes'
}));
Manager.init();
Manager.store.addByValue('q', '*:*');
var params = {
facet: true,
'facet.field': [ 'topics', 'organisations', 'exchanges', 'countryCodes' ],
'facet.limit': 20,
'facet.mincount': 1,
'f.topics.facet.limit': 50,
'f.countryCodes.facet.limit': -1,
'json.nl': 'map'
};
for (var name in params) {
Manager.store.addByValue(name, params[name]);
}
Manager.doRequest();
});
$.fn.showIf = function (condition) {
if (condition) {
return this.show();
}
else {
return this.hide();
}
}
})(jQuery);
| ox-it/wl-course-signup | tool/src/main/webapp/static/lib/ajax-solr-master/search/js/reuters.8.js | JavaScript | apache-2.0 | 1,954 |
// Copyright 2017 The Kubernetes Dashboard Authors.
//
// 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.
import {stateName as parentStateName} from 'cluster/state';
import {breadcrumbsConfig} from 'common/components/breadcrumbs/service';
import {stateName as parentState, stateUrl} from './../state';
import {NamespaceListController} from './controller';
/**
* I18n object that defines strings for translation used in this file.
*/
const i18n = {
/** @type {string} @desc Label 'Namespaces' that appears as a breadcrumbs on the action bar. */
MSG_BREADCRUMBS_NAMESPACES_LABEL: goog.getMsg('Namespaces'),
};
/**
* Config state object for the Namespace list view.
*
* @type {!ui.router.StateConfig}
*/
export const config = {
url: stateUrl,
parent: parentState,
resolve: {
'namespaceList': resolveNamespaceList,
},
data: {
[breadcrumbsConfig]: {
'label': i18n.MSG_BREADCRUMBS_NAMESPACES_LABEL,
'parent': parentStateName,
},
},
views: {
'': {
controller: NamespaceListController,
controllerAs: '$ctrl',
templateUrl: 'namespace/list/list.html',
},
},
};
/**
* @param {!angular.$resource} $resource
* @return {!angular.Resource}
* @ngInject
*/
export function namespaceListResource($resource) {
return $resource('api/v1/namespace');
}
/**
* @param {!angular.Resource} kdNamespaceListResource
* @param {!./../../common/dataselect/service.DataSelectService} kdDataSelectService
* @return {!angular.$q.Promise}
* @ngInject
*/
export function resolveNamespaceList(kdNamespaceListResource, kdDataSelectService) {
let query = kdDataSelectService.getDefaultResourceQuery('');
return kdNamespaceListResource.get(query).$promise;
}
| vlal/dashboard | src/app/frontend/namespace/list/stateconfig.js | JavaScript | apache-2.0 | 2,220 |
// Copyright (c) 2015 Alachisoft
//
// 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.
/**
/// Memcached C# client
/// Copyright (c) 2005
///
/// This module is Copyright (c) 2005 Tim Gebhardt
/// All rights reserved.
/// Based on code written by Greg Whalin and Richard Russo
/// for a Java Memcached client which can be found here:
/// http://www.whalin.com/memcached/
///
/// This library is free software; you can redistribute it and/or
/// modify it under the terms of the GNU Lesser General Public
/// License as published by the Free Software Foundation; either
/// version 2.1 of the License, or (at your option) any later
/// version.
///
/// This library is distributed in the hope that it will be
/// useful, but WITHOUT ANY WARRANTY; without even the implied
/// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
/// PURPOSE. See the GNU Lesser General Public License for more
/// details.
///
/// You should have received a copy of the GNU Lesser General Public
/// License along with this library; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///
/// @author Tim Gebhardt <tim@gebhardtcomputing.com>
/// @version 1.0
**/
namespace Memcached.ClientLibrary
{
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Resources;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using log4net;
using ICSharpCode.SharpZipLib.GZip;
using Memcached.ClientLibrary;
using System.Configuration;
using Alachisoft.NCache.Integrations.Memcached.Provider;
using Alachisoft.NCache.Integrations.Memcached.Provider.Exceptions;
/// <summary>
/// This is a C# client for the memcached server available from
/// <a href="http:/www.danga.com/memcached/">http://www.danga.com/memcached/</a>.
///
/// Supports setting, adding, replacing, deleting compressed/uncompressed and
/// serialized (can be stored as string if object is native class) objects to memcached.
///
/// Now pulls SockIO objects from SockIOPool, which is a connection pool. The server failover
/// has also been moved into the SockIOPool class.
/// This pool needs to be initialized prior to the client working. See javadocs from SockIOPool.
/// (This will have to be fixed for our C# version. Most of this code is straight ported over from Java.)
/// </summary>
/// <example>
/// //***To create cache client object and set params:***
/// MemcachedClient mc = new MemcachedClient();
///
/// // compression is enabled by default
/// mc.setCompressEnable(true);
///
/// // set compression threshhold to 4 KB (default: 15 KB)
/// mc.setCompressThreshold(4096);
///
/// // turn on storing primitive types as a string representation
/// // Should not do this in most cases.
/// mc.setPrimitiveAsString(true);
///
///
/// //***To store an object:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "cacheKey1";
/// object value = SomeClass.getObject();
/// mc.set(key, value);
///
///
/// //***To store an object using a custom server hashCode:***
/// //The set method shown here will always set the object in the cache.
/// //The add and replace methods do the same, but with a slight difference.
/// // add -- will store the object only if the server does not have an entry for this key
/// // replace -- will store the object only if the server already has an entry for this key
/// MemcachedClient mc = new MemcachedClient();
/// string key = "cacheKey1";
/// object value = SomeClass.getObject();
/// int hash = 45;
/// mc.set(key, value, hash);
///
///
/// //***To delete a cache entry:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "cacheKey1";
/// mc.delete(key);
///
///
/// //***To delete a cache entry using a custom hash code:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "cacheKey1";
/// int hash = 45;
/// mc.delete(key, hashCode);
///
///
/// //***To store a counter and then increment or decrement that counter:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "counterKey";
/// mc.storeCounter(key, 100);
/// Console.WriteLine("counter after adding 1: " mc.incr(key));
/// Console.WriteLine("counter after adding 5: " mc.incr(key, 5));
/// Console.WriteLine("counter after subtracting 4: " mc.decr(key, 4));
/// Console.WriteLine("counter after subtracting 1: " mc.decr(key));
///
///
/// //***To store a counter and then increment or decrement that counter with custom hash:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "counterKey";
/// int hash = 45;
/// mc.storeCounter(key, 100, hash);
/// Console.WriteLine("counter after adding 1: " mc.incr(key, 1, hash));
/// Console.WriteLine("counter after adding 5: " mc.incr(key, 5, hash));
/// Console.WriteLine("counter after subtracting 4: " mc.decr(key, 4, hash));
/// Console.WriteLine("counter after subtracting 1: " mc.decr(key, 1, hash));
///
///
/// //***To retrieve an object from the cache:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "key";
/// object value = mc.get(key);
///
///
/// //***To retrieve an object from the cache with custom hash:***
/// MemcachedClient mc = new MemcachedClient();
/// string key = "key";
/// int hash = 45;
/// object value = mc.get(key, hash);
///
///
/// //***To retrieve an multiple objects from the cache***
/// MemcachedClient mc = new MemcachedClient();
/// string[] keys = { "key", "key1", "key2" };
/// object value = mc.getMulti(keys);
///
///
/// //***To retrieve an multiple objects from the cache with custom hashing***
/// MemcachedClient mc = new MemcachedClient();
/// string[] keys = { "key", "key1", "key2" };
/// int[] hashes = { 45, 32, 44 };
/// object value = mc.getMulti(keys, hashes);
///
///
/// //***To flush all items in server(s)***
/// MemcachedClient mc = new MemcachedClient();
/// mc.FlushAll();
///
///
/// //***To get stats from server(s)***
/// MemcachedClient mc = new MemcachedClient();
/// Hashtable stats = mc.stats();
/// </example>
public class MemcachedClient : IDisposable
{
private IMemcachedProvider memcachedProvider;
// logger
private static ILog log = LogManager.GetLogger(typeof(MemcachedClient));
// return codes
private const string VALUE = "VALUE"; // start of value line from server
private const string STATS = "STAT"; // start of stats line from server
private const string DELETED = "DELETED"; // successful deletion
private const string NOTFOUND = "NOT_FOUND"; // record not found for delete or incr/decr
private const string STORED = "STORED"; // successful store of data
private const string NOTSTORED = "NOT_STORED"; // data not stored
private const string OK = "OK"; // success
private const string END = "END"; // end of data from server
private const string ERROR = "ERROR"; // invalid command name from client
private const string CLIENT_ERROR = "CLIENT_ERROR"; // client error in input line - invalid protocol
private const string SERVER_ERROR = "SERVER_ERROR"; // server error
// default compression threshold
private const int COMPRESS_THRESH = 30720;
// values for cache flags
//
// using 8 (1 << 3) so other clients don't try to unpickle/unstore/whatever
// things that are serialized... I don't think they'd like it. :)
private const int F_COMPRESSED = 2;
private const int F_SERIALIZED = 8;
// flags
private bool _primitiveAsString;
private bool _compressEnable;
private long _compressThreshold;
private string _defaultEncoding;
// which pool to use
private string _poolName;
/// <summary>
/// Creates a new instance of MemcachedClient.
/// </summary>
public MemcachedClient()
{
Init();
}
/// <summary>
/// Initializes client object to defaults.
///
/// This enables compression and sets compression threshhold to 15 KB.
/// </summary>
private void Init()
{
string cacheName = "";
try
{
cacheName = ConfigurationManager.AppSettings["NCache.CacheName"];
if (String.IsNullOrEmpty(cacheName))
{
Exception ex = new Exception("Unable to read NCache Name from configuration");
throw ex;
}
}
catch (Exception e)
{
throw e;
}
try
{
memcachedProvider = CacheFactory.CreateCacheProvider(cacheName);
}
catch (Exception e)
{
//do nothing
}
_primitiveAsString = false;
_compressEnable = true;
_compressThreshold = COMPRESS_THRESH;
_defaultEncoding = "UTF-8";
_poolName = GetLocalizedString("default instance");
}
/// <summary>
/// Sets the pool that this instance of the client will use.
/// The pool must already be initialized or none of this will work.
/// </summary>
public string PoolName
{
get { return _poolName; }
set { _poolName = value; }
}
/// <summary>
/// Enables storing primitive types as their string values.
/// </summary>
public bool PrimitiveAsString
{
get { return _primitiveAsString; }
set { _primitiveAsString = value; }
}
/// <summary>
/// Sets default string encoding when storing primitives as strings.
/// Default is UTF-8.
/// </summary>
public string DefaultEncoding
{
get { return _defaultEncoding; }
set { _defaultEncoding = value; }
}
/// <summary>
/// Enable storing compressed data, provided it meets the threshold requirements.
///
/// If enabled, data will be stored in compressed form if it is
/// longer than the threshold length set with setCompressThreshold(int)
///
/// The default is that compression is enabled.
///
/// Even if compression is disabled, compressed data will be automatically
/// decompressed.
/// </summary>
/// <value><c>true</c> to enable compuression, <c>false</c> to disable compression</value>
public bool EnableCompression
{
get { return _compressEnable; }
set { _compressEnable = value; }
}
/// <summary>
/// Sets the required length for data to be considered for compression.
///
/// If the length of the data to be stored is not equal or larger than this value, it will
/// not be compressed.
///
/// This defaults to 15 KB.
/// </summary>
/// <value>required length of data to consider compression</value>
public long CompressionThreshold
{
get { return _compressThreshold; }
set { _compressThreshold = value; }
}
/// <summary>
/// Checks to see if key exists in cache.
/// </summary>
/// <param name="key">the key to look for</param>
/// <returns><c>true</c> if key found in cache, <c>false</c> if not (or if cache is down)</returns>
public bool KeyExists(string key)
{
return(Get(key, null, true) != null);
}
/// <summary>
/// Deletes an object from cache given cache key.
/// </summary>
/// <param name="key">the key to be removed</param>
/// <returns><c>true</c>, if the data was deleted successfully</returns>
public bool Delete(string key)
{
return Delete(key, null, DateTime.MaxValue);
}
/// <summary>
/// Deletes an object from cache given cache key and expiration date.
/// </summary>
/// <param name="key">the key to be removed</param>
/// <param name="expiry">when to expire the record.</param>
/// <returns><c>true</c>, if the data was deleted successfully</returns>
public bool Delete(string key, DateTime expiry)
{
return Delete(key, null, expiry);
}
/// <summary>
/// Deletes an object from cache given cache key, a delete time, and an optional hashcode.
///
/// The item is immediately made non retrievable.<br/>
/// Keep in mind:
/// <see cref="add">add(string, object)</see> and <see cref="replace">replace(string, object)</see>
/// will fail when used with the same key will fail, until the server reaches the
/// specified time. However, <see cref="set">set(string, object)</see> will succeed
/// and the new value will not be deleted.
/// </summary>
/// <param name="key">the key to be removed</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <param name="expiry">when to expire the record.</param>
/// <returns><c>true</c>, if the data was deleted successfully</returns>
public bool Delete(string key, object hashCode, DateTime expiry)
{
if(key == null)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("null key delete"));
}
return false;
}
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return false;
}
ulong seconds = 0;
if(expiry != DateTime.MaxValue)
seconds=(ulong)GetExpirationTime(expiry) / 1000;
try
{
// if we get appropriate response back, then we return true
OperationResult opResult = memcachedProvider.Delete(key,0);
string line = "";
switch (opResult.ReturnResult)
{
case Result.SUCCESS:
line = "DELETED";
break;
case Result.ITEM_NOT_FOUND:
line = "NOT_FOUND";
break;
}
if(DELETED == line)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("delete success").Replace("$$Key$$", key));
}
return true;
}
else if(NOTFOUND == line)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("delete key not found").Replace("$$Key$$", key));
}
}
else
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("delete key error").Replace("$$Key$$", key).Replace("$$Line$$", line));
}
}
}
catch(Exception e)
{
if(log.IsErrorEnabled)
{
// exception thrown
log.Error(GetLocalizedString("delete IOException"), e);
}
}
return false;
}
/// <summary>
/// Converts a .NET date time to a UNIX timestamp
/// </summary>
/// <param name="ticks"></param>
/// <returns></returns>
private static int GetExpirationTime(DateTime expiration)
{
if(expiration <= DateTime.Now)
return 0;
TimeSpan thirtyDays = new TimeSpan(29, 23, 59, 59);
if(expiration.Subtract(DateTime.Now) > thirtyDays)
return (int)thirtyDays.TotalSeconds;
return (int)expiration.Subtract(DateTime.Now).TotalSeconds;
}
/// <summary>
/// Stores data on the server; only the key and the value are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Set(string key, object value)
{
return Set("set", key, value, DateTime.MaxValue, null, _primitiveAsString);
}
/// <summary>
/// Stores data on the server; only the key and the value are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Set(string key, object value, int hashCode)
{
return Set("set", key, value, DateTime.MaxValue, hashCode, _primitiveAsString);
}
/// <summary>
/// Stores data on the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Set(string key, object value, DateTime expiry)
{
return Set("set", key, value, expiry, null, _primitiveAsString);
}
/// <summary>
/// Stores data on the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Set(string key, object value, DateTime expiry, int hashCode)
{
return Set("set", key, value, expiry, hashCode, _primitiveAsString);
}
/// <summary>
/// Adds data to the server; only the key and the value are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Add(string key, object value)
{
return Set("add", key, value, DateTime.MaxValue, null, _primitiveAsString);
}
/// <summary>
/// Adds data to the server; the key, value, and an optional hashcode are passed in.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Add(string key, object value, int hashCode)
{
return Set("add", key, value, DateTime.MaxValue, hashCode, _primitiveAsString);
}
/// <summary>
/// Adds data to the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Add(string key, object value, DateTime expiry)
{
return Set("add", key, value, expiry, null, _primitiveAsString);
}
/// <summary>
/// Adds data to the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Add(string key, object value, DateTime expiry, int hashCode)
{
return Set("add", key, value, expiry, hashCode, _primitiveAsString);
}
/// <summary>
/// Updates data on the server; only the key and the value are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Replace(string key, object value)
{
return Set("replace", key, value, DateTime.MaxValue, null, _primitiveAsString);
}
/// <summary>
/// Updates data on the server; only the key and the value and an optional hash are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Replace(string key, object value, int hashCode)
{
return Set("replace", key, value, DateTime.MaxValue, hashCode, _primitiveAsString);
}
/// <summary>
/// Updates data on the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Replace(string key, object value, DateTime expiry)
{
return Set("replace", key, value, expiry, null, _primitiveAsString);
}
/// <summary>
/// Updates data on the server; the key, value, and an expiration time are specified.
/// </summary>
/// <param name="key">key to store data under</param>
/// <param name="value">value to store</param>
/// <param name="expiry">when to expire the record</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true, if the data was successfully stored</returns>
public bool Replace(string key, object value, DateTime expiry, int hashCode)
{
return Set("replace", key, value, expiry, hashCode, _primitiveAsString);
}
/// <summary>
/// Stores data to cache.
///
/// If data does not already exist for this key on the server, or if the key is being
/// deleted, the specified value will not be stored.
/// The server will automatically delete the value when the expiration time has been reached.
///
/// If compression is enabled, and the data is longer than the compression threshold
/// the data will be stored in compressed form.
///
/// As of the current release, all objects stored will use .NET serialization.
/// </summary>
/// <param name="cmdname">action to take (set, add, replace)</param>
/// <param name="key">key to store cache under</param>
/// <param name="value">object to cache</param>
/// <param name="expiry">expiration</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <param name="asString">store this object as a string?</param>
/// <returns>true/false indicating success</returns>
private bool Set(string cmdname, string key, object obj, DateTime expiry, object hashCode, bool asString)
{
if(expiry < DateTime.Now)
return true;
if(cmdname == null || cmdname.Trim().Length == 0 || key == null || key.Length == 0)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set key null"));
}
return false;
}
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$","localhost"));
}
return false;
}
if (expiry == DateTime.MaxValue)
expiry = new DateTime(0);
// store flags
int flags = 0;
// byte array to hold data
byte[] val;
int length = 0;
// useful for sharing data between .NET and non-.NET
// and also for storing ints for the increment method
if(NativeHandler.IsHandled(obj))
{
if(asString)
{
if(obj != null)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set store data as string").Replace("$$Key$$", key).Replace("$$Class$$", obj.GetType().Name));
}
try
{
val = UTF8Encoding.UTF8.GetBytes(obj.ToString());
}
catch(ArgumentException ex)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set invalid encoding").Replace("$$Encoding$$", _defaultEncoding), ex);
}
return false;
}
}
else
{
val = new byte[0];
length = 0;
}
}
else
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set store with native handler"));
}
try
{
val = NativeHandler.Encode(obj);
length = val.Length;
}
catch(ArgumentException e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set failed to native handle object"), e);
}
return false;
}
}
}
else
{
if(obj != null)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set serializing".Replace("$$Key$$", key).Replace("$$Class$$", obj.GetType().Name)));
}
// always serialize for non-primitive types
try
{
MemoryStream memStream = new MemoryStream();
new BinaryFormatter().Serialize(memStream, obj);
val = memStream.GetBuffer();
length = (int) memStream.Length;
flags |= F_SERIALIZED;
}
catch(IOException e)
{
// if we fail to serialize, then
// we bail
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set failed to serialize").Replace("$$Object$$", obj.ToString()), e);
}
return false;
}
}
else
{
val = new byte[0];
length = 0;
}
}
// now try to compress if we want to
// and if the length is over the threshold
if(_compressEnable && length > _compressThreshold)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set trying to compress data"));
log.Info(GetLocalizedString("set size prior").Replace("$$Size$$", length.ToString(new NumberFormatInfo())));
}
try
{
MemoryStream memoryStream = new MemoryStream();
GZipOutputStream gos = new GZipOutputStream(memoryStream);
gos.Write(val, 0, length);
gos.Finish();
// store it and set compression flag
val = memoryStream.GetBuffer();
length = (int)memoryStream.Length;
flags |= F_COMPRESSED;
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set compression success").Replace("$$Size$$", length.ToString(new NumberFormatInfo())));
}
}
catch(IOException e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set compression failure"), e);
}
}
}
// now write the data to the cache server
try
{
OperationResult opResult = new OperationResult();
switch (cmdname)
{
case "set":
opResult = memcachedProvider.Set(key, (uint)flags, GetExpirationTime(expiry), val);
break;
case "add":
opResult = memcachedProvider.Add(key, (uint)flags, GetExpirationTime(expiry), val);
break;
case "replace":
opResult = memcachedProvider.Replace(key, (uint)flags, GetExpirationTime(expiry), val);
break;
}
string line = "";
if (cmdname.Equals("replace") && opResult.ReturnResult == Result.ITEM_NOT_FOUND)
line = "NOT_STORED";
else
switch (opResult.ReturnResult)
{
case Result.SUCCESS:
line = "STORED";
break;
case Result.ITEM_EXISTS:
line = "NOT_STORED";
break;
case Result.ITEM_NOT_FOUND:
line = "NOT_FOUND";
break;
case Result.ITEM_MODIFIED:
line = "EXISTS";
break;
}
string cmd = cmdname + " " + key + " " + flags + " "
+ GetExpirationTime(expiry) + " " + length + "\r\n";
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set memcached command result").Replace("$$Cmd$$", cmd).Replace("$$Line$$", line));
}
if(STORED == line)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set success").Replace("$$Key$$", key));
}
return true;
}
else if(NOTSTORED == line)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("set not stored").Replace("$$Key$$", key));
}
}
else
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set error").Replace("$$Key$$", key).Replace("$$Size$$", length.ToString(new NumberFormatInfo())).Replace("$$Line$$", line));
}
}
}
catch(Exception e)
{
// exception thrown
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("set IOException"), e);
}
}
return false;
}
/// <summary>
/// Store a counter to memcached given a key
/// </summary>
/// <param name="key">cache key</param>
/// <param name="counter">number to store</param>
/// <returns>true/false indicating success</returns>
public bool StoreCounter(string key, long counter)
{
return Set("set", key, counter, DateTime.MaxValue, null, true);
}
/// <summary>
/// Store a counter to memcached given a key
/// </summary>
/// <param name="key">cache key</param>
/// <param name="counter">number to store</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>true/false indicating success</returns>
public bool StoreCounter(string key, long counter, int hashCode)
{
return Set("set", key, counter, DateTime.MaxValue, hashCode, true);
}
/// <summary>
/// Returns value in counter at given key as long.
/// </summary>
/// <param name="key">cache ket</param>
/// <returns>counter value or -1 if not found</returns>
public long GetCounter(string key)
{
return GetCounter(key, null);
}
/// <summary>
/// Returns value in counter at given key as long.
/// </summary>
/// <param name="key">cache ket</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>counter value or -1 if not found</returns>
public long GetCounter(string key, object hashCode)
{
if(key == null)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("getcounter null key"));
}
return -1;
}
long counter = -1;
try
{
counter = long.Parse((string)Get(key, hashCode, true), new NumberFormatInfo());
}
catch(ArgumentException)
{
// not found or error getting out
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("getcounter counter not found").Replace("$$Key$$", key));
}
}
return counter;
}
/// <summary>
/// Increment the value at the specified key by 1, and then return it.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Increment(string key)
{
return IncrementOrDecrement("incr", key, 1, null);
}
/// <summary>
/// Increment the value at the specified key by passed in val.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <param name="inc">how much to increment by</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Increment(string key, long inc)
{
return IncrementOrDecrement("incr", key, inc, null);
}
/// <summary>
/// Increment the value at the specified key by the specified increment, and then return it.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <param name="inc">how much to increment by</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Increment(string key, long inc, int hashCode)
{
return IncrementOrDecrement("incr", key, inc, hashCode);
}
/// <summary>
/// Decrement the value at the specified key by 1, and then return it.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Decrement(string key)
{
return IncrementOrDecrement("decr", key, 1, null);
}
/// <summary>
/// Decrement the value at the specified key by passed in value, and then return it.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <param name="inc">how much to increment by</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Decrement(string key, long inc)
{
return IncrementOrDecrement("decr", key, inc, null);
}
/// <summary>
/// Decrement the value at the specified key by the specified increment, and then return it.
/// </summary>
/// <param name="key">key where the data is stored</param>
/// <param name="inc">how much to increment by</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>-1, if the key is not found, the value after incrementing otherwise</returns>
public long Decrement(string key, long inc, int hashCode)
{
return IncrementOrDecrement("decr", key, inc, hashCode);
}
/// <summary>
/// Increments/decrements the value at the specified key by inc.
///
/// Note that the server uses a 32-bit unsigned integer, and checks for
/// underflow. In the event of underflow, the result will be zero. Because
/// Java lacks unsigned types, the value is returned as a 64-bit integer.
/// The server will only decrement a value if it already exists;
/// if a value is not found, -1 will be returned.
///
/// TODO: C# has unsigned types. We can fix this.
/// </summary>
/// <param name="cmdname">increment/decrement</param>
/// <param name="key">cache key</param>
/// <param name="inc">amount to incr or decr</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>new value or -1 if not exist</returns>
private long IncrementOrDecrement(string cmdname, string key, long inc, object hashCode)
{
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return -1;
}
if (inc < 0)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("CLIENT_ERROR cannot increment or decrement non-numeric value"));
}
return -1;
}
try
{
MutateOpResult opResult = new MutateOpResult();
switch (cmdname)
{
case "incr":
opResult = memcachedProvider.Increment(key, (ulong)inc, null, 0, 0);
break;
case "decr":
opResult = memcachedProvider.Decrement(key, (ulong)inc, null, 0, 0);
break;
}
// get result back
string line = "";
if (opResult.ReturnResult == Result.SUCCESS)
line = opResult.MutateResult.ToString();
else
if (opResult.ReturnResult == Result.ITEM_NOT_FOUND)
line = "NOT_FOUND";
else
if(opResult.ReturnResult==Result.ITEM_TYPE_MISMATCHED)
line = "CLIENT_ERROR cannot increment or decrement non-numeric value";
string cmd = cmdname + " " + key + " " + inc + "\r\n";
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("incr-decr command").Replace("$$Cmd$$", cmd));
}
if(new Regex("\\d+").Match(line).Success)
{
return long.Parse(line, new NumberFormatInfo());
}
else if(NOTFOUND == line)
{
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("incr-decr key not found").Replace("$$Key$$", key));
}
}
else
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("incr-decr key error").Replace("$$Key$$", key));
}
}
}
catch(Exception e)
{
// exception thrown
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("incr-decr IOException"), e);
}
if (e is System.OverflowException)
throw e;
}
return -1;
}
/// <summary>
/// Retrieve a key from the server, using a specific hash.
///
/// If the data was compressed or serialized when compressed, it will automatically
/// be decompressed or serialized, as appropriate. (Inclusive or)
///
/// Non-serialized data will be returned as a string, so explicit conversion to
/// numeric types will be necessary, if desired
/// </summary>
/// <param name="key">key where data is stored</param>
/// <returns>the object that was previously stored, or null if it was not previously stored</returns>
public object Get(string key)
{
return Get(key, null, false);
}
/// <summary>
/// Retrieve a key from the server, using a specific hash.
///
/// If the data was compressed or serialized when compressed, it will automatically
/// be decompressed or serialized, as appropriate. (Inclusive or)
///
/// Non-serialized data will be returned as a string, so explicit conversion to
/// numeric types will be necessary, if desired
/// </summary>
/// <param name="key">key where data is stored</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <returns>the object that was previously stored, or null if it was not previously stored</returns>
public object Get(string key, int hashCode)
{
return Get(key, hashCode, false);
}
/// <summary>
/// Retrieve a key from the server, using a specific hash.
///
/// If the data was compressed or serialized when compressed, it will automatically
/// be decompressed or serialized, as appropriate. (Inclusive or)
///
/// Non-serialized data will be returned as a string, so explicit conversion to
/// numeric types will be necessary, if desired
/// </summary>
/// <param name="key">key where data is stored</param>
/// <param name="hashCode">if not null, then the int hashcode to use</param>
/// <param name="asString">if true, then return string val</param>
/// <returns>the object that was previously stored, or null if it was not previously stored</returns>
public object Get(string key, object hashCode, bool asString)
{
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return null;
}
try
{
string cmd = "get " + key + "\r\n";
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("get memcached command").Replace("$$Cmd$$", cmd));
}
// build empty map
// and fill it from server
Hashtable hm = new Hashtable();
LoadItems(new[]{key},hm, asString);
if(log.IsDebugEnabled)
{
// debug code
log.Debug(GetLocalizedString("get memcached result").Replace("$$Results$$", hm.Count.ToString(new NumberFormatInfo())));
}
return hm[key];
}
catch(Exception e)
{
// exception thrown
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("get IOException").Replace("$$Key$$", key), e);
}
}
return null;
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <returns>object array ordered in same order as key array containing results</returns>
public object[] GetMultipleArray(string[] keys)
{
return GetMultipleArray(keys, null, false);
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <param name="hashCodes">if not null, then the int array of hashCodes</param>
/// <returns>object array ordered in same order as key array containing results</returns>
public object[] GetMultipleArray(string[] keys, int[] hashCodes)
{
return GetMultipleArray(keys, hashCodes, false);
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <param name="hashCodes">if not null, then the int array of hashCodes</param>
/// <param name="asString">asString if true, retrieve string vals</param>
/// <returns>object array ordered in same order as key array containing results</returns>
public object[] GetMultipleArray(string[] keys, int[] hashCodes, bool asString)
{
if(keys == null)
return new object[0];
Hashtable data = GetMultiple(keys, hashCodes, asString);
object[] res = new object[keys.Length];
for(int i = 0; i < keys.Length; i++)
{
res[i] = data[ keys[i] ];
}
return res;
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <returns>
/// a hashmap with entries for each key is found by the server,
/// keys that are not found are not entered into the hashmap, but attempting to
/// retrieve them from the hashmap gives you null.
/// </returns>
public Hashtable GetMultiple(string[] keys)
{
return GetMultiple(keys, null, false);
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <param name="hashCodes">hashCodes if not null, then the int array of hashCodes</param>
/// <returns>
/// a hashmap with entries for each key is found by the server,
/// keys that are not found are not entered into the hashmap, but attempting to
/// retrieve them from the hashmap gives you null.
/// </returns>
public Hashtable GetMultiple(string[] keys, int[] hashCodes)
{
return GetMultiple(keys, hashCodes, false);
}
/// <summary>
/// Retrieve multiple objects from the memcache.
///
/// This is recommended over repeated calls to <see cref="get">get(string)</see>, since it
/// is more efficient.
/// </summary>
/// <param name="keys">string array of keys to retrieve</param>
/// <param name="hashCodes">hashCodes if not null, then the int array of hashCodes</param>
/// <param name="asString">if true then retrieve using string val</param>
/// <returns>
/// a hashmap with entries for each key is found by the server,
/// keys that are not found are not entered into the hashmap, but attempting to
/// retrieve them from the hashmap gives you null.
/// </returns>
public Hashtable GetMultiple(string[] keys, int[] hashCodes, bool asString)
{
if(keys == null)
return new Hashtable();
// now query memcache
Hashtable ret = new Hashtable();
ArrayList toRemove = new ArrayList();
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return null;
}
try
{
string cmd = "get" + "\r\n";
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("getmultiple memcached command").Replace("$$Cmd$$", cmd));
}
LoadItems(keys,ret, asString);
}
catch(Exception e)
{
// exception thrown
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("getmultiple IOException"), e);
}
}
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("getmultiple results").Replace("$$Results$$", ret.Count.ToString(new NumberFormatInfo())));
}
return ret;
}
/// <summary>
/// This method loads the data from cache into a Hashtable.
///
/// Pass a SockIO object which is ready to receive data and a Hashtable
/// to store the results.
/// </summary>
/// <param name="sock">socket waiting to pass back data</param>
/// <param name="hm">hashmap to store data into</param>
/// <param name="asString">if true, and if we are using NativehHandler, return string val</param>
private void LoadItems(string[] keys,Hashtable hm, bool asString)
{
string line = "";
int length = 0;
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("loaditems line").Replace("$$Line$$", line));
}
List<GetOpResult> opResult = memcachedProvider.Get(keys);
foreach(GetOpResult resultEntry in opResult)
{
string key = resultEntry.Key;
int flag = (int)resultEntry.Flag;
if(log.IsDebugEnabled)
{
log.Debug(GetLocalizedString("loaditems header").Replace("$$Key$$", key).Replace("$$Flags$$", flag.ToString(new NumberFormatInfo())).Replace("$$Length$$", length.ToString(new NumberFormatInfo())));
}
// read obj into buffer
byte[] buf =(byte[])resultEntry.Value;
// ready object
object o;
// check for compression
if((flag & F_COMPRESSED) != 0)
{
try
{
// read the input stream, and write to a byte array output stream since
// we have to read into a byte array, but we don't know how large it
// will need to be, and we don't want to resize it a bunch
GZipInputStream gzi = new GZipInputStream(new MemoryStream(buf));
MemoryStream bos = new MemoryStream(buf.Length);
int count;
byte[] tmp = new byte[2048];
while((count = gzi.Read(tmp, 0, tmp.Length)) > 0)
{
bos.Write(tmp, 0, count);
}
// store uncompressed back to buffer
buf = bos.ToArray();
gzi.Close();
}
catch(IOException e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("loaditems uncompression IOException").Replace("$$Key$$", key), e);
}
throw new IOException(GetLocalizedString("loaditems uncompression IOException").Replace("$$Key$$", key), e);
}
}
// we can only take out serialized objects
if((flag & F_SERIALIZED) == 0)
{
if(_primitiveAsString || asString)
{
// pulling out string value
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("loaditems retrieve as string"));
}
o = Encoding.GetEncoding(_defaultEncoding).GetString(buf);
}
else
{
// decoding object
try
{
o = NativeHandler.Decode(buf);
}
catch(Exception e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("loaditems deserialize error").Replace("$$Key$$", key), e);
}
throw new IOException(GetLocalizedString("loaditems deserialize error").Replace("$$Key$$", key), e);
}
}
}
else
{
// deserialize if the data is serialized
try
{
MemoryStream memStream = new MemoryStream(buf);
o = new BinaryFormatter().Deserialize(memStream);
if(log.IsInfoEnabled)
{
log.Info(GetLocalizedString("loaditems deserializing").Replace("$$Class$$", o.GetType().Name));
}
}
catch(SerializationException e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("loaditems SerializationException").Replace("$$Key$$", key), e);
}
throw new IOException(GetLocalizedString("loaditems SerializationException").Replace("$$Key$$", key), e);
}
}
// store the object into the cache
hm[ key ] = o ;
}
}
/// <summary>
/// Invalidates the entire cache.
///
/// Will return true only if succeeds in clearing all servers.
/// </summary>
/// <returns>success true/false</returns>
public bool FlushAll()
{
return FlushAll(null);
}
/// <summary>
/// Invalidates the entire cache.
///
/// Will return true only if succeeds in clearing all servers.
/// If pass in null, then will try to flush all servers.
/// </summary>
/// <param name="servers">optional array of host(s) to flush (host:port)</param>
/// <returns>success true/false</returns>
public bool FlushAll(ArrayList servers)
{
bool success = true;
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return false;
}
try
{
OperationResult opResult = memcachedProvider.Flush_All(0);
// if we get appropriate response back, then we return true
string line = "";
if (opResult.ReturnResult == Result.SUCCESS)
line = "OK";
success = (OK == line)
? success && true
: false;
}
catch(Exception e)
{
if(log.IsErrorEnabled)
{
log.Error(GetLocalizedString("flushall IOException"), e);
}
success=false;
}
return success;
}
/// <summary>
/// Retrieves stats for all servers.
///
/// Returns a map keyed on the servername.
/// The value is another map which contains stats
/// with stat name as key and value as value.
/// </summary>
/// <returns></returns>
public Hashtable Stats()
{
return Stats(null);
}
/// <summary>
/// Retrieves stats for passed in servers (or all servers).
///
/// Returns a map keyed on the servername.
/// The value is another map which contains stats
/// with stat name as key and value as value.
/// </summary>
/// <param name="servers">string array of servers to retrieve stats from, or all if this is null</param>
/// <returns>Stats map</returns>
public Hashtable Stats(ArrayList servers)
{
// array of stats Hashtables
Hashtable statsMaps = new Hashtable();
if (memcachedProvider == null)
{
if (log.IsErrorEnabled)
{
log.Error(GetLocalizedString("failed to get socket").Replace("$$Host$$", "localhost"));
}
return statsMaps;
}
try
{
OperationResult opResult = memcachedProvider.GetStatistics("");
statsMaps = (Hashtable)opResult.Value;
}
catch (Exception e)
{ }
return statsMaps;
}
private static ResourceManager _resourceManager = new ResourceManager("Memcached.ClientLibrary.StringMessages", typeof(MemcachedClient).Assembly);
private static string GetLocalizedString(string key)
{
return _resourceManager.GetString(key);
}
~MemcachedClient()
{
try { ((IDisposable)this).Dispose(); }
catch { }
}
void IDisposable.Dispose()
{
CacheFactory.DisposeCacheProvider();
}
}
}
| Teino1978-Corp/NCache | Integration/MemCached/Clients/.NET memcached Client Library/Src/MemCachedClient.cs | C# | apache-2.0 | 53,178 |
/*
* Copyright (C) 2010 The Android Open Source Project
*
* 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.
*/
package android.animation;
import android.app.ActivityThread;
import android.app.Application;
import android.os.Build;
import android.util.ArrayMap;
import android.util.Log;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* This class plays a set of {@link Animator} objects in the specified order. Animations
* can be set up to play together, in sequence, or after a specified delay.
*
* <p>There are two different approaches to adding animations to a <code>AnimatorSet</code>:
* either the {@link AnimatorSet#playTogether(Animator[]) playTogether()} or
* {@link AnimatorSet#playSequentially(Animator[]) playSequentially()} methods can be called to add
* a set of animations all at once, or the {@link AnimatorSet#play(Animator)} can be
* used in conjunction with methods in the {@link AnimatorSet.Builder Builder}
* class to add animations
* one by one.</p>
*
* <p>It is possible to set up a <code>AnimatorSet</code> with circular dependencies between
* its animations. For example, an animation a1 could be set up to start before animation a2, a2
* before a3, and a3 before a1. The results of this configuration are undefined, but will typically
* result in none of the affected animations being played. Because of this (and because
* circular dependencies do not make logical sense anyway), circular dependencies
* should be avoided, and the dependency flow of animations should only be in one direction.
*
* <div class="special reference">
* <h3>Developer Guides</h3>
* <p>For more information about animating with {@code AnimatorSet}, read the
* <a href="{@docRoot}guide/topics/graphics/prop-animation.html#choreography">Property
* Animation</a> developer guide.</p>
* </div>
*/
public final class AnimatorSet extends Animator {
private static final String TAG = "AnimatorSet";
/**
* Internal variables
* NOTE: This object implements the clone() method, making a deep copy of any referenced
* objects. As other non-trivial fields are added to this class, make sure to add logic
* to clone() to make deep copies of them.
*/
/**
* Tracks animations currently being played, so that we know what to
* cancel or end when cancel() or end() is called on this AnimatorSet
*/
private ArrayList<Animator> mPlayingSet = new ArrayList<Animator>();
/**
* Contains all nodes, mapped to their respective Animators. When new
* dependency information is added for an Animator, we want to add it
* to a single node representing that Animator, not create a new Node
* if one already exists.
*/
private ArrayMap<Animator, Node> mNodeMap = new ArrayMap<Animator, Node>();
/**
* Set of all nodes created for this AnimatorSet. This list is used upon
* starting the set, and the nodes are placed in sorted order into the
* sortedNodes collection.
*/
private ArrayList<Node> mNodes = new ArrayList<Node>();
/**
* Animator Listener that tracks the lifecycle of each Animator in the set. It will be added
* to each Animator before they start and removed after they end.
*/
private AnimatorSetListener mSetListener = new AnimatorSetListener(this);
/**
* Flag indicating that the AnimatorSet has been manually
* terminated (by calling cancel() or end()).
* This flag is used to avoid starting other animations when currently-playing
* child animations of this AnimatorSet end. It also determines whether cancel/end
* notifications are sent out via the normal AnimatorSetListener mechanism.
*/
private boolean mTerminated = false;
/**
* Tracks whether any change has been made to the AnimatorSet, which is then used to
* determine whether the dependency graph should be re-constructed.
*/
private boolean mDependencyDirty = false;
/**
* Indicates whether an AnimatorSet has been start()'d, whether or
* not there is a nonzero startDelay.
*/
private boolean mStarted = false;
// The amount of time in ms to delay starting the animation after start() is called
private long mStartDelay = 0;
// Animator used for a nonzero startDelay
private ValueAnimator mDelayAnim = ValueAnimator.ofFloat(0f, 1f).setDuration(0);
// Root of the dependency tree of all the animators in the set. In this tree, parent-child
// relationship captures the order of animation (i.e. parent and child will play sequentially),
// and sibling relationship indicates "with" relationship, as sibling animators start at the
// same time.
private Node mRootNode = new Node(mDelayAnim);
// How long the child animations should last in ms. The default value is negative, which
// simply means that there is no duration set on the AnimatorSet. When a real duration is
// set, it is passed along to the child animations.
private long mDuration = -1;
// Records the interpolator for the set. Null value indicates that no interpolator
// was set on this AnimatorSet, so it should not be passed down to the children.
private TimeInterpolator mInterpolator = null;
// Whether the AnimatorSet can be reversed.
private boolean mReversible = true;
// The total duration of finishing all the Animators in the set.
private long mTotalDuration = 0;
// In pre-N releases, calling end() before start() on an animator set is no-op. But that is not
// consistent with the behavior for other animator types. In order to keep the behavior
// consistent within Animation framework, when end() is called without start(), we will start
// the animator set and immediately end it for N and forward.
private final boolean mShouldIgnoreEndWithoutStart;
public AnimatorSet() {
super();
mNodeMap.put(mDelayAnim, mRootNode);
mNodes.add(mRootNode);
// Set the flag to ignore calling end() without start() for pre-N releases
Application app = ActivityThread.currentApplication();
if (app == null || app.getApplicationInfo() == null) {
mShouldIgnoreEndWithoutStart = true;
} else if (app.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) {
mShouldIgnoreEndWithoutStart = true;
} else {
mShouldIgnoreEndWithoutStart = false;
}
}
/**
* Sets up this AnimatorSet to play all of the supplied animations at the same time.
* This is equivalent to calling {@link #play(Animator)} with the first animator in the
* set and then {@link Builder#with(Animator)} with each of the other animators. Note that
* an Animator with a {@link Animator#setStartDelay(long) startDelay} will not actually
* start until that delay elapses, which means that if the first animator in the list
* supplied to this constructor has a startDelay, none of the other animators will start
* until that first animator's startDelay has elapsed.
*
* @param items The animations that will be started simultaneously.
*/
public void playTogether(Animator... items) {
if (items != null) {
Builder builder = play(items[0]);
for (int i = 1; i < items.length; ++i) {
builder.with(items[i]);
}
}
}
/**
* Sets up this AnimatorSet to play all of the supplied animations at the same time.
*
* @param items The animations that will be started simultaneously.
*/
public void playTogether(Collection<Animator> items) {
if (items != null && items.size() > 0) {
Builder builder = null;
for (Animator anim : items) {
if (builder == null) {
builder = play(anim);
} else {
builder.with(anim);
}
}
}
}
/**
* Sets up this AnimatorSet to play each of the supplied animations when the
* previous animation ends.
*
* @param items The animations that will be started one after another.
*/
public void playSequentially(Animator... items) {
if (items != null) {
if (items.length == 1) {
play(items[0]);
} else {
mReversible = false;
for (int i = 0; i < items.length - 1; ++i) {
play(items[i]).before(items[i + 1]);
}
}
}
}
/**
* Sets up this AnimatorSet to play each of the supplied animations when the
* previous animation ends.
*
* @param items The animations that will be started one after another.
*/
public void playSequentially(List<Animator> items) {
if (items != null && items.size() > 0) {
if (items.size() == 1) {
play(items.get(0));
} else {
mReversible = false;
for (int i = 0; i < items.size() - 1; ++i) {
play(items.get(i)).before(items.get(i + 1));
}
}
}
}
/**
* Returns the current list of child Animator objects controlled by this
* AnimatorSet. This is a copy of the internal list; modifications to the returned list
* will not affect the AnimatorSet, although changes to the underlying Animator objects
* will affect those objects being managed by the AnimatorSet.
*
* @return ArrayList<Animator> The list of child animations of this AnimatorSet.
*/
public ArrayList<Animator> getChildAnimations() {
ArrayList<Animator> childList = new ArrayList<Animator>();
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
childList.add(node.mAnimation);
}
}
return childList;
}
/**
* Sets the target object for all current {@link #getChildAnimations() child animations}
* of this AnimatorSet that take targets ({@link ObjectAnimator} and
* AnimatorSet).
*
* @param target The object being animated
*/
@Override
public void setTarget(Object target) {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
Animator animation = node.mAnimation;
if (animation instanceof AnimatorSet) {
((AnimatorSet)animation).setTarget(target);
} else if (animation instanceof ObjectAnimator) {
((ObjectAnimator)animation).setTarget(target);
}
}
}
/**
* @hide
*/
@Override
public int getChangingConfigurations() {
int conf = super.getChangingConfigurations();
final int nodeCount = mNodes.size();
for (int i = 0; i < nodeCount; i ++) {
conf |= mNodes.get(i).mAnimation.getChangingConfigurations();
}
return conf;
}
/**
* Sets the TimeInterpolator for all current {@link #getChildAnimations() child animations}
* of this AnimatorSet. The default value is null, which means that no interpolator
* is set on this AnimatorSet. Setting the interpolator to any non-null value
* will cause that interpolator to be set on the child animations
* when the set is started.
*
* @param interpolator the interpolator to be used by each child animation of this AnimatorSet
*/
@Override
public void setInterpolator(TimeInterpolator interpolator) {
mInterpolator = interpolator;
}
@Override
public TimeInterpolator getInterpolator() {
return mInterpolator;
}
/**
* This method creates a <code>Builder</code> object, which is used to
* set up playing constraints. This initial <code>play()</code> method
* tells the <code>Builder</code> the animation that is the dependency for
* the succeeding commands to the <code>Builder</code>. For example,
* calling <code>play(a1).with(a2)</code> sets up the AnimatorSet to play
* <code>a1</code> and <code>a2</code> at the same time,
* <code>play(a1).before(a2)</code> sets up the AnimatorSet to play
* <code>a1</code> first, followed by <code>a2</code>, and
* <code>play(a1).after(a2)</code> sets up the AnimatorSet to play
* <code>a2</code> first, followed by <code>a1</code>.
*
* <p>Note that <code>play()</code> is the only way to tell the
* <code>Builder</code> the animation upon which the dependency is created,
* so successive calls to the various functions in <code>Builder</code>
* will all refer to the initial parameter supplied in <code>play()</code>
* as the dependency of the other animations. For example, calling
* <code>play(a1).before(a2).before(a3)</code> will play both <code>a2</code>
* and <code>a3</code> when a1 ends; it does not set up a dependency between
* <code>a2</code> and <code>a3</code>.</p>
*
* @param anim The animation that is the dependency used in later calls to the
* methods in the returned <code>Builder</code> object. A null parameter will result
* in a null <code>Builder</code> return value.
* @return Builder The object that constructs the AnimatorSet based on the dependencies
* outlined in the calls to <code>play</code> and the other methods in the
* <code>Builder</code object.
*/
public Builder play(Animator anim) {
if (anim != null) {
return new Builder(anim);
}
return null;
}
/**
* {@inheritDoc}
*
* <p>Note that canceling a <code>AnimatorSet</code> also cancels all of the animations that it
* is responsible for.</p>
*/
@SuppressWarnings("unchecked")
@Override
public void cancel() {
mTerminated = true;
if (isStarted()) {
ArrayList<AnimatorListener> tmpListeners = null;
if (mListeners != null) {
tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone();
int size = tmpListeners.size();
for (int i = 0; i < size; i++) {
tmpListeners.get(i).onAnimationCancel(this);
}
}
ArrayList<Animator> playingSet = new ArrayList<>(mPlayingSet);
int setSize = playingSet.size();
for (int i = 0; i < setSize; i++) {
playingSet.get(i).cancel();
}
if (tmpListeners != null) {
int size = tmpListeners.size();
for (int i = 0; i < size; i++) {
tmpListeners.get(i).onAnimationEnd(this);
}
}
mStarted = false;
}
}
/**
* {@inheritDoc}
*
* <p>Note that ending a <code>AnimatorSet</code> also ends all of the animations that it is
* responsible for.</p>
*/
@Override
public void end() {
if (mShouldIgnoreEndWithoutStart && !isStarted()) {
return;
}
mTerminated = true;
if (isStarted()) {
endRemainingAnimations();
}
if (mListeners != null) {
ArrayList<AnimatorListener> tmpListeners =
(ArrayList<AnimatorListener>) mListeners.clone();
for (int i = 0; i < tmpListeners.size(); i++) {
tmpListeners.get(i).onAnimationEnd(this);
}
}
mStarted = false;
}
/**
* Iterate the animations that haven't finished or haven't started, and end them.
*/
private void endRemainingAnimations() {
ArrayList<Animator> remainingList = new ArrayList<Animator>(mNodes.size());
remainingList.addAll(mPlayingSet);
int index = 0;
while (index < remainingList.size()) {
Animator anim = remainingList.get(index);
anim.end();
index++;
Node node = mNodeMap.get(anim);
if (node.mChildNodes != null) {
int childSize = node.mChildNodes.size();
for (int i = 0; i < childSize; i++) {
Node child = node.mChildNodes.get(i);
if (child.mLatestParent != node) {
continue;
}
remainingList.add(child.mAnimation);
}
}
}
}
/**
* Returns true if any of the child animations of this AnimatorSet have been started and have
* not yet ended. Child animations will not be started until the AnimatorSet has gone past
* its initial delay set through {@link #setStartDelay(long)}.
*
* @return Whether this AnimatorSet has gone past the initial delay, and at least one child
* animation has been started and not yet ended.
*/
@Override
public boolean isRunning() {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode && node.mAnimation.isStarted()) {
return true;
}
}
return false;
}
@Override
public boolean isStarted() {
return mStarted;
}
/**
* The amount of time, in milliseconds, to delay starting the animation after
* {@link #start()} is called.
*
* @return the number of milliseconds to delay running the animation
*/
@Override
public long getStartDelay() {
return mStartDelay;
}
/**
* The amount of time, in milliseconds, to delay starting the animation after
* {@link #start()} is called. Note that the start delay should always be non-negative. Any
* negative start delay will be clamped to 0 on N and above.
*
* @param startDelay The amount of the delay, in milliseconds
*/
@Override
public void setStartDelay(long startDelay) {
// Clamp start delay to non-negative range.
if (startDelay < 0) {
Log.w(TAG, "Start delay should always be non-negative");
startDelay = 0;
}
long delta = startDelay - mStartDelay;
if (delta == 0) {
return;
}
mStartDelay = startDelay;
if (mStartDelay > 0) {
mReversible = false;
}
if (!mDependencyDirty) {
// Dependency graph already constructed, update all the nodes' start/end time
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node == mRootNode) {
node.mEndTime = mStartDelay;
} else {
node.mStartTime = node.mStartTime == DURATION_INFINITE ?
DURATION_INFINITE : node.mStartTime + delta;
node.mEndTime = node.mEndTime == DURATION_INFINITE ?
DURATION_INFINITE : node.mEndTime + delta;
}
}
// Update total duration, if necessary.
if (mTotalDuration != DURATION_INFINITE) {
mTotalDuration += delta;
}
}
}
/**
* Gets the length of each of the child animations of this AnimatorSet. This value may
* be less than 0, which indicates that no duration has been set on this AnimatorSet
* and each of the child animations will use their own duration.
*
* @return The length of the animation, in milliseconds, of each of the child
* animations of this AnimatorSet.
*/
@Override
public long getDuration() {
return mDuration;
}
/**
* Sets the length of each of the current child animations of this AnimatorSet. By default,
* each child animation will use its own duration. If the duration is set on the AnimatorSet,
* then each child animation inherits this duration.
*
* @param duration The length of the animation, in milliseconds, of each of the child
* animations of this AnimatorSet.
*/
@Override
public AnimatorSet setDuration(long duration) {
if (duration < 0) {
throw new IllegalArgumentException("duration must be a value of zero or greater");
}
mDependencyDirty = true;
// Just record the value for now - it will be used later when the AnimatorSet starts
mDuration = duration;
return this;
}
@Override
public void setupStartValues() {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
node.mAnimation.setupStartValues();
}
}
}
@Override
public void setupEndValues() {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
node.mAnimation.setupEndValues();
}
}
}
@Override
public void pause() {
boolean previouslyPaused = mPaused;
super.pause();
if (!previouslyPaused && mPaused) {
if (mDelayAnim.isStarted()) {
// If delay hasn't passed, pause the start delay animator.
mDelayAnim.pause();
} else {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
node.mAnimation.pause();
}
}
}
}
}
@Override
public void resume() {
boolean previouslyPaused = mPaused;
super.resume();
if (previouslyPaused && !mPaused) {
if (mDelayAnim.isStarted()) {
// If start delay hasn't passed, resume the previously paused start delay animator
mDelayAnim.resume();
} else {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
node.mAnimation.resume();
}
}
}
}
}
/**
* {@inheritDoc}
*
* <p>Starting this <code>AnimatorSet</code> will, in turn, start the animations for which
* it is responsible. The details of when exactly those animations are started depends on
* the dependency relationships that have been set up between the animations.
*/
@SuppressWarnings("unchecked")
@Override
public void start() {
mTerminated = false;
mStarted = true;
mPaused = false;
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
node.mEnded = false;
node.mAnimation.setAllowRunningAsynchronously(false);
}
if (mInterpolator != null) {
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
node.mAnimation.setInterpolator(mInterpolator);
}
}
updateAnimatorsDuration();
createDependencyGraph();
// Now that all dependencies are set up, start the animations that should be started.
boolean setIsEmpty = false;
if (mStartDelay > 0) {
start(mRootNode);
} else if (mNodes.size() > 1) {
// No delay, but there are other animators in the set
onChildAnimatorEnded(mDelayAnim);
} else {
// Set is empty, no delay, no other animation. Skip to end in this case
setIsEmpty = true;
}
if (mListeners != null) {
ArrayList<AnimatorListener> tmpListeners =
(ArrayList<AnimatorListener>) mListeners.clone();
int numListeners = tmpListeners.size();
for (int i = 0; i < numListeners; ++i) {
tmpListeners.get(i).onAnimationStart(this);
}
}
if (setIsEmpty) {
// In the case of empty AnimatorSet, we will trigger the onAnimationEnd() right away.
onChildAnimatorEnded(mDelayAnim);
}
}
private void updateAnimatorsDuration() {
if (mDuration >= 0) {
// If the duration was set on this AnimatorSet, pass it along to all child animations
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
// TODO: don't set the duration of the timing-only nodes created by AnimatorSet to
// insert "play-after" delays
node.mAnimation.setDuration(mDuration);
}
}
mDelayAnim.setDuration(mStartDelay);
}
void start(final Node node) {
final Animator anim = node.mAnimation;
mPlayingSet.add(anim);
anim.addListener(mSetListener);
anim.start();
}
@Override
public AnimatorSet clone() {
final AnimatorSet anim = (AnimatorSet) super.clone();
/*
* The basic clone() operation copies all items. This doesn't work very well for
* AnimatorSet, because it will copy references that need to be recreated and state
* that may not apply. What we need to do now is put the clone in an uninitialized
* state, with fresh, empty data structures. Then we will build up the nodes list
* manually, as we clone each Node (and its animation). The clone will then be sorted,
* and will populate any appropriate lists, when it is started.
*/
final int nodeCount = mNodes.size();
anim.mTerminated = false;
anim.mStarted = false;
anim.mPlayingSet = new ArrayList<Animator>();
anim.mNodeMap = new ArrayMap<Animator, Node>();
anim.mNodes = new ArrayList<Node>(nodeCount);
anim.mReversible = mReversible;
anim.mSetListener = new AnimatorSetListener(anim);
// Walk through the old nodes list, cloning each node and adding it to the new nodemap.
// One problem is that the old node dependencies point to nodes in the old AnimatorSet.
// We need to track the old/new nodes in order to reconstruct the dependencies in the clone.
for (int n = 0; n < nodeCount; n++) {
final Node node = mNodes.get(n);
Node nodeClone = node.clone();
node.mTmpClone = nodeClone;
anim.mNodes.add(nodeClone);
anim.mNodeMap.put(nodeClone.mAnimation, nodeClone);
// clear out any listeners that were set up by the AnimatorSet
final ArrayList<AnimatorListener> cloneListeners = nodeClone.mAnimation.getListeners();
if (cloneListeners != null) {
for (int i = cloneListeners.size() - 1; i >= 0; i--) {
final AnimatorListener listener = cloneListeners.get(i);
if (listener instanceof AnimatorSetListener) {
cloneListeners.remove(i);
}
}
}
}
anim.mRootNode = mRootNode.mTmpClone;
anim.mDelayAnim = (ValueAnimator) anim.mRootNode.mAnimation;
// Now that we've cloned all of the nodes, we're ready to walk through their
// dependencies, mapping the old dependencies to the new nodes
for (int i = 0; i < nodeCount; i++) {
Node node = mNodes.get(i);
// Update dependencies for node's clone
node.mTmpClone.mLatestParent = node.mLatestParent == null ?
null : node.mLatestParent.mTmpClone;
int size = node.mChildNodes == null ? 0 : node.mChildNodes.size();
for (int j = 0; j < size; j++) {
node.mTmpClone.mChildNodes.set(j, node.mChildNodes.get(j).mTmpClone);
}
size = node.mSiblings == null ? 0 : node.mSiblings.size();
for (int j = 0; j < size; j++) {
node.mTmpClone.mSiblings.set(j, node.mSiblings.get(j).mTmpClone);
}
size = node.mParents == null ? 0 : node.mParents.size();
for (int j = 0; j < size; j++) {
node.mTmpClone.mParents.set(j, node.mParents.get(j).mTmpClone);
}
}
for (int n = 0; n < nodeCount; n++) {
mNodes.get(n).mTmpClone = null;
}
return anim;
}
private static class AnimatorSetListener implements AnimatorListener {
private AnimatorSet mAnimatorSet;
AnimatorSetListener(AnimatorSet animatorSet) {
mAnimatorSet = animatorSet;
}
public void onAnimationCancel(Animator animation) {
if (!mAnimatorSet.mTerminated) {
// Listeners are already notified of the AnimatorSet canceling in cancel().
// The logic below only kicks in when animations end normally
if (mAnimatorSet.mPlayingSet.size() == 0) {
ArrayList<AnimatorListener> listeners = mAnimatorSet.mListeners;
if (listeners != null) {
int numListeners = listeners.size();
for (int i = 0; i < numListeners; ++i) {
listeners.get(i).onAnimationCancel(mAnimatorSet);
}
}
}
}
}
@SuppressWarnings("unchecked")
public void onAnimationEnd(Animator animation) {
animation.removeListener(this);
mAnimatorSet.mPlayingSet.remove(animation);
mAnimatorSet.onChildAnimatorEnded(animation);
}
// Nothing to do
public void onAnimationRepeat(Animator animation) {
}
// Nothing to do
public void onAnimationStart(Animator animation) {
}
}
private void onChildAnimatorEnded(Animator animation) {
Node animNode = mNodeMap.get(animation);
animNode.mEnded = true;
if (!mTerminated) {
List<Node> children = animNode.mChildNodes;
// Start children animations, if any.
int childrenSize = children == null ? 0 : children.size();
for (int i = 0; i < childrenSize; i++) {
if (children.get(i).mLatestParent == animNode) {
start(children.get(i));
}
}
// Listeners are already notified of the AnimatorSet ending in cancel() or
// end(); the logic below only kicks in when animations end normally
boolean allDone = true;
// Traverse the tree and find if there's any unfinished node
int size = mNodes.size();
for (int i = 0; i < size; i++) {
if (!mNodes.get(i).mEnded) {
allDone = false;
break;
}
}
if (allDone) {
// If this was the last child animation to end, then notify listeners that this
// AnimatorSet has ended
if (mListeners != null) {
ArrayList<AnimatorListener> tmpListeners =
(ArrayList<AnimatorListener>) mListeners.clone();
int numListeners = tmpListeners.size();
for (int i = 0; i < numListeners; ++i) {
tmpListeners.get(i).onAnimationEnd(this);
}
}
mStarted = false;
mPaused = false;
}
}
}
/**
* AnimatorSet is only reversible when the set contains no sequential animation, and no child
* animators have a start delay.
* @hide
*/
@Override
public boolean canReverse() {
if (!mReversible) {
return false;
}
// Loop to make sure all the Nodes can reverse.
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (!node.mAnimation.canReverse() || node.mAnimation.getStartDelay() > 0) {
return false;
}
}
return true;
}
/**
* @hide
*/
@Override
public void reverse() {
if (canReverse()) {
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
node.mAnimation.reverse();
}
}
}
@Override
public String toString() {
String returnVal = "AnimatorSet@" + Integer.toHexString(hashCode()) + "{";
int size = mNodes.size();
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
returnVal += "\n " + node.mAnimation.toString();
}
return returnVal + "\n}";
}
private void printChildCount() {
// Print out the child count through a level traverse.
ArrayList<Node> list = new ArrayList<>(mNodes.size());
list.add(mRootNode);
Log.d(TAG, "Current tree: ");
int index = 0;
while (index < list.size()) {
int listSize = list.size();
StringBuilder builder = new StringBuilder();
for (; index < listSize; index++) {
Node node = list.get(index);
int num = 0;
if (node.mChildNodes != null) {
for (int i = 0; i < node.mChildNodes.size(); i++) {
Node child = node.mChildNodes.get(i);
if (child.mLatestParent == node) {
num++;
list.add(child);
}
}
}
builder.append(" ");
builder.append(num);
}
Log.d(TAG, builder.toString());
}
}
private void createDependencyGraph() {
if (!mDependencyDirty) {
// Check whether any duration of the child animations has changed
boolean durationChanged = false;
for (int i = 0; i < mNodes.size(); i++) {
Animator anim = mNodes.get(i).mAnimation;
if (mNodes.get(i).mTotalDuration != anim.getTotalDuration()) {
durationChanged = true;
break;
}
}
if (!durationChanged) {
return;
}
}
mDependencyDirty = false;
// Traverse all the siblings and make sure they have all the parents
int size = mNodes.size();
for (int i = 0; i < size; i++) {
mNodes.get(i).mParentsAdded = false;
}
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node.mParentsAdded) {
continue;
}
node.mParentsAdded = true;
if (node.mSiblings == null) {
continue;
}
// Find all the siblings
findSiblings(node, node.mSiblings);
node.mSiblings.remove(node);
// Get parents from all siblings
int siblingSize = node.mSiblings.size();
for (int j = 0; j < siblingSize; j++) {
node.addParents(node.mSiblings.get(j).mParents);
}
// Now make sure all siblings share the same set of parents
for (int j = 0; j < siblingSize; j++) {
Node sibling = node.mSiblings.get(j);
sibling.addParents(node.mParents);
sibling.mParentsAdded = true;
}
}
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
if (node != mRootNode && node.mParents == null) {
node.addParent(mRootNode);
}
}
// Do a DFS on the tree
ArrayList<Node> visited = new ArrayList<Node>(mNodes.size());
// Assign start/end time
mRootNode.mStartTime = 0;
mRootNode.mEndTime = mDelayAnim.getDuration();
updatePlayTime(mRootNode, visited);
long maxEndTime = 0;
for (int i = 0; i < size; i++) {
Node node = mNodes.get(i);
node.mTotalDuration = node.mAnimation.getTotalDuration();
if (node.mEndTime == DURATION_INFINITE) {
maxEndTime = DURATION_INFINITE;
break;
} else {
maxEndTime = node.mEndTime > maxEndTime ? node.mEndTime : maxEndTime;
}
}
mTotalDuration = maxEndTime;
}
/**
* Based on parent's start/end time, calculate children's start/end time. If cycle exists in
* the graph, all the nodes on the cycle will be marked to start at {@link #DURATION_INFINITE},
* meaning they will ever play.
*/
private void updatePlayTime(Node parent, ArrayList<Node> visited) {
if (parent.mChildNodes == null) {
if (parent == mRootNode) {
// All the animators are in a cycle
for (int i = 0; i < mNodes.size(); i++) {
Node node = mNodes.get(i);
if (node != mRootNode) {
node.mStartTime = DURATION_INFINITE;
node.mEndTime = DURATION_INFINITE;
}
}
}
return;
}
visited.add(parent);
int childrenSize = parent.mChildNodes.size();
for (int i = 0; i < childrenSize; i++) {
Node child = parent.mChildNodes.get(i);
int index = visited.indexOf(child);
if (index >= 0) {
// Child has been visited, cycle found. Mark all the nodes in the cycle.
for (int j = index; j < visited.size(); j++) {
visited.get(j).mLatestParent = null;
visited.get(j).mStartTime = DURATION_INFINITE;
visited.get(j).mEndTime = DURATION_INFINITE;
}
child.mStartTime = DURATION_INFINITE;
child.mEndTime = DURATION_INFINITE;
child.mLatestParent = null;
Log.w(TAG, "Cycle found in AnimatorSet: " + this);
continue;
}
if (child.mStartTime != DURATION_INFINITE) {
if (parent.mEndTime == DURATION_INFINITE) {
child.mLatestParent = parent;
child.mStartTime = DURATION_INFINITE;
child.mEndTime = DURATION_INFINITE;
} else {
if (parent.mEndTime >= child.mStartTime) {
child.mLatestParent = parent;
child.mStartTime = parent.mEndTime;
}
long duration = child.mAnimation.getTotalDuration();
child.mEndTime = duration == DURATION_INFINITE ?
DURATION_INFINITE : child.mStartTime + duration;
}
}
updatePlayTime(child, visited);
}
visited.remove(parent);
}
// Recursively find all the siblings
private void findSiblings(Node node, ArrayList<Node> siblings) {
if (!siblings.contains(node)) {
siblings.add(node);
if (node.mSiblings == null) {
return;
}
for (int i = 0; i < node.mSiblings.size(); i++) {
findSiblings(node.mSiblings.get(i), siblings);
}
}
}
/**
* @hide
* TODO: For animatorSet defined in XML, we can use a flag to indicate what the play order
* if defined (i.e. sequential or together), then we can use the flag instead of calculate
* dynamically.
* @return whether all the animators in the set are supposed to play together
*/
public boolean shouldPlayTogether() {
updateAnimatorsDuration();
createDependencyGraph();
// All the child nodes are set out to play right after the delay animation
return mRootNode.mChildNodes.size() == mNodes.size() - 1;
}
@Override
public long getTotalDuration() {
updateAnimatorsDuration();
createDependencyGraph();
return mTotalDuration;
}
private Node getNodeForAnimation(Animator anim) {
Node node = mNodeMap.get(anim);
if (node == null) {
node = new Node(anim);
mNodeMap.put(anim, node);
mNodes.add(node);
}
return node;
}
/**
* A Node is an embodiment of both the Animator that it wraps as well as
* any dependencies that are associated with that Animation. This includes
* both dependencies upon other nodes (in the dependencies list) as
* well as dependencies of other nodes upon this (in the nodeDependents list).
*/
private static class Node implements Cloneable {
Animator mAnimation;
/**
* Child nodes are the nodes associated with animations that will be played immediately
* after current node.
*/
ArrayList<Node> mChildNodes = null;
/**
* Temporary field to hold the clone in AnimatorSet#clone. Cleaned after clone is complete
*/
private Node mTmpClone = null;
/**
* Flag indicating whether the animation in this node is finished. This flag
* is used by AnimatorSet to check, as each animation ends, whether all child animations
* are mEnded and it's time to send out an end event for the entire AnimatorSet.
*/
boolean mEnded = false;
/**
* Nodes with animations that are defined to play simultaneously with the animation
* associated with this current node.
*/
ArrayList<Node> mSiblings;
/**
* Parent nodes are the nodes with animations preceding current node's animation. Parent
* nodes here are derived from user defined animation sequence.
*/
ArrayList<Node> mParents;
/**
* Latest parent is the parent node associated with a animation that finishes after all
* the other parents' animations.
*/
Node mLatestParent = null;
boolean mParentsAdded = false;
long mStartTime = 0;
long mEndTime = 0;
long mTotalDuration = 0;
/**
* Constructs the Node with the animation that it encapsulates. A Node has no
* dependencies by default; dependencies are added via the addDependency()
* method.
*
* @param animation The animation that the Node encapsulates.
*/
public Node(Animator animation) {
this.mAnimation = animation;
}
@Override
public Node clone() {
try {
Node node = (Node) super.clone();
node.mAnimation = mAnimation.clone();
if (mChildNodes != null) {
node.mChildNodes = new ArrayList<>(mChildNodes);
}
if (mSiblings != null) {
node.mSiblings = new ArrayList<>(mSiblings);
}
if (mParents != null) {
node.mParents = new ArrayList<>(mParents);
}
node.mEnded = false;
return node;
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
}
void addChild(Node node) {
if (mChildNodes == null) {
mChildNodes = new ArrayList<>();
}
if (!mChildNodes.contains(node)) {
mChildNodes.add(node);
node.addParent(this);
}
}
public void addSibling(Node node) {
if (mSiblings == null) {
mSiblings = new ArrayList<Node>();
}
if (!mSiblings.contains(node)) {
mSiblings.add(node);
node.addSibling(this);
}
}
public void addParent(Node node) {
if (mParents == null) {
mParents = new ArrayList<Node>();
}
if (!mParents.contains(node)) {
mParents.add(node);
node.addChild(this);
}
}
public void addParents(ArrayList<Node> parents) {
if (parents == null) {
return;
}
int size = parents.size();
for (int i = 0; i < size; i++) {
addParent(parents.get(i));
}
}
}
/**
* The <code>Builder</code> object is a utility class to facilitate adding animations to a
* <code>AnimatorSet</code> along with the relationships between the various animations. The
* intention of the <code>Builder</code> methods, along with the {@link
* AnimatorSet#play(Animator) play()} method of <code>AnimatorSet</code> is to make it possible
* to express the dependency relationships of animations in a natural way. Developers can also
* use the {@link AnimatorSet#playTogether(Animator[]) playTogether()} and {@link
* AnimatorSet#playSequentially(Animator[]) playSequentially()} methods if these suit the need,
* but it might be easier in some situations to express the AnimatorSet of animations in pairs.
* <p/>
* <p>The <code>Builder</code> object cannot be constructed directly, but is rather constructed
* internally via a call to {@link AnimatorSet#play(Animator)}.</p>
* <p/>
* <p>For example, this sets up a AnimatorSet to play anim1 and anim2 at the same time, anim3 to
* play when anim2 finishes, and anim4 to play when anim3 finishes:</p>
* <pre>
* AnimatorSet s = new AnimatorSet();
* s.play(anim1).with(anim2);
* s.play(anim2).before(anim3);
* s.play(anim4).after(anim3);
* </pre>
* <p/>
* <p>Note in the example that both {@link Builder#before(Animator)} and {@link
* Builder#after(Animator)} are used. These are just different ways of expressing the same
* relationship and are provided to make it easier to say things in a way that is more natural,
* depending on the situation.</p>
* <p/>
* <p>It is possible to make several calls into the same <code>Builder</code> object to express
* multiple relationships. However, note that it is only the animation passed into the initial
* {@link AnimatorSet#play(Animator)} method that is the dependency in any of the successive
* calls to the <code>Builder</code> object. For example, the following code starts both anim2
* and anim3 when anim1 ends; there is no direct dependency relationship between anim2 and
* anim3:
* <pre>
* AnimatorSet s = new AnimatorSet();
* s.play(anim1).before(anim2).before(anim3);
* </pre>
* If the desired result is to play anim1 then anim2 then anim3, this code expresses the
* relationship correctly:</p>
* <pre>
* AnimatorSet s = new AnimatorSet();
* s.play(anim1).before(anim2);
* s.play(anim2).before(anim3);
* </pre>
* <p/>
* <p>Note that it is possible to express relationships that cannot be resolved and will not
* result in sensible results. For example, <code>play(anim1).after(anim1)</code> makes no
* sense. In general, circular dependencies like this one (or more indirect ones where a depends
* on b, which depends on c, which depends on a) should be avoided. Only create AnimatorSets
* that can boil down to a simple, one-way relationship of animations starting with, before, and
* after other, different, animations.</p>
*/
public class Builder {
/**
* This tracks the current node being processed. It is supplied to the play() method
* of AnimatorSet and passed into the constructor of Builder.
*/
private Node mCurrentNode;
/**
* package-private constructor. Builders are only constructed by AnimatorSet, when the
* play() method is called.
*
* @param anim The animation that is the dependency for the other animations passed into
* the other methods of this Builder object.
*/
Builder(Animator anim) {
mDependencyDirty = true;
mCurrentNode = getNodeForAnimation(anim);
}
/**
* Sets up the given animation to play at the same time as the animation supplied in the
* {@link AnimatorSet#play(Animator)} call that created this <code>Builder</code> object.
*
* @param anim The animation that will play when the animation supplied to the
* {@link AnimatorSet#play(Animator)} method starts.
*/
public Builder with(Animator anim) {
Node node = getNodeForAnimation(anim);
mCurrentNode.addSibling(node);
return this;
}
/**
* Sets up the given animation to play when the animation supplied in the
* {@link AnimatorSet#play(Animator)} call that created this <code>Builder</code> object
* ends.
*
* @param anim The animation that will play when the animation supplied to the
* {@link AnimatorSet#play(Animator)} method ends.
*/
public Builder before(Animator anim) {
mReversible = false;
Node node = getNodeForAnimation(anim);
mCurrentNode.addChild(node);
return this;
}
/**
* Sets up the given animation to play when the animation supplied in the
* {@link AnimatorSet#play(Animator)} call that created this <code>Builder</code> object
* to start when the animation supplied in this method call ends.
*
* @param anim The animation whose end will cause the animation supplied to the
* {@link AnimatorSet#play(Animator)} method to play.
*/
public Builder after(Animator anim) {
mReversible = false;
Node node = getNodeForAnimation(anim);
mCurrentNode.addParent(node);
return this;
}
/**
* Sets up the animation supplied in the
* {@link AnimatorSet#play(Animator)} call that created this <code>Builder</code> object
* to play when the given amount of time elapses.
*
* @param delay The number of milliseconds that should elapse before the
* animation starts.
*/
public Builder after(long delay) {
// setup dummy ValueAnimator just to run the clock
ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
anim.setDuration(delay);
after(anim);
return this;
}
}
}
| xorware/android_frameworks_base | core/java/android/animation/AnimatorSet.java | Java | apache-2.0 | 51,729 |
/*
* Copyright 2009 The Closure Compiler Authors.
*
* 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.
*/
package com.google.javascript.jscomp;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.javascript.jscomp.AccessorSummary.PropertyAccessKind;
import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;
import com.google.javascript.jscomp.testing.JSCompCorrespondences;
import com.google.javascript.rhino.Node;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Tests for {@link PureFunctionIdentifier} */
@RunWith(JUnit4.class)
public final class PureFunctionIdentifierTest extends CompilerTestCase {
List<Node> noSideEffectCalls;
boolean regExpHaveSideEffects = true;
private static final String TEST_EXTERNS =
CompilerTypeTestCase.DEFAULT_EXTERNS
+ lines(
"var window; window.setTimeout;",
"/**@nosideeffects*/ function externSENone(){}",
"/**@modifies{this}*/ function externSEThis(){}",
"/**@constructor",
" * @modifies{this}*/",
"function externObjSEThis(){}",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @modifies{this}",
" */",
"externObjSEThis.prototype.externObjSEThisMethod = function(s) {};",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @modifies{arguments}",
" */",
"externObjSEThis.prototype.externObjSEThisMethod2 = function(s) {};",
"/**@nosideeffects*/function Error(){}",
"function externSef1(){}",
"/**@nosideeffects*/function externNsef1(){}",
"var externSef2 = function(){};",
"/**@nosideeffects*/var externNsef2 = function(){};",
"var externNsef3 = /**@nosideeffects*/function(){};",
"var externObj;",
"externObj.sef1 = function(){};",
"/**@nosideeffects*/externObj.nsef1 = function(){};",
"externObj.nsef2 = /**@nosideeffects*/function(){};",
"externObj.partialFn;",
"externObj.partialSharedFn;",
"var externObj2;",
"externObj2.partialSharedFn = /**@nosideeffects*/function(){};",
"/**@constructor*/function externSefConstructor(){}",
"externSefConstructor.prototype.sefFnOfSefObj = function(){};",
"externSefConstructor.prototype.nsefFnOfSefObj = ",
" /**@nosideeffects*/function(){};",
"externSefConstructor.prototype.externShared = function(){};",
"/**@constructor@nosideeffects*/function externNsefConstructor(){}",
"externNsefConstructor.prototype.sefFnOfNsefObj = function(){};",
"externNsefConstructor.prototype.nsefFnOfNsefObj = ",
" /**@nosideeffects*/function(){};",
"externNsefConstructor.prototype.externShared = ",
" /**@nosideeffects*/function(){};",
"/**@constructor @nosideeffects*/function externNsefConstructor2(){}",
"externNsefConstructor2.prototype.externShared = ",
" /**@nosideeffects*/function(){};",
"externNsefConstructor.prototype.sharedPartialSef;",
"/**@nosideeffects*/externNsefConstructor.prototype.sharedPartialNsef;",
// An externs definition with a stub before.
"/**@constructor*/function externObj3(){}",
"externObj3.prototype.propWithStubBefore;",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj3.prototype.propWithStubBefore = function(s) {};",
// useless JsDoc
"/**",
" * @see {foo}",
" */",
"externObj3.prototype.propWithStubBeforeWithJSDoc;",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj3.prototype.propWithStubBeforeWithJSDoc = function(s) {};",
// An externs definition with a stub after.
"/**@constructor*/function externObj4(){}",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj4.prototype.propWithStubAfter = function(s) {};",
"externObj4.prototype.propWithStubAfter;",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj4.prototype.propWithStubAfterWithJSDoc = function(s) {};",
// useless JsDoc
"/**",
" * @see {foo}",
" */",
"externObj4.prototype.propWithStubAfterWithJSDoc;",
"goog.reflect = {};",
"goog.reflect.cache = function(a, b, c, opt_d) {};",
"/** @nosideeffects */",
"externObj.prototype.duplicateExternFunc = function() {};",
"externObj2.prototype.duplicateExternFunc = function() {};",
"externObj.prototype['weirdDefinition'] = function() {};");
public PureFunctionIdentifierTest() {
super(TEST_EXTERNS);
}
@Override
protected int getNumRepetitions() {
// run pass once.
return 1;
}
@Override
@Before
public void setUp() throws Exception {
super.setUp();
// Allow testing of features that are not yet fully supported.
enableNormalize();
disableCompareJsDoc();
enableGatherExternProperties();
enableTypeCheck();
}
@Override
@After
public void tearDown() throws Exception {
super.tearDown();
regExpHaveSideEffects = true;
}
/**
* Run PureFunctionIdentifier, then gather a list of calls that are marked as having no side
* effects.
*/
private class NoSideEffectCallEnumerator extends AbstractPostOrderCallback
implements CompilerPass {
private final Compiler compiler;
NoSideEffectCallEnumerator(Compiler compiler) {
this.compiler = compiler;
}
@Override
public void process(Node externs, Node root) {
noSideEffectCalls = new ArrayList<>();
// TODO(nickreid): Move these into 'getOptions' and 'getCompiler' overrides.
compiler.setHasRegExpGlobalReferences(regExpHaveSideEffects);
compiler.getOptions().setUseTypesForLocalOptimization(true);
new PureFunctionIdentifier.Driver(compiler).process(externs, root);
NodeTraversal.traverse(compiler, externs, this);
NodeTraversal.traverse(compiler, root, this);
}
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isNew()) {
if (!compiler.getAstAnalyzer().constructorCallHasSideEffects(n)) {
noSideEffectCalls.add(n.getFirstChild());
}
} else if (NodeUtil.isInvocation(n)) {
if (!compiler.getAstAnalyzer().functionCallHasSideEffects(n)) {
noSideEffectCalls.add(n.getFirstChild());
}
}
}
}
@Test
public void testOptionalChainGetProp() {
assertNoPureCalls("externObj?.sef1()");
assertPureCallsMarked("externObj?.nsef1()", ImmutableList.of("externObj?.nsef1"));
}
@Test
public void testOptionalChainGetElem() {
assertNoPureCalls("externObj?.['sef1']()");
// The use of `[]` hides the exact method being called from the compiler,
// so it will assume there are side-effects.
assertNoPureCalls("externObj?.['nsef1']()");
}
@Test
public void testOptionalChainCall() {
assertNoPureCalls("externObj.sef1?.()");
assertNoPureCalls("externObj?.sef1?.()");
assertPureCallsMarked("externObj.nsef1?.()", ImmutableList.of("externObj.nsef1"));
assertPureCallsMarked("externObj?.nsef1?.()", ImmutableList.of("externObj?.nsef1"));
}
@Test
public void testOptionalGetterAccess_hasSideEffects() {
assertNoPureCalls(
lines(
"class Foo { get getter() { } }", //
"",
"function foo(a) { a?.getter; }",
"foo(x);"));
}
@Test
public void testOptionalNormalPropAccess_hasNoSideEffects() {
assertPureCallsMarked(
lines(
"", //
"function foo(a) { a?.prop; }",
"foo(x);"),
ImmutableList.of("foo"));
}
@Test
public void testOptionalElementAccess_hasNoSideEffects() {
assertPureCallsMarked(
lines(
"", //
"function foo(a) { a?.['prop']; }",
"foo(x);"),
ImmutableList.of("foo"));
}
@Test
public void testIssue303() {
String source =
lines(
"/** @constructor */ function F() {",
" var self = this;",
" window.setTimeout(function() {",
" window.location = self.location;",
" }, 0);",
"}",
"F.prototype.setLocation = function(x) {",
" this.location = x;",
"};",
"(new F()).setLocation('http://www.google.com/');");
assertNoPureCalls(source);
}
@Test
public void testIssue303b() {
String source =
lines(
"/** @constructor */ function F() {",
" var self = this;",
" window.setTimeout(function() {",
" window.location = self.location;",
" }, 0);",
"}",
"F.prototype.setLocation = function(x) {",
" this.location = x;",
"};",
"function x() {",
" (new F()).setLocation('http://www.google.com/');",
"} window['x'] = x;");
assertNoPureCalls(source);
}
@Test
public void testAnnotationInExterns_new1() {
assertPureCallsMarked("externSENone()", ImmutableList.of("externSENone"));
}
@Test
public void testAnnotationInExterns_new2() {
assertNoPureCalls("externSEThis()");
}
@Test
public void testAnnotationInExterns_new3() {
assertPureCallsMarked("new externObjSEThis()", ImmutableList.of("externObjSEThis"));
}
@Test
public void testAnnotationInExterns_new4() {
// The entire expression containing "externObjSEThisMethod" is considered
// side-effect free in this context.
assertPureCallsMarked(
"new externObjSEThis().externObjSEThisMethod('')",
ImmutableList.of("externObjSEThis", "new externObjSEThis().externObjSEThisMethod"));
}
@Test
public void testAnnotationInExterns_new5() {
assertPureCallsMarked(
"function f() { new externObjSEThis() }; f();", ImmutableList.of("externObjSEThis", "f"));
}
@Test
public void testAnnotationInExterns_new6() {
// While "externObjSEThisMethod" has modifies "this"
// it does not have global side-effects with "this" is
// a known local value.
// TODO(johnlenz): "f" is side-effect free but we need
// to propagate that "externObjSEThisMethod" is modifying
// a local object.
String source =
lines("function f() {", " new externObjSEThis().externObjSEThisMethod('') ", "};", "f();");
assertPureCallsMarked(
source, ImmutableList.of("externObjSEThis", "new externObjSEThis().externObjSEThisMethod"));
}
@Test
public void testAnnotationInExterns_new7() {
// While "externObjSEThisMethod" has modifies "this"
// it does not have global side-effects with "this" is
// a known local value.
String source =
lines(
"function f() {",
" var x = new externObjSEThis(); ",
" x.externObjSEThisMethod('') ",
"};",
"f();");
assertPureCallsMarked(source, ImmutableList.of("externObjSEThis"));
}
@Test
public void testAnnotationInExterns_new8() {
// "externObjSEThisMethod" modifies "this", the 'this'
// is not a known local value, so it must be assumed it is to
// have global side-effects.
String source =
lines(
"function f(x) {", " x.externObjSEThisMethod('') ", "};", "f(new externObjSEThis());");
assertPureCallsMarked(source, ImmutableList.of("externObjSEThis"));
}
@Test
public void testAnnotationInExterns_new9() {
// "externObjSEThisMethod" modifies "this", the 'this'
// is not a known local value, so it must be assumed it is to
// have global side-effects. All possible values of "x" are considered
// as no intraprocedural data flow is done.
String source =
lines(
"function f(x) {",
" x = new externObjSEThis(); ",
" x.externObjSEThisMethod('') ",
"};",
"f(g);");
assertPureCallsMarked(source, ImmutableList.of("externObjSEThis"));
}
@Test
public void testAnnotationInExterns_new10() {
String source =
lines(
"function f() {", " new externObjSEThis().externObjSEThisMethod2('') ", "};", "f();");
assertPureCallsMarked(
source,
ImmutableList.of("externObjSEThis", "new externObjSEThis().externObjSEThisMethod2", "f"));
}
@Test
public void testAnnotationInExterns1() {
assertNoPureCalls("externSef1()");
}
@Test
public void testAnnotationInExterns2() {
assertNoPureCalls("externSef2()");
}
@Test
public void testAnnotationInExterns3() {
assertPureCallsMarked("externNsef1()", ImmutableList.of("externNsef1"));
}
@Test
public void testAnnotationInExterns4() {
assertPureCallsMarked("externNsef2()", ImmutableList.of("externNsef2"));
}
@Test
public void testAnnotationInExterns5() {
assertPureCallsMarked("externNsef3()", ImmutableList.of("externNsef3"));
}
@Test
public void testNamespaceAnnotationInExterns1() {
assertNoPureCalls("externObj.sef1()");
}
@Test
public void testNamespaceAnnotationInExterns2() {
assertPureCallsMarked("externObj.nsef1()", ImmutableList.of("externObj.nsef1"));
}
@Test
public void testNamespaceAnnotationInExterns3() {
assertPureCallsMarked("externObj.nsef2()", ImmutableList.of("externObj.nsef2"));
}
@Test
public void testNamespaceAnnotationInExterns4() {
assertNoPureCalls("externObj.partialFn()");
}
@Test
public void testNamespaceAnnotationInExterns5() {
// Test that adding a second definition for a partially defined
// function doesn't make us think that the function has no side
// effects.
String templateSrc = "var o = {}; o.<fnName> = function(){}; o.<fnName>()";
// Ensure that functions with name != "partialFn" get marked.
assertPureCallsMarked(
templateSrc.replace("<fnName>", "notPartialFn"), ImmutableList.of("o.notPartialFn"));
assertNoPureCalls(templateSrc.replace("<fnName>", "partialFn"));
}
@Test
public void testNamespaceAnnotationInExterns6() {
assertNoPureCalls("externObj.partialSharedFn()");
}
@Test
public void testConstructorAnnotationInExterns1() {
assertNoPureCalls("new externSefConstructor()");
}
@Test
public void testConstructorAnnotationInExterns2() {
String source = lines("var a = new externSefConstructor();", "a.sefFnOfSefObj()");
assertNoPureCalls(source);
}
@Test
public void testConstructorAnnotationInExterns3() {
String source = lines("var a = new externSefConstructor();", "a.nsefFnOfSefObj()");
assertPureCallsMarked(source, ImmutableList.of("a.nsefFnOfSefObj"));
}
@Test
public void testConstructorAnnotationInExterns4() {
String source = lines("var a = new externSefConstructor();", "a.externShared()");
assertNoPureCalls(source);
}
@Test
public void testConstructorAnnotationInExterns5() {
assertPureCallsMarked("new externNsefConstructor()", ImmutableList.of("externNsefConstructor"));
}
@Test
public void testConstructorAnnotationInExterns6() {
String source = lines("var a = new externNsefConstructor();", "a.sefFnOfNsefObj()");
assertPureCallsMarked(source, ImmutableList.of("externNsefConstructor"));
}
@Test
public void testConstructorAnnotationInExterns7() {
String source = lines("var a = new externNsefConstructor();", "a.nsefFnOfNsefObj()");
assertPureCallsMarked(source, ImmutableList.of("externNsefConstructor", "a.nsefFnOfNsefObj"));
}
@Test
public void testConstructorAnnotationInExterns8() {
String source = lines("var a = new externNsefConstructor();", "a.externShared()");
assertPureCallsMarked(source, ImmutableList.of("externNsefConstructor"));
}
@Test
public void testSharedFunctionName1() {
String source =
lines(
"if (true) {",
" a = new externNsefConstructor()",
"} else {",
" a = new externSefConstructor()",
"}",
"a.externShared()");
assertPureCallsMarked(source, ImmutableList.of("externNsefConstructor"));
}
@Test
public void testSharedFunctionName2() {
// Implementation for both externNsefConstructor and externNsefConstructor2
// have no side effects.
boolean broken = true;
if (broken) {
assertPureCallsMarked(
lines(
"var a;",
"if (true) {",
" a = new externNsefConstructor()",
"} else {",
" a = new externNsefConstructor2()",
"}",
"a.externShared()"),
ImmutableList.of("externNsefConstructor", "externNsefConstructor2"));
} else {
assertPureCallsMarked(
lines(
"var a;",
"if (true) {",
" a = new externNsefConstructor()",
"} else {",
" a = new externNsefConstructor2()",
"}",
"a.externShared()"),
ImmutableList.of("externNsefConstructor", "externNsefConstructor2", "a.externShared"));
}
}
@Test
public void testAnnotationInExternStubs1() {
// In the case where a property is defined first as a stub and then with a FUNCTION:
// we have to make a conservative assumption about the behaviour of the extern, since the stub
// carried no information.
assertNoPureCalls("o.propWithStubBefore('a');");
}
@Test
public void testAnnotationInExternStubs1b() {
// In the case where a property is defined first as a stub and then with a FUNCTION:
// we have to make a conservative assumption about the behaviour of the extern, since the stub
// carried no information.
assertNoPureCalls("o.propWithStubBeforeWithJSDoc('a');");
}
@Test
public void testAnnotationInExternStubs2() {
// In the case where a property is defined first with a FUNCTION and then as a stub:
// we have to make a conservative assumption about the behaviour of the extern, since the stub
// carried no information.
assertNoPureCalls("o.propWithStubAfter('a');");
}
@Test
public void testAnnotationInExternStubs3() {
// In the case where a property is defined first with a FUNCTION and then as a stub:
// we have to make a conservative assumption about the behaviour of the extern, since the stub
// carried no information.
assertNoPureCalls("propWithAnnotatedStubAfter('a');");
}
@Test
public void testAnnotationInExternStubs4() {
// An externs definition with a stub that differs from the declaration.
// Verify our assumption is valid about this.
String externs =
lines(
"/**@constructor*/function externObj5(){}",
"externObj5.prototype.propWithAnnotatedStubAfter = function(s) {};",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj5.prototype.propWithAnnotatedStubAfter;");
enableTypeCheck();
testSame(
externs(externs),
srcs("o.prototype.propWithAnnotatedStubAfter"),
warning(TypeValidator.DUP_VAR_DECLARATION_TYPE_MISMATCH));
assertThat(noSideEffectCalls).isEmpty();
}
@Test
public void testAnnotationInExternStubs5() {
// An externs definition with a stub that differs from the declaration.
// Verify our assumption is valid about this.
String externs =
lines(
"/**@constructor*/function externObj5(){}",
"/**",
" * @param {string} s id.",
" * @return {string}",
" * @nosideeffects",
" */",
"externObj5.prototype.propWithAnnotatedStubAfter = function(s) {};",
"/**",
" * @param {string} s id.",
" * @return {string}",
" */",
"externObj5.prototype.propWithAnnotatedStubAfter;");
enableTypeCheck();
testSame(
externs(externs),
srcs("o.prototype.propWithAnnotatedStubAfter"),
warning(TypeValidator.DUP_VAR_DECLARATION));
assertThat(noSideEffectCalls).isEmpty();
}
@Test
public void testNoSideEffectsSimple() {
String prefix = "function f(){";
String suffix = "} f()";
List<String> expected = ImmutableList.of("f");
assertPureCallsMarked(prefix + "" + suffix, expected);
assertPureCallsMarked(prefix + "return 1" + suffix, expected);
assertPureCallsMarked(prefix + "return 1 + 2" + suffix, expected);
// local var
assertPureCallsMarked(prefix + "var a = 1; return a" + suffix, expected);
// mutate local var
assertPureCallsMarked(prefix + "var a = 1; a = 2; return a" + suffix, expected);
assertPureCallsMarked(prefix + "var a = 1; a = 2; return a + 1" + suffix, expected);
// read from obj literal
assertPureCallsMarked(prefix + "var a = {foo : 1}; return a.foo" + suffix, expected);
assertPureCallsMarked(prefix + "var a = {foo : 1}; return a.foo + 1" + suffix, expected);
// read from extern
assertPureCallsMarked(prefix + "return externObj" + suffix, expected);
assertPureCallsMarked(
"function g(x) { x.foo = 3; }" /* to suppress missing property */
+ prefix
+ "return externObj.foo"
+ suffix,
expected);
}
@Test
public void testNoSideEffectsSimple2() {
regExpHaveSideEffects = false;
String source = lines("function f() {", " return ''.replace(/xyz/g, '');", "}", "f()");
assertPureCallsMarked(source, ImmutableList.of("''.replace", "f"));
}
@Test
public void testNoSideEffectsSimple3() {
regExpHaveSideEffects = false;
String source =
lines(
"function f(/** string */ x) {", //
" return x.replace(/xyz/g, '');",
"}",
"f('')");
assertPureCallsMarked(source, ImmutableList.of("x.replace", "f"));
}
@Test
public void testExternCalls() {
testExternCallsForTypeInferenceMode(/* typeChecked= */ true);
}
@Test
public void testExternCallsNoTypeChecking() {
testExternCallsForTypeInferenceMode(/* typeChecked= */ false);
}
private void testExternCallsForTypeInferenceMode(boolean typeChecked) {
if (typeChecked) {
enableTypeCheck();
} else {
disableTypeCheck();
}
String prefix = "function f(){";
String suffix = "} f()";
assertPureCallsMarked(prefix + "externNsef1()" + suffix, ImmutableList.of("externNsef1", "f"));
assertPureCallsMarked(
prefix + "externObj.nsef1()" + suffix, ImmutableList.of("externObj.nsef1", "f"));
assertNoPureCalls(prefix + "externSef1()" + suffix);
assertNoPureCalls(prefix + "externObj.sef1()" + suffix);
}
@Test
public void testApply() {
String source = lines("function f() {return 42}", "f.apply(null)");
assertPureCallsMarked(source, ImmutableList.of("f.apply"));
}
@Test
public void testCall() {
String source = lines("function f() {return 42}", "f.call(null)");
assertPureCallsMarked(source, ImmutableList.of("f.call"));
}
@Test
public void testApplyToUnknownDefinition() {
String source =
lines(
"var dict = {'func': function() {}};",
"function f() { var s = dict['func'];}",
"f.apply(null)");
assertPureCallsMarked(source, ImmutableList.of("f.apply"));
// Not marked because the definition cannot be found so unknown side effects.
source =
lines(
"var dict = {'func': function() {}};",
"function f() { var s = dict['func'].apply(null); }",
"f.apply(null)");
assertNoPureCalls(source);
// Not marked because the definition cannot be found so unknown side effects.
source =
lines(
"var pure = function() {};",
"var dict = {'func': function() {}};",
"function f() { var s = (dict['func'] || pure)();}",
"f()");
assertNoPureCalls(source);
// Not marked because the definition cannot be found so unknown side effects.
source =
lines(
"var pure = function() {};",
"var dict = {'func': function() {}};",
"function f() { var s = (condition ? dict['func'] : pure)();}",
"f()");
assertNoPureCalls(source);
}
@Test
public void testOptChainCall() {
String source = lines("function f() {return g?.()}", "function g() {return 42}", "f?.()");
assertPureCallsMarked(source, ImmutableList.of("g", "f"));
}
@Test
public void testInference1() {
String source = lines("function f() {return g()}", "function g() {return 42}", "f()");
assertPureCallsMarked(source, ImmutableList.of("g", "f"));
}
@Test
public void testInference2() {
String source = lines("var a = 1;", "function f() {g()}", "function g() {a=2}", "f()");
assertNoPureCalls(source);
}
@Test
public void testInference3() {
String source =
lines("var f = function() {return g()};", "var g = function() {return 42};", "f()");
assertPureCallsMarked(source, ImmutableList.of("g", "f"));
}
@Test
public void testInference4() {
String source =
lines("var a = 1; var f = function() {g()};", "var g = function() {a=2};", "f()");
assertNoPureCalls(source);
}
@Test
public void testInference5() {
String source =
lines(
"goog.f = function() {return goog.g()};",
"goog.g = function() {return 42};",
"goog.f()");
assertPureCallsMarked(source, ImmutableList.of("goog.g", "goog.f"));
}
@Test
public void testInference6() {
String source =
lines(
"var a = 1;",
"goog.f = function() {goog.g()};",
"goog.g = function() {a=2};",
"goog.f()");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects1() {
// Returning a function that contains a modification of a local
// is not a global side-effect.
String source =
lines("function f() {", " var x = {foo : 0}; return function() {x.foo++};", "}", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects2() {
// Calling a function that contains a modification of a local
// is a global side-effect (the value has escaped).
String source =
lines("function f() {", " var x = {foo : 0}; (function() {x.foo++})();", "}", "f()");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects3() {
// A local that might be assigned a global value and whose properties
// are modified must be considered a global side-effect.
String source = lines("var g = {foo:1};", "function f() {var x = g; x.foo++};", "f();");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects4() {
// An array is a local object, assigning a local array is not a global side-effect.
assertPureCallsMarked(
lines(
"function f() {var x = []; x[0] = 1;}", // preserve newline
"f()"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"function f() {const x = []; x[0] = 1;}", // preserve newline
"f()"),
ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects5() {
// Assigning a local alias of a global is a global
// side-effect.
String source = lines("var g = [];", "function f() {var x = g; x[0] = 1;};", "f()");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects6() {
// Returning a local object that has been modified
// is not a global side-effect.
assertPureCallsMarked(
lines(
"function f() {", // preserve newline
" var x = {}; x.foo = 1; return x;",
"}",
"f()"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"function f() {", // preserve newline
" const x = {}; x.foo = 1; return x;",
"}",
"f()"),
ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects7() {
// Returning a local object that has been modified
// is not a global side-effect.
assertPureCallsMarked(
lines(
"/** @constructor A */ function A() {};",
"function f() {",
" var a = []; a[1] = 1; return a;",
"}",
"f()"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"/** @constructor A */ function A() {};",
"function f() {",
" const a = []; a[1] = 1; return a;",
"}",
"f()"),
ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects8() {
// Returning a local object that has been modified
// is not a global side-effect.
// TODO(tdeegan): Not yet. Propagate local object information.
String source =
lines(
"/** @constructor A */ function A() {};",
"function f() {",
" var a = new A; a.foo = 1; return a;",
"}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A"));
}
@Test
public void testLocalizedSideEffects9() {
// Returning a local object that has been modified
// is not a global side-effect.
// TODO(johnlenz): Not yet. Propagate local object information.
String source =
lines(
"/** @constructor A */ function A() {this.x = 1};",
"function f() {",
" var a = new A; a.foo = 1; return a;",
"}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A"));
}
@Test
public void testLocalizedSideEffects10() {
// Returning a local object that has been modified
// is not a global side-effect.
String source =
lines(
"/** @constructor A */ function A() {};",
"A.prototype.g = function() {this.x = 1};",
"function f() {",
" var a = new A; a.g(); return a;",
"}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A"));
}
@Test
public void testLocalizedSideEffects11() {
// TODO(tdeegan): updateA is side effect free.
// Calling a function of a local object that taints this.
String source =
lines(
"/** @constructor */",
"function A() {}",
"A.prototype.update = function() { this.x = 1; };",
"",
"/** @constructor */",
"function B() { ",
" this.a_ = new A();",
"}",
"B.prototype.updateA = function() {",
" var b = this.a_;",
" b.update();",
"};",
"",
"var x = new B();",
"x.updateA();");
assertPureCallsMarked(source, ImmutableList.of("A", "B"));
}
@Test
public void testLocalizedSideEffects12() {
// An array is a local object, assigning a local array is not a global
// side-effect. This tests the behavior if the access is in a block scope.
assertPureCallsMarked(
lines(
"function f() {var x = []; { x[0] = 1; } }", // preserve newline
"f()"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"function f() {const x = []; { x[0] = 1; } }", // preserve newline
"f()"),
ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects13() {
String source = lines("function f() {var [x, y] = [3, 4]; }", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects14() {
String source = lines("function f() {var x; if (true) { [x] = [5]; } }", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects15() {
String source = lines("function f() {var {length} = 'a string'; }", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects16() {
String source = lines("function f(someArray) {var [a, , b] = someArray; }", "f([])");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects17() {
String source =
lines(
"function f(someObj) {var { very: { nested: { lhs: pattern }} } = someObj; }",
"f({very: {nested: {lhs: 0}}})");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects18() {
String source =
lines(
"/** @constructor */",
"function SomeCtor() { [this.x, this.y] = getCoordinates(); }",
"new SomeCtor()");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects19() {
String source =
lines(
"/** @constructor */",
"function SomeCtor() { [this.x, this.y] = [0, 1]; }",
"new SomeCtor()");
assertPureCallsMarked(source, ImmutableList.of("SomeCtor"));
}
@Test
public void testLocalizedSideEffects20() {
String source =
lines(
"/** @constructor */", //
"function SomeCtor() { this.x += 1; }",
"new SomeCtor()");
assertPureCallsMarked(source, ImmutableList.of("SomeCtor"));
}
@Test
public void testLocalizedSideEffects21() {
String source = lines("function f(values) { const x = {}; [x.y, x.z] = values; }", "f([])");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects22() {
String source =
lines(
"var x = {};", //
"function f(values) { [x.y, x.z] = values; }",
"f([])");
assertNoPureCalls(source);
}
@Test
public void testLocalizedSideEffects23() {
String source =
lines(
"function f(values) { const x = {}; [x.y, x.z = defaultNoSideEffects] = values; }",
"f([])");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testLocalizedSideEffects24() {
String source =
lines(
"function f(values) { var x = {}; [x.y, x.z = defaultWithSideEffects()] = values; }",
"f([])");
assertNoPureCalls(source);
}
@Test
public void testUnaryOperators1() {
String source = lines("function f() {var x = 1; x++}", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testUnaryOperators2() {
String source = lines("var x = 1;", "function f() {x++}", "f()");
assertNoPureCalls(source);
}
@Test
public void testUnaryOperators3() {
assertPureCallsMarked(
lines(
"function f() {var x = {foo : 0}; x.foo++}", // preserve newline
"f()"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"function f() {const x = {foo : 0}; x.foo++}", // preserve newline
"f()"),
ImmutableList.of("f"));
}
@Test
public void testUnaryOperators4() {
String source = lines("var x = {foo : 0};", "function f() {x.foo++}", "f()");
assertNoPureCalls(source);
}
@Test
public void testUnaryOperators5() {
assertPureCallsMarked(
lines(
"function f(x) {x.foo++}", // preserve newline
"f({foo : 0})"),
ImmutableList.of("f"));
assertNoPureCalls(
lines(
"function f({x}) {x.foo++}", // preserve newline
"f({x: {foo : 0}})"));
}
@Test
public void testDeleteOperator1() {
String source = lines("var x = {};", "function f() {delete x}", "f()");
assertNoPureCalls(source);
}
@Test
public void testDeleteOperator1_getProp() {
String source = lines("var x = {y:2};", "function f() {delete x.y}", "f()");
assertNoPureCalls(source);
}
@Test
public void testDeleteOperator1_optChainGetProp() {
String source = lines("var x = {y:2};", "function f() {delete x?.y}", "f()");
assertNoPureCalls(source);
}
@Test
public void testDeleteOperator2() {
String source = lines("function f() {var x = {}; delete x}", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testDeleteOperator2_getProp() {
String source = lines("function f() {var x = {y:2}; delete x.y}", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testDeleteOperator2_optChainGetProp() {
String source = lines("function f() {var x = {y:2}; delete x?.y}", "f()");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
// Start pure alias
@Test
public void testOperatorsTraversal_pureAlias_pureAlias() {
assertCallableExpressionPure(true, "externNsef1 || externNsef2");
assertCallableExpressionPure(true, "externNsef1 && externNsef2");
assertCallableExpressionPure(true, "externNsef1, externNsef2");
assertCallableExpressionPure(true, "x ? externNsef1 : externNsef2");
}
@Test
public void testOperatorsTraversal_pureAlias_pureLiteral() {
assertCallableExpressionPure(true, "externNsef1 || function() { }");
assertCallableExpressionPure(true, "externNsef1 && function() { }");
assertCallableExpressionPure(true, "externNsef1, function() { }");
assertCallableExpressionPure(true, "x ? externNsef1 : function() { }");
}
@Test
public void testOperatorsTraversal_pureAlias_impureAlias() {
assertCallableExpressionPure(false, "externNsef1 || externSef2");
assertCallableExpressionPure(false, "externNsef1 && externSef2");
assertCallableExpressionPure(false, "externNsef1, externSef2");
assertCallableExpressionPure(false, "x ? externNsef1 : externSef2");
}
@Test
public void testOperatorsTraversal_pureAlias_impureLiteral() {
assertCallableExpressionPure(false, "externNsef1 || function() { throw 0; }");
assertCallableExpressionPure(false, "externNsef1 && function() { throw 0; }");
assertCallableExpressionPure(false, "externNsef1, function() { throw 0; }");
assertCallableExpressionPure(false, "x ? externNsef1 : function() { throw 0; }");
}
@Test
public void nullishCoalesce_pureAlias() {
assertCallableExpressionPure(true, "externNsef1 ?? externNsef2");
assertCallableExpressionPure(true, "externNsef1 ?? function() { }");
assertCallableExpressionPure(false, "externNsef1 ?? externSef2");
assertCallableExpressionPure(false, "externNsef1 ?? function() { throw 0; }");
}
// End pure alias, start pure literal
@Test
public void testOperatorsTraversal_pureLiteral_pureAlias() {
assertCallableExpressionPure(true, "function() { } || externNsef2");
assertCallableExpressionPure(true, "function() { } && externNsef2");
assertCallableExpressionPure(true, "function() { }, externNsef2");
assertCallableExpressionPure(true, "x ? function() { } : externNsef2");
}
@Test
public void testOperatorsTraversal_pureLiteral_pureLiteral() {
assertCallableExpressionPure(true, "function() { } || function() { }");
assertCallableExpressionPure(true, "function() { } && function() { }");
assertCallableExpressionPure(true, "function() { }, function() { }");
assertCallableExpressionPure(true, "x ? function() { } : function() { }");
}
@Test
public void testOperatorsTraversal_pureLiteral_impureAlias() {
assertCallableExpressionPure(false, "function() { } || externSef2");
assertCallableExpressionPure(false, "function() { } && externSef2");
assertCallableExpressionPure(false, "function() { }, externSef2");
assertCallableExpressionPure(false, "x ? function() { } : externSef2");
}
@Test
public void testOperatorsTraversal_pureLiteral_impureLiteral() {
assertCallableExpressionPure(false, "function() { } || function() { throw 0; }");
assertCallableExpressionPure(false, "function() { } && function() { throw 0; }");
assertCallableExpressionPure(false, "function() { }, function() { throw 0; }");
assertCallableExpressionPure(false, "x ? function() { } : function() { throw 0; }");
}
@Test
public void nullishCoalesce_pureLiteral() {
assertCallableExpressionPure(true, "function() { } ?? externNsef2");
assertCallableExpressionPure(true, "function() { } ?? function() { }");
assertCallableExpressionPure(false, "function() { } ?? externSef2");
assertCallableExpressionPure(false, "function() { } ?? function() { throw 0; }");
}
// End pure literal, start impure alias
@Test
public void testOperatorsTraversal_impureAlias_pureAlias() {
assertCallableExpressionPure(false, "externSef1 || externNsef2");
assertCallableExpressionPure(false, "externSef1 && externNsef2");
assertCallableExpressionPure(true, "externSef1, externNsef2");
assertCallableExpressionPure(false, "x ? externSef1 : externNsef2");
}
@Test
public void testOperatorsTraversal_impureAlias_pureLiteral() {
assertCallableExpressionPure(false, "externSef1 || function() { }");
assertCallableExpressionPure(false, "externSef1 && function() { }");
assertCallableExpressionPure(true, "externSef1, function() { }");
assertCallableExpressionPure(false, "x ? externSef1 : function() { }");
}
@Test
public void testOperatorsTraversal_impureAlias_impureAlias() {
assertCallableExpressionPure(false, "externSef1 || externSef2");
assertCallableExpressionPure(false, "externSef1 && externSef2");
assertCallableExpressionPure(false, "externSef1, externSef2");
assertCallableExpressionPure(false, "x ? externSef1 : externSef2");
}
@Test
public void testOperatorsTraversal_impureAlias_impureLiteral() {
assertCallableExpressionPure(false, "externSef1 || function() { throw 0; }");
assertCallableExpressionPure(false, "externSef1 && function() { throw 0; }");
assertCallableExpressionPure(false, "externSef1, function() { throw 0; }");
assertCallableExpressionPure(false, "x ? externSef1 : function() { throw 0; }");
}
@Test
public void nullishCoalesce_impureAlias() {
assertCallableExpressionPure(false, "externSef1 ?? externNsef2");
assertCallableExpressionPure(false, "externSef1 ?? function() { }");
assertCallableExpressionPure(false, "externSef1 ?? externSef2");
assertCallableExpressionPure(false, "externSef1 ?? function() { throw 0; }");
}
// End impure alias, start impure literal
@Test
public void testOperatorsTraversal_impureLiteral_pureAlias() {
assertCallableExpressionPure(false, "function() { throw 0; } || externNsef2");
assertCallableExpressionPure(false, "function() { throw 0; } && externNsef2");
assertCallableExpressionPure(true, "function() { throw 0; }, externNsef2");
assertCallableExpressionPure(false, "x ? function() { throw 0; } : externNsef2");
}
@Test
public void testOperatorsTraversal_impureLiteral_pureLiteral() {
assertCallableExpressionPure(false, "function() { throw 0; } || function() { }");
assertCallableExpressionPure(false, "function() { throw 0; } && function() { }");
assertCallableExpressionPure(true, "function() { throw 0; }, function() { }");
assertCallableExpressionPure(false, "x ? function() { throw 0; } : function() { }");
}
@Test
public void testOperatorsTraversal_impureLiteral_impureAlias() {
assertCallableExpressionPure(false, "function() { throw 0; } || externSef2");
assertCallableExpressionPure(false, "function() { throw 0; } && externSef2");
assertCallableExpressionPure(false, "function() { throw 0; }, externSef2");
assertCallableExpressionPure(false, "x ? function() { throw 0; } : externSef2");
}
@Test
public void testOperatorsTraversal_impureLiteral_impureLiteral() {
assertCallableExpressionPure(false, "function() { throw 0; } || function() { throw 0; }");
assertCallableExpressionPure(false, "function() { throw 0; } && function() { throw 0; }");
assertCallableExpressionPure(false, "function() { throw 0; }, function() { throw 0; }");
assertCallableExpressionPure(false, "x ? function() { throw 0; } : function() { throw 0; }");
}
@Test
public void nullishCoalesce_impureLiteral() {
assertCallableExpressionPure(false, "function() { throw 0; } ?? externNsef2");
assertCallableExpressionPure(false, "function() { throw 0; } ?? function() { }");
assertCallableExpressionPure(false, "function() { throw 0; } ?? externSef2");
assertCallableExpressionPure(false, "function() { throw 0; } ?? function() { throw 0; }");
}
// End impure literal
@Test
public void testKnownDynamicFunctions_areSkiplistedForAliasing() {
for (String name : ImmutableList.of("call", "apply", "constructor")) {
assertNoPureCalls(
lines(
// Create a known pure definition so we're sure the name isn't just undefined.
"foo." + name + " = function() { };", //
"const f = foo." + name + ";",
"f();"));
}
}
@Test
public void testThrow1() {
String source = lines("function f(){throw Error()};", "f()");
assertPureCallsMarked(source, ImmutableList.of("Error"));
}
@Test
public void testThrow2() {
String source =
lines(
"/**@constructor*/function A(){throw Error()};", "function f(){return new A()}", "f()");
assertPureCallsMarked(source, ImmutableList.of("Error"));
}
@Test
public void testThrow_insideTry_withCatch_hasNoSideEffects() {
String source =
lines(
"function f() {",
" try {",
" throw Error();",
" } catch (e) {",
" } finally {",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("f", "Error"));
}
@Test
public void testThrow_insideTry_withoutCatch_hasSideEffects() {
String source =
lines(
"function f() {",
" try {",
" throw Error();",
" } finally {",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("Error"));
}
@Test
public void testThrow_insideCatch_hasSideEffects() {
String source =
lines(
"function f() {",
" try {",
" } catch (e) {",
" throw Error();",
" } finally {",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("Error"));
}
@Test
public void testThrow_insideFinally_hasSideEffects() {
String source =
lines(
"function f() {",
" try {",
" } catch (e) {",
" } finally {",
" throw Error();",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("Error"));
}
@Test
public void testThrow_insideTry_afterNestedTry_hasNoSideEffects() {
/** Ensure we track the stack of trys correctly, rather than just toggling a boolean. */
String source =
lines(
"function f() {",
" try {",
" try {",
" } finally {",
" }",
"",
" throw Error();",
" } catch (e) {",
" } finally {",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("f", "Error"));
}
@Test
public void testThrow_insideFunction_insideTry_hasNoSideEffects() {
/** Ensure we track the stack of trys correctly, rather than just toggling a boolean. */
String source =
lines(
"function f() {",
" try {",
" function g() {",
" throw Error();",
" }",
" } catch (e) {",
" } finally {",
" }",
"}",
"",
"f();");
assertPureCallsMarked(source, ImmutableList.of("f", "Error"));
}
@Test
public void testThrow_fromCallee_insideTry_withCatch_hasNoSideEffects() {
String source =
lines(
"function h() {",
" throw Error();",
"}",
"",
"function f() {",
" try {",
" h()",
" } catch (e) {",
" } finally {",
" }",
"}",
"",
"h();",
"f();");
assertPureCallsMarked(source, ImmutableList.of("f", "Error"));
}
@Test
public void testAssignmentOverride() {
String source =
lines(
"/**@constructor*/function A(){}",
"A.prototype.foo = function(){};",
"var a = new A;",
"a.foo();");
assertPureCallsMarked(source, ImmutableList.of("A", "a.foo"));
// Ideally inline aliases takes care of this.
String sourceOverride =
lines(
"/**@constructor*/ function A(){}",
"A.prototype.foo = function(){};",
"var x = 1",
"function f(){x = 10}",
"var a = new A;",
"a.foo = f;",
"a.foo();");
assertPureCallsMarked(sourceOverride, ImmutableList.of("A"));
}
@Test
public void testAmbiguousDefinitions() {
String source =
CompilerTypeTestCase.CLOSURE_DEFS
+ lines(
"var globalVar = 1;",
"A.f = function() {globalVar = 2;};",
"A.f = function() {};",
"function sideEffectCaller() { A.f() };",
"sideEffectCaller();");
// Can't tell which f is being called so it assumes both.
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsCall() {
String source =
CompilerTypeTestCase.CLOSURE_DEFS
+ lines(
"var globalVar = 1;",
"A.f = function() {globalVar = 2;};",
"A.f = function() {};",
"function sideEffectCaller() { A.f.call(null); };",
"sideEffectCaller();");
// Can't tell which f is being called so it assumes both.
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsAllPropagationTypes() {
String source =
CompilerTypeTestCase.CLOSURE_DEFS
+ lines(
"/**@constructor*/A.f = function() { this.x = 5; };",
"/**@constructor*/B.f = function() {};",
"function sideEffectCaller() { new C.f() };",
"sideEffectCaller();");
// "f" is only known to mutate `this`, but `this` is a local object when invoked with `new`.
assertPureCallsMarked(source, ImmutableList.of("C.f", "sideEffectCaller"));
}
@Test
public void testAmbiguousDefinitionsCallWithThis() {
String source =
CompilerTypeTestCase.CLOSURE_DEFS
+ lines(
"A.modifiesThis = function() { this.x = 5; };",
"B.modifiesThis = function() {};",
"",
"/** @constructor */ function Constructor() { B.modifiesThis.call(this); };",
"",
"new Constructor();",
"A.modifiesThis();");
// Can't tell which modifiesThis is being called so it assumes both.
assertPureCallsMarked(source, ImmutableList.of("Constructor"));
}
@Test
public void testAmbiguousDefinitionsBothCallThis() {
String source =
lines(
"B.f = function() {",
" this.x = 1;",
"}",
"/** @constructor */ function C() {",
" this.f.apply(this);",
"}",
"C.prototype.f = function() {",
" this.x = 2;",
"}",
"new C();");
assertPureCallsMarked(source, ImmutableList.of("C"));
}
@Test
public void testAmbiguousDefinitionsBothCallThisWithOptionalChain() {
String source =
lines(
"B.f = function() {",
" this.x = 1;",
"}",
"/** @constructor */ function C() {",
" this.f?.apply(this);",
"}",
"C.prototype.f = function() {",
" this.x = 2;",
"}",
"new C();");
assertPureCallsMarked(source, ImmutableList.of("C"));
}
@Test
public void testAmbiguousDefinitionsAllCallThis() {
String source =
lines(
"A.f = function() { this.y = 1 };",
"C.f = function() { };",
"var g = function() {D.f()};",
"/** @constructor */ var h = function() {E.f.apply(this)};",
// TODO(nickreid): Detect that `{}` being passed as `this` is local. With that
// understanding, we could determine that `i` has no side-effects.
"var i = function() { F.f.apply({}); };",
"g();",
"new h();",
"i();");
assertPureCallsMarked(source, ImmutableList.of("F.f.apply", "h"));
}
@Test
public void testAmbiguousDefinitionsMutatesGlobalArgument() {
String source =
lines(
"// Mutates argument",
"A.a = function(argument) {",
" argument.x = 2;",
"};",
"// No side effects",
"B.a = function() {};",
"var b = function(x) {C.a(x)};",
"b({});");
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsMutatesLocalArgument() {
assertPureCallsMarked(
lines(
"// Mutates argument",
"A.a = function(argument) {",
" argument.x = 2;",
"};",
"// No side effects",
"B.a = function() {};",
"var b = function() {",
" C.a({});",
"};",
"b();"),
ImmutableList.of("C.a", "b"));
}
@Test
public void testAmbiguousExternDefinitions() {
assertNoPureCalls("x.duplicateExternFunc()");
// nsef1 is defined as no side effect in the externs.
String source =
lines(
"var global = 1;",
// Overwrite the @nosideeffects with this side effect
"A.nsef1 = function () {global = 2;};",
"externObj.nsef1();");
assertNoPureCalls(source);
}
/**
* Test bug where the FunctionInformation for "A.x" and "a" were separate causing .x() calls to
* appear pure because the global side effect was only registed for the function linked to "a".
*/
@Test
public void testAmbiguousDefinitionsDoubleDefinition() {
String source =
lines(
"var global = 1;", "A.x = function a() { global++; }", "B.x = function() {}", "B.x();");
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsDoubleDefinition2() {
String source =
lines(
"var global = 1;",
"A.x = function a() { global++; }",
"var a = function() {}", // This is the only `a` is in scope below.
"B.x();",
"a();");
assertPureCallsMarked(source, ImmutableList.of("a"));
}
@Test
public void testAmbiguousDefinitionsDoubleDefinition3() {
String source =
lines(
"var global = 1;",
"A.x = function a() {}",
"var a = function() { global++; }", // This is the only `a` is in scope below.
"B.x();",
"a();");
assertPureCallsMarked(source, ImmutableList.of("B.x"));
}
@Test
public void testAmbiguousDefinitionsDoubleDefinition4() {
String source =
lines(
"var global = 1;",
"",
"A.x = function a() {}",
"B.x = function() { global++; }",
"",
"B.x();",
"a();" // `a` isn't in scope here.
);
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsDoubleDefinition5() {
String source =
lines(
"var global = 1;",
"",
"A.x = cond ? function a() { global++ } : function b() {}",
"B.x = function() { global++; }",
"",
"B.x();",
"a();", // `a` isn't in scope here.
"b();" // `b` isn't in scope here.
);
assertNoPureCalls(source);
}
@Test
public void testAmbiguousDefinitionsDoubleDefinition6() {
String source =
lines(
"var SetCustomData1 = function SetCustomData2(element, dataName, dataValue) {",
" var x = element['_customData'];",
" x[dataName] = dataValue;",
"}",
"SetCustomData1(window, \"foo\", \"bar\");");
assertNoPureCalls(source);
}
@Test
public void testInnerFunction_isNeverPure() {
// TODO(b/129503101): `pure` should be marked pure in this case.
assertNoPureCalls(
lines(
"function f() {", //
" function pure() { };",
" pure();",
"}"));
}
@Test
public void testNamedFunctionExpression_isNeverPure() {
// TODO(b/129503101): `pure` should be marked pure in this case.
assertNoPureCalls(
lines(
"(function pure() {", //
" pure();",
"})"));
}
@Test
public void testNameAliasPurity() {
assertAliasPurity(true, "const alias = pure;", false);
assertAliasPurity(true, "let alias = pure;", false);
assertAliasPurity(false, "let alias; alias = pure;", false);
assertAliasPurity(true, "var alias = pure;", false);
assertAliasPurity(false, "var alias; alias = pure;", false);
}
@Test
public void testPropertyAliasPurity() {
assertAliasPurity(true, "({alias: pure});", true);
assertAliasPurity(true, "obj.alias = pure;", true);
}
private void assertAliasPurity(boolean isPure, String aliasDefinition, boolean isProperty) {
String aliasExpression = isProperty ? "obj.alias" : "alias";
ArrayList<String> expected = new ArrayList<>();
expected.add("pure");
if (isPure) {
expected.add(aliasExpression);
}
assertPureCallsMarked(
lines(
"const /** ? */ obj = {};",
"function pure() { }", //
aliasDefinition,
"",
"pure();",
aliasExpression + "();"),
expected);
}
@Test
public void testCallBeforeDefinition() {
assertPureCallsMarked("f(); function f(){}", ImmutableList.of("f"));
assertPureCallsMarked("var a = {}; a.f(); a.f = function (){}", ImmutableList.of("a.f"));
}
@Test
public void testSideEffectsArePropagated_toPrecedingCaller_fromFollowingCallee() {
assertPureCallsMarked(
lines(
"var following = function() { };", // This implementation is pure...
"var preceding = function() { following(); };", // so this one should be initially...
"following = function() { throw 'something'; };", // but then it becomes impure.
"",
"preceding();"),
ImmutableList.of());
}
@Test
public void testConstructorThatModifiesThis1() {
String source =
lines("/**@constructor*/function A(){this.foo = 1}", "function f() {return new A}", "f()");
assertPureCallsMarked(source, ImmutableList.of("A", "f"));
}
@Test
public void testConstructorThatModifiesThis2() {
String source =
lines(
"/**@constructor*/function A(){this.foo()}",
"A.prototype.foo = function(){this.data=24};",
"function f() {return new A}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A", "f"));
}
@Test
public void testOptChainCallInConstructorThatModifiesThis() {
String source =
lines(
"/**@constructor*/function A(){this?.foo()}",
"A.prototype.foo = function(){this.data=24};",
"function f() {return new A}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A", "f"));
}
@Test
public void testConstructorThatModifiesThis3() {
// test chained
String source =
lines(
"/**@constructor*/function A(){this.foo()}",
"A.prototype.foo = function(){this.bar()};",
"A.prototype.bar = function(){this.data=24};",
"function f() {return new A}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A", "f"));
}
@Test
public void testConstructorThatModifiesThis4() {
String source =
lines(
"/**@constructor*/function A(){foo.call(this)}",
"function foo(){this.data=24};",
"function f() {return new A}",
"f()");
assertPureCallsMarked(source, ImmutableList.of("A", "f"));
}
@Test
public void testConstructorThatModifiesGlobal1() {
String source =
lines(
"var b = 0;",
"/**@constructor*/function A(){b=1};",
"function f() {return new A}",
"f()");
assertNoPureCalls(source);
}
@Test
public void testConstructorThatModifiesGlobal2() {
String source =
lines(
"/**@constructor*/function A(){this.foo()}",
"A.prototype.foo = function(){b=1};",
"function f() {return new A}",
"f()");
assertNoPureCalls(source);
}
@Test
public void testCallFunctionThatModifiesThis() {
String source =
lines(
"/**@constructor*/function A(){}",
"A.prototype.foo = function(){this.data=24};",
"function f(){var a = new A; return a}",
"function g(){var a = new A; a.foo(); return a}",
"f(); g()");
assertPureCallsMarked(source, ImmutableList.of("A", "A", "f"));
}
@Test
public void testMutatesArguments1() {
assertPureCallsMarked(
lines(
"function f(x) { x.y = 1; }", // preserve newline
"f({});"),
ImmutableList.of("f"));
assertPureCallsMarked(
lines(
"function f(x = {}) { x.y = 1; }", // preserve newline
"f({});"),
ImmutableList.of("f"));
}
@Test
public void testMutatesArguments_notTrackedThroughDestructuring() {
assertNoPureCalls(
lines(
"const obj = {};", // preserve newline
"function f([x]) { x.y = 1; }",
"f({obj});",
""));
// This is technically pure, but right now we don't track that the array being destructured was
// a literal containing literals.
assertNoPureCalls(
lines(
"function f([x]) { x.y = 1; }", // preserve newline
"f([{}]);"));
}
@Test
public void testMutatesArguments2() {
String source = lines("function f(x) { x.y = 1; }", "f(window);");
assertNoPureCalls(source);
}
@Test
public void testMutatesArguments3() {
// We could do better here with better side-effect propagation.
String source = lines("function f(x) { x.y = 1; }", "function g(x) { f(x); }", "g({});");
assertNoPureCalls(source);
}
@Test
public void testMutatesArguments4() {
assertPureCallsMarked(
lines(
"function f(x) { x.y = 1; }", // preserve newline
"function g(x) { f({}); x.y = 1; }",
"g({});"),
ImmutableList.of("f", "g"));
}
@Test
public void testMutatesArguments5() {
String source =
lines(
"function f(x) {",
" function g() {",
" x.prop = 5;",
" }",
" g();",
"}",
"f(window);");
assertNoPureCalls(source);
}
@Test
public void testMutatesArgumentsArray1() {
String source = lines("function f(x) { arguments[0] = 1; }", "f({});");
assertPureCallsMarked(source, ImmutableList.of("f"));
}
@Test
public void testMutatesArgumentsArray2() {
// We could be smarter here.
String source = lines("function f(x) { arguments[0].y = 1; }", "f({});");
assertNoPureCalls(source);
}
@Test
public void testMutatesArgumentsArray3() {
String source = lines("function f(x) { arguments[0].y = 1; }", "f(x);");
assertNoPureCalls(source);
}
@Test
public void testCallGenerator1() {
String source =
lines(
"var x = 0;",
"function* f() {",
" x = 2",
" while (true) {",
" yield x;",
" }",
"}",
"var g = f();");
assertNoPureCalls(source);
Node lastRoot = getLastCompiler().getRoot().getLastChild();
Node call = findQualifiedNameNode("f", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isFalse();
assertThat(call.getSideEffectFlags()).isEqualTo(Node.SideEffectFlags.ALL_SIDE_EFFECTS);
}
@Test
public void testCallGenerator2() {
String source =
lines("function* f() {", " while (true) {", " yield 1;", " }", "}", "var g = f();");
assertNoPureCalls(source);
}
@Test
public void testCallFunctionFOrG() {
String source = lines("function f(){}", "function g(){}", "function h(){ (f || g)() }", "h()");
assertPureCallsMarked(source, ImmutableList.of("f || g", "h"));
}
@Test
public void testCallFunctionFOrGViaHook() {
String source =
lines("function f(){}", "function g(){}", "function h(){ (false ? f : g)() }", "h()");
assertPureCallsMarked(source, ImmutableList.of("false ? f : g", "h"));
}
@Test
public void testCallFunctionForGorH() {
String source =
lines(
"function f(){}",
"function g(){}",
"function h(){}",
"function i(){ (false ? f : (g || h))() }",
"i()");
assertPureCallsMarked(source, ImmutableList.of("false ? f : (g || h)", "i"));
}
@Test
public void testCallFunctionForGWithSideEffects() {
String source =
lines(
"var x = 0;",
"function f(){x = 10}",
"function g(){}",
"function h(){ (f || g)() }",
"function i(){ (g || f)() }",
"function j(){ (f || f)() }",
"function k(){ (g || g)() }",
"h(); i(); j(); k()");
assertPureCallsMarked(source, ImmutableList.of("g || g", "k"));
}
@Test
public void testCallFunctionFOrGViaHookWithSideEffects() {
String source =
lines(
"var x = 0;",
"function f(){x = 10}",
"function g(){}",
"function h(){ (false ? f : g)() }",
"function i(){ (false ? g : f)() }",
"function j(){ (false ? f : f)() }",
"function k(){ (false ? g : g)() }",
"h(); i(); j(); k()");
assertPureCallsMarked(source, ImmutableList.of("false ? g : g", "k"));
}
@Test
public void testCallRegExpWithSideEffects() {
String source = lines("var x = 0;", "function k(){(/a/).exec('')}", "k()");
regExpHaveSideEffects = true;
assertNoPureCalls(source);
regExpHaveSideEffects = false;
assertPureCallsMarked(source, ImmutableList.of("/a/.exec", "k"));
}
@Test
public void testAnonymousFunction1() {
assertPureCallsMarked("(function (){})();", ImmutableList.of("function(){}"));
}
@Test
public void testAnonymousFunction2() {
String source = "(Error || function (){})();";
assertPureCallsMarked(source, ImmutableList.of("(Error || function(){})"));
}
@Test
public void testAnonymousFunction3() {
String source = "var a = (Error || function (){})();";
assertPureCallsMarked(source, ImmutableList.of("(Error || function(){})"));
}
// Indirect complex function definitions aren't yet supported.
@Test
public void testAnonymousFunction4() {
String source = lines("var a = (Error || function (){});", "a();");
assertPureCallsMarked(source, ImmutableList.of("a"));
}
@Test
public void testClassMethod1() {
String source = "class C { m() { alert(1); } }; (new C).m();";
assertPureCallsMarked(source, ImmutableList.of("C"));
}
@Test
public void testClassMethod2() {
String source = "class C { m() { } }; (new C).m();";
assertPureCallsMarked(source, ImmutableList.of("C", "new C().m"));
}
@Test
public void testClassMethod3() {
String source = "class C { m1() { } m2() { this.m1(); }}; (new C).m2();";
assertPureCallsMarked(source, ImmutableList.of("C", "this.m1", "new C().m2"));
}
@Test
public void testClassInstantiation_implicitCtor_noSuperclass_isPure() {
assertPureCallsMarked(
lines(
"class C { }", //
"",
"new C()"),
ImmutableList.of("C"));
}
@Test
public void testClassInstantiation_pureCtor_noSuperclass_isPure() {
assertPureCallsMarked(
lines(
"class C {",
" constructor() { }",
"}", //
"",
"new C()"),
ImmutableList.of("C"));
}
@Test
public void testClassInstantiation_impureCtor_noSuperclass_isImpure() {
assertNoPureCalls(
lines(
"class C {",
" constructor() { throw 0; }",
"}", //
"",
"new C()"));
}
@Test
public void testClassInstantiation_implictCtor_pureSuperclassCtor_isPure() {
assertPureCallsMarked(
lines(
"class A { }", // Implict ctor is pure.
"class C extends A { }",
"",
"new C()"),
ImmutableList.of("C"));
}
@Test
public void testClassInstantiation_implictCtor_impureSuperclassCtor_isImpure() {
assertNoPureCalls(
lines(
"class A {",
" constructor() { throw 0; }",
"}", //
"class C extends A { }",
"",
"new C()"));
}
@Test
public void testClassInstantiation_explitCtor_pureSuperclassCtor_isPure() {
assertPureCallsMarked(
lines(
"class A { }",
"class C extends A {",
" constructor() {",
// This should be marked as "mutates this" despite being a call to a pure function.
// `super()` binds `this`, and more importantly is syntactically required. Marking it
// this way prevents removal.
" super();",
" }",
"}",
"",
"new C()"),
ImmutableList.of("C"));
}
@Test
public void testClassInstantiation_explitCtor_impureSuperclassCtor_isImpure() {
assertNoPureCalls(
lines(
"class A {",
" constructor() { throw 0; }",
"}", //
"class C extends A {",
" constructor() { super(); }",
"}",
"",
"new C()"));
}
@Test
public void testClassInstantiation_mutatesThis_traversesSuper() {
assertPureCallsMarked(
lines(
"class A {",
" constructor() { this.foo = 9; }",
"}", //
"class C extends A {",
" constructor() { super(); }",
"}",
"",
"new C()"),
ImmutableList.of("C"));
}
@Test
public void testMutatesThis_traversesThisAsReceiver() {
assertPureCallsMarked(
lines(
"class C {",
" constructor() {",
" /** @type {number} */",
" this.foo;",
"",
" this.mutateThis();",
" }",
"",
" mutateThis() { this.foo = 9; }",
"}",
"",
// Instantiation swallows "mutates this" side-effects.
"var x = new C();",
// But in general it is still a side-effect.
"x.mutateThis()"),
ImmutableList.of("C"));
}
@Test
public void testMutatesThis_traversesSuperAsReceiver() {
assertPureCallsMarked(
lines(
"class C {",
" constructor() {",
" /** @type {number} */",
" this.foo;",
"",
// Ignore the fact that there's no superclass.
" super.mutateThis();",
" }",
"",
" mutateThis() { this.foo = 9; }",
"}",
"",
// Instantiation swallows "mutates this" side-effects.
"var x = new C();",
// But in general it is still a side-effect.
"x.mutateThis()"),
ImmutableList.of("C"));
}
@Test
public void testMutatesThis_expandsToMutatesGlobalScope_traversingArbitraryReceiver() {
assertNoPureCalls(
lines(
"class C {",
" constructor() {",
" /** @type {number} */",
" this.foo;",
"",
" somethingElse.mutateThis();",
" }",
"",
" mutateThis() {",
" this.foo = 9;",
" }",
"}",
"",
// Instantiation swallows "mutates this" side-effects.
"var x = new C();",
// But in general it is still a side-effect.
"x.mutateThis()"));
}
@Test
public void testGlobalScopeTaintedByWayOfThisPropertyAndForOfLoop() {
String source =
lines(
"class C {",
" constructor(elements) {",
" this.elements = elements;",
" this.m1();",
" }",
" m1() {",
" for (const element of this.elements) {",
" element.someProp = 1;",
" }",
" }",
"}",
"new C([]).m1()",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testGlobalScopeTaintedByWayOfThisPropertyAndForOfLoopWithDestructuring() {
String source =
lines(
"class C {",
" constructor(elements) {",
" this.elements = elements;",
" this.m1();",
" }",
" m1() {",
" this.elements[0].someProp = 1;",
" for (const {prop} of this.elements) {",
" prop.someProp = 1;",
" }",
" }",
"}",
"new C([{prop: {}}]).m1()",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfFunctionScopedLet() {
String source =
lines(
"function m1(elements) {",
" let e;",
" for (let i = 0; i < elements.length; ++i) {",
" e = elements[i];",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfFunctionScopedLetAssignedInForOf() {
String source =
lines(
"function m1(elements) {",
" let e;",
" for (e of elements) {",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfFunctionScopedLetAssignedInForOfWithDestructuring() {
String source =
lines(
"function m1(elements) {",
" let e;",
" for ({e} of elements) {",
" e.someProp = 1;",
" }",
"}",
"m1([{e: {}}]);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfForOfAssignmentToQualifiedName() {
String source =
lines(
"function m1(obj, elements) {",
" for (obj.e of elements) {",
" if (obj.e != null) break;",
" }",
"}",
"var globalObj = {};",
"m1(globalObj, []);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfForInAssignmentToQualifiedName() {
String source =
lines(
"/**",
" *@param {!Object} obj",
" *@param {!Object} propObj",
" *@returns {number}",
" */",
"function m1(/** ? */ obj, /** Object */ propObj) {",
" var propCharCount = 0;",
" obj.e = '';",
" for (obj.e in propObj) {",
" propCharCount += obj.e.length;",
" }",
" return propCharCount;",
"}",
"var globalObj = {};",
"m1(globalObj, {x: 1});",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfBlockScopedLet() {
String source =
lines(
"function m1(elements) {",
" for (let i = 0; i < elements.length; ++i) {",
" let e;",
" e = elements[i];",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfBlockScopedConst() {
String source =
lines(
"function m1(elements) {",
" for (let i = 0; i < elements.length; ++i) {",
" const e = elements[i];",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testArgumentTaintedByWayOfForOfScopedConst() {
String source =
lines(
"function m1(elements) {",
" for (const e of elements) {",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertNoPureCalls(source);
}
@Test
public void testArgumentTaintedByWayOfForOfScopedConstWithDestructuring() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines(
"function m1(elements) {",
" for (const {e} of elements) {",
" e.someProp = 1;",
" }",
"}",
"m1([]);",
"");
assertNoPureCalls(source);
}
@Test
public void testArgumentTaintedByWayOfNameDeclaration() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines("function m1(obj) {", " let p = obj.p;", " p.someProp = 1;", "}", "m1([]);", "");
assertPureCallsMarked(source, ImmutableList.of());
}
@Test
public void testUnusedDestructuringNameDeclarationIsPure() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines(
"function m1(obj) {", //
" let {p} = obj;",
"}",
"m1([]);",
"");
assertPureCallsMarked(source, ImmutableList.of("m1"));
}
@Test
public void testArgumentTaintedByWayOfDestructuringNameDeclaration() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines(
"function m1(obj) {", //
" let {p} = obj;",
" p.someProp = 1;",
"}",
"m1([]);",
"");
assertNoPureCalls(source);
}
@Test
public void testArgumentTaintedByWayOfNestedDestructuringNameDeclaration() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines(
"function m1(obj) {", //
" let {q: {p}} = obj;",
" p.someProp = 1;",
"}",
"m1({});",
"");
assertNoPureCalls(source);
}
@Test
public void testArgumentTaintedByWayOfDestructuringAssignment() {
ignoreWarnings(TypeCheck.POSSIBLE_INEXISTENT_PROPERTY);
String source =
lines(
"function m1(obj) {",
" let p;",
" ({p} = obj);",
" p.someProp = 1;",
"}",
"m1([]);",
"");
assertNoPureCalls(source);
}
@Test
public void testArgumentTaintedByWayOfArrayDestructuringAssignment() {
String source =
lines(
"function m1(obj) {",
" let p;",
" ([p] = obj);",
" p.someProp = 1;",
"}",
"m1([]);",
"");
assertNoPureCalls(source);
}
@Test
public void testDestructuringAssignMutatingGlobalState() {
String source =
lines(
"var a = 0;", //
"function m1() {",
" ([a] = []);",
"}",
"m1();");
assertNoPureCalls(source);
source =
lines(
"var a = 0;", //
"function m1() {",
" ({a} = {a: 0});",
"}",
"m1();");
assertNoPureCalls(source);
}
@Test
public void testDefaultValueInitializers_areConsidered_whenAnalyzingDestructuring() {
assertNoPureCalls(
lines(
"function impure() { throw 'something'; }", //
"",
"function foo() { const {a = impure()} = {a: undefined}; }",
"foo();"));
assertPureCallsMarked(
lines(
"function foo() { const {a = 0} = {a: undefined}; }", //
"foo();"),
ImmutableList.of("foo"));
assertNoPureCalls(
lines(
"function impure() { throw 'something'; }", //
"",
"function foo() { const [{a = impure()}] = [{a: undefined}]; }",
"foo();"));
}
@Test
public void testDefaultValueInitializers_areConsidered_whenAnalyzingFunctions() {
assertNoPureCalls(
lines(
"function impure() { throw 'something'; }", //
"",
"function foo(a = impure()) { }",
"foo();"));
assertPureCallsMarked(
lines(
"function pure() { }", //
"",
"function foo(a = pure()) { }",
"foo();"),
ImmutableList.of("pure", "foo"));
assertPureCallsMarked(
lines(
"function foo(a = 0) { }", //
"foo();"),
ImmutableList.of("foo"));
}
@Test
public void testFunctionProperties1() {
String source =
lines(
"/** @constructor */",
"function F() { this.bar; }",
"function g() {",
" this.bar = function() { alert(3); };",
"}",
"var x = new F();",
"g.call(x);",
"x.bar();");
assertPureCallsMarked(
source,
ImmutableList.of("F"),
compiler -> {
Node lastRoot = compiler.getRoot();
Node call = findQualifiedNameNode("g.call", lastRoot).getParent();
assertThat(call.getSideEffectFlags())
.isEqualTo(
new Node.SideEffectFlags().clearAllFlags().setMutatesArguments().valueOf());
});
}
@Test
public void testAwait_makesFunctionImpure() {
assertNoPureCalls(
lines(
"async function foo() { await 0; }", //
"foo();"));
}
@Test
public void testTaggedTemplatelit_propagatesCalleeSideEffects() {
assertPureCallsMarked(
lines(
"function tag(a) { throw 'something'; }", //
"",
"function foo() { tag`Hello World!`; }",
"foo();"),
ImmutableList.of(),
compiler -> {
Node lastRoot = compiler.getRoot();
Node tagDef = findQualifiedNameNode("tag", lastRoot).getParent();
Node fooDef = findQualifiedNameNode("foo", lastRoot).getParent();
assertThat(fooDef.getSideEffectFlags()).isEqualTo(tagDef.getSideEffectFlags());
});
}
@Test
public void testIterableIteration_forOf_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertNoPureCalls(
lines(
"function foo(a) { for (const t of a) { } }", //
"foo(x);"));
}
@Test
public void testIterableIteration_forAwaitOf_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertNoPureCalls(
lines(
"async function foo(a) { for await (const t of a) { } }", //
"foo(x);"));
}
@Test
public void testIterableIteration_arraySpread_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertNoPureCalls(
lines(
"function foo(a) { [...a]; }", //
"foo(x);"));
}
@Test
public void testIterableIteration_callSpread_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertPureCallsMarked(
lines(
"function pure(...rest) { }",
"",
"function foo(a) { pure(...a); }", //
"foo(x);"),
ImmutableList.of("pure"));
}
@Test
public void testIterableIteration_newSpread_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertPureCallsMarked(
lines(
"/** @constructor */",
"function pure(...rest) { }",
"",
"function foo(a) { new pure(...a); }", //
"foo(x);"),
ImmutableList.of("pure"));
}
@Test
public void testIterableIteration_paramListRest_leavesFunctionPure() {
assertPureCallsMarked(
lines(
"function foo(...a) { }", //
"foo();"),
ImmutableList.of("foo"));
}
@Test
public void testIterableIteration_arrayPatternRest_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertNoPureCalls(
lines(
"function foo(a) { const [...x] = a; }", //
"foo(x);"));
}
@Test
public void testIterableIteration_yieldStar_makesFunctionImpure() {
// TODO(b/127862986): We could consider iteration over a known Array value to be pure.
assertNoPureCalls(
lines(
"function* foo(a) { yield* a; }", //
"foo(x);"));
}
@Test
public void testObjectSpread_hasSideEffects() {
// Object-spread may trigger a getter.
assertNoPureCalls(
lines(
"function foo(a) { ({...a}); }", //
"foo(x);"));
}
@Test
public void testObjectRest_hasSideEffects() {
// Object-rest may trigger a getter.
assertNoPureCalls(
lines(
"function foo(a, b) { ({...b} = a); }", //
"foo(x, y);"));
assertNoPureCalls(
lines(
"function foo({...b}) { }", //
"foo(x);"));
}
@Test
public void testGetterAccess_hasSideEffects() {
assertNoPureCalls(
lines(
"class Foo { get getter() { } }",
"",
"function foo(a) { a.getter; }", //
"foo(x);"));
assertNoPureCalls(
lines(
"class Foo { get getter() { } }",
"",
"function foo(a) { const {getter} = a; }", //
"foo(x);"));
}
@Test
public void testSetterAccess_hasSideEffects() {
assertNoPureCalls(
lines(
"class Foo { set setter(x) { } }",
"",
"function foo(a) { a.setter = 0; }", //
"foo(x);"));
}
@Test
public void testForAwaitOf_makesFunctionImpure() {
assertNoPureCalls(
lines(
// We use an array-literal so that it's not just the iteration that's impure.
"async function foo() { for await (const t of []) { } }", //
"foo();"));
}
@Test
public void testExistenceOfAGetter_makesPropertyNameImpure() {
declareAccessor("foo", PropertyAccessKind.GETTER_ONLY);
// Imagine the getter returned a function.
assertNoPureCalls(
lines(
"class Foo {", //
" foo() {}",
"}",
"x.foo();"));
}
@Test
public void testExistenceOfASetter_makesPropertyNameImpure() {
declareAccessor("foo", PropertyAccessKind.SETTER_ONLY);
// This doesn't actually seem like a risk but it's hard to say, and other optimizations that use
// optimize calls would be dangerous on setters.
assertNoPureCalls(
lines(
"class Foo {", //
" foo() {}",
"}",
"x.foo();"));
}
@Test
public void testCallCache() {
String source =
lines("var valueFn = function() {};", "goog.reflect.cache(externObj, \"foo\", valueFn)");
assertPureCallsMarked(
source,
ImmutableList.of("goog.reflect.cache"),
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isTrue();
assertThat(call.mayMutateGlobalStateOrThrow()).isFalse();
});
}
@Test
public void testCallCache_withKeyFn() {
String source =
lines(
"var valueFn = function(v) { return v };",
"var keyFn = function(v) { return v };",
"goog.reflect.cache(externObj, \"foo\", valueFn, keyFn)");
assertPureCallsMarked(
source,
ImmutableList.of("goog.reflect.cache"),
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isTrue();
assertThat(call.mayMutateGlobalStateOrThrow()).isFalse();
});
}
@Test
public void testCallCache_anonymousFn() {
String source = "goog.reflect.cache(externObj, \"foo\", function(v) { return v })";
assertPureCallsMarked(
source,
ImmutableList.of("goog.reflect.cache"),
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isTrue();
assertThat(call.mayMutateGlobalStateOrThrow()).isFalse();
});
}
@Test
public void testCallCache_anonymousFn_hasSideEffects() {
String source =
lines(
"var x = 0;", "goog.reflect.cache(externObj, \"foo\", function(v) { return (x+=1) })");
assertNoPureCalls(
source,
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isFalse();
assertThat(call.mayMutateGlobalStateOrThrow()).isTrue();
});
}
@Test
public void testCallCache_hasSideEffects() {
String source =
lines(
"var x = 0;",
"var valueFn = function() { return (x+=1); };",
"goog.reflect.cache(externObj, \"foo\", valueFn)");
assertNoPureCalls(
source,
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isFalse();
assertThat(call.mayMutateGlobalStateOrThrow()).isTrue();
});
}
@Test
public void testCallCache_withKeyFn_hasSideEffects() {
String source =
lines(
"var x = 0;",
"var keyFn = function(v) { return (x+=1) };",
"var valueFn = function(v) { return v };",
"goog.reflect.cache(externObj, \"foo\", valueFn, keyFn)");
assertNoPureCalls(
source,
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node call = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(call.isNoSideEffectsCall()).isFalse();
assertThat(call.mayMutateGlobalStateOrThrow()).isTrue();
});
}
@Test
public void testCallCache_propagatesSideEffects() {
String source =
lines(
"var valueFn = function(x) { return x * 2; };",
"var helper = function(x) { return goog.reflect.cache(externObj, x, valueFn); };",
"helper(10);");
assertPureCallsMarked(
source,
ImmutableList.of("goog.reflect.cache", "helper"),
compiler -> {
Node lastRoot = compiler.getRoot().getLastChild();
Node cacheCall = findQualifiedNameNode("goog.reflect.cache", lastRoot).getParent();
assertThat(cacheCall.isNoSideEffectsCall()).isTrue();
assertThat(cacheCall.mayMutateGlobalStateOrThrow()).isFalse();
Node helperCall =
Iterables.getLast(findQualifiedNameNodes("helper", lastRoot)).getParent();
assertThat(helperCall.isNoSideEffectsCall()).isTrue();
assertThat(helperCall.mayMutateGlobalStateOrThrow()).isFalse();
});
}
@Test
public void testDynamicImport() {
ignoreWarnings(DiagnosticGroups.MODULE_LOAD);
assertNoPureCalls("import('./module.js')");
assertNoPureCalls("function doImport() { import('./module.js'); } doImport();");
}
@Test
public void testParenthesizedExpression() {
assertPureCallsMarked(
lines(
"const namespace = {};",
"namespace.noSideEffects = function(x) { return 1; };",
// NOTE: `IRFactory` will unwrap `(0, callee)(42)`, so we need to use a non-number
// to preserve the parentheses for the test.
"('', namespace.noSideEffects)(42);"),
ImmutableList.of("('', namespace.noSideEffects)"));
}
void assertCallableExpressionPure(boolean purity, String expression) {
expression = "(" + expression + ")";
String directInvocation = expression + "()";
String aliasInvocation = "var $testFn = " + expression + "; $testFn()";
if (purity) {
assertPureCallsMarked(directInvocation, ImmutableList.of(expression));
assertPureCallsMarked(aliasInvocation, ImmutableList.of("$testFn"));
} else {
assertNoPureCalls(directInvocation);
assertNoPureCalls(aliasInvocation);
}
}
void assertNoPureCalls(String source) {
assertPureCallsMarked(source, ImmutableList.of(), null);
}
void assertNoPureCalls(String source, Postcondition post) {
assertPureCallsMarked(source, ImmutableList.of(), post);
}
void assertPureCallsMarked(String source, List<String> expected) {
assertPureCallsMarked(source, expected, null);
}
void assertPureCallsMarked(String source, final List<String> expected, final Postcondition post) {
testSame(
srcs(source),
postcondition(
compiler -> {
assertThat(noSideEffectCalls)
.comparingElementsUsing(JSCompCorrespondences.EQUALITY_WHEN_PARSED_AS_EXPRESSION)
.containsExactlyElementsIn(expected);
if (post != null) {
post.verify(compiler);
}
}));
}
@Override
protected CompilerPass getProcessor(Compiler compiler) {
return new NoSideEffectCallEnumerator(compiler);
}
}
| monetate/closure-compiler | test/com/google/javascript/jscomp/PureFunctionIdentifierTest.java | Java | apache-2.0 | 96,908 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.jclouds.rackspace.cloudfiles.uk.blobstore.integration;
import org.jclouds.rackspace.cloudfiles.v1.blobstore.integration.CloudFilesBlobLiveTest;
import org.testng.annotations.Test;
@Test(groups = "live", testName = "CloudFilesUKBlobLiveTest")
public class CloudFilesUKBlobLiveTest extends CloudFilesBlobLiveTest {
public CloudFilesUKBlobLiveTest() {
provider = "rackspace-cloudfiles-uk";
}
}
| yanzhijun/jclouds-aliyun | providers/rackspace-cloudfiles-uk/src/test/java/org/jclouds/rackspace/cloudfiles/uk/blobstore/integration/CloudFilesUKBlobLiveTest.java | Java | apache-2.0 | 1,219 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.harmony.sql.tests.internal.rowset;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.sql.RowSet;
import javax.sql.rowset.FilteredRowSet;
import javax.sql.rowset.Predicate;
public class FilteredRowSetTest extends CachedRowSetTestCase {
public final static int EVALUATE_DEFAULT = 0;
public final static int EVALUATE_ROWSET = 1;
public final static int EVALUATE_INSERT = 2;
public void testCreateShared() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
FilteredRowSet copyFilteredRs = (FilteredRowSet) filteredRowSet
.createShared();
assertSame(range, copyFilteredRs.getFilter());
}
public void testCreateCopy() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
if ("true".equals(System.getProperty("Testing Harmony"))) {
filteredRowSet.createCopy();
} else {
try {
filteredRowSet.createCopy();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
}
public void testSetFilter() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
/*
* Set Filter: RangeOne
*/
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
filteredRowSet.beforeFirst();
int index = 0;
while (filteredRowSet.next()) {
index++;
assertTrue(filteredRowSet.getString(2).indexOf("test") != -1);
}
assertEquals(3, index);
assertSame(range, filteredRowSet.getFilter());
/*
* Set another Filter: RangeTwo
*/
range = new RangeTwo();
filteredRowSet.setFilter(range);
filteredRowSet.beforeFirst();
index = 0;
boolean isSecondRowFiltered = true;
while (filteredRowSet.next()) {
index++;
if ("test2".equals(filteredRowSet.getString(2))) {
isSecondRowFiltered = false;
}
}
assertEquals(3, index);
assertTrue(isSecondRowFiltered);
assertSame(range, filteredRowSet.getFilter());
/*
* Remove Filter
*/
filteredRowSet.setFilter(null);
filteredRowSet.beforeFirst();
index = 0;
while (filteredRowSet.next()) {
index++;
assertEquals(index, filteredRowSet.getInt(1));
}
assertEquals(4, index);
assertNull(filteredRowSet.getFilter());
}
public void testSetFilterOnFilteredRow() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
filteredRowSet.next();
assertEquals(1, filteredRowSet.getRow());
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
// not filtered
assertEquals(1, filteredRowSet.getRow());
assertEquals("hermit", filteredRowSet.getString(2));
filteredRowSet.updateString(2, "update");
assertEquals("update", filteredRowSet.getString(2));
filteredRowSet.next();
assertEquals(2, filteredRowSet.getRow());
assertEquals("test", filteredRowSet.getString(2));
filteredRowSet.previous();
assertTrue(filteredRowSet.isBeforeFirst());
try {
filteredRowSet.getString(2);
fail("should should SQLException");
} catch (SQLException e) {
// expected, Not a valid cursor
}
filteredRowSet.setFilter(null);
assertTrue(filteredRowSet.isBeforeFirst());
assertTrue(filteredRowSet.next());
assertEquals("update", filteredRowSet.getString(2));
filteredRowSet.setFilter(range);
assertEquals("update", filteredRowSet.getString(2));
filteredRowSet.updateString(2, "testUpdate");
filteredRowSet.next();
assertEquals(2, filteredRowSet.getRow());
assertEquals("test", filteredRowSet.getString(2));
filteredRowSet.previous();
assertEquals(1, filteredRowSet.getRow());
assertEquals("testUpdate", filteredRowSet.getString(2));
}
public void testPopulate() throws Exception {
/*
* Set Filter before populate()
*/
RangeOne range = new RangeOne();
FilteredRowSet filteredRowSet = newFilterRowSet();
filteredRowSet.setFilter(range);
assertSame(range, filteredRowSet.getFilter());
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
assertTrue(filteredRowSet.first());
assertEquals(2, filteredRowSet.getInt(1));
filteredRowSet.setFilter(null);
assertTrue(filteredRowSet.first());
assertEquals(1, filteredRowSet.getInt(1));
}
public void testAbsolute() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
/*
* When running on RI, filteredRowSet.absolute(1) is false here.
* However, the cursor moves to the first row already.
*/
if ("true".equals(System.getProperty("Testing Harmony"))) {
assertTrue(filteredRowSet.absolute(1));
} else {
assertFalse(filteredRowSet.absolute(1));
}
assertEquals("hermit", filteredRowSet.getString(2));
RangeOne range = new RangeOne();
filteredRowSet.setFilter(range);
/*
* When running on RI, filteredRowSet.absolute(1) is false.
*/
if ("true".equals(System.getProperty("Testing Harmony"))) {
assertTrue(filteredRowSet.absolute(1));
} else {
assertFalse(filteredRowSet.absolute(1));
}
assertEquals("test", filteredRowSet.getString(2));
range.clear();
assertTrue(filteredRowSet.absolute(2));
assertEquals(3, filteredRowSet.getRow());
assertEquals(3, filteredRowSet.getInt(1));
assertEquals(EVALUATE_ROWSET, range.getTag());
assertEquals(3, range.getCount());
range.clear();
assertTrue(filteredRowSet.absolute(2));
assertEquals(3, filteredRowSet.getInt(1));
assertEquals(EVALUATE_ROWSET, range.getTag());
assertEquals(3, range.getCount());
range.clear();
assertTrue(filteredRowSet.absolute(3));
assertEquals(4, filteredRowSet.getInt(1));
assertEquals(EVALUATE_ROWSET, range.getTag());
assertEquals(4, range.getCount());
assertFalse(filteredRowSet.absolute(4));
assertTrue(filteredRowSet.absolute(-2));
assertEquals(3, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.absolute(-3));
assertEquals(2, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.absolute(-4));
assertTrue(filteredRowSet.isBeforeFirst());
}
public void testRelative() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
assertTrue(filteredRowSet.absolute(3));
assertEquals(3, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.relative(2));
assertTrue(filteredRowSet.absolute(3));
assertEquals(3, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.relative(1));
assertEquals(4, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.absolute(3));
assertEquals(3, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.relative(-1));
assertEquals(2, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.relative(-2));
RangeOne range = new RangeOne();
filteredRowSet.setFilter(range);
filteredRowSet.beforeFirst();
assertTrue(filteredRowSet.relative(2));
assertEquals(3, filteredRowSet.getInt(1));
assertEquals(3, filteredRowSet.getRow());
assertFalse(filteredRowSet.relative(-2));
assertTrue(filteredRowSet.isBeforeFirst());
}
public void testCursorMove() throws Exception {
insertMoreData(30);
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
RangeThree range = new RangeThree();
filteredRowSet.setFilter(range);
assertTrue(filteredRowSet.first());
assertEquals("hermit", filteredRowSet.getString(2));
/*
* TODO It's really strange. When running on RI, filteredRowSet.first()
* is true. The cursor stays on the first row. However,
* filteredRowSet.absolute(1) is false. But the cursor still stays on
* the first row.
*/
if ("true".equals(System.getProperty("Testing Harmony"))) {
assertTrue(filteredRowSet.absolute(1));
} else {
assertFalse(filteredRowSet.absolute(1));
}
assertEquals("hermit", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(1));
assertEquals("test4", filteredRowSet.getString(2));
/*
* First call absolute(2), then call relative(-1), the cursor returns
* the first row.
*/
assertTrue(filteredRowSet.absolute(2));
assertEquals("test4", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(-1));
assertEquals("hermit", filteredRowSet.getString(2));
assertTrue(filteredRowSet.last());
assertEquals("test34", filteredRowSet.getString(2));
assertTrue(filteredRowSet.previous());
assertEquals("test32", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(-1));
assertEquals("test30", filteredRowSet.getString(2));
assertTrue(filteredRowSet.absolute(5));
assertEquals("test10", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(3));
assertEquals("test16", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(-3));
assertEquals("test10", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(4));
assertEquals("test18", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(13));
assertEquals("test34", filteredRowSet.getString(2));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
assertTrue(filteredRowSet.absolute(22));
assertEquals("test34", filteredRowSet.getString(2));
assertTrue(filteredRowSet.relative(-21));
assertEquals("hermit", filteredRowSet.getString(2));
assertFalse(filteredRowSet.relative(-1));
assertTrue(filteredRowSet.isBeforeFirst());
}
public void testNextAndPrevious() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
RangeOne range = new RangeOne();
filteredRowSet.setFilter(range);
assertTrue(filteredRowSet.next());
assertEquals(2, filteredRowSet.getInt(1));
assertEquals(EVALUATE_ROWSET, range.getTag());
assertEquals(2, range.getCount());
range.clear();
assertTrue(filteredRowSet.next());
assertEquals(3, filteredRowSet.getInt(1));
assertEquals(EVALUATE_ROWSET, range.getTag());
assertEquals(1, range.getCount());
range.clear();
assertTrue(filteredRowSet.previous());
assertEquals(2, filteredRowSet.getInt(1));
assertEquals(1, range.getCount());
range.clear();
assertFalse(filteredRowSet.previous());
assertEquals(EVALUATE_ROWSET, range.getTag());
}
public void testNoFilter_Insert() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
/*
* TODO Call updateXXX() would throw NullPointerException on insert row
* when running on RI.
*/
filteredRowSet.moveToInsertRow();
if ("true".equals(System.getProperty("Testing Harmony"))) {
filteredRowSet.updateInt(1, 10);
filteredRowSet.updateString(2, "insert10");
filteredRowSet.insertRow();
} else {
try {
filteredRowSet.updateInt(1, 10);
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
try {
filteredRowSet.updateString(2, "insert10");
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
try {
filteredRowSet.insertRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
filteredRowSet.moveToCurrentRow();
}
public void testFilter_Insert() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
/*
* Insert a row. when call updateXXX(), evaluate(Object value, int
* column) is called to check first.
*/
filteredRowSet.afterLast();
filteredRowSet.moveToInsertRow();
filteredRowSet.updateInt(1, 200);
try {
filteredRowSet.updateString("NAME", "test200");
fail("should throw SQLException");
} catch (SQLException e) {
filteredRowSet.updateString("NAME", "insert200");
}
filteredRowSet.insertRow();
filteredRowSet.moveToCurrentRow();
/*
* Although the new row is inserted, it is invalid through
* evaluate(RowSet rs). Therefore, the inserted row is not visible.
*/
filteredRowSet.beforeFirst();
int index = 0;
while (filteredRowSet.next()) {
index++;
assertEquals(index + 1, filteredRowSet.getInt(1));
}
assertEquals(3, index);
/*
* Remove filter. See the inserted row. Then set again, and commit to
* database.
*/
filteredRowSet.setFilter(null);
assertTrue(filteredRowSet.last());
assertEquals(200, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.rowInserted());
filteredRowSet.setFilter(range);
filteredRowSet.acceptChanges(conn);
// check database: the inserted row isn't commited to database
rs = st.executeQuery("SELECT * FROM USER_INFO");
index = 0;
while (rs.next()) {
index++;
assertEquals(index, rs.getInt(1));
}
assertEquals(4, index);
/*
* Remove filter
*/
filteredRowSet.setFilter(null);
filteredRowSet.beforeFirst();
index = 0;
while (filteredRowSet.next()) {
index++;
if (index == 5) {
/*
* Though the new row isn't inserted into database, the inserted
* row lost it's status after acceptChanges().
*/
assertEquals(200, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.rowInserted());
} else {
assertEquals(index, filteredRowSet.getInt(1));
}
}
assertEquals(5, index);
}
public void testFilter_Update() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
/*
* Update the third row. Filter has no effect here.
*/
assertTrue(filteredRowSet.last());
assertEquals("test4", filteredRowSet.getString(2));
filteredRowSet.updateString(2, "update4");
filteredRowSet.updateRow();
assertEquals("update4", filteredRowSet.getString(2));
// the updated row becomes not visible through filter
assertTrue(filteredRowSet.last());
assertEquals("test3", filteredRowSet.getString(2));
// commit to database
filteredRowSet.acceptChanges(conn);
rs = st
.executeQuery("SELECT COUNT(*) FROM USER_INFO WHERE NAME = 'update4'");
assertTrue(rs.next());
assertEquals(0, rs.getInt(1));
/*
* Remove filter
*/
filteredRowSet.setFilter(null);
assertTrue(filteredRowSet.last());
assertEquals("update4", filteredRowSet.getString(2));
/*
* The forth row isn't updated to database, and it lost it's status
* after acceptChanges().
*/
assertFalse(filteredRowSet.rowUpdated());
}
public void testFilter_Delete() throws Exception {
FilteredRowSet filteredRowSet = newFilterRowSet();
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet.populate(rs);
/*
* Mark the first row as delete.
*/
assertTrue(filteredRowSet.first());
assertEquals(1, filteredRowSet.getInt(1));
filteredRowSet.deleteRow();
Predicate range = new RangeOne();
filteredRowSet.setFilter(range);
assertTrue(filteredRowSet.first());
assertEquals(2, filteredRowSet.getInt(1));
filteredRowSet.acceptChanges(conn);
rs = st.executeQuery("SELECT COUNT(*) FROM USER_INFO WHERE ID = 1");
assertTrue(rs.next());
assertEquals(1, rs.getInt(1));
/*
* Remove filter
*/
filteredRowSet.setFilter(null);
filteredRowSet.acceptChanges(conn);
rs = st.executeQuery("SELECT COUNT(*) FROM USER_INFO WHERE ID = 1");
assertTrue(rs.next());
assertEquals(1, rs.getInt(1));
/*
* The first row has been deleted from FilteredRowSet. However, it isn't
* deleted from database.
*/
filteredRowSet.setShowDeleted(true);
assertTrue(filteredRowSet.first());
assertEquals(2, filteredRowSet.getInt(1));
}
public void testPaging() throws Exception {
insertMoreData(4);
FilteredRowSet filteredRowSet = newFilterRowSet();
filteredRowSet.setCommand("select * from USER_INFO");
filteredRowSet.setUrl(DERBY_URL);
filteredRowSet.setPageSize(3);
filteredRowSet.execute();
Predicate filter = new OddRowFilter();
filteredRowSet.setFilter(filter);
assertEquals("select * from USER_INFO", filteredRowSet.getCommand());
assertFalse(filteredRowSet.previousPage());
assertTrue(filteredRowSet.next());
assertEquals(1, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(3, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
if (!"true".equals(System.getProperty("Testing Harmony"))) {
// RI need nextPage one more time
assertTrue(filteredRowSet.nextPage());
}
int index = 5;
while (filteredRowSet.nextPage()) {
while (filteredRowSet.next()) {
assertEquals(index, filteredRowSet.getInt(1));
index += 2;
}
}
assertEquals(9, index);
filteredRowSet = newFilterRowSet();
filteredRowSet.setCommand("select * from USER_INFO");
filteredRowSet.setUrl(DERBY_URL);
filteredRowSet.setPageSize(3);
filteredRowSet.execute();
filteredRowSet.setFilter(filter);
assertTrue(filteredRowSet.next());
assertEquals(1, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.nextPage());
if (!"true".equals(System.getProperty("Testing Harmony"))) {
// RI need nextPage one more time
assertTrue(filteredRowSet.nextPage());
}
assertTrue(filteredRowSet.next());
assertEquals(5, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.nextPage());
assertTrue(filteredRowSet.next());
assertEquals(7, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.nextPage());
}
public void testPagingInMemory() throws Exception {
insertMoreData(10);
FilteredRowSet filteredRowSet = newFilterRowSet();
st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery("SELECT * FROM USER_INFO");
// the max rows load into memory
filteredRowSet.setMaxRows(5);
filteredRowSet.setPageSize(3);
filteredRowSet.populate(rs, 1);
OddRowFilter filter = new OddRowFilter();
filteredRowSet.setFilter(filter);
if (!"true".equals(System.getProperty("Testing Harmony"))) {
// RI need nextPage one more time
assertTrue(filteredRowSet.nextPage());
}
assertTrue(filteredRowSet.next());
assertEquals(1, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(3, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
assertTrue(filteredRowSet.nextPage());
filteredRowSet.beforeFirst();
assertTrue(filteredRowSet.next());
assertEquals(5, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
assertFalse(filteredRowSet.nextPage());
st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rs = st.executeQuery("SELECT * FROM USER_INFO");
filteredRowSet = newFilterRowSet();
filteredRowSet.setFilter(filter);
filteredRowSet.setPageSize(3);
filteredRowSet.populate(rs, 1);
if (!"true".equals(System.getProperty("Testing Harmony"))) {
// RI need nextPage one more time
assertTrue(filteredRowSet.nextPage());
}
assertTrue(filteredRowSet.next());
assertEquals(1, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(3, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
filteredRowSet.setPageSize(2);
assertTrue(filteredRowSet.nextPage());
assertTrue(filteredRowSet.isBeforeFirst());
assertTrue(filteredRowSet.next());
assertEquals(5, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
filteredRowSet.setPageSize(5);
assertTrue(filteredRowSet.nextPage());
assertTrue(filteredRowSet.isBeforeFirst());
assertTrue(filteredRowSet.next());
assertEquals(7, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(9, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
assertTrue(filteredRowSet.previousPage());
assertTrue(filteredRowSet.isBeforeFirst());
assertTrue(filteredRowSet.next());
assertEquals(1, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(3, filteredRowSet.getInt(1));
assertTrue(filteredRowSet.next());
assertEquals(5, filteredRowSet.getInt(1));
assertFalse(filteredRowSet.next());
assertTrue(filteredRowSet.isAfterLast());
assertFalse(filteredRowSet.previousPage());
}
protected FilteredRowSet newFilterRowSet() throws Exception {
try {
return (FilteredRowSet) Class.forName(
"com.sun.rowset.FilteredRowSetImpl").newInstance();
} catch (ClassNotFoundException e) {
return (FilteredRowSet) Class
.forName(
"org.apache.harmony.sql.internal.rowset.FilteredRowSetImpl")
.newInstance();
}
}
}
class RangeOne implements Predicate, Cloneable {
private boolean isPrint;
private int tag;
private int count;
public void setPrint(boolean isPrint) {
this.isPrint = isPrint;
}
public int getTag() {
return tag;
}
public int getCount() {
return count;
}
public void clear() {
tag = FilteredRowSetTest.EVALUATE_DEFAULT;
count = 0;
}
public boolean evaluate(RowSet rs) {
tag = FilteredRowSetTest.EVALUATE_ROWSET;
count++;
if (isPrint) {
System.out.println("RangeOne.evaluate(RowSet rs)");
}
try {
if (rs.getString(2).indexOf("test") != -1) {
return true;
}
} catch (SQLException e) {
// e.printStackTrace();
}
return false;
}
public boolean evaluate(Object value, int column) throws SQLException {
/*
* This method is internally called by FilteredRowSet while inserting
* new rows.
*/
tag = FilteredRowSetTest.EVALUATE_INSERT;
count++;
if (column == 2) {
return value.toString().indexOf("insert") != -1;
}
return true;
}
public boolean evaluate(Object value, String columnName)
throws SQLException {
/*
* This method is internally called by FilteredRowSet while inserting
* new rows. However, even the second parameter is columnName,
* FilteredRowSet still calls evaluate(Object value, int column).
*/
tag = FilteredRowSetTest.EVALUATE_INSERT;
count++;
return false;
}
public RangeOne clone() throws CloneNotSupportedException {
return (RangeOne) super.clone();
}
}
class RangeTwo implements Predicate {
public boolean evaluate(RowSet rs) {
try {
if (rs.getInt(1) > 2 || "hermit".equals(rs.getString(2))) {
return true;
}
} catch (SQLException e) {
// e.printStackTrace();
}
return false;
}
public boolean evaluate(Object value, int column) throws SQLException {
return false;
}
public boolean evaluate(Object value, String columnName)
throws SQLException {
return false;
}
}
class RangeThree implements Predicate {
public boolean evaluate(RowSet rs) {
try {
String name = rs.getString(2);
if ("hermit".equals(name) || name.indexOf("2") != -1
|| name.indexOf("4") != -1 || name.indexOf("6") != -1
|| name.indexOf("8") != -1 || name.indexOf("0") != -1) {
return true;
}
} catch (SQLException e) {
// do nothing
}
return false;
}
public boolean evaluate(Object value, int column) throws SQLException {
return false;
}
public boolean evaluate(Object value, String columnName)
throws SQLException {
return false;
}
}
class OddRowFilter implements Predicate {
public boolean evaluate(RowSet rs) {
try {
return (rs.getInt(1) & 1) == 1;
} catch (SQLException e) {
// do nothing
}
return false;
}
public boolean evaluate(Object value, int column) throws SQLException {
return false;
}
public boolean evaluate(Object value, String columnName)
throws SQLException {
return false;
}
}
| freeVM/freeVM | enhanced/java/classlib/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/FilteredRowSetTest.java | Java | apache-2.0 | 29,556 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
package org.apache.camel.component.solr;
import java.util.Map;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.impl.StreamingUpdateSolrServer;
/**
* Represents a Solr endpoint.
*/
public class SolrEndpoint extends DefaultEndpoint {
private CommonsHttpSolrServer solrServer;
private CommonsHttpSolrServer streamingSolrServer;
private String requestHandler;
private int streamingThreadCount;
private int streamingQueueSize;
public SolrEndpoint(String endpointUri, SolrComponent component, String address, Map<String, Object> parameters) throws Exception {
super(endpointUri, component);
solrServer = new CommonsHttpSolrServer("http://" + address);
streamingQueueSize = getIntFromString((String) parameters.get(SolrConstants.PARAM_STREAMING_QUEUE_SIZE), SolrConstants.DEFUALT_STREAMING_QUEUE_SIZE);
streamingThreadCount = getIntFromString((String) parameters.get(SolrConstants.PARAM_STREAMING_THREAD_COUNT), SolrConstants.DEFAULT_STREAMING_THREAD_COUNT);
streamingSolrServer = new StreamingUpdateSolrServer("http://" + address, streamingQueueSize, streamingThreadCount);
}
public static int getIntFromString(String value, int defaultValue) {
if (value != null && value.length() > 0) {
return Integer.parseInt(value);
}
return defaultValue;
}
@Override
public Producer createProducer() throws Exception {
return new SolrProducer(this);
}
@Override
public Consumer createConsumer(Processor processor) throws Exception {
throw new UnsupportedOperationException("Consumer not supported for Solr endpoint.");
}
@Override
public boolean isSingleton() {
return true;
}
public CommonsHttpSolrServer getSolrServer() {
return solrServer;
}
public CommonsHttpSolrServer getStreamingSolrServer() {
return streamingSolrServer;
}
public void setStreamingSolrServer(CommonsHttpSolrServer streamingSolrServer) {
this.streamingSolrServer = streamingSolrServer;
}
public void setMaxRetries(int maxRetries) {
solrServer.setMaxRetries(maxRetries);
streamingSolrServer.setMaxRetries(maxRetries);
}
public void setSoTimeout(int soTimeout) {
solrServer.setSoTimeout(soTimeout);
streamingSolrServer.setSoTimeout(soTimeout);
}
public void setConnectionTimeout(int connectionTimeout) {
solrServer.setConnectionTimeout(connectionTimeout);
streamingSolrServer.setConnectionTimeout(connectionTimeout);
}
public void setDefaultMaxConnectionsPerHost(int defaultMaxConnectionsPerHost) {
solrServer.setDefaultMaxConnectionsPerHost(defaultMaxConnectionsPerHost);
streamingSolrServer.setDefaultMaxConnectionsPerHost(defaultMaxConnectionsPerHost);
}
public void setMaxTotalConnections(int maxTotalConnections) {
solrServer.setMaxTotalConnections(maxTotalConnections);
streamingSolrServer.setMaxTotalConnections(maxTotalConnections);
}
public void setFollowRedirects(boolean followRedirects) {
solrServer.setFollowRedirects(followRedirects);
streamingSolrServer.setFollowRedirects(followRedirects);
}
public void setAllowCompression(boolean allowCompression) {
solrServer.setAllowCompression(allowCompression);
streamingSolrServer.setAllowCompression(allowCompression);
}
public void setRequestHandler(String requestHandler) {
this.requestHandler = requestHandler;
}
public String getRequestHandler() {
return requestHandler;
}
public int getStreamingThreadCount() {
return streamingThreadCount;
}
public void setStreamingThreadCount(int streamingThreadCount) {
this.streamingThreadCount = streamingThreadCount;
}
public int getStreamingQueueSize() {
return streamingQueueSize;
}
public void setStreamingQueueSize(int streamingQueueSize) {
this.streamingQueueSize = streamingQueueSize;
}
}
| engagepoint/camel | components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrEndpoint.java | Java | apache-2.0 | 5,066 |
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
hosts.each do |host|
# Install Puppet
install_puppet
end
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(:source => proj_root, :module_name => 'softwarecollectionsorg')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
end
end
end
| gregswift/puppet-softwarecollectionsorg | spec/spec_helper_acceptance.rb | Ruby | apache-2.0 | 644 |
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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.
*/
package org.jetbrains.idea.devkit.inspections;
import com.intellij.ExtensionPoints;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemHighlightType;
import com.intellij.diagnostic.ITNReporter;
import com.intellij.ide.plugins.IdeaPluginDescriptorImpl;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.ide.plugins.PluginManagerMain;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlAttributeValue;
import com.intellij.psi.xml.XmlFile;
import com.intellij.psi.xml.XmlTag;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.xml.*;
import com.intellij.util.xml.highlighting.*;
import com.intellij.util.xml.reflect.DomAttributeChildDescription;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.idea.devkit.dom.*;
import org.jetbrains.idea.devkit.util.PsiUtil;
import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author mike
*/
public class PluginXmlDomInspection extends BasicDomElementsInspection<IdeaPlugin> {
private static final Logger LOG = Logger.getInstance(PluginXmlDomInspection.class);
public PluginXmlDomInspection() {
super(IdeaPlugin.class);
}
@NotNull
public String getShortName() {
return "PluginXmlValidity";
}
@Override
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
super.checkDomElement(element, holder, helper);
if (element instanceof IdeaPlugin) {
checkJetBrainsPlugin((IdeaPlugin)element, holder);
}
else if (element instanceof Extension) {
annotateExtension((Extension)element, holder);
}
else if (element instanceof Vendor) {
annotateVendor((Vendor)element, holder);
}
else if (element instanceof IdeaVersion) {
annotateIdeaVersion((IdeaVersion)element, holder);
}
else if (element instanceof Extensions) {
annotateExtensions((Extensions)element, holder);
}
else if (element instanceof AddToGroup) {
annotateAddToGroup((AddToGroup)element, holder);
}
else if (element instanceof Action) {
annotateAction((Action)element, holder);
}
else if (element instanceof Group) {
annotateGroup((Group)element, holder);
}
}
private static void checkJetBrainsPlugin(IdeaPlugin ideaPlugin, DomElementAnnotationHolder holder) {
final Module module = ideaPlugin.getModule();
if (module == null) return;
if (!PsiUtil.isIdeaProject(module.getProject())) return;
String pluginId = ideaPlugin.getPluginId();
if (pluginId == null || pluginId.equals(PluginManagerCore.CORE_PLUGIN_ID)) return;
XmlTag xmlTag = ideaPlugin.getXmlTag();
if (xmlTag == null) return;
VirtualFile virtualFile = xmlTag.getContainingFile().getVirtualFile();
if (virtualFile == null ||
!ModuleRootManager.getInstance(module).getFileIndex().isUnderSourceRootOfType(virtualFile, JavaModuleSourceRootTypes.PRODUCTION)) {
return;
}
final Vendor vendor = ContainerUtil.getFirstItem(ideaPlugin.getVendors());
if (vendor == null) {
holder.createProblem(DomUtil.getFileElement(ideaPlugin),
"Plugin developed as a part of IntelliJ IDEA project should specify 'JetBrains' as its vendor",
new SpecifyJetBrainsAsVendorQuickFix());
}
else if (!PluginManagerMain.isDevelopedByJetBrains(vendor.getValue())) {
holder.createProblem(vendor, "Plugin developed as a part of IntelliJ IDEA project should include 'JetBrains' as one of its vendors");
}
}
private static void annotateExtensions(Extensions extensions, DomElementAnnotationHolder holder) {
final GenericAttributeValue<IdeaPlugin> xmlnsAttribute = extensions.getXmlns();
if (DomUtil.hasXml(xmlnsAttribute)) {
holder.createProblem(xmlnsAttribute,
ProblemHighlightType.LIKE_DEPRECATED,
"Use defaultExtensionNs instead", null).highlightWholeElement();
return;
}
if (!DomUtil.hasXml(extensions.getDefaultExtensionNs())) {
holder.createProblem(extensions, ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
"Specify defaultExtensionNs=\"" + Extensions.DEFAULT_PREFIX + "\" explicitly", null,
new AddDomElementQuickFix<GenericAttributeValue>(extensions.getDefaultExtensionNs()) {
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
super.applyFix(project, descriptor);
myElement.setStringValue(Extensions.DEFAULT_PREFIX);
}
});
}
}
private static void annotateIdeaVersion(IdeaVersion ideaVersion, DomElementAnnotationHolder holder) {
highlightNotUsedAnymore(ideaVersion.getMin(), holder);
highlightNotUsedAnymore(ideaVersion.getMax(), holder);
highlightUntilBuild(ideaVersion, holder);
}
private static void highlightUntilBuild(IdeaVersion ideaVersion, DomElementAnnotationHolder holder) {
String untilBuild = ideaVersion.getUntilBuild().getStringValue();
if (untilBuild != null && isStarSupported(ideaVersion.getSinceBuild().getStringValue())) {
Matcher matcher = IdeaPluginDescriptorImpl.EXPLICIT_BIG_NUMBER_PATTERN.matcher(untilBuild);
if (matcher.matches()) {
holder.createProblem(ideaVersion.getUntilBuild(), "Don't use '" + matcher.group(2) + "' in 'until-build', use '*' instead",
new CorrectUntilBuildAttributeFix(IdeaPluginDescriptorImpl.convertExplicitBigNumberInUntilBuildToStar(untilBuild)));
}
if (untilBuild.matches("\\d+")) {
int branch = Integer.parseInt(untilBuild);
String corrected = (branch - 1) + ".*";
String message = "Plain numbers in 'until-build' attribute may be misleading. '" + untilBuild + "' means the same as '" + untilBuild
+ ".0', so the plugin won't be compatible with " + untilBuild + ".* builds. It's better to specify '" + corrected + "' instead.";
holder.createProblem(ideaVersion.getUntilBuild(), message, new CorrectUntilBuildAttributeFix(corrected));
}
}
}
private static final Pattern BASE_LINE_EXTRACTOR = Pattern.compile("(?:\\p{javaLetter}+-)?(\\d+)(?:\\..*)?");
private static final int FIRST_BRANCH_SUPPORTING_STAR = 131;
private static boolean isStarSupported(String buildNumber) {
if (buildNumber == null) return false;
Matcher matcher = BASE_LINE_EXTRACTOR.matcher(buildNumber);
if (matcher.matches()) {
int branch = Integer.parseInt(matcher.group(1));
return branch >= FIRST_BRANCH_SUPPORTING_STAR;
}
return false;
}
private static void annotateExtension(Extension extension, DomElementAnnotationHolder holder) {
final ExtensionPoint extensionPoint = extension.getExtensionPoint();
if (extensionPoint == null) return;
final GenericAttributeValue<PsiClass> interfaceAttribute = extensionPoint.getInterface();
if (DomUtil.hasXml(interfaceAttribute)) {
final PsiClass value = interfaceAttribute.getValue();
if (value != null && value.isDeprecated()) {
holder.createProblem(extension, ProblemHighlightType.LIKE_DEPRECATED,
"Deprecated EP '" + extensionPoint.getEffectiveQualifiedName() + "'", null);
return;
}
}
if (ExtensionPoints.ERROR_HANDLER.equals(extensionPoint.getEffectiveQualifiedName()) && extension.exists()) {
String implementation = extension.getXmlTag().getAttributeValue("implementation");
if (ITNReporter.class.getName().equals(implementation)) {
IdeaPlugin plugin = extension.getParentOfType(IdeaPlugin.class, true);
if (plugin != null) {
Vendor vendor = ContainerUtil.getFirstItem(plugin.getVendors());
if (vendor != null && PluginManagerMain.isDevelopedByJetBrains(vendor.getValue())) {
LocalQuickFix fix = new RemoveDomElementQuickFix(extension);
holder.createProblem(extension, ProblemHighlightType.LIKE_UNUSED_SYMBOL,
"Exceptions from plugins developed by JetBrains are reported via ITNReporter automatically," +
" there is no need to specify it explicitly",
null, fix).highlightWholeElement();
}
}
}
}
final List<? extends DomAttributeChildDescription> descriptions = extension.getGenericInfo().getAttributeChildrenDescriptions();
for (DomAttributeChildDescription attributeDescription : descriptions) {
final GenericAttributeValue attributeValue = attributeDescription.getDomAttributeValue(extension);
if (attributeValue == null || !DomUtil.hasXml(attributeValue)) continue;
// IconsReferencesContributor
if ("icon".equals(attributeDescription.getXmlElementName())) {
annotateResolveProblems(holder, attributeValue);
}
final PsiElement declaration = attributeDescription.getDeclaration(extension.getManager().getProject());
if (declaration instanceof PsiField) {
PsiField psiField = (PsiField)declaration;
if (psiField.isDeprecated()) {
holder.createProblem(attributeValue, ProblemHighlightType.LIKE_DEPRECATED,
"Deprecated attribute '" + attributeDescription.getName() + "'",
null)
.highlightWholeElement();
}
}
}
}
private static void annotateVendor(Vendor vendor, DomElementAnnotationHolder holder) {
highlightNotUsedAnymore(vendor.getLogo(), holder);
}
private static void highlightNotUsedAnymore(GenericAttributeValue attributeValue,
DomElementAnnotationHolder holder) {
if (!DomUtil.hasXml(attributeValue)) return;
holder.createProblem(attributeValue,
ProblemHighlightType.LIKE_DEPRECATED,
"Attribute '" + attributeValue.getXmlElementName() + "' not used anymore",
null, new RemoveDomElementQuickFix(attributeValue))
.highlightWholeElement();
}
private static void annotateAddToGroup(AddToGroup addToGroup, DomElementAnnotationHolder holder) {
if (!DomUtil.hasXml(addToGroup.getRelativeToAction())) return;
if (!DomUtil.hasXml(addToGroup.getAnchor())) {
holder.createProblem(addToGroup, "'anchor' must be specified with 'relative-to-action'",
new AddDomElementQuickFix<GenericAttributeValue>(addToGroup.getAnchor()));
return;
}
final Anchor value = addToGroup.getAnchor().getValue();
if (value == Anchor.after || value == Anchor.before) {
return;
}
holder.createProblem(addToGroup.getAnchor(), "Must use '" + Anchor.after + "'|'" + Anchor.before + "' with 'relative-to-action'");
}
private static void annotateGroup(Group group, DomElementAnnotationHolder holder) {
final GenericAttributeValue<String> iconAttribute = group.getIcon();
if (DomUtil.hasXml(iconAttribute)) {
annotateResolveProblems(holder, iconAttribute);
}
}
private static void annotateAction(Action action, DomElementAnnotationHolder holder) {
final GenericAttributeValue<String> iconAttribute = action.getIcon();
if (DomUtil.hasXml(iconAttribute)) {
annotateResolveProblems(holder, iconAttribute);
}
}
private static void annotateResolveProblems(DomElementAnnotationHolder holder, GenericAttributeValue attributeValue) {
final XmlAttributeValue value = attributeValue.getXmlAttributeValue();
if (value != null) {
for (PsiReference reference : value.getReferences()) {
if (reference.resolve() == null) {
holder.createResolveProblem(attributeValue, reference);
}
}
}
}
private static class CorrectUntilBuildAttributeFix implements LocalQuickFix {
private final String myCorrectValue;
public CorrectUntilBuildAttributeFix(String correctValue) {
myCorrectValue = correctValue;
}
@Nls
@NotNull
@Override
public String getName() {
return "Change 'until-build' to '" + myCorrectValue + "'";
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return "Correct 'until-build' attribute";
}
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
final XmlAttribute attribute = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), XmlAttribute.class, false);
//noinspection unchecked
final GenericAttributeValue<String> domElement = DomManager.getDomManager(project).getDomElement(attribute);
LOG.assertTrue(domElement != null);
domElement.setStringValue(myCorrectValue);
}
}
private static class SpecifyJetBrainsAsVendorQuickFix implements LocalQuickFix {
@Nls
@NotNull
@Override
public String getFamilyName() {
return "Specify JetBrains as vendor";
}
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
PsiFile file = descriptor.getPsiElement().getContainingFile();
DomFileElement<IdeaPlugin> fileElement = DomManager.getDomManager(project).getFileElement((XmlFile)file, IdeaPlugin.class);
if (fileElement != null) {
IdeaPlugin root = fileElement.getRootElement();
XmlTag after = getLastSubTag(root, root.getId(), ContainerUtil.getLastItem(root.getDescriptions()),
ContainerUtil.getLastItem(root.getVersions()), root.getName());
XmlTag rootTag = root.getXmlTag();
XmlTag vendorTag = rootTag.createChildTag("vendor", rootTag.getNamespace(), PluginManagerMain.JETBRAINS_VENDOR, false);
if (after == null) {
rootTag.addSubTag(vendorTag, true);
}
else {
rootTag.addAfter(vendorTag, after);
}
}
}
private static XmlTag getLastSubTag(IdeaPlugin root, DomElement... children) {
Set<XmlTag> childrenTags = new HashSet<>();
for (DomElement child : children) {
if (child != null) {
childrenTags.add(child.getXmlTag());
}
}
XmlTag[] subTags = root.getXmlTag().getSubTags();
for (int i = subTags.length - 1; i >= 0; i--) {
if (childrenTags.contains(subTags[i])) {
return subTags[i];
}
}
return null;
}
}
}
| fitermay/intellij-community | plugins/devkit/src/inspections/PluginXmlDomInspection.java | Java | apache-2.0 | 15,763 |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#include <aws/logs/model/PutMetricFilterRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::CloudWatchLogs::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
PutMetricFilterRequest::PutMetricFilterRequest() :
m_logGroupNameHasBeenSet(false),
m_filterNameHasBeenSet(false),
m_filterPatternHasBeenSet(false),
m_metricTransformationsHasBeenSet(false)
{
}
Aws::String PutMetricFilterRequest::SerializePayload() const
{
JsonValue payload;
if(m_logGroupNameHasBeenSet)
{
payload.WithString("logGroupName", m_logGroupName);
}
if(m_filterNameHasBeenSet)
{
payload.WithString("filterName", m_filterName);
}
if(m_filterPatternHasBeenSet)
{
payload.WithString("filterPattern", m_filterPattern);
}
if(m_metricTransformationsHasBeenSet)
{
Array<JsonValue> metricTransformationsJsonList(m_metricTransformations.size());
for(unsigned metricTransformationsIndex = 0; metricTransformationsIndex < metricTransformationsJsonList.GetLength(); ++metricTransformationsIndex)
{
metricTransformationsJsonList[metricTransformationsIndex].AsObject(m_metricTransformations[metricTransformationsIndex].Jsonize());
}
payload.WithArray("metricTransformations", std::move(metricTransformationsJsonList));
}
return payload.WriteReadable();
}
Aws::Http::HeaderValueCollection PutMetricFilterRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Logs_20140328.PutMetricFilter"));
return headers;
}
| chiaming0914/awe-cpp-sdk | aws-cpp-sdk-logs/source/model/PutMetricFilterRequest.cpp | C++ | apache-2.0 | 2,197 |
<?php
final class DiffusionCommentView extends AphrontView {
private $comment;
private $commentNumber;
private $handles;
private $isPreview;
private $pathMap;
private $inlineComments;
private $markupEngine;
public function setComment(PhabricatorAuditComment $comment) {
$this->comment = $comment;
return $this;
}
public function setCommentNumber($comment_number) {
$this->commentNumber = $comment_number;
return $this;
}
public function setHandles(array $handles) {
assert_instances_of($handles, 'PhabricatorObjectHandle');
$this->handles = $handles;
return $this;
}
public function setIsPreview($is_preview) {
$this->isPreview = $is_preview;
return $this;
}
public function setInlineComments(array $inline_comments) {
assert_instances_of($inline_comments, 'PhabricatorInlineCommentInterface');
$this->inlineComments = $inline_comments;
return $this;
}
public function setPathMap(array $path_map) {
$this->pathMap = $path_map;
return $this;
}
public function setMarkupEngine(PhabricatorMarkupEngine $markup_engine) {
$this->markupEngine = $markup_engine;
return $this;
}
public function getMarkupEngine() {
return $this->markupEngine;
}
public function getRequiredHandlePHIDs() {
return array($this->comment->getActorPHID());
}
private function getHandle($phid) {
if (empty($this->handles[$phid])) {
throw new Exception("Unloaded handle '{$phid}'!");
}
return $this->handles[$phid];
}
public function render() {
$comment = $this->comment;
$author = $this->getHandle($comment->getActorPHID());
$author_link = $author->renderLink();
$actions = $this->renderActions();
$content = $this->renderContent();
$classes = $this->renderClasses();
$xaction_view = id(new PhabricatorTransactionView())
->setUser($this->user)
->setImageURI($author->getImageURI())
->setActions($actions)
->appendChild($content);
if ($this->isPreview) {
$xaction_view->setIsPreview(true);
} else {
$xaction_view
->setAnchor('comment-'.$this->commentNumber, '#'.$this->commentNumber)
->setEpoch($comment->getDateCreated());
}
foreach ($classes as $class) {
$xaction_view->addClass($class);
}
return $xaction_view->render();
}
private function renderActions() {
$comment = $this->comment;
$author = $this->getHandle($comment->getActorPHID());
$author_link = $author->renderLink();
$action = $comment->getAction();
$verb = PhabricatorAuditActionConstants::getActionPastTenseVerb($action);
$metadata = $comment->getMetadata();
$added_auditors = idx(
$metadata,
PhabricatorAuditComment::METADATA_ADDED_AUDITORS,
array());
$added_ccs = idx(
$metadata,
PhabricatorAuditComment::METADATA_ADDED_CCS,
array());
$actions = array();
if ($action == PhabricatorAuditActionConstants::ADD_CCS) {
$rendered_ccs = $this->renderHandleList($added_ccs);
$actions[] = pht("%s added CCs: %s.", $author_link, $rendered_ccs);
} else if ($action == PhabricatorAuditActionConstants::ADD_AUDITORS) {
$rendered_auditors = $this->renderHandleList($added_auditors);
$actions[] = pht(
"%s added auditors: %s.",
$author_link,
$rendered_auditors);
} else {
$actions[] = hsprintf("%s %s this commit.", $author_link, $verb);
}
foreach ($actions as $key => $action) {
$actions[$key] = phutil_tag('div', array(), $action);
}
return $actions;
}
private function renderContent() {
$comment = $this->comment;
$engine = $this->getMarkupEngine();
if (!strlen($comment->getContent()) && empty($this->inlineComments)) {
return null;
} else {
return phutil_tag_div('phabricator-remarkup', array(
$engine->getOutput(
$comment,
PhabricatorAuditComment::MARKUP_FIELD_BODY),
$this->renderInlines(),
));
}
}
private function renderInlines() {
if (!$this->inlineComments) {
return null;
}
$engine = $this->getMarkupEngine();
$inlines_by_path = mgroup($this->inlineComments, 'getPathID');
$view = new PhabricatorInlineSummaryView();
foreach ($inlines_by_path as $path_id => $inlines) {
$path = idx($this->pathMap, $path_id);
if ($path === null) {
continue;
}
$items = array();
foreach ($inlines as $inline) {
$items[] = array(
'id' => $inline->getID(),
'line' => $inline->getLineNumber(),
'length' => $inline->getLineLength(),
'content' => $engine->getOutput(
$inline,
PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY),
);
}
$view->addCommentGroup($path, $items);
}
return $view;
}
private function renderHandleList(array $phids) {
$result = array();
foreach ($phids as $phid) {
$result[] = $this->handles[$phid]->renderLink();
}
return phutil_implode_html(', ', $result);
}
private function renderClasses() {
$comment = $this->comment;
$classes = array();
switch ($comment->getAction()) {
case PhabricatorAuditActionConstants::ACCEPT:
$classes[] = 'audit-accept';
break;
case PhabricatorAuditActionConstants::CONCERN:
$classes[] = 'audit-concern';
break;
}
return $classes;
}
}
| yangming85/phabricator | src/applications/diffusion/view/DiffusionCommentView.php | PHP | apache-2.0 | 5,512 |
/**
* Copyright 2017 The GreyCat Authors. All rights reserved.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.
*/
package greycat.ml.neuralnet.layer;
import greycat.ml.neuralnet.process.ExMatrix;
import greycat.ml.neuralnet.process.ProcessGraph;
import greycat.struct.matrix.RandomGenerator;
public interface Layer {
ExMatrix forward(ExMatrix input, ProcessGraph g);
ExMatrix[] getLayerParameters();
Layer init(int inputs, int outputs, int activationUnit, double[] activationParams, RandomGenerator random, double std);
Layer reInit(RandomGenerator random, double std);
void resetState();
int inputDimensions();
int outputDimensions();
}
| electricalwind/greycat | plugins/ml/src/main/java/greycat/ml/neuralnet/layer/Layer.java | Java | apache-2.0 | 1,198 |
package action
import (
"bosh-softlayer-cpi/api"
"bosh-softlayer-cpi/registry"
vgs "bosh-softlayer-cpi/softlayer/virtual_guest_service"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boslconfig "bosh-softlayer-cpi/softlayer/config"
)
type DeleteVMAction struct {
vmService vgs.Service
registryClient registry.Client
softlayerOptions boslconfig.Config
}
func NewDeleteVM(
vmDeleterProvider vgs.Service,
registryClient registry.Client,
softlayerOptions boslconfig.Config,
) (action DeleteVMAction) {
action.vmService = vmDeleterProvider
action.registryClient = registryClient
action.softlayerOptions = softlayerOptions
return
}
func (dv DeleteVMAction) Run(vmCID VMCID) (interface{}, error) {
// Delete the VM
if err := dv.vmService.Delete(vmCID.Int(), dv.softlayerOptions.EnableVps); err != nil {
if _, ok := err.(api.CloudError); ok {
return nil, nil
}
return nil, bosherr.WrapErrorf(err, "Deleting vm '%s'", vmCID)
}
// Delete the VM agent settings
if err := dv.registryClient.Delete(vmCID.String()); err != nil {
return nil, bosherr.WrapErrorf(err, "Deleting vm '%s'", vmCID)
}
return nil, nil
}
| maximilien/bosh-softlayer-cpi | src/bosh-softlayer-cpi/action/delete_vm.go | GO | apache-2.0 | 1,152 |
/* global L, leafLet, emp, armyc2, sec */
leafLet.internalPrivateClass.MilStdFeature = function() {
var publicInterface = {
initialize: function(args) {
var options = {
oMilStdModifiers: {},
sBasicSymbolCode: undefined,
i2525Version: 0,
bIsMultiPointTG: false
};
L.Util.setOptions(this, options);
leafLet.typeLibrary.Feature.prototype.initialize.call(this, args);
},
getMilStdModifiers: function() {
return this.options.oMilStdModifiers;
},
getBasicSymbolCode: function() {
return this.options.sBasicSymbolCode;
},
getAzimuthUnits: function() {
var sUnits = leafLet.utils.AngleUnits.DEGREES;
var RendererSettings = armyc2.c2sd.renderer.utilities.RendererSettings;
var oBasicSymbolCode = leafLet.utils.milstd.basicSymbolCode;
switch (this.getBasicSymbolCode()) {
case oBasicSymbolCode.RECTANGULAR_TARGET:
switch (this.get2525Version()) {
case RendererSettings.Symbology_2525Bch2_USAS_13_14:
sUnits = leafLet.utils.AngleUnits.MILS;
break;
case RendererSettings.Symbology_2525C:
sUnits = leafLet.utils.AngleUnits.DEGREES;
break;
}
break;
}
return sUnits;
},
getAltitudeUnits: function() {
var sRet = leafLet.utils.Units.FEET;
return sRet;
},
getUnits: function() {
var retValue = leafLet.utils.Units.METERS;
var RendererSettings = armyc2.c2sd.renderer.utilities.RendererSettings;
var oBasicSymbolCode = leafLet.utils.milstd.basicSymbolCode;
switch (this.getBasicSymbolCode()) {
case oBasicSymbolCode.RECTANGULAR_TARGET:
/*
switch (this.get2525Version())
{
case RendererSettings.Symbology_2525Bch2_USAS_13_14:
case RendererSettings.Symbology_2525C:
retValue = leafLet.utils.Units.METERS;
break;
}
*/
break;
}
return retValue;
},
getPopupHeading: function() {
var sText = this.getName();
if (!sText || (typeof(sText) !== 'string') || (sText === "")) {
// There is no name, check for a unique identifier.
var cMilStdModifiers = leafLet.utils.milstd.Modifiers;
var oModifiers = this.getMilStdModifiers();
if (oModifiers.hasOwnProperty(cMilStdModifiers.UNIQUE_DESIGNATOR_1)) {
sText = oModifiers[cMilStdModifiers.UNIQUE_DESIGNATOR_1];
} else {
sText = "";
}
}
return sText;
},
getPopupText: function() {
var sPopupText = "";
if (this.options.leafletObject instanceof L.Marker) {
var oCoordList = this.getCoordinateList();
sPopupText = "<b>Symbol Code</b>: " + this.options.data.symbolCode +
"<br/> <b>Lat</b>: " + oCoordList[0].lat.toFixed(5) +
"<br/> <b>Lon</b>: " + oCoordList[0].lng.toFixed(5) +
(!isNaN(oCoordList[0].alt) ? "<br/> <b>Alt</b>: " + oCoordList[0].alt + this._getAltUnitsAndModeText() : "") +
"<br/><br/>" + this._getPopupDescription();
} else {
sPopupText = "<b>Symbol Code</b>: " + this.options.data.symbolCode + "<br/><br/>" +
this._getPopupDescription();
}
return sPopupText;
},
_createMultiPointFeature: function(args, oModifier, i2525Version) {
var leafletObject;
var leafletObject2;
var leafletObjectTemp;
var sDescription = args.properties.description || "";
var oMapBounds = this.getEngineInstanceInterface().leafletInstance.getBounds();
var southWest = oMapBounds.getSouthWest();
var northEast = oMapBounds.getNorthEast();
var angularWidth = Math.abs(oMapBounds.getEast() - oMapBounds.getWest());
var oEmpMapBounds;
var center = this.getEngineInstanceInterface().leafletInstance.getCenter();
// We must make sure we don't send a bound beyond 180 deg width. The render has problems rendering
// graphics when the BBox is wider than 180.
if (angularWidth >= 180.0) {
southWest.lng = center.lng - 89;
northEast.lng = center.lng + 89;
oEmpMapBounds = new leafLet.typeLibrary.EmpBoundary(southWest, northEast);
}
else{
oEmpMapBounds = new leafLet.typeLibrary.EmpBoundary(oMapBounds.getSouthWest(), oMapBounds.getNorthEast());
}
leafLet.utils.milstd.applyRequiredModifiers(args.data.symbolCode, oModifier, i2525Version, this.getEngineInstanceInterface().getLeafletMap());
leafletObject = leafLet.utils.milstd.renderMPGraphic({
instanceInterface: this.getEngineInstanceInterface(),
isSelected: args.selected,
sID: args.coreId,
sName: args.name,
sDescription: sDescription,
sSymbolCode: args.data.symbolCode,
oCoordData: args.data,
oModifiers: oModifier,
i2525Version: i2525Version,
oFeature: this,
empMapBounds: oEmpMapBounds
});
return leafletObject;
},
_createSinglePointFeature: function(oItem, oModifiers) {
var oFeature;
var oCoordinates = leafLet.utils.geoJson.convertCoordinatesToLatLng(oItem.data)[0];
var oMilStdIcon = this._getSinglePointIcon(oItem, oModifiers);
oFeature = new L.Marker(oCoordinates, {
icon: oMilStdIcon,
oFeature: this
});
return oFeature;
},
_modifierOnList: function(sModifier) {
return ((this.getEngineInstanceInterface().oLabelList.indexOf(sModifier) === -1) ? false : true);
},
_getSinglePointIcon: function(oItem, oMainModifiers) {
var sModifier,
oModifierArray = [],
oModifiers = {},
strippedSymbolCode = '',
msa = armyc2.c2sd.renderer.utilities.MilStdAttributes,
image,
oMilStdIcon,
oOffset,
iconUrl,
iconAnchor,
iconSize,
popupAnchor,
oImageBounds,
renderingOptimization,
baseURL,
sModifiers,
svgColor;
if (!oMainModifiers.hasOwnProperty('T') ||
(oMainModifiers.hasOwnProperty('T') && (oMainModifiers.T !== oItem.name))) {
// If there is no T or its diff than name.
if (this._modifierOnList("CN"))
{
oModifiers["CN"] = oItem.name;
}
}
for (sModifier in oMainModifiers) {
if (oMainModifiers.hasOwnProperty(sModifier)) {
switch (sModifier) {
case leafLet.utils.milstd.longModifiers.FILL_COLOR:
if (L.Browser.canvas) {
oModifiers[msa.FillColor] = '#' + oMainModifiers[sModifier];
} else {
oModifiers['fillcolor'] = oMainModifiers[sModifier];
}
break;
case leafLet.utils.milstd.longModifiers.LINE_COLOR:
if (L.Browser.canvas) {
oModifiers[msa.LineColor] = '#' + oMainModifiers[sModifier];
} else {
oModifiers['linecolor'] = oMainModifiers[sModifier];
}
break;
case leafLet.utils.milstd.Modifiers.STANDARD:
oModifiers[sModifier] = oMainModifiers[sModifier];
break;
default:
if (this._modifierOnList(sModifier)) {
oModifiers[sModifier] = oMainModifiers[sModifier];
}
break;
}
}
}
oModifiers[msa.PixelSize] = this.getEngineInstanceInterface().iMilStdIconSize;
if (this.isSelected()) {}
if (L.Browser.canvas) {
renderingOptimization = this.getEngineInstanceInterface().renderingOptimization;
if (renderingOptimization.viewInZone) {
switch (renderingOptimization.viewInZone) {
case "farDistanceZone":
switch (oItem.data.symbolCode.charAt(1)) {
case "H":
case "S":
case "J":
case "K":
svgColor = renderingOptimization.farDistanceThreshold.RED;
break;
case "F":
case "D":
case "A":
case "M":
svgColor = renderingOptimization.farDistanceThreshold.BLUE;
break;
case "N":
case "L":
svgColor = renderingOptimization.farDistanceThreshold.GREEN;
break;
case "U":
case "P":
case "G":
case "W":
svgColor = renderingOptimization.farDistanceThreshold.YELLOW;
break;
default:
svgColor = renderingOptimization.farDistanceThreshold.YELLOW;
break;
}
image = renderingOptimization.farDistanceThreshold.getSVG({
x: 6,
y: 6,
radius: 5,
color: svgColor
});
iconUrl = 'data:image/svg+xml,' + image;
iconAnchor = new L.Point(4, 5);
iconSize = new L.Point(12, 12);
popupAnchor = new L.Point(4, 5);
break;
case "midDistanceZone":
image = armyc2.c2sd.renderer.MilStdIconRenderer.Render(oItem.data.symbolCode, {
SIZE: oModifiers.SIZE
});
iconUrl = image.toDataUrl();
oOffset = image.getCenterPoint();
iconAnchor = new L.Point(oOffset.x, oOffset.y);
popupAnchor = new L.Point(oOffset.x, oOffset.y);
oImageBounds = image.getImageBounds();
iconSize = new L.Point(oImageBounds.width, oImageBounds.height);
break;
default:
//below mid distance zone - show labels
// image = armyc2.c2sd.renderer.MilStdIconRenderer.Render(oItem.data.symbolCode, oModifiers);
// iconUrl = image.toDataUrl();
// oOffset = image.getCenterPoint();
// iconAnchor = new L.Point(oOffset.x, oOffset.y);
// popupAnchor = new L.Point(oOffset.x, oOffset.y);
// oImageBounds = image.getImageBounds();
// iconSize = new L.Point(oImageBounds.width, oImageBounds.height);
break;
}
}
else {
// below mid distance zone. show icon with labels
image = armyc2.c2sd.renderer.MilStdIconRenderer.Render(oItem.data.symbolCode, oModifiers);
iconUrl = image.toDataUrl();
oOffset = image.getCenterPoint();
iconAnchor = new L.Point(oOffset.x, oOffset.y);
popupAnchor = new L.Point(oOffset.x, oOffset.y);
oImageBounds = image.getImageBounds();
iconSize = new L.Point(oImageBounds.width, oImageBounds.height);
}
oMilStdIcon = new L.Icon({
iconUrl: iconUrl,
iconAnchor: iconAnchor,
iconSize: iconSize,
popupAnchor: popupAnchor
});
return oMilStdIcon;
}
sModifiers = "";
for (sModifier in oModifiers) {
if (oModifiers.hasOwnProperty(sModifier)) {
oModifierArray.push(sModifier + "=" + oModifiers[sModifier]);
}
}
if (oModifierArray.length > 0) {
sModifiers = "?" + oModifierArray.join("&");
}
if (!emp.map.engine.rendererUrl || emp.map.engine.rendererUrl === "") {
baseURL = location.protocol + "//" + location.host + "/";
} else {
baseURL = emp.map.engine.rendererUrl;
}
iconUrl = baseURL + "/mil-sym-service/renderer/image/" + oItem.data.symbolCode + sModifiers;
size = oModifiers.size || 32;
oMilStdIcon = new L.Icon({
iconUrl: iconUrl,
className: sClassName
});
return oMilStdIcon;
},
_updateSinglePointFeature: function(oItem, oModifiers, bUpdateIcon) {
var oCoordinates = leafLet.utils.geoJson.convertCoordinatesToLatLng(oItem.data)[0];
if (bUpdateIcon) {
var oIcon = this._getSinglePointIcon(oItem, oModifiers);
oItem.leafletObject.setLatLng(oCoordinates);
oItem.leafletObject.setIcon(oIcon);
} else {
oItem.leafletObject.setLatLng(oCoordinates);
}
oItem.leafletObject.update();
return oItem.leafletObject;
},
_createFeature: function(oOptions) {
var oFeature = undefined;
var sSymbolCode = oOptions.data.symbolCode;
var oModifiers = leafLet.utils.milstd.convertModifiersTo2525(oOptions);
var i2525Version = oModifiers[leafLet.utils.milstd.Modifiers.STANDARD];
var isMultiPoint = armyc2.c2sd.renderer.utilities.SymbolUtilities.isMultiPoint(sSymbolCode, i2525Version);
var sBasicSymbolCode = armyc2.c2sd.renderer.utilities.SymbolUtilities.getBasicSymbolID(sSymbolCode);
var oSymbolDef = armyc2.c2sd.renderer.utilities.SymbolDefTable.getSymbolDef(sBasicSymbolCode, i2525Version);
var oCoordList = leafLet.utils.geoJson.convertCoordinatesToLatLng(oOptions.data);
if (oSymbolDef && (oCoordList.length < oSymbolDef.minPoints)) {
// We can't draw it yet.
this.options.oMilStdModifiers = new leafLet.typeLibrary.MilStdModifiers(this, oModifiers);
this.options.properties.modifiers = this.options.oMilStdModifiers.toLongModifiers();
this.options.i2525Version = i2525Version;
this.options.sBasicSymbolCode = sBasicSymbolCode;
return undefined;
}
if (isMultiPoint) {
oFeature = this._createMultiPointFeature(oOptions, oModifiers, i2525Version);
oOptions.bIsMultiPointTG = true;
} else if (oOptions.data.coordinates.length > 0) {
oFeature = this._createSinglePointFeature(oOptions, oModifiers);
oOptions.bIsMultiPointTG = false;
}
if (oFeature) {
var oMapBoundry = this.getEngineInstanceInterface().leafletInstance.getBounds();
this._updateLeafletObject(oMapBoundry, oFeature, false);
}
this.options.oMilStdModifiers = new leafLet.typeLibrary.MilStdModifiers(this, oModifiers);
this.options.properties.modifiers = this.options.oMilStdModifiers.toLongModifiers();
this.options.i2525Version = i2525Version;
this.options.sBasicSymbolCode = sBasicSymbolCode;
return oFeature;
},
getCoordinateList: function() {
return leafLet.utils.geoJson.convertCoordinatesToLatLng(this.getData());
},
setCoordinates: function(oLatLngList) {
leafLet.utils.geoJson.convertLatLngListToGeoJson(this.getData(), oLatLngList);
},
isMultiPointTG: function() {
return this.options.bIsMultiPointTG;
},
getFeatureBounds: function() {
var oEmpBoundary = leafLet.typeLibrary.Feature.prototype.getFeatureBounds.call(this);
if (!oEmpBoundary || oEmpBoundary.isEmpty()) {
var oCoordList = leafLet.utils.geoJson.convertCoordinatesToLatLng(this.options.data);
oEmpBoundary = new leafLet.typeLibrary.EmpBoundary(oCoordList);
}
return oEmpBoundary;
},
get2525Version: function() {
return this.options.i2525Version;
},
render: function() {
if (this.isVisible()) {
var oLeafletObject = this._createFeature(this.options);
this.setLeafletObject(oLeafletObject);
}
},
_updateMilStdFeature: function(args, oModifiers, bUpdateGraphic) {
var oFeature = undefined;
var sSymbolCode = args.data.symbolCode;
var i2525Version = oModifiers[leafLet.utils.milstd.Modifiers.STANDARD];
var isMultiPoint = armyc2.c2sd.renderer.utilities.SymbolUtilities.isMultiPoint(sSymbolCode, i2525Version);
if (isMultiPoint) {
oFeature = this._createMultiPointFeature(args, oModifiers, i2525Version);
args.bIsMultiPointTG = true;
} else {
oFeature = this._updateSinglePointFeature(args, oModifiers, bUpdateGraphic);
}
if (oFeature) {
var oMapBoundry = this.getEngineInstanceInterface().leafletInstance.getBounds();
this._updateLeafletObject(oMapBoundry, oFeature, false);
}
return oFeature;
},
updateCoordinates: function(oMapBounds) {
if (this.isVisible() && !this.isMultiPointTG()) {
// We only update coordinates to the visible NON tactical graphics.
// TG will get re-rendered.
this._updateLeafletObject(oMapBounds, this.getLeafletObject(), false);
}
},
_updateFeature: function(oArgs) {
var oNewFeafure;
var sModifier;
var bUpdateGraphic = (oArgs.bUpdateGraphic === true);
var oMilStdModifiers = this.options.oMilStdModifiers;
var oMilStdUtil = leafLet.utils.milstd;
var oModifiers = oMilStdUtil.convertModifiersTo2525(oArgs);
if (!bUpdateGraphic) {
if ((oArgs.hasOwnProperty('name') && (oArgs['name'] !== this.getName()))) {
bUpdateGraphic = true;
} else if (oArgs.data.symbolCode !== this.options.data.symbolCode) {
// The symbol changed we need to regenerate the graphic.
bUpdateGraphic = true;
} else {
for (sModifier in oModifiers) {
if (!oModifiers.hasOwnProperty(sModifier)) {
continue;
}
if (oMilStdModifiers.oModifiers[sModifier] === undefined) {
// There is a new modifiers.
// We need to regenerate the graphic.
bUpdateGraphic = true;
break;
} else if (!oMilStdUtil.areModifierValuesEqual(oMilStdModifiers.oModifiers[sModifier], oModifiers[sModifier])) {
// The modifier changed.
// We need to regenerate the graphic.
bUpdateGraphic = true;
break;
}
}
if (!bUpdateGraphic) {
for (sModifier in oMilStdModifiers.oModifiers) {
if (!oMilStdModifiers.oModifiers.hasOwnProperty(sModifier)) {
continue;
}
if ((sModifier !== 'CN') && (oModifiers[sModifier] === undefined)) {
// A modifier was removed.
// We need to regenerate the graphic.
bUpdateGraphic = true;
break;
}
}
}
}
}
oNewFeafure = this._updateMilStdFeature(oArgs, oModifiers, bUpdateGraphic);
this.options.oMilStdModifiers = new leafLet.typeLibrary.MilStdModifiers(this, oModifiers);
this.options.properties.modifiers = this.options.oMilStdModifiers.toLongModifiers();
this.options.bIsMultiPointTG = oArgs.bIsMultiPointTG;
return oNewFeafure;
},
updateIconSize: function() {
var sSymbolCode = this.options.data.symbolCode;
var oModifiers = this.options.oMilStdModifiers.toModifiers();
var i2525Version = oModifiers[leafLet.utils.milstd.Modifiers.STANDARD];
var isMultiPoint = armyc2.c2sd.renderer.utilities.SymbolUtilities.isMultiPoint(sSymbolCode, i2525Version);
if (!isMultiPoint) {
this._updateSinglePointFeature(this.options, oModifiers, true);
}
},
resetEditMode: function() {
this.options.isEditMode = false;
if (this.isSelected() && this.isMultiPointTG()) {
this.render();
}
}
};
return publicInterface;
};
leafLet.typeLibrary.MilStdFeature = leafLet.typeLibrary.Feature.extend(leafLet.internalPrivateClass.MilStdFeature());
| missioncommand/emp3-web | src/mapengine/leaflet/js/typeLibrary/leaflet-eng.typeLibrary.feature.milstd.js | JavaScript | apache-2.0 | 19,728 |
let httpRequest = {
send(url, cb) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
cb(xhr.responseText);
}
}
xhr.send();
}
}
export default httpRequest; | juancjara/bets-extension | src/js/background/httpRequest.js | JavaScript | apache-2.0 | 276 |
Puppet::Type.type(:l2_ovs_port).provide(:ovs) do
optional_commands :vsctl => "/usr/bin/ovs-vsctl"
def exists?
vsctl("list-ports", @resource[:bridge]).split(/\n+/).include? @resource[:interface]
end
def create
begin
vsctl('port-to-br', @resource[:interface])
if @resource[:skip_existing]
return true
else
raise Puppet::ExecutionFailure, "Port '#{@resource[:interface]}' already exists."
end
rescue Puppet::ExecutionFailure
# pass
end
# tag and trunks for port
port_properties = @resource[:port_properties]
if @resource[:vlan_id] > 0
port_properties.insert(-1, "tag=#{@resource[:vlan_id]}")
end
if not @resource[:trunks].empty?
port_properties.insert(-1, "trunks=[#{@resource[:trunks].join(',')}]")
end
# Port create begins from definition brodge and port
cmd = [@resource[:bridge], @resource[:interface]]
# add port properties (k/w) to command line
if not port_properties.empty?
for option in port_properties
cmd.insert(-1, option)
end
end
# set interface type
if @resource[:type] and @resource[:type].to_s != ''
tt = "type=" + @resource[:type].to_s
cmd += ['--', "set", "Interface", @resource[:interface], tt]
end
# executing OVS add-port command
cmd = ["add-port"] + cmd
begin
vsctl(cmd)
rescue Puppet::ExecutionFailure => error
raise Puppet::ExecutionFailure, "Can't add port '#{@resource[:interface]}'\n#{error}"
end
# set interface properties
if @resource[:interface_properties]
for option in @resource[:interface_properties]
begin
vsctl('--', "set", "Interface", @resource[:interface], option.to_s)
rescue Puppet::ExecutionFailure => error
raise Puppet::ExecutionFailure, "Interface '#{@resource[:interface]}' can't set option '#{option}':\n#{error}"
end
end
end
# enable vlan_splinters if need
if @resource[:vlan_splinters].to_s() == 'true' # puppet send non-boolean value instead true/false
Puppet.debug("Interface '#{@resource[:interface]}' vlan_splinters is '#{@resource[:vlan_splinters]}' [#{@resource[:vlan_splinters].class}]")
begin
vsctl('--', "set", "Port", @resource[:interface], "vlan_mode=trunk")
vsctl('--', "set", "Interface", @resource[:interface], "other-config:enable-vlan-splinters=true")
rescue Puppet::ExecutionFailure => error
raise Puppet::ExecutionFailure, "Interface '#{@resource[:interface]}' can't setup vlan_splinters:\n#{error}"
end
end
end
def destroy
vsctl("del-port", @resource[:bridge], @resource[:interface])
end
end
| andrei4ka/fuel-library-redhat | deployment/puppet/l23network/lib/puppet/provider/l2_ovs_port/ovs.rb | Ruby | apache-2.0 | 2,699 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
package org.apache.hadoop.mapred.pipes;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Iterator;
import java.util.StringTokenizer;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.Parser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.mapreduce.MRJobConfig;
import org.apache.hadoop.mapreduce.filecache.DistributedCache;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.InputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputFormat;
import org.apache.hadoop.mapred.Partitioner;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.RunningJob;
import org.apache.hadoop.mapred.lib.HashPartitioner;
import org.apache.hadoop.mapred.lib.LazyOutputFormat;
import org.apache.hadoop.mapred.lib.NullOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.hadoop.util.Tool;
/**
* The main entry point and job submitter. It may either be used as a command
* line-based or API-based method to launch Pipes jobs.
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public class Submitter extends Configured implements Tool {
protected static final Log LOG = LogFactory.getLog(Submitter.class);
public static final String PRESERVE_COMMANDFILE =
"mapreduce.pipes.commandfile.preserve";
public static final String EXECUTABLE = "mapreduce.pipes.executable";
public static final String INTERPRETOR =
"mapreduce.pipes.executable.interpretor";
public static final String IS_JAVA_MAP = "mapreduce.pipes.isjavamapper";
public static final String IS_JAVA_RR = "mapreduce.pipes.isjavarecordreader";
public static final String IS_JAVA_RW = "mapreduce.pipes.isjavarecordwriter";
public static final String IS_JAVA_REDUCE = "mapreduce.pipes.isjavareducer";
public static final String PARTITIONER = "mapreduce.pipes.partitioner";
public static final String INPUT_FORMAT = "mapreduce.pipes.inputformat";
public static final String PORT = "mapreduce.pipes.command.port";
public Submitter() {
this(new Configuration());
}
public Submitter(Configuration conf) {
setConf(conf);
}
/**
* Get the URI of the application's executable.
* @param conf
* @return the URI where the application's executable is located
*/
public static String getExecutable(JobConf conf) {
return conf.get(Submitter.EXECUTABLE);
}
/**
* Set the URI for the application's executable. Normally this is a hdfs:
* location.
* @param conf
* @param executable The URI of the application's executable.
*/
public static void setExecutable(JobConf conf, String executable) {
conf.set(Submitter.EXECUTABLE, executable);
}
/**
* Set whether the job is using a Java RecordReader.
* @param conf the configuration to modify
* @param value the new value
*/
public static void setIsJavaRecordReader(JobConf conf, boolean value) {
conf.setBoolean(Submitter.IS_JAVA_RR, value);
}
/**
* Check whether the job is using a Java RecordReader
* @param conf the configuration to check
* @return is it a Java RecordReader?
*/
public static boolean getIsJavaRecordReader(JobConf conf) {
return conf.getBoolean(Submitter.IS_JAVA_RR, false);
}
/**
* Set whether the Mapper is written in Java.
* @param conf the configuration to modify
* @param value the new value
*/
public static void setIsJavaMapper(JobConf conf, boolean value) {
conf.setBoolean(Submitter.IS_JAVA_MAP, value);
}
/**
* Check whether the job is using a Java Mapper.
* @param conf the configuration to check
* @return is it a Java Mapper?
*/
public static boolean getIsJavaMapper(JobConf conf) {
return conf.getBoolean(Submitter.IS_JAVA_MAP, false);
}
/**
* Set whether the Reducer is written in Java.
* @param conf the configuration to modify
* @param value the new value
*/
public static void setIsJavaReducer(JobConf conf, boolean value) {
conf.setBoolean(Submitter.IS_JAVA_REDUCE, value);
}
/**
* Check whether the job is using a Java Reducer.
* @param conf the configuration to check
* @return is it a Java Reducer?
*/
public static boolean getIsJavaReducer(JobConf conf) {
return conf.getBoolean(Submitter.IS_JAVA_REDUCE, false);
}
/**
* Set whether the job will use a Java RecordWriter.
* @param conf the configuration to modify
* @param value the new value to set
*/
public static void setIsJavaRecordWriter(JobConf conf, boolean value) {
conf.setBoolean(Submitter.IS_JAVA_RW, value);
}
/**
* Will the reduce use a Java RecordWriter?
* @param conf the configuration to check
* @return true, if the output of the job will be written by Java
*/
public static boolean getIsJavaRecordWriter(JobConf conf) {
return conf.getBoolean(Submitter.IS_JAVA_RW, false);
}
/**
* Set the configuration, if it doesn't already have a value for the given
* key.
* @param conf the configuration to modify
* @param key the key to set
* @param value the new "default" value to set
*/
private static void setIfUnset(JobConf conf, String key, String value) {
if (conf.get(key) == null) {
conf.set(key, value);
}
}
/**
* Save away the user's original partitioner before we override it.
* @param conf the configuration to modify
* @param cls the user's partitioner class
*/
static void setJavaPartitioner(JobConf conf, Class cls) {
conf.set(Submitter.PARTITIONER, cls.getName());
}
/**
* Get the user's original partitioner.
* @param conf the configuration to look in
* @return the class that the user submitted
*/
static Class<? extends Partitioner> getJavaPartitioner(JobConf conf) {
return conf.getClass(Submitter.PARTITIONER,
HashPartitioner.class,
Partitioner.class);
}
/**
* Does the user want to keep the command file for debugging? If this is
* true, pipes will write a copy of the command data to a file in the
* task directory named "downlink.data", which may be used to run the C++
* program under the debugger. You probably also want to set
* JobConf.setKeepFailedTaskFiles(true) to keep the entire directory from
* being deleted.
* To run using the data file, set the environment variable
* "mapreduce.pipes.commandfile" to point to the file.
* @param conf the configuration to check
* @return will the framework save the command file?
*/
public static boolean getKeepCommandFile(JobConf conf) {
return conf.getBoolean(Submitter.PRESERVE_COMMANDFILE, false);
}
/**
* Set whether to keep the command file for debugging
* @param conf the configuration to modify
* @param keep the new value
*/
public static void setKeepCommandFile(JobConf conf, boolean keep) {
conf.setBoolean(Submitter.PRESERVE_COMMANDFILE, keep);
}
/**
* Submit a job to the map/reduce cluster. All of the necessary modifications
* to the job to run under pipes are made to the configuration.
* @param conf the job to submit to the cluster (MODIFIED)
* @throws IOException
* @deprecated Use {@link Submitter#runJob(JobConf)}
*/
@Deprecated
public static RunningJob submitJob(JobConf conf) throws IOException {
return runJob(conf);
}
/**
* Submit a job to the map/reduce cluster. All of the necessary modifications
* to the job to run under pipes are made to the configuration.
* @param conf the job to submit to the cluster (MODIFIED)
* @throws IOException
*/
public static RunningJob runJob(JobConf conf) throws IOException {
setupPipesJob(conf);
return JobClient.runJob(conf);
}
/**
* Submit a job to the Map-Reduce framework.
* This returns a handle to the {@link RunningJob} which can be used to track
* the running-job.
*
* @param conf the job configuration.
* @return a handle to the {@link RunningJob} which can be used to track the
* running-job.
* @throws IOException
*/
public static RunningJob jobSubmit(JobConf conf) throws IOException {
setupPipesJob(conf);
return new JobClient(conf).submitJob(conf);
}
private static void setupPipesJob(JobConf conf) throws IOException {
// default map output types to Text
if (!getIsJavaMapper(conf)) {
conf.setMapRunnerClass(PipesMapRunner.class);
// Save the user's partitioner and hook in our's.
setJavaPartitioner(conf, conf.getPartitionerClass());
conf.setPartitionerClass(PipesPartitioner.class);
}
if (!getIsJavaReducer(conf)) {
conf.setReducerClass(PipesReducer.class);
if (!getIsJavaRecordWriter(conf)) {
conf.setOutputFormat(NullOutputFormat.class);
}
}
String textClassname = Text.class.getName();
setIfUnset(conf, MRJobConfig.MAP_OUTPUT_KEY_CLASS, textClassname);
setIfUnset(conf, MRJobConfig.MAP_OUTPUT_VALUE_CLASS, textClassname);
setIfUnset(conf, MRJobConfig.OUTPUT_KEY_CLASS, textClassname);
setIfUnset(conf, MRJobConfig.OUTPUT_VALUE_CLASS, textClassname);
// Use PipesNonJavaInputFormat if necessary to handle progress reporting
// from C++ RecordReaders ...
if (!getIsJavaRecordReader(conf) && !getIsJavaMapper(conf)) {
conf.setClass(Submitter.INPUT_FORMAT,
conf.getInputFormat().getClass(), InputFormat.class);
conf.setInputFormat(PipesNonJavaInputFormat.class);
}
String exec = getExecutable(conf);
if (exec == null) {
throw new IllegalArgumentException("No application program defined.");
}
// add default debug script only when executable is expressed as
// <path>#<executable>
if (exec.contains("#")) {
DistributedCache.createSymlink(conf);
// set default gdb commands for map and reduce task
String defScript = "$HADOOP_PREFIX/src/c++/pipes/debug/pipes-default-script";
setIfUnset(conf, MRJobConfig.MAP_DEBUG_SCRIPT,defScript);
setIfUnset(conf, MRJobConfig.REDUCE_DEBUG_SCRIPT,defScript);
}
URI[] fileCache = DistributedCache.getCacheFiles(conf);
if (fileCache == null) {
fileCache = new URI[1];
} else {
URI[] tmp = new URI[fileCache.length+1];
System.arraycopy(fileCache, 0, tmp, 1, fileCache.length);
fileCache = tmp;
}
try {
fileCache[0] = new URI(exec);
} catch (URISyntaxException e) {
IOException ie = new IOException("Problem parsing execable URI " + exec);
ie.initCause(e);
throw ie;
}
DistributedCache.setCacheFiles(fileCache, conf);
}
/**
* A command line parser for the CLI-based Pipes job submitter.
*/
static class CommandLineParser {
private Options options = new Options();
void addOption(String longName, boolean required, String description,
String paramName) {
Option option = OptionBuilder.withArgName(paramName).hasArgs(1).withDescription(description).isRequired(required).create(longName);
options.addOption(option);
}
void addArgument(String name, boolean required, String description) {
Option option = OptionBuilder.withArgName(name).hasArgs(1).withDescription(description).isRequired(required).create();
options.addOption(option);
}
Parser createParser() {
Parser result = new BasicParser();
return result;
}
void printUsage() {
// The CLI package should do this for us, but I can't figure out how
// to make it print something reasonable.
System.out.println("bin/hadoop pipes");
System.out.println(" [-input <path>] // Input directory");
System.out.println(" [-output <path>] // Output directory");
System.out.println(" [-jar <jar file> // jar filename");
System.out.println(" [-inputformat <class>] // InputFormat class");
System.out.println(" [-map <class>] // Java Map class");
System.out.println(" [-partitioner <class>] // Java Partitioner");
System.out.println(" [-reduce <class>] // Java Reduce class");
System.out.println(" [-writer <class>] // Java RecordWriter");
System.out.println(" [-program <executable>] // executable URI");
System.out.println(" [-reduces <num>] // number of reduces");
System.out.println(" [-lazyOutput <true/false>] // createOutputLazily");
System.out.println();
GenericOptionsParser.printGenericCommandUsage(System.out);
}
}
private static <InterfaceType>
Class<? extends InterfaceType> getClass(CommandLine cl, String key,
JobConf conf,
Class<InterfaceType> cls
) throws ClassNotFoundException {
return conf.getClassByName(cl.getOptionValue(key)).asSubclass(cls);
}
@Override
public int run(String[] args) throws Exception {
CommandLineParser cli = new CommandLineParser();
if (args.length == 0) {
cli.printUsage();
return 1;
}
cli.addOption("input", false, "input path to the maps", "path");
cli.addOption("output", false, "output path from the reduces", "path");
cli.addOption("jar", false, "job jar file", "path");
cli.addOption("inputformat", false, "java classname of InputFormat",
"class");
//cli.addArgument("javareader", false, "is the RecordReader in Java");
cli.addOption("map", false, "java classname of Mapper", "class");
cli.addOption("partitioner", false, "java classname of Partitioner",
"class");
cli.addOption("reduce", false, "java classname of Reducer", "class");
cli.addOption("writer", false, "java classname of OutputFormat", "class");
cli.addOption("program", false, "URI to application executable", "class");
cli.addOption("reduces", false, "number of reduces", "num");
cli.addOption("jobconf", false,
"\"n1=v1,n2=v2,..\" (Deprecated) Optional. Add or override a JobConf property.",
"key=val");
cli.addOption("lazyOutput", false, "Optional. Create output lazily",
"boolean");
Parser parser = cli.createParser();
try {
GenericOptionsParser genericParser = new GenericOptionsParser(getConf(), args);
CommandLine results = parser.parse(cli.options, genericParser.getRemainingArgs());
JobConf job = new JobConf(getConf());
if (results.hasOption("input")) {
FileInputFormat.setInputPaths(job, results.getOptionValue("input"));
}
if (results.hasOption("output")) {
FileOutputFormat.setOutputPath(job,
new Path(results.getOptionValue("output")));
}
if (results.hasOption("jar")) {
job.setJar(results.getOptionValue("jar"));
}
if (results.hasOption("inputformat")) {
setIsJavaRecordReader(job, true);
job.setInputFormat(getClass(results, "inputformat", job,
InputFormat.class));
}
if (results.hasOption("javareader")) {
setIsJavaRecordReader(job, true);
}
if (results.hasOption("map")) {
setIsJavaMapper(job, true);
job.setMapperClass(getClass(results, "map", job, Mapper.class));
}
if (results.hasOption("partitioner")) {
job.setPartitionerClass(getClass(results, "partitioner", job,
Partitioner.class));
}
if (results.hasOption("reduce")) {
setIsJavaReducer(job, true);
job.setReducerClass(getClass(results, "reduce", job, Reducer.class));
}
if (results.hasOption("reduces")) {
job.setNumReduceTasks(Integer.parseInt(
results.getOptionValue("reduces")));
}
if (results.hasOption("writer")) {
setIsJavaRecordWriter(job, true);
job.setOutputFormat(getClass(results, "writer", job,
OutputFormat.class));
}
if (results.hasOption("lazyOutput")) {
if (Boolean.parseBoolean(results.getOptionValue("lazyOutput"))) {
LazyOutputFormat.setOutputFormatClass(job,
job.getOutputFormat().getClass());
}
}
if (results.hasOption("program")) {
setExecutable(job, results.getOptionValue("program"));
}
if (results.hasOption("jobconf")) {
LOG.warn("-jobconf option is deprecated, please use -D instead.");
String options = results.getOptionValue("jobconf");
StringTokenizer tokenizer = new StringTokenizer(options, ",");
while (tokenizer.hasMoreTokens()) {
String keyVal = tokenizer.nextToken().trim();
String[] keyValSplit = keyVal.split("=");
job.set(keyValSplit[0], keyValSplit[1]);
}
}
// if they gave us a jar file, include it into the class path
String jarFile = job.getJar();
if (jarFile != null) {
final URL[] urls = new URL[]{ FileSystem.getLocal(job).
pathToFile(new Path(jarFile)).toURL()};
//FindBugs complains that creating a URLClassLoader should be
//in a doPrivileged() block.
ClassLoader loader =
AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return new URLClassLoader(urls);
}
}
);
job.setClassLoader(loader);
}
runJob(job);
return 0;
} catch (ParseException pe) {
LOG.info("Error : " + pe);
cli.printUsage();
return 1;
}
}
/**
* Submit a pipes job based on the command line arguments.
* @param args
*/
public static void main(String[] args) throws Exception {
int exitCode = new Submitter().run(args);
System.exit(exitCode);
}
}
| rekhajoshm/mapreduce-fork | src/java/org/apache/hadoop/mapred/pipes/Submitter.java | Java | apache-2.0 | 19,655 |
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.
*/
package org.wso2.carbon.device.mgt.core.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
import org.wso2.carbon.device.mgt.core.device.details.mgt.impl.DeviceInformationManagerImpl;
import org.wso2.carbon.device.mgt.core.search.mgt.SearchManagerService;
import org.wso2.carbon.device.mgt.core.search.mgt.impl.SearchManagerServiceImpl;
import org.wso2.carbon.device.mgt.core.task.DeviceMgtTaskException;
import org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerService;
import org.wso2.carbon.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl;
import org.wso2.carbon.ntask.core.service.TaskService;
import java.util.ArrayList;
import java.util.Map;
/**
* @scr.component name="org.wso2.carbon.device.task.manager" immediate="true"
* @scr.reference name="device.ntask.component"
* interface="org.wso2.carbon.ntask.core.service.TaskService"
* cardinality="1..1"
* policy="dynamic"
* bind="setTaskService"
* unbind="unsetTaskService"
*/
public class DeviceTaskManagerServiceComponent {
private static Log log = LogFactory.getLog(DeviceManagementServiceComponent.class);
@SuppressWarnings("unused")
protected void activate(ComponentContext componentContext) {
try {
if (log.isDebugEnabled()) {
log.debug("Initializing device details retrieving task manager bundle.");
}
// This will start the device details retrieving task.
// DeviceTaskManagerService deviceTaskManagerService = new DeviceTaskManagerServiceImpl();
// DeviceManagementDataHolder.getInstance().setDeviceTaskManagerService(
// deviceTaskManagerService);
// componentContext.getBundleContext().registerService(DeviceTaskManagerService.class,
// deviceTaskManagerService, null);
getDeviceOperationMonitoringConfig(componentContext);
componentContext.getBundleContext().registerService(DeviceInformationManager.class,
new DeviceInformationManagerImpl(), null);
componentContext.getBundleContext().registerService(SearchManagerService.class,
new SearchManagerServiceImpl(), null);
} catch (Throwable e) {
log.error("Error occurred while initializing device details retrieving task manager service.", e);
}
}
private void getDeviceOperationMonitoringConfig(ComponentContext componentContext)
throws DeviceMgtTaskException {
DeviceTaskManagerService deviceTaskManagerService = new DeviceTaskManagerServiceImpl();
DeviceManagementDataHolder.getInstance().setDeviceTaskManagerService(deviceTaskManagerService);
componentContext.getBundleContext().registerService(DeviceTaskManagerService.class,
deviceTaskManagerService, null);
Map<String, OperationMonitoringTaskConfig> deviceConfigMap = DeviceMonitoringOperationDataHolder
.getInstance().getOperationMonitoringConfigFromMap();
for (String platformType : new ArrayList<>(deviceConfigMap.keySet())) {
deviceTaskManagerService.startTask(platformType, deviceConfigMap.get(platformType));
deviceConfigMap.remove(platformType);
}
}
@SuppressWarnings("unused")
protected void deactivate(ComponentContext componentContext) {
try {
// DeviceTaskManagerService taskManagerService = new DeviceTaskManagerServiceImpl();
// taskManagerService.stopTask();
} catch (Throwable e) {
log.error("Error occurred while destroying the device details retrieving task manager service.", e);
}
}
protected void setTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Setting the task service.");
}
DeviceManagementDataHolder.getInstance().setTaskService(taskService);
}
protected void unsetTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Removing the task service.");
}
DeviceManagementDataHolder.getInstance().setTaskService(null);
}
}
| milanperera/carbon-device-mgt | components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java | Java | apache-2.0 | 5,133 |
package com.lohika.example.pages;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
public class MyPageFactory {
public static <T extends Page> T getPage(WebDriver driver, Class<T> pageClass) {
T page = instantiatePage(driver, pageClass);
PageFactory.initElements(new AjaxElementLocatorFactory(driver, 10), page);
page.driver = driver;
if (! page.isOnThisPage()) {
page.tryToOpen();
if (! page.isOnThisPage()) {
throw new Error("Can't open page " + pageClass);
}
}
return page;
}
private static <T> T instantiatePage(WebDriver driver, Class<T> pageClassToProxy) {
try {
try {
Constructor<T> constructor = pageClassToProxy.getConstructor(WebDriver.class);
return constructor.newInstance(driver);
} catch (NoSuchMethodException e) {
return pageClassToProxy.newInstance();
}
} catch (InstantiationException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
}
| almyazin/selenium-junit-lr | workshop-selenium-project/src/com/lohika/example/pages/MyPageFactory.java | Java | apache-2.0 | 1,369 |
/**
* Get more info at : www.jrebirth.org .
* Copyright JRebirth.org © 2011-2013
* Contact : sebastien.bordes@jrebirth.org
*
* 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.
*/
package org.jrebirth.af.component.ui.stack;
import javafx.scene.layout.StackPane;
import org.jrebirth.af.api.exception.CoreException;
import org.jrebirth.af.api.ui.annotation.RootNodeClass;
import org.jrebirth.af.core.ui.DefaultController;
import org.jrebirth.af.core.ui.DefaultView;
/**
* The Class StackView only creates a StackPane.
*
* No Controller is needed.
*
* @author Sébastien Bordes
*/
@RootNodeClass("StackPanel")
public class StackView extends DefaultView<StackModel, StackPane, DefaultController<StackModel, StackView>> {
/** The Constant LOGGER. */
// private static final Logger LOGGER = LoggerFactory.getLogger(StackView.class);
/**
* Instantiates a new Stack View.
*
* @param model the model
*
* @throws CoreException the core exception
*/
public StackView(final StackModel model) throws CoreException {
super(model);
}
}
| JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackView.java | Java | apache-2.0 | 1,651 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
package org.apache.pig.builtin;
import java.io.IOException;
import org.apache.pig.FilterFunc;
import org.apache.pig.data.DataBag;
import org.apache.pig.data.DataMap;
import org.apache.pig.data.Datum;
import org.apache.pig.data.Tuple;
public class IsEmpty extends FilterFunc {
@Override
public boolean exec(Tuple input) throws IOException {
Datum values = input.getField(0);
if (values instanceof DataBag) {
return ((DataBag)values).size() == 0;
} else if (values instanceof DataMap) {
return ((DataMap)values).cardinality() == 0;
} else {
StringBuilder sb = new StringBuilder();
sb.append("Cannot test a ");
sb.append(values.getClass().getSimpleName());
sb.append(" for emptiness.");
throw new IOException(sb.toString());
}
}
}
| korrelate/pig | src/org/apache/pig/builtin/IsEmpty.java | Java | apache-2.0 | 1,676 |
// Copyright 2022 Google LLC
//
// 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
//
// https://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.
// Generated code. DO NOT EDIT!
namespace Google.Cloud.Tpu.V1.Snippets
{
// [START tpu_v1_generated_Tpu_ListNodes_async_flattened]
using Google.Api.Gax;
using Google.Cloud.Tpu.V1;
using System;
using System.Linq;
using System.Threading.Tasks;
public sealed partial class GeneratedTpuClientSnippets
{
/// <summary>Snippet for ListNodesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task ListNodesAsync()
{
// Create client
TpuClient tpuClient = await TpuClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListNodesResponse, Node> response = tpuClient.ListNodesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Node item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListNodesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Node item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Node> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Node item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
}
}
// [END tpu_v1_generated_Tpu_ListNodes_async_flattened]
}
| googleapis/google-cloud-dotnet | apis/Google.Cloud.Tpu.V1/Google.Cloud.Tpu.V1.GeneratedSnippets/TpuClient.ListNodesAsyncSnippet.g.cs | C# | apache-2.0 | 3,085 |
package org.javers.core.cases;
import org.fest.assertions.api.Assertions;
import org.javers.core.Javers;
import org.javers.core.JaversBuilder;
import org.javers.core.metamodel.object.CdoSnapshot;
import org.junit.Test;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
/**
* see https://github.com/javers/javers/issues/213
* @author bartosz.walacik
*/
public class ChangedPropertyNamesForNullifiedValuesCase {
@Test
public void shouldCalculateChangedPropertyNamesForNullifiedValues() {
//given
Javers javers = JaversBuilder.javers().build();
SimpleTypes obj = new SimpleTypes("1");
javers.commit("anonymous", obj);
//when
obj.shortNumber = -1;
javers.commit("anonymous", obj);
CdoSnapshot s = javers.getLatestSnapshot("1", SimpleTypes.class).get();
//then
Assertions.assertThat(s.getChanged()).containsExactly("shortNumber");
//when
obj.nullify();
javers.commit("anonymous", obj);
s = javers.getLatestSnapshot("1", SimpleTypes.class).get();
//then
Assertions.assertThat(s.getChanged()).hasSize(11);
}
static class SimpleTypes {
@Id
String id;
enum TestEnum { ONE, TWO }
Date date = new Date();
java.sql.Date dateSql = new java.sql.Date(date.getTime());
Timestamp ts = new Timestamp(date.getTime());
String text = "test";
Boolean bool = true;
Long longNumber = 1l;
Integer integerNumber = 1;
Short shortNumber = 1;
Double doubleNumber = 1.0;
Float floatNumber = 1.0f;
BigDecimal bigDecimalNumber = BigDecimal.ONE;
byte byteFiled = 0x1;
TestEnum testEnum = TestEnum.ONE;
public SimpleTypes(String id) {
this.id = id;
}
public void nullify() {
date = null;
ts = null;
text = null;
bool = null;
longNumber = null;
integerNumber = null;
shortNumber = null;
doubleNumber = null;
floatNumber = null;
bigDecimalNumber = null;
testEnum = null;
}
}
}
| ramasinka/javers | javers-core/src/test/java/org/javers/core/cases/ChangedPropertyNamesForNullifiedValuesCase.java | Java | apache-2.0 | 2,269 |
/*
* Copyright 2015-2017 the original author or authors.
*
* 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
*
* https://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.
*/
package org.springframework.cloud.stream.provisioning;
import org.springframework.cloud.stream.binder.ProducerProperties;
/**
* Represents a ProducerDestination that provides the information about the destination
* that is physically provisioned through
* {@link ProvisioningProvider#provisionProducerDestination(String, ProducerProperties)}.
*
* @author Soby Chacko
* @since 1.2
*/
public interface ProducerDestination {
/**
* Provides the destination name.
* @return destination name
*/
String getName();
/**
* Provides the destination name for a given partition.
*
* If the producer provision the destination with partitions, on certain middleware
* brokers there may exist multiple destinations distinguishable by the partition. For
* example, if the destination name is <b>xyz</b> and it is provisioned with <b>4</b>
* partitions, there may be 4 different destinations on the broker such as - <b>xyz-0,
* xyz-1, xyz-2 and xyz-3</b>. This behavior is dependent on the broker and the way
* the corresponding binder implements the logic.
*
* On certain brokers (for instance, Kafka), this behavior is completely skipped and
* there is a one-to-one correspondence between the destination name in the
* provisioner and the physical destination on the broker.
* @param partition the partition to find destination for
* @return destination name for the given partition
*/
String getNameForPartition(int partition);
}
| ilayaperumalg/spring-cloud-stream | spring-cloud-stream/src/main/java/org/springframework/cloud/stream/provisioning/ProducerDestination.java | Java | apache-2.0 | 2,090 |
<?php namespace Fungku\NetSuite\Classes;
class SearchEnumMultiSelectCustomField extends SearchCustomField {
public $searchValue;
public $operator;
static $paramtypesmap = array(
"searchValue" => "string[]",
"operator" => "SearchEnumMultiSelectFieldOperator",
);
}
| bitclaw/netsuite-php | src/Classes/SearchEnumMultiSelectCustomField.php | PHP | apache-2.0 | 274 |
import * as f from "./first" assert {
| Microsoft/TypeScript | tests/cases/conformance/importAssertion/importAssertion5.ts | TypeScript | apache-2.0 | 38 |
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// 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.
package com.google.devtools.build.lib.skyframe;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.packages.AdvertisedProviderSet;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.util.StringCanonicalizer;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.annotation.Nullable;
/**
* A <i>transitive</i> target reference that, when built in skyframe, loads the entire transitive
* closure of a target. Retains the first error message found during the transitive traversal, the
* kind of target, and a set of names of providers if the target is a {@link Rule}.
*
* <p>Interns values for error-free traversal nodes that correspond to built-in rules.
*/
@Immutable
@ThreadSafe
@AutoCodec
public abstract class TransitiveTraversalValue implements SkyValue {
// A quick-lookup cache that allows us to get the value for a given target kind, assuming no error
// messages for the target. The number of built-in target kinds is limited, so memory bloat is not
// a concern.
private static final ConcurrentMap<String, TransitiveTraversalValue> VALUES_BY_TARGET_KIND =
new ConcurrentHashMap<>();
/**
* A strong interner of TransitiveTargetValue objects. Because we only wish to intern values for
* built-in non-skylark targets, we need an interner with an additional method to return the
* canonical representative if it is present without interning our sample. This is only mutated in
* {@link #forTarget}, and read in {@link #forTarget} and {@link #create}.
*/
private static final InternerWithPresenceCheck<TransitiveTraversalValue> VALUE_INTERNER =
new InternerWithPresenceCheck<>();
private final String kind;
protected TransitiveTraversalValue(String kind) {
this.kind = Preconditions.checkNotNull(kind);
}
static TransitiveTraversalValue unsuccessfulTransitiveTraversal(
String firstErrorMessage, Target target) {
return new TransitiveTraversalValueWithError(
Preconditions.checkNotNull(firstErrorMessage), target.getTargetKind());
}
static TransitiveTraversalValue forTarget(Target target, @Nullable String firstErrorMessage) {
if (firstErrorMessage == null) {
if (target instanceof Rule && ((Rule) target).getRuleClassObject().isSkylark()) {
Rule rule = (Rule) target;
// Do not intern values for skylark rules.
return TransitiveTraversalValue.create(
rule.getRuleClassObject().getAdvertisedProviders(),
rule.getTargetKind(),
firstErrorMessage);
} else {
TransitiveTraversalValue value = VALUES_BY_TARGET_KIND.get(target.getTargetKind());
if (value != null) {
return value;
}
AdvertisedProviderSet providers =
target instanceof Rule
? ((Rule) target).getRuleClassObject().getAdvertisedProviders()
: AdvertisedProviderSet.EMPTY;
value = new TransitiveTraversalValueWithoutError(providers, target.getTargetKind());
// May already be there from another target or a concurrent put.
value = VALUE_INTERNER.intern(value);
// May already be there from a concurrent put.
VALUES_BY_TARGET_KIND.putIfAbsent(target.getTargetKind(), value);
return value;
}
} else {
return new TransitiveTraversalValueWithError(firstErrorMessage, target.getTargetKind());
}
}
@AutoCodec.Instantiator
public static TransitiveTraversalValue create(
AdvertisedProviderSet providers, String kind, @Nullable String firstErrorMessage) {
TransitiveTraversalValue value =
firstErrorMessage == null
? new TransitiveTraversalValueWithoutError(providers, kind)
: new TransitiveTraversalValueWithError(firstErrorMessage, kind);
if (firstErrorMessage == null) {
TransitiveTraversalValue oldValue = VALUE_INTERNER.getCanonical(value);
return oldValue == null ? value : oldValue;
}
return value;
}
/** Returns if the associated target can have any provider. True for "alias" rules. */
public abstract boolean canHaveAnyProvider();
/**
* Returns the set of provider names from the target, if the target is a {@link Rule}. Otherwise
* returns the empty set.
*/
public abstract AdvertisedProviderSet getProviders();
/** Returns the target kind. */
public String getKind() {
return kind;
}
/**
* Returns the first error message, if any, from loading the target and its transitive
* dependencies.
*/
@Nullable
public abstract String getFirstErrorMessage();
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof TransitiveTraversalValue)) {
return false;
}
TransitiveTraversalValue that = (TransitiveTraversalValue) o;
return Objects.equals(this.getFirstErrorMessage(), that.getFirstErrorMessage())
&& Objects.equals(this.getKind(), that.getKind())
&& this.getProviders().equals(that.getProviders());
}
@Override
public int hashCode() {
return Objects.hash(getFirstErrorMessage(), getKind(), getProviders());
}
@ThreadSafe
public static SkyKey key(Label label) {
Preconditions.checkArgument(!label.getPackageIdentifier().getRepository().isDefault());
return label;
}
/** A transitive target reference without error. */
public static final class TransitiveTraversalValueWithoutError extends TransitiveTraversalValue {
private final AdvertisedProviderSet advertisedProviders;
private TransitiveTraversalValueWithoutError(
AdvertisedProviderSet providers, @Nullable String kind) {
super(kind);
this.advertisedProviders = Preconditions.checkNotNull(providers);
}
@Override
public boolean canHaveAnyProvider() {
return advertisedProviders.canHaveAnyProvider();
}
@Override
public AdvertisedProviderSet getProviders() {
return advertisedProviders;
}
@Override
@Nullable
public String getFirstErrorMessage() {
return null;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("kind", getKind())
.add("providers", advertisedProviders)
.toString();
}
}
/** A transitive target reference with error. */
public static final class TransitiveTraversalValueWithError extends TransitiveTraversalValue {
private final String firstErrorMessage;
private TransitiveTraversalValueWithError(String firstErrorMessage, String kind) {
super(kind);
this.firstErrorMessage =
StringCanonicalizer.intern(Preconditions.checkNotNull(firstErrorMessage));
}
@Override
public boolean canHaveAnyProvider() {
return AdvertisedProviderSet.EMPTY.canHaveAnyProvider();
}
@Override
public AdvertisedProviderSet getProviders() {
return AdvertisedProviderSet.EMPTY;
}
@Override
@Nullable
public String getFirstErrorMessage() {
return firstErrorMessage;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("error", firstErrorMessage)
.add("kind", getKind())
.toString();
}
}
}
| ButterflyNetwork/bazel | src/main/java/com/google/devtools/build/lib/skyframe/TransitiveTraversalValue.java | Java | apache-2.0 | 8,454 |
package com.nick.scalpel.core.utils;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.UndeclaredThrowableException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public abstract class ReflectionUtils {
private static final Map<Class<?>, Method[]> declaredMethodsCache =
new HashMap<>(256);
private static final Method[] NO_METHODS = {};
private static final Map<Class<?>, Class<?>> primitiveTypeToWrapperMap = new IdentityHashMap<>(8);
private static final Map<Class<?>, Class<?>> primitiveWrapperTypeMap = new IdentityHashMap<>(8);
static {
primitiveWrapperTypeMap.put(Boolean.class, boolean.class);
primitiveWrapperTypeMap.put(Byte.class, byte.class);
primitiveWrapperTypeMap.put(Character.class, char.class);
primitiveWrapperTypeMap.put(Double.class, double.class);
primitiveWrapperTypeMap.put(Float.class, float.class);
primitiveWrapperTypeMap.put(Integer.class, int.class);
primitiveWrapperTypeMap.put(Long.class, long.class);
primitiveWrapperTypeMap.put(Short.class, short.class);
for (Map.Entry<Class<?>, Class<?>> entry : primitiveWrapperTypeMap.entrySet()) {
primitiveTypeToWrapperMap.put(entry.getValue(), entry.getKey());
}
}
public static Field findField(Object o, String name) {
for (Field f : o.getClass().getDeclaredFields()) {
if (f.getName().equals(name)) {
return f;
}
}
return null;
}
public static boolean isBaseDataType(Class clazz) {
return
clazz.equals(String.class) ||
clazz.equals(Integer.class) ||
clazz.equals(Byte.class) ||
clazz.equals(Long.class) ||
clazz.equals(Double.class) ||
clazz.equals(Float.class) ||
clazz.equals(Character.class) ||
clazz.equals(Short.class) ||
clazz.equals(BigDecimal.class) ||
clazz.equals(BigInteger.class) ||
clazz.equals(Boolean.class) ||
clazz.equals(Date.class) ||
clazz.isPrimitive();
}
/**
* Set the field represented by the supplied {@link Field field object} on the
* specified {@link Object target object} to the specified {@code value}.
* In accordance with {@link Field#set(Object, Object)} semantics, the new value
* is automatically unwrapped if the underlying field has a primitive type.
* <p>Thrown exceptions are handled via a call to {@link #handleReflectionException(Exception)}.
*
* @param field the field to set
* @param target the target object on which to set the field
* @param value the value to set (may be {@code null})
*/
public static void setField(Field field, Object target, Object value) {
try {
field.set(target, value);
} catch (IllegalAccessException ex) {
handleReflectionException(ex);
throw new IllegalStateException(
"Unexpected reflection exception - " + ex.getClass().getName() + ": " + ex.getMessage());
}
}
/**
* Get the field represented by the supplied {@link Field field object} on the
* specified {@link Object target object}. In accordance with {@link Field#get(Object)}
* semantics, the returned value is automatically wrapped if the underlying field
* has a primitive type.
* <p>Thrown exceptions are handled via a call to {@link #handleReflectionException(Exception)}.
*
* @param field the field to get
* @param target the target object from which to get the field
* @return the field's current value
*/
public static Object getField(Field field, Object target) {
try {
return field.get(target);
} catch (IllegalAccessException ex) {
handleReflectionException(ex);
throw new IllegalStateException(
"Unexpected reflection exception - " + ex.getClass().getName() + ": " + ex.getMessage());
}
}
/**
* Attempt to find a {@link Method} on the supplied class with the supplied name
* and no parameters. Searches all superclasses up to {@code Object}.
* <p>Returns {@code null} if no {@link Method} can be found.
*
* @param clazz the class to introspect
* @param name the name of the method
* @return the Method object, or {@code null} if none found
*/
public static Method findMethod(Class<?> clazz, String name) {
return findMethod(clazz, name, new Class<?>[0]);
}
public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) {
Preconditions.checkNotNull(clazz, "Class must not be null");
Preconditions.checkNotNull(name, "Method name must not be null");
Class<?> searchType = clazz;
while (searchType != null) {
Method[] methods = (searchType.isInterface() ? searchType.getMethods() : getDeclaredMethods(searchType));
for (Method method : methods) {
if (name.equals(method.getName()) &&
(paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) {
return method;
}
}
searchType = searchType.getSuperclass();
}
return null;
}
/**
* This variant retrieves {@link Class#getDeclaredMethods()} from a local cache
* in order to avoid the JVM's SecurityManager check and defensive array copying.
* In addition, it also includes Java 8 default methods from locally implemented
* interfaces, since those are effectively to be treated just like declared methods.
*
* @param clazz the class to introspect
* @return the cached array of methods
* @see Class#getDeclaredMethods()
*/
private static Method[] getDeclaredMethods(Class<?> clazz) {
Method[] result = declaredMethodsCache.get(clazz);
if (result == null) {
Method[] declaredMethods = clazz.getDeclaredMethods();
List<Method> defaultMethods = findConcreteMethodsOnInterfaces(clazz);
if (defaultMethods != null) {
result = new Method[declaredMethods.length + defaultMethods.size()];
System.arraycopy(declaredMethods, 0, result, 0, declaredMethods.length);
int index = declaredMethods.length;
for (Method defaultMethod : defaultMethods) {
result[index] = defaultMethod;
index++;
}
} else {
result = declaredMethods;
}
declaredMethodsCache.put(clazz, (result.length == 0 ? NO_METHODS : result));
}
return result;
}
private static List<Method> findConcreteMethodsOnInterfaces(Class<?> clazz) {
List<Method> result = null;
for (Class<?> ifc : clazz.getInterfaces()) {
for (Method ifcMethod : ifc.getMethods()) {
if (!Modifier.isAbstract(ifcMethod.getModifiers())) {
if (result == null) {
result = new LinkedList<Method>();
}
result.add(ifcMethod);
}
}
}
return result;
}
/**
* Invoke the specified {@link Method} against the supplied target object with no arguments.
* The target object can be {@code null} when invoking a static {@link Method}.
* <p>Thrown exceptions are handled via a call to {@link #handleReflectionException}.
*
* @param method the method to invoke
* @param target the target object to invoke the method on
* @return the invocation result, if any
* @see #invokeMethod(Method, Object, Object[])
*/
public static Object invokeMethod(Method method, Object target) {
return invokeMethod(method, target, new Object[0]);
}
/**
* Invoke the specified {@link Method} against the supplied target object with the
* supplied arguments. The target object can be {@code null} when invoking a
* static {@link Method}.
* <p>Thrown exceptions are handled via a call to {@link #handleReflectionException}.
*
* @param method the method to invoke
* @param target the target object to invoke the method on
* @param args the invocation arguments (may be {@code null})
* @return the invocation result, if any
*/
public static Object invokeMethod(Method method, Object target, Object... args) {
try {
return method.invoke(target, args);
} catch (Exception ex) {
handleReflectionException(ex);
}
throw new IllegalStateException("Should never get here");
}
/**
* Handle the given reflection exception. Should only be called if no
* checked exception is expected to be thrown by the target method.
* <p>Throws the underlying RuntimeException or Error in case of an
* InvocationTargetException with such a root cause. Throws an
* IllegalStateException with an appropriate message else.
*
* @param ex the reflection exception to handle
*/
public static void handleReflectionException(Exception ex) {
if (ex instanceof NoSuchMethodException) {
throw new IllegalStateException("Method not found: " + ex.getMessage());
}
if (ex instanceof IllegalAccessException) {
throw new IllegalStateException("Could not access method: " + ex.getMessage());
}
if (ex instanceof InvocationTargetException) {
handleInvocationTargetException((InvocationTargetException) ex);
}
if (ex instanceof RuntimeException) {
throw (RuntimeException) ex;
}
throw new UndeclaredThrowableException(ex);
}
/**
* Handle the given invocation target exception. Should only be called if no
* checked exception is expected to be thrown by the target method.
* <p>Throws the underlying RuntimeException or Error in case of such a root
* cause. Throws an IllegalStateException else.
*
* @param ex the invocation target exception to handle
*/
public static void handleInvocationTargetException(InvocationTargetException ex) {
rethrowRuntimeException(ex.getTargetException());
}
/**
* Rethrow the given {@link Throwable exception}, which is presumably the
* <em>target exception</em> of an {@link InvocationTargetException}.
* Should only be called if no checked exception is expected to be thrown
* by the target method.
* <p>Rethrows the underlying exception cast to an {@link RuntimeException} or
* {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}.
*
* @param ex the exception to rethrow
* @throws RuntimeException the rethrown exception
*/
public static void rethrowRuntimeException(Throwable ex) {
if (ex instanceof RuntimeException) {
throw (RuntimeException) ex;
}
if (ex instanceof Error) {
throw (Error) ex;
}
throw new UndeclaredThrowableException(ex);
}
/**
* Rethrow the given {@link Throwable exception}, which is presumably the
* <em>target exception</em> of an {@link InvocationTargetException}.
* Should only be called if no checked exception is expected to be thrown
* by the target method.
* <p>Rethrows the underlying exception cast to an {@link Exception} or
* {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}.
*
* @param ex the exception to rethrow
* @throws Exception the rethrown exception (in case of a checked exception)
*/
public static void rethrowException(Throwable ex) throws Exception {
if (ex instanceof Exception) {
throw (Exception) ex;
}
if (ex instanceof Error) {
throw (Error) ex;
}
throw new UndeclaredThrowableException(ex);
}
/**
* Determine whether the given field is a "public static final" constant.
*
* @param field the field to check
*/
public static boolean isPublicStaticFinal(Field field) {
int modifiers = field.getModifiers();
return (Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers));
}
/**
* Determine whether the given method is an "equals" method.
*
* @see Object#equals(Object)
*/
public static boolean isEqualsMethod(Method method) {
if (method == null || !method.getName().equals("equals")) {
return false;
}
Class<?>[] paramTypes = method.getParameterTypes();
return (paramTypes.length == 1 && paramTypes[0] == Object.class);
}
/**
* Determine whether the given method is a "hashCode" method.
*
* @see Object#hashCode()
*/
public static boolean isHashCodeMethod(Method method) {
return (method != null && method.getName().equals("hashCode") && method.getParameterTypes().length == 0);
}
/**
* Determine whether the given method is a "toString" method.
*
* @see Object#toString()
*/
public static boolean isToStringMethod(Method method) {
return (method != null && method.getName().equals("toString") && method.getParameterTypes().length == 0);
}
/**
* Determine whether the given method is originally declared by {@link Object}.
*/
public static boolean isObjectMethod(Method method) {
if (method == null) {
return false;
}
try {
Object.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
return true;
} catch (Exception ex) {
return false;
}
}
/**
* Make the given field accessible, explicitly setting it accessible if
* necessary. The {@code setAccessible(true)} method is only called
* when actually necessary, to avoid unnecessary conflicts with a JVM
* SecurityManager (if active).
*
* @param field the field to make accessible
* @see Field#setAccessible
*/
public static void makeAccessible(Field field) {
if ((!Modifier.isPublic(field.getModifiers()) ||
!Modifier.isPublic(field.getDeclaringClass().getModifiers()) ||
Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) {
field.setAccessible(true);
}
}
/**
* Make the given method accessible, explicitly setting it accessible if
* necessary. The {@code setAccessible(true)} method is only called
* when actually necessary, to avoid unnecessary conflicts with a JVM
* SecurityManager (if active).
*
* @param method the method to make accessible
* @see Method#setAccessible
*/
public static void makeAccessible(Method method) {
if ((!Modifier.isPublic(method.getModifiers()) ||
!Modifier.isPublic(method.getDeclaringClass().getModifiers())) && !method.isAccessible()) {
method.setAccessible(true);
}
}
/**
* Make the given constructor accessible, explicitly setting it accessible
* if necessary. The {@code setAccessible(true)} method is only called
* when actually necessary, to avoid unnecessary conflicts with a JVM
* SecurityManager (if active).
*
* @param ctor the constructor to make accessible
* @see Constructor#setAccessible
*/
public static void makeAccessible(Constructor<?> ctor) {
if ((!Modifier.isPublic(ctor.getModifiers()) ||
!Modifier.isPublic(ctor.getDeclaringClass().getModifiers())) && !ctor.isAccessible()) {
ctor.setAccessible(true);
}
}
/**
* Finds a constructoron the given type that matches the given constructor arguments.
*
* @param type must not be {@literal null}.
* @param constructorArguments must not be {@literal null}.
* @return a {@link Constructor} that is compatible with the given arguments or {@literal null} if none found.
*/
public static Constructor<?> findConstructor(Class<?> type, Object... constructorArguments) {
Preconditions.checkNotNull(type, "Target type must not be null!");
Preconditions.checkNotNull(constructorArguments, "Constructor arguments must not be null!");
for (Constructor<?> candidate : type.getDeclaredConstructors()) {
Class<?>[] parameterTypes = candidate.getParameterTypes();
if (argumentsMatch(parameterTypes, constructorArguments)) {
return candidate;
}
}
return null;
}
private static boolean argumentsMatch(Class<?>[] parameterTypes, Object[] arguments) {
if (parameterTypes.length != arguments.length) {
return false;
}
int index = 0;
for (Class<?> argumentType : parameterTypes) {
Object argument = arguments[index];
// Reject nulls for primitives
if (argumentType.isPrimitive() && argument == null) {
return false;
}
// Type check if argument is not null
if (argument != null && !isAssignableValue(argumentType, argument)) {
return false;
}
index++;
}
return true;
}
/**
* Determine if the given type is assignable from the given value,
* assuming setting by reflection. Considers primitive wrapper classes
* as assignable to the corresponding primitive types.
*
* @param type the target type
* @param value the value that should be assigned to the type
* @return if the type is assignable from the value
*/
public static boolean isAssignableValue(Class<?> type, Object value) {
return (value != null ? isAssignable(type, value.getClass()) : !type.isPrimitive());
}
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
if (lhsType.isAssignableFrom(rhsType)) {
return true;
}
if (lhsType.isPrimitive()) {
Class<?> resolvedPrimitive = primitiveWrapperTypeMap.get(rhsType);
if (lhsType == resolvedPrimitive) {
return true;
}
} else {
Class<?> resolvedWrapper = primitiveTypeToWrapperMap.get(rhsType);
if (resolvedWrapper != null && lhsType.isAssignableFrom(resolvedWrapper)) {
return true;
}
}
return false;
}
}
| Tornaco/WildCard | scalpel/src/main/java/com/nick/scalpel/core/utils/ReflectionUtils.java | Java | apache-2.0 | 19,291 |
/*
Derby - Class org.apache.derby.iapi.sql.dictionary.DefaultDescriptor
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you 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.
*/
package org.apache.derby.iapi.sql.dictionary;
import org.apache.derby.catalog.Dependable;
import org.apache.derby.catalog.DependableFinder;
import org.apache.derby.catalog.UUID;
import org.apache.derby.shared.common.error.StandardException;
import org.apache.derby.shared.common.reference.SQLState;
import org.apache.derby.shared.common.i18n.MessageService;
import org.apache.derby.iapi.services.io.StoredFormatIds;
import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
import org.apache.derby.iapi.sql.depend.DependencyManager;
import org.apache.derby.iapi.sql.depend.Dependent;
import org.apache.derby.iapi.sql.depend.Provider;
/**
* This interface is used to get information from a DefaultDescriptor.
*
*/
public final class DefaultDescriptor
extends UniqueTupleDescriptor
implements Provider, Dependent
{
private final int columnNumber;
private final UUID defaultUUID;
private final UUID tableUUID;
/**
* Constructor for a DefaultDescriptor
*
* @param dataDictionary the DD
* @param defaultUUID The UUID of the default
* @param tableUUID The UUID of the table
* @param columnNumber The column number of the column that the default is for
*/
public DefaultDescriptor(DataDictionary dataDictionary, UUID defaultUUID, UUID tableUUID, int columnNumber)
{
super( dataDictionary );
this.defaultUUID = defaultUUID;
this.tableUUID = tableUUID;
this.columnNumber = columnNumber;
}
/**
* Get the UUID of the default.
*
* @return The UUID of the default.
*/
public UUID getUUID()
{
return defaultUUID;
}
/**
* Get the UUID of the table.
*
* @return The UUID of the table.
*/
public UUID getTableUUID()
{
return tableUUID;
}
/**
* Get the column number of the column.
*
* @return The column number of the column.
*/
public int getColumnNumber()
{
return columnNumber;
}
/**
* Convert the DefaultDescriptor to a String.
*
* @return A String representation of this DefaultDescriptor
*/
public String toString()
{
if (SanityManager.DEBUG)
{
/*
** NOTE: This does not format table, because table.toString()
** formats columns, leading to infinite recursion.
*/
return "defaultUUID: " + defaultUUID + "\n" +
"tableUUID: " + tableUUID + "\n" +
"columnNumber: " + columnNumber + "\n";
}
else
{
return "";
}
}
////////////////////////////////////////////////////////////////////
//
// PROVIDER INTERFACE
//
////////////////////////////////////////////////////////////////////
/**
@return the stored form of this provider
@see Dependable#getDependableFinder
*/
public DependableFinder getDependableFinder()
{
return getDependableFinder(StoredFormatIds.DEFAULT_DESCRIPTOR_FINDER_V01_ID);
}
/**
* Return the name of this Provider. (Useful for errors.)
*
* @return String The name of this provider.
*/
public String getObjectName()
{
return "default";
}
/**
* Get the provider's UUID
*
* @return The provider's UUID
*/
public UUID getObjectID()
{
return defaultUUID;
}
/**
* Get the provider's type.
*
* @return char The provider's type.
*/
public String getClassType()
{
return Dependable.DEFAULT;
}
//////////////////////////////////////////////////////
//
// DEPENDENT INTERFACE
//
//////////////////////////////////////////////////////
/**
* Check that all of the dependent's dependencies are valid.
*
* @return true if the dependent is currently valid
*/
public synchronized boolean isValid()
{
return true;
}
/**
* Prepare to mark the dependent as invalid (due to at least one of
* its dependencies being invalid).
*
* @param action The action causing the invalidation
* @param p the provider
*
* @exception StandardException thrown if unable to make it invalid
*/
public void prepareToInvalidate(Provider p, int action,
LanguageConnectionContext lcc)
throws StandardException
{
DependencyManager dm = getDataDictionary().getDependencyManager();
switch (action)
{
/*
** Currently, the only thing we are depenedent
** on is an alias.
*/
default:
DataDictionary dd = getDataDictionary();
ColumnDescriptor cd = dd.getColumnDescriptorByDefaultId(defaultUUID);
TableDescriptor td = dd.getTableDescriptor(cd.getReferencingUUID());
throw StandardException.newException(SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,
dm.getActionString(action),
p.getObjectName(), "DEFAULT",
td.getQualifiedName() + "." +
cd.getColumnName());
}
}
/**
* Mark the dependent as invalid (due to at least one of
* its dependencies being invalid). Always an error
* for a constraint -- should never have gotten here.
*
* @param action The action causing the invalidation
*
* @exception StandardException thrown if called in sanity mode
*/
public void makeInvalid(int action, LanguageConnectionContext lcc)
throws StandardException
{
/*
** We should never get here, we should have barfed on
** prepareToInvalidate().
*/
if (SanityManager.DEBUG)
{
DependencyManager dm;
dm = getDataDictionary().getDependencyManager();
SanityManager.THROWASSERT("makeInvalid("+
dm.getActionString(action)+
") not expected to get called");
}
}
}
| apache/derby | java/org.apache.derby.engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java | Java | apache-2.0 | 6,240 |
class interface(object):
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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.
specs={}
specsGui={}
| schristakidis/p2ner | p2ner/components/output/nulloutput/nulloutput/interface.py | Python | apache-2.0 | 682 |
//// [classWithPredefinedTypesAsNames.ts]
// classes cannot use predefined types as names
class any { }
class number { }
class boolean { }
class string { }
//// [classWithPredefinedTypesAsNames.js]
var any = (function () {
function any() {
}
return any;
})();
var number = (function () {
function number() {
}
return number;
})();
var boolean = (function () {
function boolean() {
}
return boolean;
})();
var string = (function () {
function string() {
}
return string;
})();
| DickvdBrink/TypeScript | tests/baselines/reference/classWithPredefinedTypesAsNames.js | JavaScript | apache-2.0 | 550 |
<?php
/**
* This is a standard Phabricator page with menus, Javelin, DarkConsole, and
* basic styles.
*/
final class PhabricatorStandardPageView extends PhabricatorBarePageView
implements AphrontResponseProducerInterface {
private $baseURI;
private $applicationName;
private $glyph;
private $menuContent;
private $showChrome = true;
private $classes = array();
private $disableConsole;
private $pageObjects = array();
private $applicationMenu;
private $showFooter = true;
private $showDurableColumn = true;
private $quicksandConfig = array();
private $tabs;
private $crumbs;
private $navigation;
public function setShowFooter($show_footer) {
$this->showFooter = $show_footer;
return $this;
}
public function getShowFooter() {
return $this->showFooter;
}
public function setApplicationMenu($application_menu) {
// NOTE: For now, this can either be a PHUIListView or a
// PHUIApplicationMenuView.
$this->applicationMenu = $application_menu;
return $this;
}
public function getApplicationMenu() {
return $this->applicationMenu;
}
public function setApplicationName($application_name) {
$this->applicationName = $application_name;
return $this;
}
public function setDisableConsole($disable) {
$this->disableConsole = $disable;
return $this;
}
public function getApplicationName() {
return $this->applicationName;
}
public function setBaseURI($base_uri) {
$this->baseURI = $base_uri;
return $this;
}
public function getBaseURI() {
return $this->baseURI;
}
public function setShowChrome($show_chrome) {
$this->showChrome = $show_chrome;
return $this;
}
public function getShowChrome() {
return $this->showChrome;
}
public function addClass($class) {
$this->classes[] = $class;
return $this;
}
public function setPageObjectPHIDs(array $phids) {
$this->pageObjects = $phids;
return $this;
}
public function setShowDurableColumn($show) {
$this->showDurableColumn = $show;
return $this;
}
public function getShowDurableColumn() {
$request = $this->getRequest();
if (!$request) {
return false;
}
$viewer = $request->getUser();
if (!$viewer->isLoggedIn()) {
return false;
}
$conpherence_installed = PhabricatorApplication::isClassInstalledForViewer(
'PhabricatorConpherenceApplication',
$viewer);
if (!$conpherence_installed) {
return false;
}
if ($this->isQuicksandBlacklistURI()) {
return false;
}
return true;
}
private function isQuicksandBlacklistURI() {
$request = $this->getRequest();
if (!$request) {
return false;
}
$patterns = $this->getQuicksandURIPatternBlacklist();
$path = $request->getRequestURI()->getPath();
foreach ($patterns as $pattern) {
if (preg_match('(^'.$pattern.'$)', $path)) {
return true;
}
}
return false;
}
public function getDurableColumnVisible() {
$column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY;
return (bool)$this->getUserPreference($column_key, false);
}
public function getDurableColumnMinimize() {
$column_key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY;
return (bool)$this->getUserPreference($column_key, false);
}
public function addQuicksandConfig(array $config) {
$this->quicksandConfig = $config + $this->quicksandConfig;
return $this;
}
public function getQuicksandConfig() {
return $this->quicksandConfig;
}
public function setCrumbs(PHUICrumbsView $crumbs) {
$this->crumbs = $crumbs;
return $this;
}
public function getCrumbs() {
return $this->crumbs;
}
public function setTabs(PHUIListView $tabs) {
$tabs->setType(PHUIListView::TABBAR_LIST);
$tabs->addClass('phabricator-standard-page-tabs');
$this->tabs = $tabs;
return $this;
}
public function getTabs() {
return $this->tabs;
}
public function setNavigation(AphrontSideNavFilterView $navigation) {
$this->navigation = $navigation;
return $this;
}
public function getNavigation() {
return $this->navigation;
}
public function getTitle() {
$glyph_key = PhabricatorTitleGlyphsSetting::SETTINGKEY;
$glyph_on = PhabricatorTitleGlyphsSetting::VALUE_TITLE_GLYPHS;
$glyph_setting = $this->getUserPreference($glyph_key, $glyph_on);
$use_glyph = ($glyph_setting == $glyph_on);
$title = parent::getTitle();
$prefix = null;
if ($use_glyph) {
$prefix = $this->getGlyph();
} else {
$application_name = $this->getApplicationName();
if (strlen($application_name)) {
$prefix = '['.$application_name.']';
}
}
if (strlen($prefix)) {
$title = $prefix.' '.$title;
}
return $title;
}
protected function willRenderPage() {
parent::willRenderPage();
if (!$this->getRequest()) {
throw new Exception(
pht(
'You must set the %s to render a %s.',
'Request',
__CLASS__));
}
$console = $this->getConsole();
require_celerity_resource('phabricator-core-css');
require_celerity_resource('phabricator-zindex-css');
require_celerity_resource('phui-button-css');
require_celerity_resource('phui-spacing-css');
require_celerity_resource('phui-form-css');
require_celerity_resource('phabricator-standard-page-view');
require_celerity_resource('conpherence-durable-column-view');
require_celerity_resource('font-lato');
Javelin::initBehavior('workflow', array());
$request = $this->getRequest();
$user = null;
if ($request) {
$user = $request->getUser();
}
if ($user) {
if ($user->isUserActivated()) {
$offset = $user->getTimeZoneOffset();
$ignore_key = PhabricatorTimezoneIgnoreOffsetSetting::SETTINGKEY;
$ignore = $user->getUserSetting($ignore_key);
Javelin::initBehavior(
'detect-timezone',
array(
'offset' => $offset,
'uri' => '/settings/timezone/',
'message' => pht(
'Your browser timezone setting differs from the timezone '.
'setting in your profile, click to reconcile.'),
'ignoreKey' => $ignore_key,
'ignore' => $ignore,
));
if ($user->getIsAdmin()) {
$server_https = $request->isHTTPS();
$server_protocol = $server_https ? 'HTTPS' : 'HTTP';
$client_protocol = $server_https ? 'HTTP' : 'HTTPS';
$doc_name = 'Configuring a Preamble Script';
$doc_href = PhabricatorEnv::getDoclink($doc_name);
Javelin::initBehavior(
'setup-check-https',
array(
'server_https' => $server_https,
'doc_name' => pht('See Documentation'),
'doc_href' => $doc_href,
'message' => pht(
'Phabricator thinks you are using %s, but your '.
'client is convinced that it is using %s. This is a serious '.
'misconfiguration with subtle, but significant, consequences.',
$server_protocol, $client_protocol),
));
}
}
$icon = id(new PHUIIconView())
->setIcon('fa-download')
->addClass('phui-icon-circle-icon');
$lightbox_id = celerity_generate_unique_node_id();
$download_form = phabricator_form(
$user,
array(
'action' => '#',
'method' => 'POST',
'class' => 'lightbox-download-form',
'sigil' => 'download lightbox-download-submit',
'id' => 'lightbox-download-form',
),
phutil_tag(
'a',
array(
'class' => 'lightbox-download phui-icon-circle hover-green',
'href' => '#',
),
array(
$icon,
)));
Javelin::initBehavior(
'lightbox-attachments',
array(
'lightbox_id' => $lightbox_id,
'downloadForm' => $download_form,
));
}
Javelin::initBehavior('aphront-form-disable-on-submit');
Javelin::initBehavior('toggle-class', array());
Javelin::initBehavior('history-install');
Javelin::initBehavior('phabricator-gesture');
$current_token = null;
if ($user) {
$current_token = $user->getCSRFToken();
}
Javelin::initBehavior(
'refresh-csrf',
array(
'tokenName' => AphrontRequest::getCSRFTokenName(),
'header' => AphrontRequest::getCSRFHeaderName(),
'viaHeader' => AphrontRequest::getViaHeaderName(),
'current' => $current_token,
));
Javelin::initBehavior('device');
Javelin::initBehavior(
'high-security-warning',
$this->getHighSecurityWarningConfig());
if (PhabricatorEnv::isReadOnly()) {
Javelin::initBehavior(
'read-only-warning',
array(
'message' => PhabricatorEnv::getReadOnlyMessage(),
'uri' => PhabricatorEnv::getReadOnlyURI(),
));
}
if ($console) {
require_celerity_resource('aphront-dark-console-css');
$headers = array();
if (DarkConsoleXHProfPluginAPI::isProfilerStarted()) {
$headers[DarkConsoleXHProfPluginAPI::getProfilerHeader()] = 'page';
}
if (DarkConsoleServicesPlugin::isQueryAnalyzerRequested()) {
$headers[DarkConsoleServicesPlugin::getQueryAnalyzerHeader()] = true;
}
Javelin::initBehavior(
'dark-console',
$this->getConsoleConfig());
// Change this to initBehavior when there is some behavior to initialize
require_celerity_resource('javelin-behavior-error-log');
}
if ($user) {
$viewer = $user;
} else {
$viewer = new PhabricatorUser();
}
$menu = id(new PhabricatorMainMenuView())
->setUser($viewer);
if ($this->getController()) {
$menu->setController($this->getController());
}
$application_menu = $this->getApplicationMenu();
if ($application_menu) {
if ($application_menu instanceof PHUIApplicationMenuView) {
$crumbs = $this->getCrumbs();
if ($crumbs) {
$application_menu->setCrumbs($crumbs);
}
$application_menu = $application_menu->buildListView();
}
$menu->setApplicationMenu($application_menu);
}
$this->menuContent = $menu->render();
}
protected function getHead() {
$monospaced = null;
$request = $this->getRequest();
if ($request) {
$user = $request->getUser();
if ($user) {
$monospaced = $user->getUserSetting(
PhabricatorMonospacedFontSetting::SETTINGKEY);
}
}
$response = CelerityAPI::getStaticResourceResponse();
$font_css = null;
if (!empty($monospaced)) {
// We can't print this normally because escaping quotation marks will
// break the CSS. Instead, filter it strictly and then mark it as safe.
$monospaced = new PhutilSafeHTML(
PhabricatorMonospacedFontSetting::filterMonospacedCSSRule(
$monospaced));
$font_css = hsprintf(
'<style type="text/css">'.
'.PhabricatorMonospaced, '.
'.phabricator-remarkup .remarkup-code-block '.
'.remarkup-code { font: %s !important; } '.
'</style>',
$monospaced);
}
return hsprintf(
'%s%s%s',
parent::getHead(),
$font_css,
$response->renderSingleResource('javelin-magical-init', 'phabricator'));
}
public function setGlyph($glyph) {
$this->glyph = $glyph;
return $this;
}
public function getGlyph() {
return $this->glyph;
}
protected function willSendResponse($response) {
$request = $this->getRequest();
$response = parent::willSendResponse($response);
$console = $request->getApplicationConfiguration()->getConsole();
if ($console) {
$response = PhutilSafeHTML::applyFunction(
'str_replace',
hsprintf('<darkconsole />'),
$console->render($request),
$response);
}
return $response;
}
protected function getBody() {
$user = null;
$request = $this->getRequest();
if ($request) {
$user = $request->getUser();
}
$header_chrome = null;
if ($this->getShowChrome()) {
$header_chrome = $this->menuContent;
}
$classes = array();
$classes[] = 'main-page-frame';
$developer_warning = null;
if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode') &&
DarkConsoleErrorLogPluginAPI::getErrors()) {
$developer_warning = phutil_tag_div(
'aphront-developer-error-callout',
pht(
'This page raised PHP errors. Find them in DarkConsole '.
'or the error log.'));
}
$main_page = phutil_tag(
'div',
array(
'id' => 'phabricator-standard-page',
'class' => 'phabricator-standard-page',
),
array(
$developer_warning,
$header_chrome,
phutil_tag(
'div',
array(
'id' => 'phabricator-standard-page-body',
'class' => 'phabricator-standard-page-body',
),
$this->renderPageBodyContent()),
));
$durable_column = null;
if ($this->getShowDurableColumn()) {
$is_visible = $this->getDurableColumnVisible();
$is_minimize = $this->getDurableColumnMinimize();
$durable_column = id(new ConpherenceDurableColumnView())
->setSelectedConpherence(null)
->setUser($user)
->setQuicksandConfig($this->buildQuicksandConfig())
->setVisible($is_visible)
->setMinimize($is_minimize)
->setInitialLoad(true);
if ($is_minimize) {
$this->classes[] = 'minimize-column';
}
}
Javelin::initBehavior('quicksand-blacklist', array(
'patterns' => $this->getQuicksandURIPatternBlacklist(),
));
return phutil_tag(
'div',
array(
'class' => implode(' ', $classes),
'id' => 'main-page-frame',
),
array(
$main_page,
$durable_column,
));
}
private function renderPageBodyContent() {
$console = $this->getConsole();
$body = parent::getBody();
$footer = $this->renderFooter();
$nav = $this->getNavigation();
$tabs = $this->getTabs();
if ($nav) {
$crumbs = $this->getCrumbs();
if ($crumbs) {
$nav->setCrumbs($crumbs);
}
$nav->appendChild($body);
$nav->appendFooter($footer);
$content = phutil_implode_html('', array($nav->render()));
} else {
$content = array();
$crumbs = $this->getCrumbs();
if ($crumbs) {
if ($this->getTabs()) {
$crumbs->setBorder(true);
}
$content[] = $crumbs;
}
$tabs = $this->getTabs();
if ($tabs) {
$content[] = $tabs;
}
$content[] = $body;
$content[] = $footer;
$content = phutil_implode_html('', $content);
}
return array(
($console ? hsprintf('<darkconsole />') : null),
$content,
);
}
protected function getTail() {
$request = $this->getRequest();
$user = $request->getUser();
$tail = array(
parent::getTail(),
);
$response = CelerityAPI::getStaticResourceResponse();
if ($request->isHTTPS()) {
$with_protocol = 'https';
} else {
$with_protocol = 'http';
}
$servers = PhabricatorNotificationServerRef::getEnabledClientServers(
$with_protocol);
if ($servers) {
if ($user && $user->isLoggedIn()) {
// TODO: We could tell the browser about all the servers and let it
// do random reconnects to improve reliability.
shuffle($servers);
$server = head($servers);
$client_uri = $server->getWebsocketURI();
Javelin::initBehavior(
'aphlict-listen',
array(
'websocketURI' => (string)$client_uri,
) + $this->buildAphlictListenConfigData());
}
}
$tail[] = $response->renderHTMLFooter();
return $tail;
}
protected function getBodyClasses() {
$classes = array();
if (!$this->getShowChrome()) {
$classes[] = 'phabricator-chromeless-page';
}
$agent = AphrontRequest::getHTTPHeader('User-Agent');
// Try to guess the device resolution based on UA strings to avoid a flash
// of incorrectly-styled content.
$device_guess = 'device-desktop';
if (preg_match('@iPhone|iPod|(Android.*Chrome/[.0-9]* Mobile)@', $agent)) {
$device_guess = 'device-phone device';
} else if (preg_match('@iPad|(Android.*Chrome/)@', $agent)) {
$device_guess = 'device-tablet device';
}
$classes[] = $device_guess;
if (preg_match('@Windows@', $agent)) {
$classes[] = 'platform-windows';
} else if (preg_match('@Macintosh@', $agent)) {
$classes[] = 'platform-mac';
} else if (preg_match('@X11@', $agent)) {
$classes[] = 'platform-linux';
}
if ($this->getRequest()->getStr('__print__')) {
$classes[] = 'printable';
}
if ($this->getRequest()->getStr('__aural__')) {
$classes[] = 'audible';
}
$classes[] = 'phui-theme-'.PhabricatorEnv::getEnvConfig('ui.header-color');
foreach ($this->classes as $class) {
$classes[] = $class;
}
return implode(' ', $classes);
}
private function getConsole() {
if ($this->disableConsole) {
return null;
}
return $this->getRequest()->getApplicationConfiguration()->getConsole();
}
private function getConsoleConfig() {
$user = $this->getRequest()->getUser();
$headers = array();
if (DarkConsoleXHProfPluginAPI::isProfilerStarted()) {
$headers[DarkConsoleXHProfPluginAPI::getProfilerHeader()] = 'page';
}
if (DarkConsoleServicesPlugin::isQueryAnalyzerRequested()) {
$headers[DarkConsoleServicesPlugin::getQueryAnalyzerHeader()] = true;
}
if ($user) {
$setting_tab = PhabricatorDarkConsoleTabSetting::SETTINGKEY;
$setting_visible = PhabricatorDarkConsoleVisibleSetting::SETTINGKEY;
$tab = $user->getUserSetting($setting_tab);
$visible = $user->getUserSetting($setting_visible);
} else {
$tab = null;
$visible = true;
}
return array(
// NOTE: We use a generic label here to prevent input reflection
// and mitigate compression attacks like BREACH. See discussion in
// T3684.
'uri' => pht('Main Request'),
'selected' => $tab,
'visible' => $visible,
'headers' => $headers,
);
}
private function getHighSecurityWarningConfig() {
$user = $this->getRequest()->getUser();
$show = false;
if ($user->hasSession()) {
$hisec = ($user->getSession()->getHighSecurityUntil() - time());
if ($hisec > 0) {
$show = true;
}
}
return array(
'show' => $show,
'uri' => '/auth/session/downgrade/',
'message' => pht(
'Your session is in high security mode. When you '.
'finish using it, click here to leave.'),
);
}
private function renderFooter() {
if (!$this->getShowChrome()) {
return null;
}
if (!$this->getShowFooter()) {
return null;
}
$items = PhabricatorEnv::getEnvConfig('ui.footer-items');
if (!$items) {
return null;
}
$foot = array();
foreach ($items as $item) {
$name = idx($item, 'name', pht('Unnamed Footer Item'));
$href = idx($item, 'href');
if (!PhabricatorEnv::isValidURIForLink($href)) {
$href = null;
}
if ($href !== null) {
$tag = 'a';
} else {
$tag = 'span';
}
$foot[] = phutil_tag(
$tag,
array(
'href' => $href,
),
$name);
}
$foot = phutil_implode_html(" \xC2\xB7 ", $foot);
return phutil_tag(
'div',
array(
'class' => 'phabricator-standard-page-footer grouped',
),
$foot);
}
public function renderForQuicksand() {
parent::willRenderPage();
$response = $this->renderPageBodyContent();
$response = $this->willSendResponse($response);
$extra_config = $this->getQuicksandConfig();
return array(
'content' => hsprintf('%s', $response),
) + $this->buildQuicksandConfig()
+ $extra_config;
}
private function buildQuicksandConfig() {
$viewer = $this->getRequest()->getUser();
$controller = $this->getController();
$dropdown_query = id(new AphlictDropdownDataQuery())
->setViewer($viewer);
$dropdown_query->execute();
$hisec_warning_config = $this->getHighSecurityWarningConfig();
$console_config = null;
$console = $this->getConsole();
if ($console) {
$console_config = $this->getConsoleConfig();
}
$upload_enabled = false;
if ($controller) {
$upload_enabled = $controller->isGlobalDragAndDropUploadEnabled();
}
$application_class = null;
$application_search_icon = null;
$application_help = null;
$controller = $this->getController();
if ($controller) {
$application = $controller->getCurrentApplication();
if ($application) {
$application_class = get_class($application);
if ($application->getApplicationSearchDocumentTypes()) {
$application_search_icon = $application->getIcon();
}
$help_items = $application->getHelpMenuItems($viewer);
if ($help_items) {
$help_list = id(new PhabricatorActionListView())
->setViewer($viewer);
foreach ($help_items as $help_item) {
$help_list->addAction($help_item);
}
$application_help = $help_list->getDropdownMenuMetadata();
}
}
}
return array(
'title' => $this->getTitle(),
'bodyClasses' => $this->getBodyClasses(),
'aphlictDropdownData' => array(
$dropdown_query->getNotificationData(),
$dropdown_query->getConpherenceData(),
),
'globalDragAndDrop' => $upload_enabled,
'hisecWarningConfig' => $hisec_warning_config,
'consoleConfig' => $console_config,
'applicationClass' => $application_class,
'applicationSearchIcon' => $application_search_icon,
'helpItems' => $application_help,
) + $this->buildAphlictListenConfigData();
}
private function buildAphlictListenConfigData() {
$user = $this->getRequest()->getUser();
$subscriptions = $this->pageObjects;
$subscriptions[] = $user->getPHID();
return array(
'pageObjects' => array_fill_keys($this->pageObjects, true),
'subscriptions' => $subscriptions,
);
}
private function getQuicksandURIPatternBlacklist() {
$applications = PhabricatorApplication::getAllApplications();
$blacklist = array();
foreach ($applications as $application) {
$blacklist[] = $application->getQuicksandURIPatternBlacklist();
}
return array_mergev($blacklist);
}
private function getUserPreference($key, $default = null) {
$request = $this->getRequest();
if (!$request) {
return $default;
}
$user = $request->getUser();
if (!$user) {
return $default;
}
return $user->getUserSetting($key);
}
public function produceAphrontResponse() {
$controller = $this->getController();
if (!$this->getApplicationMenu()) {
$application_menu = $controller->buildApplicationMenu();
if ($application_menu) {
$this->setApplicationMenu($application_menu);
}
}
$viewer = $this->getUser();
if ($viewer && $viewer->getPHID()) {
$object_phids = $this->pageObjects;
foreach ($object_phids as $object_phid) {
PhabricatorFeedStoryNotification::updateObjectNotificationViews(
$viewer,
$object_phid);
}
}
if ($this->getRequest()->isQuicksand()) {
$content = $this->renderForQuicksand();
$response = id(new AphrontAjaxResponse())
->setContent($content);
} else {
$content = $this->render();
$response = id(new AphrontWebpageResponse())
->setContent($content)
->setFrameable($this->getFrameable());
}
return $response;
}
}
| r4nt/phabricator | src/view/page/PhabricatorStandardPageView.php | PHP | apache-2.0 | 24,331 |
// Copyright 2016 The Bazel Authors. All rights reserved.
//
// 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.
package com.google.devtools.build.lib.skylarkinterface;
/** A category of a Java type exposed to Skylark */
public enum SkylarkModuleCategory {
CONFIGURATION_FRAGMENT("Configuration Fragments",
"Configuration fragments give rules access to "
+ "language-specific parts of <a href=\"configuration.html\">"
+ "configuration</a>. "
+ "<p>Rule implementations can get them using "
+ "<code><a href=\"ctx.html#fragments\">ctx."
+ "fragments</a>.<i>[fragment name]</i></code>"),
PROVIDER("Providers",
"This section lists providers available on built-in rules. See the "
+ "<a href='../rules.$DOC_EXT#providers'>Rules page</a> for more on providers."
),
BUILTIN("Built-in Types and Modules", ""),
TOP_LEVEL_TYPE,
NONE;
private final String title;
private final String description;
SkylarkModuleCategory(String title, String description) {
this.title = title;
this.description = description;
}
SkylarkModuleCategory() {
this.title = null;
this.description = null;
}
public String getTemplateIdentifier() {
return name().toLowerCase().replace("_", "-");
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
}
| dropbox/bazel | src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkModuleCategory.java | Java | apache-2.0 | 1,885 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you 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.
*/
package org.elasticsearch.search.functionscore;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.lucene.search.function.CombineFunction;
import org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery;
import org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery.ScoreMode;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder;
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.search.MultiValueMode;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.test.VersionUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
import static org.elasticsearch.client.Requests.indexRequest;
import static org.elasticsearch.client.Requests.searchRequest;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery;
import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery;
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.exponentialDecayFunction;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.gaussDecayFunction;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.linearDecayFunction;
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertOrderedSearchHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isOneOf;
import static org.hamcrest.Matchers.lessThan;
public class DecayFunctionScoreIT extends ESIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return pluginList(InternalSettingsPlugin.class); // uses index.version.created
}
private final QueryBuilder baseQuery = constantScoreQuery(termQuery("test", "value"));
public void testDistanceScoreGeoLinGaussExp() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("loc").field("type", "geo_point").endObject().endObject().endObject().endObject()));
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();
indexBuilders.add(client().prepareIndex()
.setType("type1")
.setId("1")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startObject("loc").field("lat", 10).field("lon", 20).endObject()
.endObject()));
indexBuilders.add(client().prepareIndex()
.setType("type1")
.setId("2")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startObject("loc").field("lat", 11).field("lon", 22).endObject()
.endObject()));
int numDummyDocs = 20;
for (int i = 1; i <= numDummyDocs; i++) {
indexBuilders.add(client().prepareIndex()
.setType("type1")
.setId(Integer.toString(i + 3))
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startObject("loc").field("lat", 11 + i).field("lon", 22 + i)
.endObject().endObject()));
}
indexRandom(true, indexBuilders);
// Test Gauss
List<Float> lonlat = new ArrayList<>();
lonlat.add(20f);
lonlat.add(11f);
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(baseQuery)));
SearchResponse sr = response.actionGet();
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("loc", lonlat, "1000km")))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat(sh.getAt(1).getId(), equalTo("2"));
// Test Exp
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(baseQuery)));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, linearDecayFunction("loc", lonlat, "1000km")))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat(sh.getAt(1).getId(), equalTo("2"));
// Test Lin
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(baseQuery)));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, exponentialDecayFunction("loc", lonlat, "1000km")))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat(sh.getAt(1).getId(), equalTo("2"));
}
public void testDistanceScoreGeoLinGaussExpWithOffset() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num").field("type", "double").endObject().endObject().endObject().endObject()));
// add tw docs within offset
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();
indexBuilders.add(client().prepareIndex().setType("type1").setId("1").setIndex("test")
.setSource(jsonBuilder().startObject().field("test", "value").field("num", 0.5).endObject()));
indexBuilders.add(client().prepareIndex().setType("type1").setId("2").setIndex("test")
.setSource(jsonBuilder().startObject().field("test", "value").field("num", 1.7).endObject()));
// add docs outside offset
int numDummyDocs = 20;
for (int i = 0; i < numDummyDocs; i++) {
indexBuilders.add(client().prepareIndex().setType("type1").setId(Integer.toString(i + 3)).setIndex("test")
.setSource(jsonBuilder().startObject().field("test", "value").field("num", 3.0 + i).endObject()));
}
indexRandom(true, indexBuilders);
// Test Gauss
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource()
.size(numDummyDocs + 2)
.query(functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("num", 1.0, 5.0, 1.0))
.boostMode(CombineFunction.REPLACE))));
SearchResponse sr = response.actionGet();
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).score(), equalTo(sh.getAt(0).score()));
for (int i = 0; i < numDummyDocs; i++) {
assertThat(sh.getAt(i + 2).getId(), equalTo(Integer.toString(i + 3)));
}
// Test Exp
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource()
.size(numDummyDocs + 2)
.query(functionScoreQuery(termQuery("test", "value"),
exponentialDecayFunction("num", 1.0, 5.0, 1.0)).boostMode(
CombineFunction.REPLACE))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).score(), equalTo(sh.getAt(0).score()));
for (int i = 0; i < numDummyDocs; i++) {
assertThat(sh.getAt(i + 2).getId(), equalTo(Integer.toString(i + 3)));
}
// Test Lin
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource()
.size(numDummyDocs + 2)
.query(functionScoreQuery(termQuery("test", "value"), linearDecayFunction("num", 1.0, 20.0, 1.0))
.boostMode(CombineFunction.REPLACE))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (numDummyDocs + 2)));
assertThat(sh.getAt(0).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).getId(), anyOf(equalTo("1"), equalTo("2")));
assertThat(sh.getAt(1).score(), equalTo(sh.getAt(0).score()));
}
public void testBoostModeSettingWorks() throws Exception {
Settings settings = Settings.builder().put(IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1).build();
assertAcked(prepareCreate("test").setSettings(settings)
.addMapping(
"type1",
jsonBuilder()
.startObject()
.startObject("type1")
.startObject("properties")
.startObject("test").field("type", "text").endObject()
.startObject("loc").field("type", "geo_point").endObject()
.endObject()
.endObject()
.endObject()));
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();
indexBuilders.add(client().prepareIndex()
.setType("type1")
.setId("1")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startObject("loc").field("lat", 11).field("lon", 21).endObject()
.endObject()));
indexBuilders.add(client().prepareIndex()
.setType("type1")
.setId("2")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value value").startObject("loc").field("lat", 11).field("lon", 20)
.endObject().endObject()));
indexRandom(true, false, indexBuilders); // force no dummy docs
// Test Gauss
List<Float> lonlat = new ArrayList<>();
lonlat.add(20f);
lonlat.add(11f);
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("loc", lonlat, "1000km")).boostMode(
CombineFunction.MULTIPLY))));
SearchResponse sr = response.actionGet();
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (2)));
assertThat(sh.getAt(0).getId(), isOneOf("1"));
assertThat(sh.getAt(1).getId(), equalTo("2"));
// Test Exp
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("loc", lonlat, "1000km")).boostMode(
CombineFunction.REPLACE))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (2)));
assertThat(sh.getAt(0).getId(), equalTo("2"));
assertThat(sh.getAt(1).getId(), equalTo("1"));
}
public void testParseGeoPoint() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("loc").field("type", "geo_point").endObject().endObject().endObject().endObject()));
client().prepareIndex()
.setType("type1")
.setId("1")
.setIndex("test")
.setSource(
jsonBuilder().startObject()
.field("test", "value")
.startObject("loc")
.field("lat", 20)
.field("lon", 11)
.endObject()
.endObject()).setRefreshPolicy(IMMEDIATE).get();
FunctionScoreQueryBuilder baseQuery = functionScoreQuery(constantScoreQuery(termQuery("test", "value")),
ScoreFunctionBuilders.weightFactorFunction(randomIntBetween(1, 10)));
GeoPoint point = new GeoPoint(20, 11);
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("loc", point, "1000km")).boostMode(
CombineFunction.REPLACE))));
SearchResponse sr = response.actionGet();
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(1.0, 1.e-5));
// this is equivalent to new GeoPoint(20, 11); just flipped so scores must be same
float[] coords = { 11, 20 };
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("loc", coords, "1000km")).boostMode(
CombineFunction.REPLACE))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(1.0f, 1.e-5));
}
public void testCombineModes() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num").field("type", "double").endObject().endObject().endObject().endObject()));
client().prepareIndex().setType("type1").setId("1").setIndex("test").setRefreshPolicy(IMMEDIATE)
.setSource(jsonBuilder().startObject().field("test", "value value").field("num", 1.0).endObject()).get();
FunctionScoreQueryBuilder baseQuery = functionScoreQuery(constantScoreQuery(termQuery("test", "value")),
ScoreFunctionBuilders.weightFactorFunction(2));
// decay score should return 0.5 for this function and baseQuery should return 2.0f as it's score
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.MULTIPLY))));
SearchResponse sr = response.actionGet();
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(1.0, 1.e-5));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.REPLACE))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(0.5, 1.e-5));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.SUM))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(2.0 + 0.5, 1.e-5));
logger.info("--> Hit[0] {} Explanation:\n {}", sr.getHits().getAt(0).id(), sr.getHits().getAt(0).explanation());
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.AVG))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo((2.0 + 0.5) / 2, 1.e-5));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.MIN))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(0.5, 1.e-5));
response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, gaussDecayFunction("num", 0.0, 1.0, null, 0.5))
.boostMode(CombineFunction.MAX))));
sr = response.actionGet();
sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (1)));
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat((double) sh.getAt(0).score(), closeTo(2.0, 1.e-5));
}
public void testExceptionThrownIfScaleLE0() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num1").field("type", "date").endObject().endObject().endObject().endObject()));
client().index(
indexRequest("test").type("type1").id("1")
.source(jsonBuilder().startObject().field("test", "value").field("num1", "2013-05-27").endObject())).actionGet();
client().index(
indexRequest("test").type("type1").id("2")
.source(jsonBuilder().startObject().field("test", "value").field("num1", "2013-05-28").endObject())).actionGet();
refresh();
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("num1", "2013-05-28", "-1d")))));
try {
response.actionGet();
fail("Expected SearchPhaseExecutionException");
} catch (SearchPhaseExecutionException e) {
assertThat(e.getMessage(), is("all shards failed"));
}
}
public void testParseDateMath() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject()
.startObject("type1")
.startObject("properties")
.startObject("test")
.field("type", "text")
.endObject()
.startObject("num1")
.field("type", "date")
.field("format", "epoch_millis")
.endObject()
.endObject()
.endObject()
.endObject()));
client().index(indexRequest("test").type("type1").id("1")
.source(jsonBuilder().startObject().field("test", "value").field("num1", System.currentTimeMillis()).endObject()))
.actionGet();
client().index(indexRequest("test").type("type1").id("2").source(jsonBuilder().startObject().field("test", "value")
.field("num1", System.currentTimeMillis() - (1000 * 60 * 60 * 24)).endObject())).actionGet();
refresh();
SearchResponse sr = client().search(
searchRequest().source(
searchSource().query(
functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("num1", "now", "2d"))))).get();
assertNoFailures(sr);
assertOrderedSearchHits(sr, "1", "2");
sr = client().search(
searchRequest().source(
searchSource().query(
functionScoreQuery(termQuery("test", "value"), gaussDecayFunction("num1", "now-1d", "2d"))))).get();
assertNoFailures(sr);
assertOrderedSearchHits(sr, "2", "1");
}
public void testValueMissingLin() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num1").field("type", "date").endObject().startObject("num2").field("type", "double")
.endObject().endObject().endObject().endObject())
);
client().index(
indexRequest("test").type("type1").id("1")
.source(jsonBuilder().startObject().field("test", "value").field("num1", "2013-05-27").field("num2", "1.0")
.endObject())).actionGet();
client().index(
indexRequest("test").type("type1").id("2")
.source(jsonBuilder().startObject().field("test", "value").field("num2", "1.0").endObject())).actionGet();
client().index(
indexRequest("test").type("type1").id("3")
.source(jsonBuilder().startObject().field("test", "value").field("num1", "2013-05-30").field("num2", "1.0")
.endObject())).actionGet();
client().index(
indexRequest("test").type("type1").id("4")
.source(jsonBuilder().startObject().field("test", "value").field("num1", "2013-05-30").endObject())).actionGet();
refresh();
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(baseQuery, new FilterFunctionBuilder[]{
new FilterFunctionBuilder(linearDecayFunction("num1", "2013-05-28", "+3d")),
new FilterFunctionBuilder(linearDecayFunction("num2", "0.0", "1"))
}).scoreMode(FiltersFunctionScoreQuery.ScoreMode.MULTIPLY))));
SearchResponse sr = response.actionGet();
assertNoFailures(sr);
SearchHits sh = sr.getHits();
assertThat(sh.hits().length, equalTo(4));
double[] scores = new double[4];
for (int i = 0; i < sh.hits().length; i++) {
scores[Integer.parseInt(sh.getAt(i).getId()) - 1] = sh.getAt(i).getScore();
}
assertThat(scores[0], lessThan(scores[1]));
assertThat(scores[2], lessThan(scores[3]));
}
public void testDateWithoutOrigin() throws Exception {
DateTime dt = new DateTime(DateTimeZone.UTC);
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject().startObject("type1").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num1").field("type", "date").endObject().endObject().endObject().endObject()));
DateTime docDate = dt.minusDays(1);
String docDateString = docDate.getYear() + "-" + String.format(Locale.ROOT, "%02d", docDate.getMonthOfYear()) + "-"
+ String.format(Locale.ROOT, "%02d", docDate.getDayOfMonth());
client().index(
indexRequest("test").type("type1").id("1")
.source(jsonBuilder().startObject().field("test", "value").field("num1", docDateString).endObject())).actionGet();
docDate = dt.minusDays(2);
docDateString = docDate.getYear() + "-" + String.format(Locale.ROOT, "%02d", docDate.getMonthOfYear()) + "-"
+ String.format(Locale.ROOT, "%02d", docDate.getDayOfMonth());
client().index(
indexRequest("test").type("type1").id("2")
.source(jsonBuilder().startObject().field("test", "value").field("num1", docDateString).endObject())).actionGet();
docDate = dt.minusDays(3);
docDateString = docDate.getYear() + "-" + String.format(Locale.ROOT, "%02d", docDate.getMonthOfYear()) + "-"
+ String.format(Locale.ROOT, "%02d", docDate.getDayOfMonth());
client().index(
indexRequest("test").type("type1").id("3")
.source(jsonBuilder().startObject().field("test", "value").field("num1", docDateString).endObject())).actionGet();
refresh();
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(QueryBuilders.matchAllQuery(), new FilterFunctionBuilder[]{
new FilterFunctionBuilder(linearDecayFunction("num1", null, "7000d")),
new FilterFunctionBuilder(gaussDecayFunction("num1", null, "1d")),
new FilterFunctionBuilder(exponentialDecayFunction("num1", null, "7000d"))
}).scoreMode(FiltersFunctionScoreQuery.ScoreMode.MULTIPLY))));
SearchResponse sr = response.actionGet();
assertNoFailures(sr);
SearchHits sh = sr.getHits();
assertThat(sh.hits().length, equalTo(3));
double[] scores = new double[4];
for (int i = 0; i < sh.hits().length; i++) {
scores[Integer.parseInt(sh.getAt(i).getId()) - 1] = sh.getAt(i).getScore();
}
assertThat(scores[1], lessThan(scores[0]));
assertThat(scores[2], lessThan(scores[1]));
}
public void testManyDocsLin() throws Exception {
Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT);
Settings settings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, version).build();
XContentBuilder xContentBuilder = jsonBuilder().startObject().startObject("type").startObject("properties")
.startObject("test").field("type", "text").endObject().startObject("date").field("type", "date")
.field("doc_values", true).endObject().startObject("num").field("type", "double")
.field("doc_values", true).endObject().startObject("geo").field("type", "geo_point")
.field("ignore_malformed", true);
if (version.before(Version.V_2_2_0)) {
xContentBuilder.field("coerce", true);
}
xContentBuilder.endObject().endObject().endObject().endObject();
assertAcked(prepareCreate("test").setSettings(settings).addMapping("type", xContentBuilder.string()));
int numDocs = 200;
List<IndexRequestBuilder> indexBuilders = new ArrayList<>();
for (int i = 0; i < numDocs; i++) {
double lat = 100 + (int) (10.0 * (i) / (numDocs));
double lon = 100;
int day = (int) (29.0 * (i) / (numDocs)) + 1;
String dayString = day < 10 ? "0" + Integer.toString(day) : Integer.toString(day);
String date = "2013-05-" + dayString;
indexBuilders.add(client().prepareIndex()
.setType("type")
.setId(Integer.toString(i))
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").field("date", date).field("num", i).startObject("geo")
.field("lat", lat).field("lon", lon).endObject().endObject()));
}
indexRandom(true, indexBuilders);
List<Float> lonlat = new ArrayList<>();
lonlat.add(100f);
lonlat.add(110f);
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().size(numDocs).query(
functionScoreQuery(termQuery("test", "value"), new FilterFunctionBuilder[]{
new FilterFunctionBuilder(linearDecayFunction("date", "2013-05-30", "+15d")),
new FilterFunctionBuilder(linearDecayFunction("geo", lonlat, "1000km")),
new FilterFunctionBuilder(linearDecayFunction("num", numDocs, numDocs / 2.0))
}).scoreMode(ScoreMode.MULTIPLY).boostMode(CombineFunction.REPLACE))));
SearchResponse sr = response.actionGet();
assertNoFailures(sr);
SearchHits sh = sr.getHits();
assertThat(sh.hits().length, equalTo(numDocs));
double[] scores = new double[numDocs];
for (int i = 0; i < numDocs; i++) {
scores[Integer.parseInt(sh.getAt(i).getId())] = sh.getAt(i).getScore();
}
for (int i = 0; i < numDocs - 1; i++) {
assertThat(scores[i], lessThan(scores[i + 1]));
}
}
public void testParsingExceptionIfFieldDoesNotExist() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type",
jsonBuilder().startObject().startObject("type").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("geo").field("type", "geo_point").endObject().endObject().endObject().endObject()));
int numDocs = 2;
client().index(
indexRequest("test").type("type").source(
jsonBuilder().startObject().field("test", "value").startObject("geo").field("lat", 1).field("lon", 2).endObject()
.endObject())).actionGet();
refresh();
List<Float> lonlat = new ArrayList<>();
lonlat.add(100f);
lonlat.add(110f);
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource()
.size(numDocs)
.query(functionScoreQuery(termQuery("test", "value"), linearDecayFunction("type.geo", lonlat, "1000km"))
.scoreMode(FiltersFunctionScoreQuery.ScoreMode.MULTIPLY))));
try {
response.actionGet();
fail("Expected SearchPhaseExecutionException");
} catch (SearchPhaseExecutionException e) {
assertThat(e.getMessage(), is("all shards failed"));
}
}
public void testParsingExceptionIfFieldTypeDoesNotMatch() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type",
jsonBuilder().startObject().startObject("type").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num").field("type", "text").endObject().endObject().endObject().endObject()));
client().index(
indexRequest("test").type("type").source(
jsonBuilder().startObject().field("test", "value").field("num", Integer.toString(1)).endObject())).actionGet();
refresh();
// so, we indexed a string field, but now we try to score a num field
ActionFuture<SearchResponse> response = client().search(searchRequest().searchType(SearchType.QUERY_THEN_FETCH)
.source(searchSource().query(functionScoreQuery(termQuery("test", "value"), linearDecayFunction("num", 1.0, 0.5))
.scoreMode(ScoreMode.MULTIPLY))));
try {
response.actionGet();
fail("Expected SearchPhaseExecutionException");
} catch (SearchPhaseExecutionException e) {
assertThat(e.getMessage(), is("all shards failed"));
}
}
public void testNoQueryGiven() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type",
jsonBuilder().startObject().startObject("type").startObject("properties").startObject("test").field("type", "text")
.endObject().startObject("num").field("type", "double").endObject().endObject().endObject().endObject()));
client().index(
indexRequest("test").type("type").source(jsonBuilder().startObject().field("test", "value").field("num", 1.0).endObject()))
.actionGet();
refresh();
// so, we indexed a string field, but now we try to score a num field
ActionFuture<SearchResponse> response = client().search(
searchRequest().searchType(SearchType.QUERY_THEN_FETCH).source(
searchSource().query(
functionScoreQuery(linearDecayFunction("num", 1, 0.5)).scoreMode(
FiltersFunctionScoreQuery.ScoreMode.MULTIPLY))));
response.actionGet();
}
public void testMultiFieldOptions() throws Exception {
assertAcked(prepareCreate("test").addMapping(
"type1",
jsonBuilder().startObject()
.startObject("type1")
.startObject("properties")
.startObject("test").field("type", "text").endObject()
.startObject("loc").field("type", "geo_point").endObject()
.startObject("num").field("type", "float").endObject()
.endObject()
.endObject()
.endObject()));
// Index for testing MIN and MAX
IndexRequestBuilder doc1 = client().prepareIndex().setType("type1").setId("1").setIndex("test")
.setSource(jsonBuilder().startObject()
.field("test", "value")
.startArray("loc")
.startObject().field("lat", 10).field("lon", 20).endObject()
.startObject().field("lat", 12).field("lon", 23).endObject()
.endArray()
.endObject());
IndexRequestBuilder doc2 = client().prepareIndex()
.setType("type1")
.setId("2")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startObject("loc").field("lat", 11).field("lon", 22).endObject()
.endObject());
indexRandom(true, doc1, doc2);
ActionFuture<SearchResponse> response = client().search(
searchRequest().source(
searchSource().query(baseQuery)));
SearchResponse sr = response.actionGet();
assertSearchHits(sr, "1", "2");
SearchHits sh = sr.getHits();
assertThat(sh.getTotalHits(), equalTo((long) (2)));
List<Float> lonlat = new ArrayList<>();
lonlat.add(20f);
lonlat.add(10f);
response = client().search(searchRequest().source(searchSource()
.query(functionScoreQuery(baseQuery, gaussDecayFunction("loc", lonlat, "1000km").setMultiValueMode(MultiValueMode.MIN)))));
sr = response.actionGet();
assertSearchHits(sr, "1", "2");
sh = sr.getHits();
assertThat(sh.getAt(0).getId(), equalTo("1"));
assertThat(sh.getAt(1).getId(), equalTo("2"));
response = client().search(searchRequest().source(searchSource()
.query(functionScoreQuery(baseQuery, gaussDecayFunction("loc", lonlat, "1000km").setMultiValueMode(MultiValueMode.MAX)))));
sr = response.actionGet();
assertSearchHits(sr, "1", "2");
sh = sr.getHits();
assertThat(sh.getAt(0).getId(), equalTo("2"));
assertThat(sh.getAt(1).getId(), equalTo("1"));
// Now test AVG and SUM
doc1 = client().prepareIndex()
.setType("type1")
.setId("1")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").startArray("num").value(0.0).value(1.0).value(2.0).endArray()
.endObject());
doc2 = client().prepareIndex()
.setType("type1")
.setId("2")
.setIndex("test")
.setSource(
jsonBuilder().startObject().field("test", "value").field("num", 1.0)
.endObject());
indexRandom(true, doc1, doc2);
response = client().search(searchRequest().source(searchSource()
.query(functionScoreQuery(baseQuery, linearDecayFunction("num", "0", "10").setMultiValueMode(MultiValueMode.SUM)))));
sr = response.actionGet();
assertSearchHits(sr, "1", "2");
sh = sr.getHits();
assertThat(sh.getAt(0).getId(), equalTo("2"));
assertThat(sh.getAt(1).getId(), equalTo("1"));
assertThat(1.0 - sh.getAt(0).getScore(), closeTo((1.0 - sh.getAt(1).getScore())/3.0, 1.e-6d));
response = client().search(searchRequest().source(searchSource()
.query(functionScoreQuery(baseQuery, linearDecayFunction("num", "0", "10").setMultiValueMode(MultiValueMode.AVG)))));
sr = response.actionGet();
assertSearchHits(sr, "1", "2");
sh = sr.getHits();
assertThat((double) (sh.getAt(0).getScore()), closeTo((sh.getAt(1).getScore()), 1.e-6d));
}
}
| dpursehouse/elasticsearch | core/src/test/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java | Java | apache-2.0 | 43,922 |
package com.erakk.lnreader.model;
import java.util.Date;
public class UpdateInfoModel {
private int id = -1;
private UpdateTypeEnum updateType;
private String updateTitle;
private Date updateDate;
private String updatePage;
private PageModel updatePageModel;
private boolean isSelected;
private boolean isExternal;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public UpdateTypeEnum getUpdateType() {
return updateType;
}
public void setUpdateType(UpdateTypeEnum updateType) {
this.updateType = updateType;
}
public String getUpdateTitle() {
return updateTitle;
}
public void setUpdateTitle(String updateTitle) {
this.updateTitle = updateTitle;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getUpdatePage() {
return updatePage;
}
public void setUpdatePage(String updatePage) {
this.updatePage = updatePage;
}
public PageModel getUpdatePageModel() throws Exception {
if (updatePageModel == null) {
updatePageModel = PageModel.getPageModelByName(this.updatePage);
}
return updatePageModel;
}
public void setUpdatePageModel(PageModel updatePageModel) {
this.updatePageModel = updatePageModel;
}
public boolean isSelected() {
return isSelected;
}
public void setSelected(boolean isSelected) {
this.isSelected = isSelected;
}
public boolean isExternal() {
return isExternal;
}
public void setExternal(boolean isExternal) {
this.isExternal = isExternal;
}
}
| freedomofkeima/LNReader-Android | app/src/main/java/com/erakk/lnreader/model/UpdateInfoModel.java | Java | apache-2.0 | 1,819 |
<?php
/*
* Copyright 2014 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.
*/
namespace Google\Service\ShoppingContent;
class AccountStatusProducts extends \Google\Collection
{
protected $collection_key = 'itemLevelIssues';
/**
* @var string
*/
public $channel;
/**
* @var string
*/
public $country;
/**
* @var string
*/
public $destination;
protected $itemLevelIssuesType = AccountStatusItemLevelIssue::class;
protected $itemLevelIssuesDataType = 'array';
protected $statisticsType = AccountStatusStatistics::class;
protected $statisticsDataType = '';
/**
* @param string
*/
public function setChannel($channel)
{
$this->channel = $channel;
}
/**
* @return string
*/
public function getChannel()
{
return $this->channel;
}
/**
* @param string
*/
public function setCountry($country)
{
$this->country = $country;
}
/**
* @return string
*/
public function getCountry()
{
return $this->country;
}
/**
* @param string
*/
public function setDestination($destination)
{
$this->destination = $destination;
}
/**
* @return string
*/
public function getDestination()
{
return $this->destination;
}
/**
* @param AccountStatusItemLevelIssue[]
*/
public function setItemLevelIssues($itemLevelIssues)
{
$this->itemLevelIssues = $itemLevelIssues;
}
/**
* @return AccountStatusItemLevelIssue[]
*/
public function getItemLevelIssues()
{
return $this->itemLevelIssues;
}
/**
* @param AccountStatusStatistics
*/
public function setStatistics(AccountStatusStatistics $statistics)
{
$this->statistics = $statistics;
}
/**
* @return AccountStatusStatistics
*/
public function getStatistics()
{
return $this->statistics;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AccountStatusProducts::class, 'Google_Service_ShoppingContent_AccountStatusProducts');
| googleapis/google-api-php-client-services | src/ShoppingContent/AccountStatusProducts.php | PHP | apache-2.0 | 2,528 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/lexv2-models/model/Effect.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace LexModelsV2
{
namespace Model
{
namespace EffectMapper
{
static const int Allow_HASH = HashingUtils::HashString("Allow");
static const int Deny_HASH = HashingUtils::HashString("Deny");
Effect GetEffectForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == Allow_HASH)
{
return Effect::Allow;
}
else if (hashCode == Deny_HASH)
{
return Effect::Deny;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<Effect>(hashCode);
}
return Effect::NOT_SET;
}
Aws::String GetNameForEffect(Effect enumValue)
{
switch(enumValue)
{
case Effect::Allow:
return "Allow";
case Effect::Deny:
return "Deny";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace EffectMapper
} // namespace Model
} // namespace LexModelsV2
} // namespace Aws
| aws/aws-sdk-cpp | aws-cpp-sdk-lexv2-models/source/model/Effect.cpp | C++ | apache-2.0 | 1,842 |
// Copyright 2021 Google LLC
//
// 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.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.12.2
// source: google/cloud/contactcenterinsights/v1/contact_center_insights.proto
package contactcenterinsights
import (
context "context"
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
longrunning "google.golang.org/genproto/googleapis/longrunning"
status "google.golang.org/genproto/googleapis/rpc/status"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status1 "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
emptypb "google.golang.org/protobuf/types/known/emptypb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Represents the options for views of a conversation.
type ConversationView int32
const (
// Not specified. Defaults to FULL on GetConversationRequest and BASIC for
// ListConversationsRequest.
ConversationView_CONVERSATION_VIEW_UNSPECIFIED ConversationView = 0
// Transcript field is not populated in the response.
ConversationView_BASIC ConversationView = 1
// All fields are populated.
ConversationView_FULL ConversationView = 2
)
// Enum value maps for ConversationView.
var (
ConversationView_name = map[int32]string{
0: "CONVERSATION_VIEW_UNSPECIFIED",
1: "BASIC",
2: "FULL",
}
ConversationView_value = map[string]int32{
"CONVERSATION_VIEW_UNSPECIFIED": 0,
"BASIC": 1,
"FULL": 2,
}
)
func (x ConversationView) Enum() *ConversationView {
p := new(ConversationView)
*p = x
return p
}
func (x ConversationView) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ConversationView) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_enumTypes[0].Descriptor()
}
func (ConversationView) Type() protoreflect.EnumType {
return &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_enumTypes[0]
}
func (x ConversationView) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ConversationView.Descriptor instead.
func (ConversationView) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{0}
}
// The request for calculating conversation statistics.
type CalculateStatsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The location of the conversations.
Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
// A filter to reduce results to a specific subset. This field is useful for
// getting statistics about conversations with specific properties.
Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
}
func (x *CalculateStatsRequest) Reset() {
*x = CalculateStatsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateStatsRequest) ProtoMessage() {}
func (x *CalculateStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateStatsRequest.ProtoReflect.Descriptor instead.
func (*CalculateStatsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{0}
}
func (x *CalculateStatsRequest) GetLocation() string {
if x != nil {
return x.Location
}
return ""
}
func (x *CalculateStatsRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
// The response for calculating conversation statistics.
type CalculateStatsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The average duration of all conversations. The average is calculated using
// only conversations that have a time duration.
AverageDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=average_duration,json=averageDuration,proto3" json:"average_duration,omitempty"`
// The average number of turns per conversation.
AverageTurnCount int32 `protobuf:"varint,2,opt,name=average_turn_count,json=averageTurnCount,proto3" json:"average_turn_count,omitempty"`
// The total number of conversations.
ConversationCount int32 `protobuf:"varint,3,opt,name=conversation_count,json=conversationCount,proto3" json:"conversation_count,omitempty"`
// A map associating each smart highlighter display name with its respective
// number of matches in the set of conversations.
SmartHighlighterMatches map[string]int32 `protobuf:"bytes,4,rep,name=smart_highlighter_matches,json=smartHighlighterMatches,proto3" json:"smart_highlighter_matches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
// A map associating each custom highlighter resource name with its respective
// number of matches in the set of conversations.
CustomHighlighterMatches map[string]int32 `protobuf:"bytes,5,rep,name=custom_highlighter_matches,json=customHighlighterMatches,proto3" json:"custom_highlighter_matches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
// A map associating each issue resource name with its respective number of
// matches in the set of conversations. Key has the format:
// `projects/<Project ID>/locations/<Location ID>/issueModels/<Issue Model
// ID>/issues/<Issue ID>`
// Deprecated, use `issue_matches_stats` field instead.
//
// Deprecated: Do not use.
IssueMatches map[string]int32 `protobuf:"bytes,6,rep,name=issue_matches,json=issueMatches,proto3" json:"issue_matches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
// A map associating each issue resource name with its respective number of
// matches in the set of conversations. Key has the format:
// `projects/<ProjectID>/locations/<LocationID>/issueModels/<IssueModelID>/issues/<IssueID>`
IssueMatchesStats map[string]*IssueModelLabelStats_IssueStats `protobuf:"bytes,8,rep,name=issue_matches_stats,json=issueMatchesStats,proto3" json:"issue_matches_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// A time series representing the count of conversations created over time
// that match that requested filter criteria.
ConversationCountTimeSeries *CalculateStatsResponse_TimeSeries `protobuf:"bytes,7,opt,name=conversation_count_time_series,json=conversationCountTimeSeries,proto3" json:"conversation_count_time_series,omitempty"`
}
func (x *CalculateStatsResponse) Reset() {
*x = CalculateStatsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateStatsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateStatsResponse) ProtoMessage() {}
func (x *CalculateStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateStatsResponse.ProtoReflect.Descriptor instead.
func (*CalculateStatsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{1}
}
func (x *CalculateStatsResponse) GetAverageDuration() *durationpb.Duration {
if x != nil {
return x.AverageDuration
}
return nil
}
func (x *CalculateStatsResponse) GetAverageTurnCount() int32 {
if x != nil {
return x.AverageTurnCount
}
return 0
}
func (x *CalculateStatsResponse) GetConversationCount() int32 {
if x != nil {
return x.ConversationCount
}
return 0
}
func (x *CalculateStatsResponse) GetSmartHighlighterMatches() map[string]int32 {
if x != nil {
return x.SmartHighlighterMatches
}
return nil
}
func (x *CalculateStatsResponse) GetCustomHighlighterMatches() map[string]int32 {
if x != nil {
return x.CustomHighlighterMatches
}
return nil
}
// Deprecated: Do not use.
func (x *CalculateStatsResponse) GetIssueMatches() map[string]int32 {
if x != nil {
return x.IssueMatches
}
return nil
}
func (x *CalculateStatsResponse) GetIssueMatchesStats() map[string]*IssueModelLabelStats_IssueStats {
if x != nil {
return x.IssueMatchesStats
}
return nil
}
func (x *CalculateStatsResponse) GetConversationCountTimeSeries() *CalculateStatsResponse_TimeSeries {
if x != nil {
return x.ConversationCountTimeSeries
}
return nil
}
// Metadata for a create analysis operation.
type CreateAnalysisOperationMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// Output only. The Conversation that this Analysis Operation belongs to.
Conversation string `protobuf:"bytes,3,opt,name=conversation,proto3" json:"conversation,omitempty"`
}
func (x *CreateAnalysisOperationMetadata) Reset() {
*x = CreateAnalysisOperationMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateAnalysisOperationMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAnalysisOperationMetadata) ProtoMessage() {}
func (x *CreateAnalysisOperationMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateAnalysisOperationMetadata.ProtoReflect.Descriptor instead.
func (*CreateAnalysisOperationMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{2}
}
func (x *CreateAnalysisOperationMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *CreateAnalysisOperationMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *CreateAnalysisOperationMetadata) GetConversation() string {
if x != nil {
return x.Conversation
}
return ""
}
// Request to create a conversation.
type CreateConversationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the conversation.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Required. The conversation resource to create.
Conversation *Conversation `protobuf:"bytes,2,opt,name=conversation,proto3" json:"conversation,omitempty"`
// A unique ID for the new conversation. This ID will become the final
// component of the conversation's resource name. If no ID is specified, a
// server-generated ID will be used.
//
// This value should be 4-32 characters and must match the regular
// expression /^[a-z0-9-]{4,32}$/. Valid characters are /[a-z][0-9]-/
ConversationId string `protobuf:"bytes,3,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`
}
func (x *CreateConversationRequest) Reset() {
*x = CreateConversationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateConversationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateConversationRequest) ProtoMessage() {}
func (x *CreateConversationRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateConversationRequest.ProtoReflect.Descriptor instead.
func (*CreateConversationRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{3}
}
func (x *CreateConversationRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CreateConversationRequest) GetConversation() *Conversation {
if x != nil {
return x.Conversation
}
return nil
}
func (x *CreateConversationRequest) GetConversationId() string {
if x != nil {
return x.ConversationId
}
return ""
}
// Request to list conversations.
type ListConversationsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the conversation.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The maximum number of conversations to return in the response. A valid page
// size ranges from 0 to 1,000 inclusive. If the page size is zero or
// unspecified, a default page size of 100 will be chosen. Note that a call
// might return fewer results than the requested page size.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The value returned by the last `ListConversationsResponse`. This value
// indicates that this is a continuation of a prior `ListConversations` call
// and that the system should return the next page of data.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// A filter to reduce results to a specific subset. Useful for querying
// conversations with specific properties.
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
// The level of details of the conversation. Default is `BASIC`.
View ConversationView `protobuf:"varint,5,opt,name=view,proto3,enum=google.cloud.contactcenterinsights.v1.ConversationView" json:"view,omitempty"`
}
func (x *ListConversationsRequest) Reset() {
*x = ListConversationsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListConversationsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListConversationsRequest) ProtoMessage() {}
func (x *ListConversationsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListConversationsRequest.ProtoReflect.Descriptor instead.
func (*ListConversationsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{4}
}
func (x *ListConversationsRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ListConversationsRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListConversationsRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *ListConversationsRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
func (x *ListConversationsRequest) GetView() ConversationView {
if x != nil {
return x.View
}
return ConversationView_CONVERSATION_VIEW_UNSPECIFIED
}
// The response of listing conversations.
type ListConversationsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The conversations that match the request.
Conversations []*Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations,omitempty"`
// A token which can be sent as `page_token` to retrieve the next page. If
// this field is set, it means there is another page available. If it is not
// set, it means no other pages are available.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *ListConversationsResponse) Reset() {
*x = ListConversationsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListConversationsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListConversationsResponse) ProtoMessage() {}
func (x *ListConversationsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListConversationsResponse.ProtoReflect.Descriptor instead.
func (*ListConversationsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{5}
}
func (x *ListConversationsResponse) GetConversations() []*Conversation {
if x != nil {
return x.Conversations
}
return nil
}
func (x *ListConversationsResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The request to get a conversation.
type GetConversationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the conversation to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The level of details of the conversation. Default is `FULL`.
View ConversationView `protobuf:"varint,2,opt,name=view,proto3,enum=google.cloud.contactcenterinsights.v1.ConversationView" json:"view,omitempty"`
}
func (x *GetConversationRequest) Reset() {
*x = GetConversationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetConversationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetConversationRequest) ProtoMessage() {}
func (x *GetConversationRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetConversationRequest.ProtoReflect.Descriptor instead.
func (*GetConversationRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{6}
}
func (x *GetConversationRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *GetConversationRequest) GetView() ConversationView {
if x != nil {
return x.View
}
return ConversationView_CONVERSATION_VIEW_UNSPECIFIED
}
// The request to update a conversation.
type UpdateConversationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The new values for the conversation.
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation,omitempty"`
// The list of fields to be updated.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdateConversationRequest) Reset() {
*x = UpdateConversationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateConversationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateConversationRequest) ProtoMessage() {}
func (x *UpdateConversationRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateConversationRequest.ProtoReflect.Descriptor instead.
func (*UpdateConversationRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{7}
}
func (x *UpdateConversationRequest) GetConversation() *Conversation {
if x != nil {
return x.Conversation
}
return nil
}
func (x *UpdateConversationRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// The request to delete a conversation.
type DeleteConversationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the conversation to delete.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// If set to true, all of this conversation's analyses will also be deleted.
// Otherwise, the request will only succeed if the conversation has no
// analyses.
Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"`
}
func (x *DeleteConversationRequest) Reset() {
*x = DeleteConversationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteConversationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteConversationRequest) ProtoMessage() {}
func (x *DeleteConversationRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteConversationRequest.ProtoReflect.Descriptor instead.
func (*DeleteConversationRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteConversationRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DeleteConversationRequest) GetForce() bool {
if x != nil {
return x.Force
}
return false
}
// The request to create an analysis.
type CreateAnalysisRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the analysis.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Required. The analysis to create.
Analysis *Analysis `protobuf:"bytes,2,opt,name=analysis,proto3" json:"analysis,omitempty"`
}
func (x *CreateAnalysisRequest) Reset() {
*x = CreateAnalysisRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateAnalysisRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAnalysisRequest) ProtoMessage() {}
func (x *CreateAnalysisRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateAnalysisRequest.ProtoReflect.Descriptor instead.
func (*CreateAnalysisRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{9}
}
func (x *CreateAnalysisRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CreateAnalysisRequest) GetAnalysis() *Analysis {
if x != nil {
return x.Analysis
}
return nil
}
// The request to list analyses.
type ListAnalysesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the analyses.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The maximum number of analyses to return in the response. If this
// value is zero, the service will select a default size. A call might return
// fewer objects than requested. A non-empty `next_page_token` in the response
// indicates that more data is available.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The value returned by the last `ListAnalysesResponse`; indicates
// that this is a continuation of a prior `ListAnalyses` call and
// the system should return the next page of data.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// A filter to reduce results to a specific subset. Useful for querying
// conversations with specific properties.
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
}
func (x *ListAnalysesRequest) Reset() {
*x = ListAnalysesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListAnalysesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListAnalysesRequest) ProtoMessage() {}
func (x *ListAnalysesRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListAnalysesRequest.ProtoReflect.Descriptor instead.
func (*ListAnalysesRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{10}
}
func (x *ListAnalysesRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ListAnalysesRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListAnalysesRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *ListAnalysesRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
// The response to list analyses.
type ListAnalysesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The analyses that match the request.
Analyses []*Analysis `protobuf:"bytes,1,rep,name=analyses,proto3" json:"analyses,omitempty"`
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *ListAnalysesResponse) Reset() {
*x = ListAnalysesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListAnalysesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListAnalysesResponse) ProtoMessage() {}
func (x *ListAnalysesResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListAnalysesResponse.ProtoReflect.Descriptor instead.
func (*ListAnalysesResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{11}
}
func (x *ListAnalysesResponse) GetAnalyses() []*Analysis {
if x != nil {
return x.Analyses
}
return nil
}
func (x *ListAnalysesResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The request to get an analysis.
type GetAnalysisRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the analysis to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetAnalysisRequest) Reset() {
*x = GetAnalysisRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetAnalysisRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetAnalysisRequest) ProtoMessage() {}
func (x *GetAnalysisRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetAnalysisRequest.ProtoReflect.Descriptor instead.
func (*GetAnalysisRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{12}
}
func (x *GetAnalysisRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to delete an analysis.
type DeleteAnalysisRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the analysis to delete.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *DeleteAnalysisRequest) Reset() {
*x = DeleteAnalysisRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteAnalysisRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteAnalysisRequest) ProtoMessage() {}
func (x *DeleteAnalysisRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteAnalysisRequest.ProtoReflect.Descriptor instead.
func (*DeleteAnalysisRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{13}
}
func (x *DeleteAnalysisRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to export insights.
type ExportInsightsDataRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Exporter destination.
//
// Types that are assignable to Destination:
// *ExportInsightsDataRequest_BigQueryDestination_
Destination isExportInsightsDataRequest_Destination `protobuf_oneof:"destination"`
// Required. The parent resource to export data from.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// A filter to reduce results to a specific subset. Useful for exporting
// conversations with specific properties.
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
// A fully qualified KMS key name for BigQuery tables protected by CMEK.
// Format:
// projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}
KmsKey string `protobuf:"bytes,4,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"`
}
func (x *ExportInsightsDataRequest) Reset() {
*x = ExportInsightsDataRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExportInsightsDataRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExportInsightsDataRequest) ProtoMessage() {}
func (x *ExportInsightsDataRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExportInsightsDataRequest.ProtoReflect.Descriptor instead.
func (*ExportInsightsDataRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{14}
}
func (m *ExportInsightsDataRequest) GetDestination() isExportInsightsDataRequest_Destination {
if m != nil {
return m.Destination
}
return nil
}
func (x *ExportInsightsDataRequest) GetBigQueryDestination() *ExportInsightsDataRequest_BigQueryDestination {
if x, ok := x.GetDestination().(*ExportInsightsDataRequest_BigQueryDestination_); ok {
return x.BigQueryDestination
}
return nil
}
func (x *ExportInsightsDataRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ExportInsightsDataRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
func (x *ExportInsightsDataRequest) GetKmsKey() string {
if x != nil {
return x.KmsKey
}
return ""
}
type isExportInsightsDataRequest_Destination interface {
isExportInsightsDataRequest_Destination()
}
type ExportInsightsDataRequest_BigQueryDestination_ struct {
// Specified if sink is a BigQuery table.
BigQueryDestination *ExportInsightsDataRequest_BigQueryDestination `protobuf:"bytes,2,opt,name=big_query_destination,json=bigQueryDestination,proto3,oneof"`
}
func (*ExportInsightsDataRequest_BigQueryDestination_) isExportInsightsDataRequest_Destination() {}
// Metadata for an export insights operation.
type ExportInsightsDataMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// The original request for export.
Request *ExportInsightsDataRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
// Partial errors during export operation that might cause the operation
// output to be incomplete.
PartialErrors []*status.Status `protobuf:"bytes,4,rep,name=partial_errors,json=partialErrors,proto3" json:"partial_errors,omitempty"`
}
func (x *ExportInsightsDataMetadata) Reset() {
*x = ExportInsightsDataMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExportInsightsDataMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExportInsightsDataMetadata) ProtoMessage() {}
func (x *ExportInsightsDataMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExportInsightsDataMetadata.ProtoReflect.Descriptor instead.
func (*ExportInsightsDataMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{15}
}
func (x *ExportInsightsDataMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *ExportInsightsDataMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *ExportInsightsDataMetadata) GetRequest() *ExportInsightsDataRequest {
if x != nil {
return x.Request
}
return nil
}
func (x *ExportInsightsDataMetadata) GetPartialErrors() []*status.Status {
if x != nil {
return x.PartialErrors
}
return nil
}
// Response for an export insights operation.
type ExportInsightsDataResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ExportInsightsDataResponse) Reset() {
*x = ExportInsightsDataResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExportInsightsDataResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExportInsightsDataResponse) ProtoMessage() {}
func (x *ExportInsightsDataResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExportInsightsDataResponse.ProtoReflect.Descriptor instead.
func (*ExportInsightsDataResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{16}
}
// The request to create an issue model.
type CreateIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the issue model.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Required. The issue model to create.
IssueModel *IssueModel `protobuf:"bytes,2,opt,name=issue_model,json=issueModel,proto3" json:"issue_model,omitempty"`
}
func (x *CreateIssueModelRequest) Reset() {
*x = CreateIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateIssueModelRequest) ProtoMessage() {}
func (x *CreateIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateIssueModelRequest.ProtoReflect.Descriptor instead.
func (*CreateIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{17}
}
func (x *CreateIssueModelRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CreateIssueModelRequest) GetIssueModel() *IssueModel {
if x != nil {
return x.IssueModel
}
return nil
}
// Metadata for creating an issue model.
type CreateIssueModelMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// The original request for creation.
Request *CreateIssueModelRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
}
func (x *CreateIssueModelMetadata) Reset() {
*x = CreateIssueModelMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateIssueModelMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateIssueModelMetadata) ProtoMessage() {}
func (x *CreateIssueModelMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateIssueModelMetadata.ProtoReflect.Descriptor instead.
func (*CreateIssueModelMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{18}
}
func (x *CreateIssueModelMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *CreateIssueModelMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *CreateIssueModelMetadata) GetRequest() *CreateIssueModelRequest {
if x != nil {
return x.Request
}
return nil
}
// The request to update an issue model.
type UpdateIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The new values for the issue model.
IssueModel *IssueModel `protobuf:"bytes,1,opt,name=issue_model,json=issueModel,proto3" json:"issue_model,omitempty"`
// The list of fields to be updated.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdateIssueModelRequest) Reset() {
*x = UpdateIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateIssueModelRequest) ProtoMessage() {}
func (x *UpdateIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateIssueModelRequest.ProtoReflect.Descriptor instead.
func (*UpdateIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{19}
}
func (x *UpdateIssueModelRequest) GetIssueModel() *IssueModel {
if x != nil {
return x.IssueModel
}
return nil
}
func (x *UpdateIssueModelRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// Request to list issue models.
type ListIssueModelsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the issue model.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
}
func (x *ListIssueModelsRequest) Reset() {
*x = ListIssueModelsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIssueModelsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIssueModelsRequest) ProtoMessage() {}
func (x *ListIssueModelsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIssueModelsRequest.ProtoReflect.Descriptor instead.
func (*ListIssueModelsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{20}
}
func (x *ListIssueModelsRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
// The response of listing issue models.
type ListIssueModelsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The issue models that match the request.
IssueModels []*IssueModel `protobuf:"bytes,1,rep,name=issue_models,json=issueModels,proto3" json:"issue_models,omitempty"`
}
func (x *ListIssueModelsResponse) Reset() {
*x = ListIssueModelsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIssueModelsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIssueModelsResponse) ProtoMessage() {}
func (x *ListIssueModelsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIssueModelsResponse.ProtoReflect.Descriptor instead.
func (*ListIssueModelsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{21}
}
func (x *ListIssueModelsResponse) GetIssueModels() []*IssueModel {
if x != nil {
return x.IssueModels
}
return nil
}
// The request to get an issue model.
type GetIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the issue model to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetIssueModelRequest) Reset() {
*x = GetIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetIssueModelRequest) ProtoMessage() {}
func (x *GetIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetIssueModelRequest.ProtoReflect.Descriptor instead.
func (*GetIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{22}
}
func (x *GetIssueModelRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to delete an issue model.
type DeleteIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the issue model to delete.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *DeleteIssueModelRequest) Reset() {
*x = DeleteIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteIssueModelRequest) ProtoMessage() {}
func (x *DeleteIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteIssueModelRequest.ProtoReflect.Descriptor instead.
func (*DeleteIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{23}
}
func (x *DeleteIssueModelRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// Metadata for deleting an issue model.
type DeleteIssueModelMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// The original request for deletion.
Request *DeleteIssueModelRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
}
func (x *DeleteIssueModelMetadata) Reset() {
*x = DeleteIssueModelMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteIssueModelMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteIssueModelMetadata) ProtoMessage() {}
func (x *DeleteIssueModelMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[24]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteIssueModelMetadata.ProtoReflect.Descriptor instead.
func (*DeleteIssueModelMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{24}
}
func (x *DeleteIssueModelMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *DeleteIssueModelMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *DeleteIssueModelMetadata) GetRequest() *DeleteIssueModelRequest {
if x != nil {
return x.Request
}
return nil
}
// The request to deploy an issue model.
type DeployIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The issue model to deploy.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *DeployIssueModelRequest) Reset() {
*x = DeployIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeployIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeployIssueModelRequest) ProtoMessage() {}
func (x *DeployIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[25]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeployIssueModelRequest.ProtoReflect.Descriptor instead.
func (*DeployIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{25}
}
func (x *DeployIssueModelRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response to deploy an issue model.
type DeployIssueModelResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DeployIssueModelResponse) Reset() {
*x = DeployIssueModelResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeployIssueModelResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeployIssueModelResponse) ProtoMessage() {}
func (x *DeployIssueModelResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[26]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeployIssueModelResponse.ProtoReflect.Descriptor instead.
func (*DeployIssueModelResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{26}
}
// Metadata for deploying an issue model.
type DeployIssueModelMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// The original request for deployment.
Request *DeployIssueModelRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
}
func (x *DeployIssueModelMetadata) Reset() {
*x = DeployIssueModelMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeployIssueModelMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeployIssueModelMetadata) ProtoMessage() {}
func (x *DeployIssueModelMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[27]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeployIssueModelMetadata.ProtoReflect.Descriptor instead.
func (*DeployIssueModelMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{27}
}
func (x *DeployIssueModelMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *DeployIssueModelMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *DeployIssueModelMetadata) GetRequest() *DeployIssueModelRequest {
if x != nil {
return x.Request
}
return nil
}
// The request to undeploy an issue model.
type UndeployIssueModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The issue model to undeploy.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *UndeployIssueModelRequest) Reset() {
*x = UndeployIssueModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UndeployIssueModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UndeployIssueModelRequest) ProtoMessage() {}
func (x *UndeployIssueModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[28]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UndeployIssueModelRequest.ProtoReflect.Descriptor instead.
func (*UndeployIssueModelRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{28}
}
func (x *UndeployIssueModelRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The response to undeploy an issue model.
type UndeployIssueModelResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UndeployIssueModelResponse) Reset() {
*x = UndeployIssueModelResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UndeployIssueModelResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UndeployIssueModelResponse) ProtoMessage() {}
func (x *UndeployIssueModelResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[29]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UndeployIssueModelResponse.ProtoReflect.Descriptor instead.
func (*UndeployIssueModelResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{29}
}
// Metadata for undeploying an issue model.
type UndeployIssueModelMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The time the operation was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. The time the operation finished running.
EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
// The original request for undeployment.
Request *UndeployIssueModelRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"`
}
func (x *UndeployIssueModelMetadata) Reset() {
*x = UndeployIssueModelMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UndeployIssueModelMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UndeployIssueModelMetadata) ProtoMessage() {}
func (x *UndeployIssueModelMetadata) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[30]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UndeployIssueModelMetadata.ProtoReflect.Descriptor instead.
func (*UndeployIssueModelMetadata) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{30}
}
func (x *UndeployIssueModelMetadata) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *UndeployIssueModelMetadata) GetEndTime() *timestamppb.Timestamp {
if x != nil {
return x.EndTime
}
return nil
}
func (x *UndeployIssueModelMetadata) GetRequest() *UndeployIssueModelRequest {
if x != nil {
return x.Request
}
return nil
}
// The request to get an issue.
type GetIssueRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the issue to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetIssueRequest) Reset() {
*x = GetIssueRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetIssueRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetIssueRequest) ProtoMessage() {}
func (x *GetIssueRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[31]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetIssueRequest.ProtoReflect.Descriptor instead.
func (*GetIssueRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{31}
}
func (x *GetIssueRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// Request to list issues.
type ListIssuesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the issue.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
}
func (x *ListIssuesRequest) Reset() {
*x = ListIssuesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIssuesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIssuesRequest) ProtoMessage() {}
func (x *ListIssuesRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[32]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIssuesRequest.ProtoReflect.Descriptor instead.
func (*ListIssuesRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{32}
}
func (x *ListIssuesRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
// The response of listing issues.
type ListIssuesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The issues that match the request.
Issues []*Issue `protobuf:"bytes,1,rep,name=issues,proto3" json:"issues,omitempty"`
}
func (x *ListIssuesResponse) Reset() {
*x = ListIssuesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIssuesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIssuesResponse) ProtoMessage() {}
func (x *ListIssuesResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[33]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIssuesResponse.ProtoReflect.Descriptor instead.
func (*ListIssuesResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{33}
}
func (x *ListIssuesResponse) GetIssues() []*Issue {
if x != nil {
return x.Issues
}
return nil
}
// The request to update an issue.
type UpdateIssueRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The new values for the issue.
Issue *Issue `protobuf:"bytes,1,opt,name=issue,proto3" json:"issue,omitempty"`
// The list of fields to be updated.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdateIssueRequest) Reset() {
*x = UpdateIssueRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[34]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateIssueRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateIssueRequest) ProtoMessage() {}
func (x *UpdateIssueRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[34]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateIssueRequest.ProtoReflect.Descriptor instead.
func (*UpdateIssueRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{34}
}
func (x *UpdateIssueRequest) GetIssue() *Issue {
if x != nil {
return x.Issue
}
return nil
}
func (x *UpdateIssueRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// Request to get statistics of an issue model.
type CalculateIssueModelStatsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The resource name of the issue model to query against.
IssueModel string `protobuf:"bytes,1,opt,name=issue_model,json=issueModel,proto3" json:"issue_model,omitempty"`
}
func (x *CalculateIssueModelStatsRequest) Reset() {
*x = CalculateIssueModelStatsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateIssueModelStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateIssueModelStatsRequest) ProtoMessage() {}
func (x *CalculateIssueModelStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[35]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateIssueModelStatsRequest.ProtoReflect.Descriptor instead.
func (*CalculateIssueModelStatsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{35}
}
func (x *CalculateIssueModelStatsRequest) GetIssueModel() string {
if x != nil {
return x.IssueModel
}
return ""
}
// Response of querying an issue model's statistics.
type CalculateIssueModelStatsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The latest label statistics for the queried issue model. Includes results
// on both training data and data labeled after deployment.
CurrentStats *IssueModelLabelStats `protobuf:"bytes,4,opt,name=current_stats,json=currentStats,proto3" json:"current_stats,omitempty"`
}
func (x *CalculateIssueModelStatsResponse) Reset() {
*x = CalculateIssueModelStatsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateIssueModelStatsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateIssueModelStatsResponse) ProtoMessage() {}
func (x *CalculateIssueModelStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[36]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateIssueModelStatsResponse.ProtoReflect.Descriptor instead.
func (*CalculateIssueModelStatsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{36}
}
func (x *CalculateIssueModelStatsResponse) GetCurrentStats() *IssueModelLabelStats {
if x != nil {
return x.CurrentStats
}
return nil
}
// Request to create a phrase matcher.
type CreatePhraseMatcherRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the phrase matcher. Required. The location
// to create a phrase matcher for. Format: `projects/<Project
// ID>/locations/<Location ID>` or `projects/<Project
// Number>/locations/<Location ID>`
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Required. The phrase matcher resource to create.
PhraseMatcher *PhraseMatcher `protobuf:"bytes,2,opt,name=phrase_matcher,json=phraseMatcher,proto3" json:"phrase_matcher,omitempty"`
}
func (x *CreatePhraseMatcherRequest) Reset() {
*x = CreatePhraseMatcherRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreatePhraseMatcherRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreatePhraseMatcherRequest) ProtoMessage() {}
func (x *CreatePhraseMatcherRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[37]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreatePhraseMatcherRequest.ProtoReflect.Descriptor instead.
func (*CreatePhraseMatcherRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{37}
}
func (x *CreatePhraseMatcherRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CreatePhraseMatcherRequest) GetPhraseMatcher() *PhraseMatcher {
if x != nil {
return x.PhraseMatcher
}
return nil
}
// Request to list phrase matchers.
type ListPhraseMatchersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The parent resource of the phrase matcher.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The maximum number of phrase matchers to return in the response. If this
// value is zero, the service will select a default size. A call might return
// fewer objects than requested. A non-empty `next_page_token` in the response
// indicates that more data is available.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The value returned by the last `ListPhraseMatchersResponse`. This value
// indicates that this is a continuation of a prior `ListPhraseMatchers` call
// and that the system should return the next page of data.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// A filter to reduce results to a specific subset. Useful for querying
// phrase matchers with specific properties.
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
}
func (x *ListPhraseMatchersRequest) Reset() {
*x = ListPhraseMatchersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[38]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListPhraseMatchersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListPhraseMatchersRequest) ProtoMessage() {}
func (x *ListPhraseMatchersRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[38]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListPhraseMatchersRequest.ProtoReflect.Descriptor instead.
func (*ListPhraseMatchersRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{38}
}
func (x *ListPhraseMatchersRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ListPhraseMatchersRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListPhraseMatchersRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *ListPhraseMatchersRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
// The response of listing phrase matchers.
type ListPhraseMatchersResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The phrase matchers that match the request.
PhraseMatchers []*PhraseMatcher `protobuf:"bytes,1,rep,name=phrase_matchers,json=phraseMatchers,proto3" json:"phrase_matchers,omitempty"`
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *ListPhraseMatchersResponse) Reset() {
*x = ListPhraseMatchersResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[39]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListPhraseMatchersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListPhraseMatchersResponse) ProtoMessage() {}
func (x *ListPhraseMatchersResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[39]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListPhraseMatchersResponse.ProtoReflect.Descriptor instead.
func (*ListPhraseMatchersResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{39}
}
func (x *ListPhraseMatchersResponse) GetPhraseMatchers() []*PhraseMatcher {
if x != nil {
return x.PhraseMatchers
}
return nil
}
func (x *ListPhraseMatchersResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The request to get a a phrase matcher.
type GetPhraseMatcherRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the phrase matcher to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetPhraseMatcherRequest) Reset() {
*x = GetPhraseMatcherRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[40]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetPhraseMatcherRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetPhraseMatcherRequest) ProtoMessage() {}
func (x *GetPhraseMatcherRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[40]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetPhraseMatcherRequest.ProtoReflect.Descriptor instead.
func (*GetPhraseMatcherRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{40}
}
func (x *GetPhraseMatcherRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to delete a phrase matcher.
type DeletePhraseMatcherRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the phrase matcher to delete.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *DeletePhraseMatcherRequest) Reset() {
*x = DeletePhraseMatcherRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[41]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeletePhraseMatcherRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeletePhraseMatcherRequest) ProtoMessage() {}
func (x *DeletePhraseMatcherRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[41]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeletePhraseMatcherRequest.ProtoReflect.Descriptor instead.
func (*DeletePhraseMatcherRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{41}
}
func (x *DeletePhraseMatcherRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to update a phrase matcher.
type UpdatePhraseMatcherRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The new values for the phrase matcher.
PhraseMatcher *PhraseMatcher `protobuf:"bytes,1,opt,name=phrase_matcher,json=phraseMatcher,proto3" json:"phrase_matcher,omitempty"`
// The list of fields to be updated.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdatePhraseMatcherRequest) Reset() {
*x = UpdatePhraseMatcherRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[42]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdatePhraseMatcherRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdatePhraseMatcherRequest) ProtoMessage() {}
func (x *UpdatePhraseMatcherRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[42]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdatePhraseMatcherRequest.ProtoReflect.Descriptor instead.
func (*UpdatePhraseMatcherRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{42}
}
func (x *UpdatePhraseMatcherRequest) GetPhraseMatcher() *PhraseMatcher {
if x != nil {
return x.PhraseMatcher
}
return nil
}
func (x *UpdatePhraseMatcherRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// The request to get project-level settings.
type GetSettingsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the settings resource to get.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetSettingsRequest) Reset() {
*x = GetSettingsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[43]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetSettingsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetSettingsRequest) ProtoMessage() {}
func (x *GetSettingsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[43]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetSettingsRequest.ProtoReflect.Descriptor instead.
func (*GetSettingsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{43}
}
func (x *GetSettingsRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request to update project-level settings.
type UpdateSettingsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The new settings values.
Settings *Settings `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"`
// Required. The list of fields to be updated.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdateSettingsRequest) Reset() {
*x = UpdateSettingsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[44]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateSettingsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateSettingsRequest) ProtoMessage() {}
func (x *UpdateSettingsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[44]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateSettingsRequest.ProtoReflect.Descriptor instead.
func (*UpdateSettingsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{44}
}
func (x *UpdateSettingsRequest) GetSettings() *Settings {
if x != nil {
return x.Settings
}
return nil
}
func (x *UpdateSettingsRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// A time series representing conversations over time.
type CalculateStatsResponse_TimeSeries struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The duration of each interval.
IntervalDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=interval_duration,json=intervalDuration,proto3" json:"interval_duration,omitempty"`
// An ordered list of intervals from earliest to latest, where each interval
// represents the number of conversations that transpired during the time
// window.
Points []*CalculateStatsResponse_TimeSeries_Interval `protobuf:"bytes,2,rep,name=points,proto3" json:"points,omitempty"`
}
func (x *CalculateStatsResponse_TimeSeries) Reset() {
*x = CalculateStatsResponse_TimeSeries{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[45]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateStatsResponse_TimeSeries) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateStatsResponse_TimeSeries) ProtoMessage() {}
func (x *CalculateStatsResponse_TimeSeries) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[45]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateStatsResponse_TimeSeries.ProtoReflect.Descriptor instead.
func (*CalculateStatsResponse_TimeSeries) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{1, 0}
}
func (x *CalculateStatsResponse_TimeSeries) GetIntervalDuration() *durationpb.Duration {
if x != nil {
return x.IntervalDuration
}
return nil
}
func (x *CalculateStatsResponse_TimeSeries) GetPoints() []*CalculateStatsResponse_TimeSeries_Interval {
if x != nil {
return x.Points
}
return nil
}
// A single interval in a time series.
type CalculateStatsResponse_TimeSeries_Interval struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The start time of this interval.
StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
// The number of conversations created in this interval.
ConversationCount int32 `protobuf:"varint,2,opt,name=conversation_count,json=conversationCount,proto3" json:"conversation_count,omitempty"`
}
func (x *CalculateStatsResponse_TimeSeries_Interval) Reset() {
*x = CalculateStatsResponse_TimeSeries_Interval{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[50]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CalculateStatsResponse_TimeSeries_Interval) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CalculateStatsResponse_TimeSeries_Interval) ProtoMessage() {}
func (x *CalculateStatsResponse_TimeSeries_Interval) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[50]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CalculateStatsResponse_TimeSeries_Interval.ProtoReflect.Descriptor instead.
func (*CalculateStatsResponse_TimeSeries_Interval) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{1, 0, 0}
}
func (x *CalculateStatsResponse_TimeSeries_Interval) GetStartTime() *timestamppb.Timestamp {
if x != nil {
return x.StartTime
}
return nil
}
func (x *CalculateStatsResponse_TimeSeries_Interval) GetConversationCount() int32 {
if x != nil {
return x.ConversationCount
}
return 0
}
// A BigQuery Table Reference.
type ExportInsightsDataRequest_BigQueryDestination struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A project ID or number. If specified, then export will attempt to
// write data to this project instead of the resource project. Otherwise,
// the resource project will be used.
ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
// Required. The name of the BigQuery dataset that the snapshot result
// should be exported to. If this dataset does not exist, the export call
// returns an INVALID_ARGUMENT error.
Dataset string `protobuf:"bytes,1,opt,name=dataset,proto3" json:"dataset,omitempty"`
// The BigQuery table name to which the insights data should be written.
// If this table does not exist, the export call returns an INVALID_ARGUMENT
// error.
Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"`
}
func (x *ExportInsightsDataRequest_BigQueryDestination) Reset() {
*x = ExportInsightsDataRequest_BigQueryDestination{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[51]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExportInsightsDataRequest_BigQueryDestination) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExportInsightsDataRequest_BigQueryDestination) ProtoMessage() {}
func (x *ExportInsightsDataRequest_BigQueryDestination) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[51]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExportInsightsDataRequest_BigQueryDestination.ProtoReflect.Descriptor instead.
func (*ExportInsightsDataRequest_BigQueryDestination) Descriptor() ([]byte, []int) {
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP(), []int{14, 0}
}
func (x *ExportInsightsDataRequest_BigQueryDestination) GetProjectId() string {
if x != nil {
return x.ProjectId
}
return ""
}
func (x *ExportInsightsDataRequest_BigQueryDestination) GetDataset() string {
if x != nil {
return x.Dataset
}
return ""
}
func (x *ExportInsightsDataRequest_BigQueryDestination) GetTable() string {
if x != nil {
return x.Table
}
return ""
}
var File_google_cloud_contactcenterinsights_v1_contact_center_insights_proto protoreflect.FileDescriptor
var file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDesc = []byte{
0x0a, 0x43, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x35, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6c,
0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70,
0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x76, 0x0a, 0x15, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74,
0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a,
0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xa2, 0x0c, 0x0a,
0x16, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x10, 0x61, 0x76, 0x65, 0x72, 0x61,
0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x61, 0x76,
0x65, 0x72, 0x61, 0x67, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a,
0x12, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x61, 0x76, 0x65, 0x72, 0x61,
0x67, 0x65, 0x54, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x63,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x96, 0x01, 0x0a, 0x19, 0x73,
0x6d, 0x61, 0x72, 0x74, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72,
0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x5a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65,
0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x6d,
0x61, 0x72, 0x74, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x17, 0x73, 0x6d, 0x61, 0x72,
0x74, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x1a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x68,
0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x5b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x69,
0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x69, 0x67,
0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12,
0x78, 0x0a, 0x0d, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73,
0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43,
0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0c, 0x69, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x13, 0x69, 0x73,
0x73, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74,
0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x54, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x69,
0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73,
0x12, 0x8d, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x65, 0x72,
0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72,
0x69, 0x65, 0x73, 0x52, 0x1b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73,
0x1a, 0xb5, 0x02, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12,
0x46, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x44,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x69, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x51, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65,
0x73, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e,
0x74, 0x73, 0x1a, 0x74, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x39,
0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09,
0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x4a, 0x0a, 0x1c, 0x53, 0x6d, 0x61, 0x72,
0x74, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4b, 0x0a, 0x1d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x48, 0x69,
0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x1a, 0x8c, 0x01, 0x0a, 0x16, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x5c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x6c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x49, 0x73, 0x73, 0x75,
0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x22, 0xfe, 0x01, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c,
0x79, 0x73, 0x69, 0x73, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f,
0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65,
0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74,
0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54,
0x69, 0x6d, 0x65, 0x12, 0x5d, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0xe0, 0x41, 0x03, 0xfa, 0x41,
0x33, 0x0a, 0x31, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x22, 0xe5, 0x01, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72,
0x65, 0x6e, 0x74, 0x12, 0x5c, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03,
0xe0, 0x41, 0x02, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xfe, 0x01, 0x0a, 0x18, 0x4c,
0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a,
0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61,
0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70,
0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67,
0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x4b,
0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x22, 0x9e, 0x01, 0x0a, 0x19,
0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67,
0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e,
0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb4, 0x01, 0x0a,
0x16, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x33, 0x0a, 0x31, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x04, 0x76,
0x69, 0x65, 0x77, 0x22, 0xb6, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x5c, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41,
0x02, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b,
0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x80, 0x01, 0x0a,
0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x33,
0x0a, 0x31, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69,
0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72,
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22,
0xbc, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73,
0x69, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x06, 0x70, 0x61, 0x72,
0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0xe0, 0x41, 0x02, 0xfa, 0x41,
0x33, 0x0a, 0x31, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x08,
0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x42,
0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x22, 0xbc,
0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x39, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x33, 0x0a, 0x31,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67,
0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61,
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74,
0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65,
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x8b, 0x01,
0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73,
0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65,
0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65,
0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5f, 0x0a, 0x12, 0x47,
0x65, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x49, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x35, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2f, 0x0a, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6e,
0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x15,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x35, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2f, 0x0a, 0x2d, 0x63, 0x6f, 0x6e,
0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68,
0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x22, 0x96, 0x03, 0x0a, 0x19, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x8a,
0x01, 0x0a, 0x15, 0x62, 0x69, 0x67, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x64, 0x65, 0x73,
0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x54,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x2e, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x13, 0x62, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79,
0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02,
0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65,
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x1a,
0x69, 0x0a, 0x13, 0x42, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x64, 0x61, 0x74,
0x61, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x64, 0x65,
0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb1, 0x02, 0x0a, 0x1a, 0x45, 0x78,
0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61,
0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x6e,
0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65,
0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x44, 0x61,
0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0d,
0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x1c, 0x0a,
0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x44,
0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x17,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a,
0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x69, 0x73,
0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x6c, 0x22, 0xf2, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73,
0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x58,
0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73,
0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52,
0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x03, 0xe0, 0x41,
0x02, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x0a,
0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5b, 0x0a, 0x16, 0x4c, 0x69,
0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x6f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49,
0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65,
0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0b, 0x69, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x22, 0x63, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x49,
0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37,
0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x66, 0x0a,
0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xf2, 0x01, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
0x12, 0x58, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e,
0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x66, 0x0a, 0x17, 0x44, 0x65,
0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6f, 0x6e,
0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68,
0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf2,
0x01, 0x0a, 0x18, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41,
0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3a, 0x0a,
0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03,
0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x07, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63,
0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x19, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49,
0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37,
0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1c, 0x0a,
0x1a, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x1a,
0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72,
0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03,
0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x08,
0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d,
0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
0x64, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x5a, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73,
0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x69,
0x73, 0x73, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65,
0x73, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x05, 0x69, 0x73, 0x73, 0x75,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x49, 0x73, 0x73, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x69, 0x73, 0x73, 0x75,
0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61,
0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x7b,
0x0a, 0x1f, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65,
0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x58, 0x0a, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x84, 0x01, 0x0a, 0x20,
0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f,
0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x60, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74,
0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53,
0x74, 0x61, 0x74, 0x73, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61,
0x74, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x68, 0x72,
0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x12, 0x60, 0x0a, 0x0e, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x50,
0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xa3, 0x01, 0x0a, 0x1a,
0x4c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x0f, 0x70, 0x68,
0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x72, 0x61,
0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0e, 0x70, 0x68, 0x72, 0x61, 0x73,
0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,
0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x22, 0x69, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3a, 0xe0, 0x41, 0x02, 0xfa,
0x41, 0x34, 0x0a, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x6c, 0x0a, 0x1a,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3a, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x34,
0x0a, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69,
0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x1a, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x60, 0x0a, 0x0e, 0x70, 0x68, 0x72,
0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e,
0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65,
0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0d, 0x70, 0x68,
0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x5f, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x35, 0xe0, 0x41,
0x02, 0xfa, 0x41, 0x2f, 0x0a, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x15, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x73, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65,
0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x2a, 0x4a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x12, 0x21, 0x0a, 0x1d, 0x43,
0x4f, 0x4e, 0x56, 0x45, 0x52, 0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x56, 0x49, 0x45, 0x57,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09,
0x0a, 0x05, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c,
0x4c, 0x10, 0x02, 0x32, 0xdf, 0x33, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0xfa, 0x01,
0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6d, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x41, 0x22, 0x31, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0xda, 0x41, 0x23, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x63, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x12, 0xfc, 0x01, 0x0a, 0x12, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e,
0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4e,
0x32, 0x3e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f,
0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d,
0x3a, 0x0c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xda, 0x41,
0x18, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x75, 0x70,
0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0xc7, 0x01, 0x0a, 0x0f, 0x47, 0x65,
0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e,
0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68,
0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0xda, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63,
0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x12, 0xb0, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x22, 0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x2a, 0x31, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0xfe, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e,
0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f,
0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x22, 0x3c, 0x2f, 0x76,
0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a,
0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a,
0x7d, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0x3a, 0x08, 0x61, 0x6e, 0x61, 0x6c,
0x79, 0x73, 0x69, 0x73, 0xda, 0x41, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x61, 0x6e,
0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0xca, 0x41, 0x2b, 0x0a, 0x08, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x69, 0x73, 0x12, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x69, 0x73, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0x12, 0xc6, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x61, 0x6c,
0x79, 0x73, 0x69, 0x73, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73,
0x22, 0x4b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xd6, 0x01,
0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0x12, 0x3a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63,
0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12,
0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f,
0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x73, 0xda, 0x41, 0x06,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xb3, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x4b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x2a, 0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61,
0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73,
0x65, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xfe, 0x01, 0x0a,
0x12, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x44,
0x61, 0x74, 0x61, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f,
0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c,
0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x22, 0x86, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x22, 0x37, 0x2f,
0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
0x2a, 0x7d, 0x2f, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x64, 0x61, 0x74, 0x61, 0x3a,
0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x3a, 0x01, 0x2a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65,
0x6e, 0x74, 0xca, 0x41, 0x38, 0x0a, 0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x1a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xf6, 0x01,
0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x6c, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69,
0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67,
0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x22, 0x82, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x22, 0x2f, 0x2f, 0x76, 0x31, 0x2f,
0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f,
0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x3a, 0x0b, 0x69, 0x73, 0x73,
0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0xda, 0x41, 0x12, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x2c, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0xca, 0x41, 0x26,
0x0a, 0x0a, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x18, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xf1, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3e, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d,
0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x6a,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x32, 0x3b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x73, 0x73,
0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x2f, 0x2a, 0x7d, 0x3a, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
0xda, 0x41, 0x17, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x75,
0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0xbf, 0x01, 0x0a, 0x0d, 0x47,
0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3b, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x3e, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xd2, 0x01, 0x0a,
0x0f, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x40, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x12, 0xe5, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x2a, 0x2f, 0x2f,
0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f,
0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0xca, 0x41, 0x31, 0x0a, 0x15, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xf2, 0x01, 0x0a, 0x10, 0x44, 0x65,
0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3e,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e,
0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7f, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x22, 0x36, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64,
0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x3a, 0x01, 0x2a,
0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0xca, 0x41, 0x34, 0x0a, 0x18, 0x44, 0x65, 0x70, 0x6c,
0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xfd,
0x01, 0x0a, 0x12, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65,
0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e,
0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x22,
0x38, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d,
0x3a, 0x75, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x3a, 0x01, 0x2a, 0xda, 0x41, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0xca, 0x41, 0x38, 0x0a, 0x1a, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79,
0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x1a, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0xb9,
0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73, 0x75,
0x65, 0x22, 0x47, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73,
0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xcc, 0x01, 0x0a, 0x0a, 0x4c,
0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x12, 0x38, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72,
0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65,
0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73,
0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xd9, 0x01, 0x0a, 0x0b, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74,
0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76,
0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x73,
0x75, 0x65, 0x22, 0x61, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x32, 0x3e, 0x2f, 0x76, 0x31, 0x2f,
0x7b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a,
0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x05, 0x69, 0x73, 0x73, 0x75,
0x65, 0xda, 0x41, 0x11, 0x69, 0x73, 0x73, 0x75, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x92, 0x02, 0x0a, 0x18, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c,
0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61,
0x74, 0x73, 0x12, 0x46, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69,
0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75,
0x6c, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74,
0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x47, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63,
0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75,
0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x51, 0x12, 0x4f, 0x2f, 0x76, 0x31,
0x2f, 0x7b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
0x2f, 0x2a, 0x7d, 0x3a, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73,
0x75, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x73, 0xda, 0x41, 0x0b, 0x69,
0x73, 0x73, 0x75, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0xf2, 0x01, 0x0a, 0x13, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x12, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69,
0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68,
0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0x62, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x44, 0x22, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x3a, 0x0e, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f,
0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xda, 0x41, 0x15, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x2c, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12,
0xcb, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x72,
0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xde, 0x01,
0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63,
0x68, 0x65, 0x72, 0x73, 0x12, 0x40, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x34, 0x12, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70,
0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x65, 0x72, 0x73, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xb3,
0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x2a, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x68, 0x72, 0x61,
0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x86, 0x02, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x41, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x68, 0x72, 0x61, 0x73,
0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x22, 0x76, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x53, 0x32, 0x41, 0x2f,
0x76, 0x31, 0x2f, 0x7b, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73,
0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70,
0x68, 0x72, 0x61, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d,
0x3a, 0x0e, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
0xda, 0x41, 0x1a, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0xe4, 0x01,
0x0a, 0x0e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73,
0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61,
0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65,
0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x63, 0x61, 0x6c, 0x63, 0x75,
0x6c, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0xda, 0x41, 0x08, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb4, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x73, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0xdd, 0x01, 0x0a, 0x0e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67,
0x68, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74,
0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5c, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x3f, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a,
0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x7d, 0x3a, 0x08, 0x73, 0x65, 0x74, 0x74,
0x69, 0x6e, 0x67, 0x73, 0xda, 0x41, 0x14, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2c,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x1a, 0x58, 0xca, 0x41, 0x24,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73,
0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77,
0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61,
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0xa0, 0x02, 0x0a, 0x29, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x42, 0x1a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x5a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x63,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0xaa, 0x02, 0x25,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x43, 0x6f, 0x6e,
0x74, 0x61, 0x63, 0x74, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68,
0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x25, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x49, 0x6e, 0x73, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x28,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x43,
0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x69,
0x67, 0x68, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescOnce sync.Once
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescData = file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDesc
)
func file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescGZIP() []byte {
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescOnce.Do(func() {
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescData)
})
return file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDescData
}
var file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes = make([]protoimpl.MessageInfo, 52)
var file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_goTypes = []interface{}{
(ConversationView)(0), // 0: google.cloud.contactcenterinsights.v1.ConversationView
(*CalculateStatsRequest)(nil), // 1: google.cloud.contactcenterinsights.v1.CalculateStatsRequest
(*CalculateStatsResponse)(nil), // 2: google.cloud.contactcenterinsights.v1.CalculateStatsResponse
(*CreateAnalysisOperationMetadata)(nil), // 3: google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata
(*CreateConversationRequest)(nil), // 4: google.cloud.contactcenterinsights.v1.CreateConversationRequest
(*ListConversationsRequest)(nil), // 5: google.cloud.contactcenterinsights.v1.ListConversationsRequest
(*ListConversationsResponse)(nil), // 6: google.cloud.contactcenterinsights.v1.ListConversationsResponse
(*GetConversationRequest)(nil), // 7: google.cloud.contactcenterinsights.v1.GetConversationRequest
(*UpdateConversationRequest)(nil), // 8: google.cloud.contactcenterinsights.v1.UpdateConversationRequest
(*DeleteConversationRequest)(nil), // 9: google.cloud.contactcenterinsights.v1.DeleteConversationRequest
(*CreateAnalysisRequest)(nil), // 10: google.cloud.contactcenterinsights.v1.CreateAnalysisRequest
(*ListAnalysesRequest)(nil), // 11: google.cloud.contactcenterinsights.v1.ListAnalysesRequest
(*ListAnalysesResponse)(nil), // 12: google.cloud.contactcenterinsights.v1.ListAnalysesResponse
(*GetAnalysisRequest)(nil), // 13: google.cloud.contactcenterinsights.v1.GetAnalysisRequest
(*DeleteAnalysisRequest)(nil), // 14: google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest
(*ExportInsightsDataRequest)(nil), // 15: google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest
(*ExportInsightsDataMetadata)(nil), // 16: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata
(*ExportInsightsDataResponse)(nil), // 17: google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse
(*CreateIssueModelRequest)(nil), // 18: google.cloud.contactcenterinsights.v1.CreateIssueModelRequest
(*CreateIssueModelMetadata)(nil), // 19: google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata
(*UpdateIssueModelRequest)(nil), // 20: google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest
(*ListIssueModelsRequest)(nil), // 21: google.cloud.contactcenterinsights.v1.ListIssueModelsRequest
(*ListIssueModelsResponse)(nil), // 22: google.cloud.contactcenterinsights.v1.ListIssueModelsResponse
(*GetIssueModelRequest)(nil), // 23: google.cloud.contactcenterinsights.v1.GetIssueModelRequest
(*DeleteIssueModelRequest)(nil), // 24: google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest
(*DeleteIssueModelMetadata)(nil), // 25: google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata
(*DeployIssueModelRequest)(nil), // 26: google.cloud.contactcenterinsights.v1.DeployIssueModelRequest
(*DeployIssueModelResponse)(nil), // 27: google.cloud.contactcenterinsights.v1.DeployIssueModelResponse
(*DeployIssueModelMetadata)(nil), // 28: google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata
(*UndeployIssueModelRequest)(nil), // 29: google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest
(*UndeployIssueModelResponse)(nil), // 30: google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse
(*UndeployIssueModelMetadata)(nil), // 31: google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata
(*GetIssueRequest)(nil), // 32: google.cloud.contactcenterinsights.v1.GetIssueRequest
(*ListIssuesRequest)(nil), // 33: google.cloud.contactcenterinsights.v1.ListIssuesRequest
(*ListIssuesResponse)(nil), // 34: google.cloud.contactcenterinsights.v1.ListIssuesResponse
(*UpdateIssueRequest)(nil), // 35: google.cloud.contactcenterinsights.v1.UpdateIssueRequest
(*CalculateIssueModelStatsRequest)(nil), // 36: google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest
(*CalculateIssueModelStatsResponse)(nil), // 37: google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse
(*CreatePhraseMatcherRequest)(nil), // 38: google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest
(*ListPhraseMatchersRequest)(nil), // 39: google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest
(*ListPhraseMatchersResponse)(nil), // 40: google.cloud.contactcenterinsights.v1.ListPhraseMatchersResponse
(*GetPhraseMatcherRequest)(nil), // 41: google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest
(*DeletePhraseMatcherRequest)(nil), // 42: google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest
(*UpdatePhraseMatcherRequest)(nil), // 43: google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest
(*GetSettingsRequest)(nil), // 44: google.cloud.contactcenterinsights.v1.GetSettingsRequest
(*UpdateSettingsRequest)(nil), // 45: google.cloud.contactcenterinsights.v1.UpdateSettingsRequest
(*CalculateStatsResponse_TimeSeries)(nil), // 46: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries
nil, // 47: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.SmartHighlighterMatchesEntry
nil, // 48: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.CustomHighlighterMatchesEntry
nil, // 49: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.IssueMatchesEntry
nil, // 50: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.IssueMatchesStatsEntry
(*CalculateStatsResponse_TimeSeries_Interval)(nil), // 51: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries.Interval
(*ExportInsightsDataRequest_BigQueryDestination)(nil), // 52: google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination
(*durationpb.Duration)(nil), // 53: google.protobuf.Duration
(*timestamppb.Timestamp)(nil), // 54: google.protobuf.Timestamp
(*Conversation)(nil), // 55: google.cloud.contactcenterinsights.v1.Conversation
(*fieldmaskpb.FieldMask)(nil), // 56: google.protobuf.FieldMask
(*Analysis)(nil), // 57: google.cloud.contactcenterinsights.v1.Analysis
(*status.Status)(nil), // 58: google.rpc.Status
(*IssueModel)(nil), // 59: google.cloud.contactcenterinsights.v1.IssueModel
(*Issue)(nil), // 60: google.cloud.contactcenterinsights.v1.Issue
(*IssueModelLabelStats)(nil), // 61: google.cloud.contactcenterinsights.v1.IssueModelLabelStats
(*PhraseMatcher)(nil), // 62: google.cloud.contactcenterinsights.v1.PhraseMatcher
(*Settings)(nil), // 63: google.cloud.contactcenterinsights.v1.Settings
(*IssueModelLabelStats_IssueStats)(nil), // 64: google.cloud.contactcenterinsights.v1.IssueModelLabelStats.IssueStats
(*emptypb.Empty)(nil), // 65: google.protobuf.Empty
(*longrunning.Operation)(nil), // 66: google.longrunning.Operation
}
var file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_depIdxs = []int32{
53, // 0: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.average_duration:type_name -> google.protobuf.Duration
47, // 1: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.smart_highlighter_matches:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.SmartHighlighterMatchesEntry
48, // 2: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.custom_highlighter_matches:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.CustomHighlighterMatchesEntry
49, // 3: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.issue_matches:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.IssueMatchesEntry
50, // 4: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.issue_matches_stats:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.IssueMatchesStatsEntry
46, // 5: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.conversation_count_time_series:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries
54, // 6: google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 7: google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata.end_time:type_name -> google.protobuf.Timestamp
55, // 8: google.cloud.contactcenterinsights.v1.CreateConversationRequest.conversation:type_name -> google.cloud.contactcenterinsights.v1.Conversation
0, // 9: google.cloud.contactcenterinsights.v1.ListConversationsRequest.view:type_name -> google.cloud.contactcenterinsights.v1.ConversationView
55, // 10: google.cloud.contactcenterinsights.v1.ListConversationsResponse.conversations:type_name -> google.cloud.contactcenterinsights.v1.Conversation
0, // 11: google.cloud.contactcenterinsights.v1.GetConversationRequest.view:type_name -> google.cloud.contactcenterinsights.v1.ConversationView
55, // 12: google.cloud.contactcenterinsights.v1.UpdateConversationRequest.conversation:type_name -> google.cloud.contactcenterinsights.v1.Conversation
56, // 13: google.cloud.contactcenterinsights.v1.UpdateConversationRequest.update_mask:type_name -> google.protobuf.FieldMask
57, // 14: google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.analysis:type_name -> google.cloud.contactcenterinsights.v1.Analysis
57, // 15: google.cloud.contactcenterinsights.v1.ListAnalysesResponse.analyses:type_name -> google.cloud.contactcenterinsights.v1.Analysis
52, // 16: google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.big_query_destination:type_name -> google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination
54, // 17: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 18: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata.end_time:type_name -> google.protobuf.Timestamp
15, // 19: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata.request:type_name -> google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest
58, // 20: google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata.partial_errors:type_name -> google.rpc.Status
59, // 21: google.cloud.contactcenterinsights.v1.CreateIssueModelRequest.issue_model:type_name -> google.cloud.contactcenterinsights.v1.IssueModel
54, // 22: google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 23: google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata.end_time:type_name -> google.protobuf.Timestamp
18, // 24: google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata.request:type_name -> google.cloud.contactcenterinsights.v1.CreateIssueModelRequest
59, // 25: google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest.issue_model:type_name -> google.cloud.contactcenterinsights.v1.IssueModel
56, // 26: google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest.update_mask:type_name -> google.protobuf.FieldMask
59, // 27: google.cloud.contactcenterinsights.v1.ListIssueModelsResponse.issue_models:type_name -> google.cloud.contactcenterinsights.v1.IssueModel
54, // 28: google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 29: google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata.end_time:type_name -> google.protobuf.Timestamp
24, // 30: google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata.request:type_name -> google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest
54, // 31: google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 32: google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata.end_time:type_name -> google.protobuf.Timestamp
26, // 33: google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata.request:type_name -> google.cloud.contactcenterinsights.v1.DeployIssueModelRequest
54, // 34: google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata.create_time:type_name -> google.protobuf.Timestamp
54, // 35: google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata.end_time:type_name -> google.protobuf.Timestamp
29, // 36: google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata.request:type_name -> google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest
60, // 37: google.cloud.contactcenterinsights.v1.ListIssuesResponse.issues:type_name -> google.cloud.contactcenterinsights.v1.Issue
60, // 38: google.cloud.contactcenterinsights.v1.UpdateIssueRequest.issue:type_name -> google.cloud.contactcenterinsights.v1.Issue
56, // 39: google.cloud.contactcenterinsights.v1.UpdateIssueRequest.update_mask:type_name -> google.protobuf.FieldMask
61, // 40: google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse.current_stats:type_name -> google.cloud.contactcenterinsights.v1.IssueModelLabelStats
62, // 41: google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest.phrase_matcher:type_name -> google.cloud.contactcenterinsights.v1.PhraseMatcher
62, // 42: google.cloud.contactcenterinsights.v1.ListPhraseMatchersResponse.phrase_matchers:type_name -> google.cloud.contactcenterinsights.v1.PhraseMatcher
62, // 43: google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest.phrase_matcher:type_name -> google.cloud.contactcenterinsights.v1.PhraseMatcher
56, // 44: google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest.update_mask:type_name -> google.protobuf.FieldMask
63, // 45: google.cloud.contactcenterinsights.v1.UpdateSettingsRequest.settings:type_name -> google.cloud.contactcenterinsights.v1.Settings
56, // 46: google.cloud.contactcenterinsights.v1.UpdateSettingsRequest.update_mask:type_name -> google.protobuf.FieldMask
53, // 47: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries.interval_duration:type_name -> google.protobuf.Duration
51, // 48: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries.points:type_name -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries.Interval
64, // 49: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.IssueMatchesStatsEntry.value:type_name -> google.cloud.contactcenterinsights.v1.IssueModelLabelStats.IssueStats
54, // 50: google.cloud.contactcenterinsights.v1.CalculateStatsResponse.TimeSeries.Interval.start_time:type_name -> google.protobuf.Timestamp
4, // 51: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation:input_type -> google.cloud.contactcenterinsights.v1.CreateConversationRequest
8, // 52: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation:input_type -> google.cloud.contactcenterinsights.v1.UpdateConversationRequest
7, // 53: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation:input_type -> google.cloud.contactcenterinsights.v1.GetConversationRequest
5, // 54: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations:input_type -> google.cloud.contactcenterinsights.v1.ListConversationsRequest
9, // 55: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation:input_type -> google.cloud.contactcenterinsights.v1.DeleteConversationRequest
10, // 56: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis:input_type -> google.cloud.contactcenterinsights.v1.CreateAnalysisRequest
13, // 57: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis:input_type -> google.cloud.contactcenterinsights.v1.GetAnalysisRequest
11, // 58: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses:input_type -> google.cloud.contactcenterinsights.v1.ListAnalysesRequest
14, // 59: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis:input_type -> google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest
15, // 60: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData:input_type -> google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest
18, // 61: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel:input_type -> google.cloud.contactcenterinsights.v1.CreateIssueModelRequest
20, // 62: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel:input_type -> google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest
23, // 63: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel:input_type -> google.cloud.contactcenterinsights.v1.GetIssueModelRequest
21, // 64: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels:input_type -> google.cloud.contactcenterinsights.v1.ListIssueModelsRequest
24, // 65: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel:input_type -> google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest
26, // 66: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel:input_type -> google.cloud.contactcenterinsights.v1.DeployIssueModelRequest
29, // 67: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel:input_type -> google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest
32, // 68: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue:input_type -> google.cloud.contactcenterinsights.v1.GetIssueRequest
33, // 69: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues:input_type -> google.cloud.contactcenterinsights.v1.ListIssuesRequest
35, // 70: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue:input_type -> google.cloud.contactcenterinsights.v1.UpdateIssueRequest
36, // 71: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats:input_type -> google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest
38, // 72: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher:input_type -> google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest
41, // 73: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher:input_type -> google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest
39, // 74: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers:input_type -> google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest
42, // 75: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher:input_type -> google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest
43, // 76: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher:input_type -> google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest
1, // 77: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats:input_type -> google.cloud.contactcenterinsights.v1.CalculateStatsRequest
44, // 78: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings:input_type -> google.cloud.contactcenterinsights.v1.GetSettingsRequest
45, // 79: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings:input_type -> google.cloud.contactcenterinsights.v1.UpdateSettingsRequest
55, // 80: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation:output_type -> google.cloud.contactcenterinsights.v1.Conversation
55, // 81: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation:output_type -> google.cloud.contactcenterinsights.v1.Conversation
55, // 82: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation:output_type -> google.cloud.contactcenterinsights.v1.Conversation
6, // 83: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations:output_type -> google.cloud.contactcenterinsights.v1.ListConversationsResponse
65, // 84: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation:output_type -> google.protobuf.Empty
66, // 85: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis:output_type -> google.longrunning.Operation
57, // 86: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis:output_type -> google.cloud.contactcenterinsights.v1.Analysis
12, // 87: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses:output_type -> google.cloud.contactcenterinsights.v1.ListAnalysesResponse
65, // 88: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis:output_type -> google.protobuf.Empty
66, // 89: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData:output_type -> google.longrunning.Operation
66, // 90: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel:output_type -> google.longrunning.Operation
59, // 91: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel:output_type -> google.cloud.contactcenterinsights.v1.IssueModel
59, // 92: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel:output_type -> google.cloud.contactcenterinsights.v1.IssueModel
22, // 93: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels:output_type -> google.cloud.contactcenterinsights.v1.ListIssueModelsResponse
66, // 94: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel:output_type -> google.longrunning.Operation
66, // 95: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel:output_type -> google.longrunning.Operation
66, // 96: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel:output_type -> google.longrunning.Operation
60, // 97: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue:output_type -> google.cloud.contactcenterinsights.v1.Issue
34, // 98: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues:output_type -> google.cloud.contactcenterinsights.v1.ListIssuesResponse
60, // 99: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue:output_type -> google.cloud.contactcenterinsights.v1.Issue
37, // 100: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats:output_type -> google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse
62, // 101: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher:output_type -> google.cloud.contactcenterinsights.v1.PhraseMatcher
62, // 102: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher:output_type -> google.cloud.contactcenterinsights.v1.PhraseMatcher
40, // 103: google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers:output_type -> google.cloud.contactcenterinsights.v1.ListPhraseMatchersResponse
65, // 104: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher:output_type -> google.protobuf.Empty
62, // 105: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher:output_type -> google.cloud.contactcenterinsights.v1.PhraseMatcher
2, // 106: google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats:output_type -> google.cloud.contactcenterinsights.v1.CalculateStatsResponse
63, // 107: google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings:output_type -> google.cloud.contactcenterinsights.v1.Settings
63, // 108: google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings:output_type -> google.cloud.contactcenterinsights.v1.Settings
80, // [80:109] is the sub-list for method output_type
51, // [51:80] is the sub-list for method input_type
51, // [51:51] is the sub-list for extension type_name
51, // [51:51] is the sub-list for extension extendee
0, // [0:51] is the sub-list for field type_name
}
func init() { file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_init() }
func file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_init() {
if File_google_cloud_contactcenterinsights_v1_contact_center_insights_proto != nil {
return
}
file_google_cloud_contactcenterinsights_v1_resources_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateStatsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateStatsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateAnalysisOperationMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateConversationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListConversationsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListConversationsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetConversationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateConversationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteConversationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateAnalysisRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListAnalysesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListAnalysesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetAnalysisRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteAnalysisRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExportInsightsDataRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExportInsightsDataMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExportInsightsDataResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateIssueModelMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListIssueModelsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListIssueModelsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteIssueModelMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeployIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeployIssueModelResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeployIssueModelMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UndeployIssueModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UndeployIssueModelResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UndeployIssueModelMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetIssueRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListIssuesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListIssuesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateIssueRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateIssueModelStatsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateIssueModelStatsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreatePhraseMatcherRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListPhraseMatchersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListPhraseMatchersResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetPhraseMatcherRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeletePhraseMatcherRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdatePhraseMatcherRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSettingsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateSettingsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateStatsResponse_TimeSeries); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CalculateStatsResponse_TimeSeries_Interval); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExportInsightsDataRequest_BigQueryDestination); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes[14].OneofWrappers = []interface{}{
(*ExportInsightsDataRequest_BigQueryDestination_)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDesc,
NumEnums: 1,
NumMessages: 52,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_goTypes,
DependencyIndexes: file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_depIdxs,
EnumInfos: file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_enumTypes,
MessageInfos: file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_msgTypes,
}.Build()
File_google_cloud_contactcenterinsights_v1_contact_center_insights_proto = out.File
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_rawDesc = nil
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_goTypes = nil
file_google_cloud_contactcenterinsights_v1_contact_center_insights_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// ContactCenterInsightsClient is the client API for ContactCenterInsights service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ContactCenterInsightsClient interface {
// Creates a conversation.
CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
// Updates a conversation.
UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
// Gets a conversation.
GetConversation(ctx context.Context, in *GetConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
// Lists conversations.
ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...grpc.CallOption) (*ListConversationsResponse, error)
// Deletes a conversation.
DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Creates an analysis. The long running operation is done when the analysis
// has completed.
CreateAnalysis(ctx context.Context, in *CreateAnalysisRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Gets an analysis.
GetAnalysis(ctx context.Context, in *GetAnalysisRequest, opts ...grpc.CallOption) (*Analysis, error)
// Lists analyses.
ListAnalyses(ctx context.Context, in *ListAnalysesRequest, opts ...grpc.CallOption) (*ListAnalysesResponse, error)
// Deletes an analysis.
DeleteAnalysis(ctx context.Context, in *DeleteAnalysisRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Export insights data to a destination defined in the request body.
ExportInsightsData(ctx context.Context, in *ExportInsightsDataRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Creates an issue model.
CreateIssueModel(ctx context.Context, in *CreateIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Updates an issue model.
UpdateIssueModel(ctx context.Context, in *UpdateIssueModelRequest, opts ...grpc.CallOption) (*IssueModel, error)
// Gets an issue model.
GetIssueModel(ctx context.Context, in *GetIssueModelRequest, opts ...grpc.CallOption) (*IssueModel, error)
// Lists issue models.
ListIssueModels(ctx context.Context, in *ListIssueModelsRequest, opts ...grpc.CallOption) (*ListIssueModelsResponse, error)
// Deletes an issue model.
DeleteIssueModel(ctx context.Context, in *DeleteIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Deploys an issue model. Returns an error if a model is already deployed.
// An issue model can only be used in analysis after it has been deployed.
DeployIssueModel(ctx context.Context, in *DeployIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Undeploys an issue model.
// An issue model can not be used in analysis after it has been undeployed.
UndeployIssueModel(ctx context.Context, in *UndeployIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error)
// Gets an issue.
GetIssue(ctx context.Context, in *GetIssueRequest, opts ...grpc.CallOption) (*Issue, error)
// Lists issues.
ListIssues(ctx context.Context, in *ListIssuesRequest, opts ...grpc.CallOption) (*ListIssuesResponse, error)
// Updates an issue.
UpdateIssue(ctx context.Context, in *UpdateIssueRequest, opts ...grpc.CallOption) (*Issue, error)
// Gets an issue model's statistics.
CalculateIssueModelStats(ctx context.Context, in *CalculateIssueModelStatsRequest, opts ...grpc.CallOption) (*CalculateIssueModelStatsResponse, error)
// Creates a phrase matcher.
CreatePhraseMatcher(ctx context.Context, in *CreatePhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error)
// Gets a phrase matcher.
GetPhraseMatcher(ctx context.Context, in *GetPhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error)
// Lists phrase matchers.
ListPhraseMatchers(ctx context.Context, in *ListPhraseMatchersRequest, opts ...grpc.CallOption) (*ListPhraseMatchersResponse, error)
// Deletes a phrase matcher.
DeletePhraseMatcher(ctx context.Context, in *DeletePhraseMatcherRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Updates a phrase matcher.
UpdatePhraseMatcher(ctx context.Context, in *UpdatePhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error)
// Gets conversation statistics.
CalculateStats(ctx context.Context, in *CalculateStatsRequest, opts ...grpc.CallOption) (*CalculateStatsResponse, error)
// Gets project-level settings.
GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*Settings, error)
// Updates project-level settings.
UpdateSettings(ctx context.Context, in *UpdateSettingsRequest, opts ...grpc.CallOption) (*Settings, error)
}
type contactCenterInsightsClient struct {
cc grpc.ClientConnInterface
}
func NewContactCenterInsightsClient(cc grpc.ClientConnInterface) ContactCenterInsightsClient {
return &contactCenterInsightsClient{cc}
}
func (c *contactCenterInsightsClient) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
out := new(Conversation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateConversation", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UpdateConversation(ctx context.Context, in *UpdateConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
out := new(Conversation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateConversation", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetConversation(ctx context.Context, in *GetConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
out := new(Conversation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetConversation", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...grpc.CallOption) (*ListConversationsResponse, error) {
out := new(ListConversationsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListConversations", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteConversation", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) CreateAnalysis(ctx context.Context, in *CreateAnalysisRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateAnalysis", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetAnalysis(ctx context.Context, in *GetAnalysisRequest, opts ...grpc.CallOption) (*Analysis, error) {
out := new(Analysis)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetAnalysis", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ListAnalyses(ctx context.Context, in *ListAnalysesRequest, opts ...grpc.CallOption) (*ListAnalysesResponse, error) {
out := new(ListAnalysesResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAnalyses", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) DeleteAnalysis(ctx context.Context, in *DeleteAnalysisRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteAnalysis", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ExportInsightsData(ctx context.Context, in *ExportInsightsDataRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportInsightsData", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) CreateIssueModel(ctx context.Context, in *CreateIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UpdateIssueModel(ctx context.Context, in *UpdateIssueModelRequest, opts ...grpc.CallOption) (*IssueModel, error) {
out := new(IssueModel)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetIssueModel(ctx context.Context, in *GetIssueModelRequest, opts ...grpc.CallOption) (*IssueModel, error) {
out := new(IssueModel)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ListIssueModels(ctx context.Context, in *ListIssueModelsRequest, opts ...grpc.CallOption) (*ListIssueModelsResponse, error) {
out := new(ListIssueModelsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssueModels", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) DeleteIssueModel(ctx context.Context, in *DeleteIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) DeployIssueModel(ctx context.Context, in *DeployIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeployIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UndeployIssueModel(ctx context.Context, in *UndeployIssueModelRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) {
out := new(longrunning.Operation)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UndeployIssueModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetIssue(ctx context.Context, in *GetIssueRequest, opts ...grpc.CallOption) (*Issue, error) {
out := new(Issue)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssue", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ListIssues(ctx context.Context, in *ListIssuesRequest, opts ...grpc.CallOption) (*ListIssuesResponse, error) {
out := new(ListIssuesResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssues", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UpdateIssue(ctx context.Context, in *UpdateIssueRequest, opts ...grpc.CallOption) (*Issue, error) {
out := new(Issue)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateIssue", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) CalculateIssueModelStats(ctx context.Context, in *CalculateIssueModelStatsRequest, opts ...grpc.CallOption) (*CalculateIssueModelStatsResponse, error) {
out := new(CalculateIssueModelStatsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CalculateIssueModelStats", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) CreatePhraseMatcher(ctx context.Context, in *CreatePhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error) {
out := new(PhraseMatcher)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreatePhraseMatcher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetPhraseMatcher(ctx context.Context, in *GetPhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error) {
out := new(PhraseMatcher)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetPhraseMatcher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) ListPhraseMatchers(ctx context.Context, in *ListPhraseMatchersRequest, opts ...grpc.CallOption) (*ListPhraseMatchersResponse, error) {
out := new(ListPhraseMatchersResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListPhraseMatchers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) DeletePhraseMatcher(ctx context.Context, in *DeletePhraseMatcherRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeletePhraseMatcher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UpdatePhraseMatcher(ctx context.Context, in *UpdatePhraseMatcherRequest, opts ...grpc.CallOption) (*PhraseMatcher, error) {
out := new(PhraseMatcher)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdatePhraseMatcher", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) CalculateStats(ctx context.Context, in *CalculateStatsRequest, opts ...grpc.CallOption) (*CalculateStatsResponse, error) {
out := new(CalculateStatsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CalculateStats", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) GetSettings(ctx context.Context, in *GetSettingsRequest, opts ...grpc.CallOption) (*Settings, error) {
out := new(Settings)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetSettings", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contactCenterInsightsClient) UpdateSettings(ctx context.Context, in *UpdateSettingsRequest, opts ...grpc.CallOption) (*Settings, error) {
out := new(Settings)
err := c.cc.Invoke(ctx, "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateSettings", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ContactCenterInsightsServer is the server API for ContactCenterInsights service.
type ContactCenterInsightsServer interface {
// Creates a conversation.
CreateConversation(context.Context, *CreateConversationRequest) (*Conversation, error)
// Updates a conversation.
UpdateConversation(context.Context, *UpdateConversationRequest) (*Conversation, error)
// Gets a conversation.
GetConversation(context.Context, *GetConversationRequest) (*Conversation, error)
// Lists conversations.
ListConversations(context.Context, *ListConversationsRequest) (*ListConversationsResponse, error)
// Deletes a conversation.
DeleteConversation(context.Context, *DeleteConversationRequest) (*emptypb.Empty, error)
// Creates an analysis. The long running operation is done when the analysis
// has completed.
CreateAnalysis(context.Context, *CreateAnalysisRequest) (*longrunning.Operation, error)
// Gets an analysis.
GetAnalysis(context.Context, *GetAnalysisRequest) (*Analysis, error)
// Lists analyses.
ListAnalyses(context.Context, *ListAnalysesRequest) (*ListAnalysesResponse, error)
// Deletes an analysis.
DeleteAnalysis(context.Context, *DeleteAnalysisRequest) (*emptypb.Empty, error)
// Export insights data to a destination defined in the request body.
ExportInsightsData(context.Context, *ExportInsightsDataRequest) (*longrunning.Operation, error)
// Creates an issue model.
CreateIssueModel(context.Context, *CreateIssueModelRequest) (*longrunning.Operation, error)
// Updates an issue model.
UpdateIssueModel(context.Context, *UpdateIssueModelRequest) (*IssueModel, error)
// Gets an issue model.
GetIssueModel(context.Context, *GetIssueModelRequest) (*IssueModel, error)
// Lists issue models.
ListIssueModels(context.Context, *ListIssueModelsRequest) (*ListIssueModelsResponse, error)
// Deletes an issue model.
DeleteIssueModel(context.Context, *DeleteIssueModelRequest) (*longrunning.Operation, error)
// Deploys an issue model. Returns an error if a model is already deployed.
// An issue model can only be used in analysis after it has been deployed.
DeployIssueModel(context.Context, *DeployIssueModelRequest) (*longrunning.Operation, error)
// Undeploys an issue model.
// An issue model can not be used in analysis after it has been undeployed.
UndeployIssueModel(context.Context, *UndeployIssueModelRequest) (*longrunning.Operation, error)
// Gets an issue.
GetIssue(context.Context, *GetIssueRequest) (*Issue, error)
// Lists issues.
ListIssues(context.Context, *ListIssuesRequest) (*ListIssuesResponse, error)
// Updates an issue.
UpdateIssue(context.Context, *UpdateIssueRequest) (*Issue, error)
// Gets an issue model's statistics.
CalculateIssueModelStats(context.Context, *CalculateIssueModelStatsRequest) (*CalculateIssueModelStatsResponse, error)
// Creates a phrase matcher.
CreatePhraseMatcher(context.Context, *CreatePhraseMatcherRequest) (*PhraseMatcher, error)
// Gets a phrase matcher.
GetPhraseMatcher(context.Context, *GetPhraseMatcherRequest) (*PhraseMatcher, error)
// Lists phrase matchers.
ListPhraseMatchers(context.Context, *ListPhraseMatchersRequest) (*ListPhraseMatchersResponse, error)
// Deletes a phrase matcher.
DeletePhraseMatcher(context.Context, *DeletePhraseMatcherRequest) (*emptypb.Empty, error)
// Updates a phrase matcher.
UpdatePhraseMatcher(context.Context, *UpdatePhraseMatcherRequest) (*PhraseMatcher, error)
// Gets conversation statistics.
CalculateStats(context.Context, *CalculateStatsRequest) (*CalculateStatsResponse, error)
// Gets project-level settings.
GetSettings(context.Context, *GetSettingsRequest) (*Settings, error)
// Updates project-level settings.
UpdateSettings(context.Context, *UpdateSettingsRequest) (*Settings, error)
}
// UnimplementedContactCenterInsightsServer can be embedded to have forward compatible implementations.
type UnimplementedContactCenterInsightsServer struct {
}
func (*UnimplementedContactCenterInsightsServer) CreateConversation(context.Context, *CreateConversationRequest) (*Conversation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CreateConversation not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UpdateConversation(context.Context, *UpdateConversationRequest) (*Conversation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdateConversation not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetConversation(context.Context, *GetConversationRequest) (*Conversation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetConversation not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ListConversations(context.Context, *ListConversationsRequest) (*ListConversationsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListConversations not implemented")
}
func (*UnimplementedContactCenterInsightsServer) DeleteConversation(context.Context, *DeleteConversationRequest) (*emptypb.Empty, error) {
return nil, status1.Errorf(codes.Unimplemented, "method DeleteConversation not implemented")
}
func (*UnimplementedContactCenterInsightsServer) CreateAnalysis(context.Context, *CreateAnalysisRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CreateAnalysis not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetAnalysis(context.Context, *GetAnalysisRequest) (*Analysis, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetAnalysis not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ListAnalyses(context.Context, *ListAnalysesRequest) (*ListAnalysesResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListAnalyses not implemented")
}
func (*UnimplementedContactCenterInsightsServer) DeleteAnalysis(context.Context, *DeleteAnalysisRequest) (*emptypb.Empty, error) {
return nil, status1.Errorf(codes.Unimplemented, "method DeleteAnalysis not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ExportInsightsData(context.Context, *ExportInsightsDataRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ExportInsightsData not implemented")
}
func (*UnimplementedContactCenterInsightsServer) CreateIssueModel(context.Context, *CreateIssueModelRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CreateIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UpdateIssueModel(context.Context, *UpdateIssueModelRequest) (*IssueModel, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdateIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetIssueModel(context.Context, *GetIssueModelRequest) (*IssueModel, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ListIssueModels(context.Context, *ListIssueModelsRequest) (*ListIssueModelsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListIssueModels not implemented")
}
func (*UnimplementedContactCenterInsightsServer) DeleteIssueModel(context.Context, *DeleteIssueModelRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method DeleteIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) DeployIssueModel(context.Context, *DeployIssueModelRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method DeployIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UndeployIssueModel(context.Context, *UndeployIssueModelRequest) (*longrunning.Operation, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UndeployIssueModel not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetIssue(context.Context, *GetIssueRequest) (*Issue, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetIssue not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ListIssues(context.Context, *ListIssuesRequest) (*ListIssuesResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListIssues not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UpdateIssue(context.Context, *UpdateIssueRequest) (*Issue, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdateIssue not implemented")
}
func (*UnimplementedContactCenterInsightsServer) CalculateIssueModelStats(context.Context, *CalculateIssueModelStatsRequest) (*CalculateIssueModelStatsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CalculateIssueModelStats not implemented")
}
func (*UnimplementedContactCenterInsightsServer) CreatePhraseMatcher(context.Context, *CreatePhraseMatcherRequest) (*PhraseMatcher, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CreatePhraseMatcher not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetPhraseMatcher(context.Context, *GetPhraseMatcherRequest) (*PhraseMatcher, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetPhraseMatcher not implemented")
}
func (*UnimplementedContactCenterInsightsServer) ListPhraseMatchers(context.Context, *ListPhraseMatchersRequest) (*ListPhraseMatchersResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListPhraseMatchers not implemented")
}
func (*UnimplementedContactCenterInsightsServer) DeletePhraseMatcher(context.Context, *DeletePhraseMatcherRequest) (*emptypb.Empty, error) {
return nil, status1.Errorf(codes.Unimplemented, "method DeletePhraseMatcher not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UpdatePhraseMatcher(context.Context, *UpdatePhraseMatcherRequest) (*PhraseMatcher, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdatePhraseMatcher not implemented")
}
func (*UnimplementedContactCenterInsightsServer) CalculateStats(context.Context, *CalculateStatsRequest) (*CalculateStatsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CalculateStats not implemented")
}
func (*UnimplementedContactCenterInsightsServer) GetSettings(context.Context, *GetSettingsRequest) (*Settings, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetSettings not implemented")
}
func (*UnimplementedContactCenterInsightsServer) UpdateSettings(context.Context, *UpdateSettingsRequest) (*Settings, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdateSettings not implemented")
}
func RegisterContactCenterInsightsServer(s *grpc.Server, srv ContactCenterInsightsServer) {
s.RegisterService(&_ContactCenterInsights_serviceDesc, srv)
}
func _ContactCenterInsights_CreateConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CreateConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateConversation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CreateConversation(ctx, req.(*CreateConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UpdateConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UpdateConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateConversation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UpdateConversation(ctx, req.(*UpdateConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetConversation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetConversation(ctx, req.(*GetConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ListConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListConversationsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ListConversations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListConversations",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ListConversations(ctx, req.(*ListConversationsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_DeleteConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).DeleteConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteConversation",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).DeleteConversation(ctx, req.(*DeleteConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_CreateAnalysis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAnalysisRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CreateAnalysis(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateAnalysis",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CreateAnalysis(ctx, req.(*CreateAnalysisRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetAnalysis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetAnalysisRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetAnalysis(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetAnalysis",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetAnalysis(ctx, req.(*GetAnalysisRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ListAnalyses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListAnalysesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ListAnalyses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListAnalyses",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ListAnalyses(ctx, req.(*ListAnalysesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_DeleteAnalysis_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteAnalysisRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).DeleteAnalysis(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteAnalysis",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).DeleteAnalysis(ctx, req.(*DeleteAnalysisRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ExportInsightsData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExportInsightsDataRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ExportInsightsData(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ExportInsightsData",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ExportInsightsData(ctx, req.(*ExportInsightsDataRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_CreateIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CreateIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreateIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CreateIssueModel(ctx, req.(*CreateIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UpdateIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UpdateIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UpdateIssueModel(ctx, req.(*UpdateIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetIssueModel(ctx, req.(*GetIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ListIssueModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListIssueModelsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ListIssueModels(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssueModels",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ListIssueModels(ctx, req.(*ListIssueModelsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_DeleteIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).DeleteIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeleteIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).DeleteIssueModel(ctx, req.(*DeleteIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_DeployIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeployIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).DeployIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeployIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).DeployIssueModel(ctx, req.(*DeployIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UndeployIssueModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UndeployIssueModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UndeployIssueModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UndeployIssueModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UndeployIssueModel(ctx, req.(*UndeployIssueModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetIssue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetIssueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetIssue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetIssue",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetIssue(ctx, req.(*GetIssueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ListIssues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListIssuesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ListIssues(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListIssues",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ListIssues(ctx, req.(*ListIssuesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UpdateIssue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateIssueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UpdateIssue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateIssue",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UpdateIssue(ctx, req.(*UpdateIssueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_CalculateIssueModelStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CalculateIssueModelStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CalculateIssueModelStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CalculateIssueModelStats",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CalculateIssueModelStats(ctx, req.(*CalculateIssueModelStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_CreatePhraseMatcher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreatePhraseMatcherRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CreatePhraseMatcher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CreatePhraseMatcher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CreatePhraseMatcher(ctx, req.(*CreatePhraseMatcherRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetPhraseMatcher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPhraseMatcherRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetPhraseMatcher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetPhraseMatcher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetPhraseMatcher(ctx, req.(*GetPhraseMatcherRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_ListPhraseMatchers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPhraseMatchersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).ListPhraseMatchers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/ListPhraseMatchers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).ListPhraseMatchers(ctx, req.(*ListPhraseMatchersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_DeletePhraseMatcher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePhraseMatcherRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).DeletePhraseMatcher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/DeletePhraseMatcher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).DeletePhraseMatcher(ctx, req.(*DeletePhraseMatcherRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UpdatePhraseMatcher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdatePhraseMatcherRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UpdatePhraseMatcher(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdatePhraseMatcher",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UpdatePhraseMatcher(ctx, req.(*UpdatePhraseMatcherRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_CalculateStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CalculateStatsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).CalculateStats(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/CalculateStats",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).CalculateStats(ctx, req.(*CalculateStatsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSettingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).GetSettings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/GetSettings",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).GetSettings(ctx, req.(*GetSettingsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ContactCenterInsights_UpdateSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateSettingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContactCenterInsightsServer).UpdateSettings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.contactcenterinsights.v1.ContactCenterInsights/UpdateSettings",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContactCenterInsightsServer).UpdateSettings(ctx, req.(*UpdateSettingsRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ContactCenterInsights_serviceDesc = grpc.ServiceDesc{
ServiceName: "google.cloud.contactcenterinsights.v1.ContactCenterInsights",
HandlerType: (*ContactCenterInsightsServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateConversation",
Handler: _ContactCenterInsights_CreateConversation_Handler,
},
{
MethodName: "UpdateConversation",
Handler: _ContactCenterInsights_UpdateConversation_Handler,
},
{
MethodName: "GetConversation",
Handler: _ContactCenterInsights_GetConversation_Handler,
},
{
MethodName: "ListConversations",
Handler: _ContactCenterInsights_ListConversations_Handler,
},
{
MethodName: "DeleteConversation",
Handler: _ContactCenterInsights_DeleteConversation_Handler,
},
{
MethodName: "CreateAnalysis",
Handler: _ContactCenterInsights_CreateAnalysis_Handler,
},
{
MethodName: "GetAnalysis",
Handler: _ContactCenterInsights_GetAnalysis_Handler,
},
{
MethodName: "ListAnalyses",
Handler: _ContactCenterInsights_ListAnalyses_Handler,
},
{
MethodName: "DeleteAnalysis",
Handler: _ContactCenterInsights_DeleteAnalysis_Handler,
},
{
MethodName: "ExportInsightsData",
Handler: _ContactCenterInsights_ExportInsightsData_Handler,
},
{
MethodName: "CreateIssueModel",
Handler: _ContactCenterInsights_CreateIssueModel_Handler,
},
{
MethodName: "UpdateIssueModel",
Handler: _ContactCenterInsights_UpdateIssueModel_Handler,
},
{
MethodName: "GetIssueModel",
Handler: _ContactCenterInsights_GetIssueModel_Handler,
},
{
MethodName: "ListIssueModels",
Handler: _ContactCenterInsights_ListIssueModels_Handler,
},
{
MethodName: "DeleteIssueModel",
Handler: _ContactCenterInsights_DeleteIssueModel_Handler,
},
{
MethodName: "DeployIssueModel",
Handler: _ContactCenterInsights_DeployIssueModel_Handler,
},
{
MethodName: "UndeployIssueModel",
Handler: _ContactCenterInsights_UndeployIssueModel_Handler,
},
{
MethodName: "GetIssue",
Handler: _ContactCenterInsights_GetIssue_Handler,
},
{
MethodName: "ListIssues",
Handler: _ContactCenterInsights_ListIssues_Handler,
},
{
MethodName: "UpdateIssue",
Handler: _ContactCenterInsights_UpdateIssue_Handler,
},
{
MethodName: "CalculateIssueModelStats",
Handler: _ContactCenterInsights_CalculateIssueModelStats_Handler,
},
{
MethodName: "CreatePhraseMatcher",
Handler: _ContactCenterInsights_CreatePhraseMatcher_Handler,
},
{
MethodName: "GetPhraseMatcher",
Handler: _ContactCenterInsights_GetPhraseMatcher_Handler,
},
{
MethodName: "ListPhraseMatchers",
Handler: _ContactCenterInsights_ListPhraseMatchers_Handler,
},
{
MethodName: "DeletePhraseMatcher",
Handler: _ContactCenterInsights_DeletePhraseMatcher_Handler,
},
{
MethodName: "UpdatePhraseMatcher",
Handler: _ContactCenterInsights_UpdatePhraseMatcher_Handler,
},
{
MethodName: "CalculateStats",
Handler: _ContactCenterInsights_CalculateStats_Handler,
},
{
MethodName: "GetSettings",
Handler: _ContactCenterInsights_GetSettings_Handler,
},
{
MethodName: "UpdateSettings",
Handler: _ContactCenterInsights_UpdateSettings_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "google/cloud/contactcenterinsights/v1/contact_center_insights.proto",
}
| google/go-genproto | googleapis/cloud/contactcenterinsights/v1/contact_center_insights.pb.go | GO | apache-2.0 | 288,569 |
/*
* Copyright (c) 2015 AsyncHttpClient Project. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package org.asynchttpclient.exception;
import java.io.IOException;
import static org.asynchttpclient.util.MiscUtils.trimStackTrace;
@SuppressWarnings("serial")
public final class ChannelClosedException extends IOException {
public static final ChannelClosedException INSTANCE = trimStackTrace(new ChannelClosedException());
private ChannelClosedException() {
super("Channel closed");
}
}
| Aulust/async-http-client | client/src/main/java/org/asynchttpclient/exception/ChannelClosedException.java | Java | apache-2.0 | 1,114 |
# Copyright (c) 2010-2012 OpenStack, LLC.
#
# 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.
"""
Internal client library for making calls directly to the servers rather than
through the proxy.
"""
import os
import socket
from httplib import HTTPException
from time import time
from eventlet import sleep, Timeout
from swift.common.bufferedhttp import http_connect
from swiftclient import ClientException, json_loads
from swift.common.utils import FileLikeIter
from swift.common.ondisk import normalize_timestamp
from swift.common.http import HTTP_NO_CONTENT, HTTP_INSUFFICIENT_STORAGE, \
is_success, is_server_error
from swift.common.swob import HeaderKeyDict
from swift.common.utils import quote
def _get_direct_account_container(path, stype, node, part,
account, marker=None, limit=None,
prefix=None, delimiter=None, conn_timeout=5,
response_timeout=15):
"""Base class for get direct account and container.
Do not use directly use the get_direct_account or
get_direct_container instead.
"""
qs = 'format=json'
if marker:
qs += '&marker=%s' % quote(marker)
if limit:
qs += '&limit=%d' % limit
if prefix:
qs += '&prefix=%s' % quote(prefix)
if delimiter:
qs += '&delimiter=%s' % quote(delimiter)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'GET', path, query_string=qs,
headers=gen_headers())
with Timeout(response_timeout):
resp = conn.getresponse()
if not is_success(resp.status):
resp.read()
raise ClientException(
'%s server %s:%s direct GET %s gave stats %s' %
(stype, node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
resp_headers = {}
for header, value in resp.getheaders():
resp_headers[header.lower()] = value
if resp.status == HTTP_NO_CONTENT:
resp.read()
return resp_headers, []
return resp_headers, json_loads(resp.read())
def gen_headers(hdrs_in=None, add_ts=False):
hdrs_out = HeaderKeyDict(hdrs_in) if hdrs_in else HeaderKeyDict()
if add_ts:
hdrs_out['X-Timestamp'] = normalize_timestamp(time())
hdrs_out['User-Agent'] = 'direct-client %s' % os.getpid()
return hdrs_out
def direct_get_account(node, part, account, marker=None, limit=None,
prefix=None, delimiter=None, conn_timeout=5,
response_timeout=15):
"""
Get listings directly from the account server.
:param node: node dictionary from the ring
:param part: partition the account is on
:param account: account name
:param marker: marker query
:param limit: query limit
:param prefix: prefix query
:param delimeter: delimeter for the query
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:returns: a tuple of (response headers, a list of containers) The response
headers will be a dict and all header names will be lowercase.
"""
path = '/' + account
return _get_direct_account_container(path, "Account", node, part,
account, marker=None,
limit=None, prefix=None,
delimiter=None,
conn_timeout=5,
response_timeout=15)
def direct_head_container(node, part, account, container, conn_timeout=5,
response_timeout=15):
"""
Request container information directly from the container server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:returns: a dict containing the response's headers (all header names will
be lowercase)
"""
path = '/%s/%s' % (account, container)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'HEAD', path, headers=gen_headers())
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Container server %s:%s direct HEAD %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
resp_headers = {}
for header, value in resp.getheaders():
resp_headers[header.lower()] = value
return resp_headers
def direct_get_container(node, part, account, container, marker=None,
limit=None, prefix=None, delimiter=None,
conn_timeout=5, response_timeout=15):
"""
Get container listings directly from the container server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param marker: marker query
:param limit: query limit
:param prefix: prefix query
:param delimeter: delimeter for the query
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:returns: a tuple of (response headers, a list of objects) The response
headers will be a dict and all header names will be lowercase.
"""
path = '/%s/%s' % (account, container)
return _get_direct_account_container(path, "Container", node,
part, account, marker=None,
limit=None, prefix=None,
delimiter=None,
conn_timeout=5,
response_timeout=15)
def direct_delete_container(node, part, account, container, conn_timeout=5,
response_timeout=15, headers=None):
if headers is None:
headers = {}
path = '/%s/%s' % (account, container)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'DELETE', path,
headers=gen_headers(headers, True))
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Container server %s:%s direct DELETE %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)), resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
def direct_head_object(node, part, account, container, obj, conn_timeout=5,
response_timeout=15):
"""
Request object information directly from the object server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param obj: object name
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:returns: a dict containing the response's headers (all header names will
be lowercase)
"""
path = '/%s/%s/%s' % (account, container, obj)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'HEAD', path, headers=gen_headers())
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Object server %s:%s direct HEAD %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
resp_headers = {}
for header, value in resp.getheaders():
resp_headers[header.lower()] = value
return resp_headers
def direct_get_object(node, part, account, container, obj, conn_timeout=5,
response_timeout=15, resp_chunk_size=None, headers=None):
"""
Get object directly from the object server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param obj: object name
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:param resp_chunk_size: if defined, chunk size of data to read.
:param headers: dict to be passed into HTTPConnection headers
:returns: a tuple of (response headers, the object's contents) The response
headers will be a dict and all header names will be lowercase.
"""
if headers is None:
headers = {}
path = '/%s/%s/%s' % (account, container, obj)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'GET', path, headers=gen_headers(headers))
with Timeout(response_timeout):
resp = conn.getresponse()
if not is_success(resp.status):
resp.read()
raise ClientException(
'Object server %s:%s direct GET %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)), resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
if resp_chunk_size:
def _object_body():
buf = resp.read(resp_chunk_size)
while buf:
yield buf
buf = resp.read(resp_chunk_size)
object_body = _object_body()
else:
object_body = resp.read()
resp_headers = {}
for header, value in resp.getheaders():
resp_headers[header.lower()] = value
return resp_headers, object_body
def direct_put_object(node, part, account, container, name, contents,
content_length=None, etag=None, content_type=None,
headers=None, conn_timeout=5, response_timeout=15,
chunk_size=65535):
"""
Put object directly from the object server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param name: object name
:param contents: an iterable or string to read object data from
:param content_length: value to send as content-length header
:param etag: etag of contents
:param content_type: value to send as content-type header
:param headers: additional headers to include in the request
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:param chunk_size: if defined, chunk size of data to send.
:returns: etag from the server response
"""
path = '/%s/%s/%s' % (account, container, name)
if headers is None:
headers = {}
if etag:
headers['ETag'] = etag.strip('"')
if content_length is not None:
headers['Content-Length'] = str(content_length)
else:
for n, v in headers.iteritems():
if n.lower() == 'content-length':
content_length = int(v)
if content_type is not None:
headers['Content-Type'] = content_type
else:
headers['Content-Type'] = 'application/octet-stream'
if not contents:
headers['Content-Length'] = '0'
if isinstance(contents, basestring):
contents = [contents]
#Incase the caller want to insert an object with specific age
add_ts = 'X-Timestamp' not in headers
if content_length is None:
headers['Transfer-Encoding'] = 'chunked'
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'PUT', path, headers=gen_headers(headers, add_ts))
contents_f = FileLikeIter(contents)
if content_length is None:
chunk = contents_f.read(chunk_size)
while chunk:
conn.send('%x\r\n%s\r\n' % (len(chunk), chunk))
chunk = contents_f.read(chunk_size)
conn.send('0\r\n\r\n')
else:
left = content_length
while left > 0:
size = chunk_size
if size > left:
size = left
chunk = contents_f.read(size)
if not chunk:
break
conn.send(chunk)
left -= len(chunk)
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Object server %s:%s direct PUT %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
return resp.getheader('etag').strip('"')
def direct_post_object(node, part, account, container, name, headers,
conn_timeout=5, response_timeout=15):
"""
Direct update to object metadata on object server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param name: object name
:param headers: headers to store as metadata
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:raises ClientException: HTTP POST request failed
"""
path = '/%s/%s/%s' % (account, container, name)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'POST', path, headers=gen_headers(headers, True))
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Object server %s:%s direct POST %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
def direct_delete_object(node, part, account, container, obj,
conn_timeout=5, response_timeout=15, headers=None):
"""
Delete object directly from the object server.
:param node: node dictionary from the ring
:param part: partition the container is on
:param account: account name
:param container: container name
:param obj: object name
:param conn_timeout: timeout in seconds for establishing the connection
:param response_timeout: timeout in seconds for getting the response
:returns: response from server
"""
if headers is None:
headers = {}
path = '/%s/%s/%s' % (account, container, obj)
with Timeout(conn_timeout):
conn = http_connect(node['ip'], node['port'], node['device'], part,
'DELETE', path, headers=gen_headers(headers, True))
with Timeout(response_timeout):
resp = conn.getresponse()
resp.read()
if not is_success(resp.status):
raise ClientException(
'Object server %s:%s direct DELETE %s gave status %s' %
(node['ip'], node['port'],
repr('/%s/%s%s' % (node['device'], part, path)),
resp.status),
http_host=node['ip'], http_port=node['port'],
http_device=node['device'], http_status=resp.status,
http_reason=resp.reason)
def retry(func, *args, **kwargs):
"""
Helper function to retry a given function a number of times.
:param func: callable to be called
:param retries: number of retries
:param error_log: logger for errors
:param args: arguments to send to func
:param kwargs: keyward arguments to send to func (if retries or
error_log are sent, they will be deleted from kwargs
before sending on to func)
:returns: restult of func
"""
retries = 5
if 'retries' in kwargs:
retries = kwargs['retries']
del kwargs['retries']
error_log = None
if 'error_log' in kwargs:
error_log = kwargs['error_log']
del kwargs['error_log']
attempts = 0
backoff = 1
while attempts <= retries:
attempts += 1
try:
return attempts, func(*args, **kwargs)
except (socket.error, HTTPException, Timeout) as err:
if error_log:
error_log(err)
if attempts > retries:
raise
except ClientException as err:
if error_log:
error_log(err)
if attempts > retries or not is_server_error(err.http_status) or \
err.http_status == HTTP_INSUFFICIENT_STORAGE:
raise
sleep(backoff)
backoff *= 2
# Shouldn't actually get down here, but just in case.
if args and 'ip' in args[0]:
raise ClientException('Raise too many retries',
http_host=args[
0]['ip'], http_port=args[0]['port'],
http_device=args[0]['device'])
else:
raise ClientException('Raise too many retries')
| citrix-openstack-build/swift | swift/common/direct_client.py | Python | apache-2.0 | 19,446 |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) 1999-2006 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <p>
*/
package org.olat.presentation.framework.core.control.generic.folder;
import java.text.Collator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import org.olat.data.commons.vfs.VFSConstants;
import org.olat.data.commons.vfs.VFSContainer;
import org.olat.data.commons.vfs.VFSItem;
import org.olat.data.commons.vfs.filters.VFSItemFilter;
import org.olat.presentation.framework.core.components.tree.GenericTreeModel;
import org.olat.presentation.framework.core.components.tree.GenericTreeNode;
import org.olat.presentation.framework.core.components.tree.TreeNode;
/**
* Initial Date: Feb 13, 2004
*
* @author Mike Stock
*/
public class FolderTreeModel extends GenericTreeModel {
private boolean foldersOnly = false;
private boolean selectableFiles = false;
private boolean selectableFolders = true;
private Locale locale;
private VFSItemFilter fileFilter;
Collator collator;
/**
* @param alocale
* @param rootContainer
* @param foldersOnly
* @param selectableFiles
* @param selectableFolders
* @param allowRootFolderSelect
* @param fileFilter
*/
public FolderTreeModel(Locale alocale, VFSContainer rootContainer, boolean foldersOnly, boolean selectableFiles, boolean selectableFolders,
boolean allowRootFolderSelect, VFSItemFilter fileFilter) {
this.locale = alocale;
this.collator = Collator.getInstance(locale);
this.foldersOnly = foldersOnly;
this.selectableFiles = selectableFiles;
this.selectableFolders = selectableFolders;
this.fileFilter = fileFilter;
GenericTreeNode newRoot = new GenericTreeNode(rootContainer.getName(), rootContainer.getName());
newRoot.setIconCssClass("b_filetype_folder");
setRootNode(newRoot);
if (allowRootFolderSelect) { // include root folder as selection
GenericTreeNode effectiveRoot = new GenericTreeNode("/", "/");
newRoot.addChild(effectiveRoot);
buildTree(effectiveRoot, rootContainer, "/");
} else {
buildTree(getRootNode(), rootContainer, "/");
}
}
/**
* @param selectedNode
* @return The Path object represented by the given selection.
*/
public String getSelectedPath(TreeNode selectedNode) {
if (selectedNode == null || !(selectedNode instanceof GenericTreeNode))
return null;
return (String) ((GenericTreeNode) selectedNode).getUserObject();
}
private boolean buildTree(TreeNode tParent, VFSContainer parentContainer, String parentPath) {
List children = parentContainer.getItems(fileFilter);
if (children.size() == 0)
return false;
// sort the children
Collections.sort(children, new Comparator() {
final Collator c = collator;
@Override
public int compare(final Object o1, final Object o2) {
return c.compare(((VFSItem) o1).getName(), ((VFSItem) o2).getName());
}
});
boolean addedAtLeastOneChild = false;
for (Iterator iter = children.iterator(); iter.hasNext();) {
VFSItem child = (VFSItem) iter.next();
String childName = child.getName();
if (child instanceof VFSContainer) {
// container node
String filePath = parentPath + childName + "/";
GenericTreeNode tChild = new GenericTreeNode(childName, filePath); // filePath is the information to be remembered later
tChild.setIconCssClass("b_filetype_folder");
tChild.setAltText(child.getName());
tChild.setAccessible(selectableFolders ? (child.canWrite() == VFSConstants.YES) : false);
tParent.addChild(tChild);
boolean addedChildren = buildTree(tChild, (VFSContainer) child, filePath);
if (foldersOnly || addedChildren) {
addedAtLeastOneChild = true;
} else {
// this directory does not contain anything usefull, remove it again!
tParent.remove(tChild);
}
} else {
// leaf node
if (foldersOnly)
continue;
String filePath = parentPath + childName;
GenericTreeNode tChild = new GenericTreeNode(childName, filePath);
String type = FolderHelper.extractFileType(childName, locale);
if (!FolderHelper.isKnownFileType(type)) {
type = "file";
}
tChild.setIconCssClass("b_filetype_" + type);
tChild.setAltText(childName);
tChild.setAccessible(selectableFiles);
tParent.addChild(tChild);
addedAtLeastOneChild = true;
}
}
return addedAtLeastOneChild;
}
/**
*/
@Override
public GenericTreeNode getRootNode() {
return (GenericTreeNode) super.getRootNode();
}
}
| huihoo/olat | olat7.8/src/main/java/org/olat/presentation/framework/core/control/generic/folder/FolderTreeModel.java | Java | apache-2.0 | 5,942 |
/*
* Copyright (c) 2013
* Kozlov Nikita
*/
package org.yeti;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.yeti.console.listener.ConsoleEventListener;
import org.yeti.utilz.appcontext.ApplicationContextProvider;
/**
* Main-класс, который инициализирует основные ресурсы, в том числе и Console Listener (в отдельном потоке с именем "ConsoleListener Thread"). <br/>
* Так же инициализируется applicationContext, который сохраняется в классе {@link ApplicationContextProvider}.
* Класс является точкой входа в приложение. Содержит метод {@link Bootstrap#main(String[])}.
*
* @author Kozlov Nikita
* @see org.yeti.console.listener.ConsoleEventListener
* @see org.yeti.console.ConsoleEventHandler
* @see ApplicationContextProvider
*/
public class Bootstrap {
private static final Logger logger = LoggerFactory.getLogger(Bootstrap.class);
/**
* Основной метод, с которого начинается выполнение проложения.
*
* @see Bootstrap
*/
public static void main(String[] args) {
ApplicationContext applicationContext;
try {
applicationContext =
new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");
} catch (BeanDefinitionStoreException e) {
logger.error(e.getMessage(), e);
throw new RuntimeException(e);
}
// создаем поток для Console Listener
ConsoleEventListener consoleEventListener = applicationContext.getBean("consoleEventListener", ConsoleEventListener.class);
Thread threadConsoleListener = new Thread(consoleEventListener);
threadConsoleListener.setName("ConsoleListener Thread");
logger.debug("ApplicationContext = {}", ApplicationContextProvider.getApplicationContext());
threadConsoleListener.start();
}
}
| YetiGame/td-yeti-server | src/main/java/org/yeti/Bootstrap.java | Java | apache-2.0 | 2,271 |
/*
* (C) Copyright IBM Corp. 2015
*
* 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.
*/
package com.ibm.portal.samples.resolver.resolver;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import com.ibm.portal.resolver.cor.helper.DefaultContentOperationsRegistryFactory;
/**
* This class is registered with the <code>plugin.xml</code>. We use this proxy
* because it automatically constructs and fills in the dependencies interface
* for the {@link ResolverSampleResolver}. Since the proxy implements
* {@link IExecutableExtensionFactory} the eclipse instantiation process will
* actually return the resulting class as the real implementation.
*
* @author cleue
*/
public class ResolverSampleResolverProxy extends DefaultContentOperationsRegistryFactory
implements IExecutableExtensionFactory {
/*
* (non-Javadoc)
*
* @see com.ibm.portal.resolver.cor.helper.
* DefaultContentOperationsRegistryFactory #getTargetClass()
*/
@Override
protected Class<ResolverSampleResolver> getTargetClass() {
// construct this class
return ResolverSampleResolver.class;
}
}
| CarstenLeue/ResolverSamples | ResolverSampleResolverWAR/src/main/java/com/ibm/portal/samples/resolver/resolver/ResolverSampleResolverProxy.java | Java | apache-2.0 | 1,662 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
package org.apache.hadoop.ozone.container.common.impl;
import java.beans.IntrospectionException;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos
.ContainerType;
import org.apache.hadoop.hdds.scm.container.common.helpers
.StorageContainerException;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData;
import com.google.common.base.Preconditions;
import static org.apache.hadoop.ozone.container.keyvalue
.KeyValueContainerData.KEYVALUE_YAML_TAG;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.AbstractConstruct;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.introspector.BeanAccess;
import org.yaml.snakeyaml.introspector.Property;
import org.yaml.snakeyaml.introspector.PropertyUtils;
import org.yaml.snakeyaml.nodes.MappingNode;
import org.yaml.snakeyaml.nodes.Node;
import org.yaml.snakeyaml.nodes.ScalarNode;
import org.yaml.snakeyaml.nodes.Tag;
import org.yaml.snakeyaml.representer.Representer;
/**
* Class for creating and reading .container files.
*/
public final class ContainerDataYaml {
private static final Logger LOG =
LoggerFactory.getLogger(ContainerDataYaml.class);
private ContainerDataYaml() {
}
/**
* Creates a .container file in yaml format.
*
* @param containerFile
* @param containerData
* @throws IOException
*/
public static void createContainerFile(ContainerType containerType,
ContainerData containerData, File containerFile) throws IOException {
Writer writer = null;
try {
// Create Yaml for given container type
Yaml yaml = getYamlForContainerType(containerType);
// Compute Checksum and update ContainerData
containerData.computeAndSetChecksum(yaml);
// Write the ContainerData with checksum to Yaml file.
writer = new OutputStreamWriter(new FileOutputStream(
containerFile), "UTF-8");
yaml.dump(containerData, writer);
} finally {
try {
if (writer != null) {
writer.close();
}
} catch (IOException ex) {
LOG.warn("Error occurred during closing the writer. ContainerID: " +
containerData.getContainerID());
}
}
}
/**
* Read the yaml file, and return containerData.
*
* @throws IOException
*/
public static ContainerData readContainerFile(File containerFile)
throws IOException {
Preconditions.checkNotNull(containerFile, "containerFile cannot be null");
try (FileInputStream inputFileStream = new FileInputStream(containerFile)) {
return readContainer(inputFileStream);
}
}
/**
* Read the yaml file content, and return containerData.
*
* @throws IOException
*/
public static ContainerData readContainer(byte[] containerFileContent)
throws IOException {
return readContainer(
new ByteArrayInputStream(containerFileContent));
}
/**
* Read the yaml content, and return containerData.
*
* @throws IOException
*/
public static ContainerData readContainer(InputStream input)
throws IOException {
ContainerData containerData;
PropertyUtils propertyUtils = new PropertyUtils();
propertyUtils.setBeanAccess(BeanAccess.FIELD);
propertyUtils.setAllowReadOnlyProperties(true);
Representer representer = new ContainerDataRepresenter();
representer.setPropertyUtils(propertyUtils);
Constructor containerDataConstructor = new ContainerDataConstructor();
Yaml yaml = new Yaml(containerDataConstructor, representer);
yaml.setBeanAccess(BeanAccess.FIELD);
containerData = (ContainerData)
yaml.load(input);
return containerData;
}
/**
* Given a ContainerType this method returns a Yaml representation of
* the container properties.
*
* @param containerType type of container
* @return Yamal representation of container properties
*
* @throws StorageContainerException if the type is unrecognized
*/
public static Yaml getYamlForContainerType(ContainerType containerType)
throws StorageContainerException {
PropertyUtils propertyUtils = new PropertyUtils();
propertyUtils.setBeanAccess(BeanAccess.FIELD);
propertyUtils.setAllowReadOnlyProperties(true);
switch (containerType) {
case KeyValueContainer:
Representer representer = new ContainerDataRepresenter();
representer.setPropertyUtils(propertyUtils);
representer.addClassTag(
KeyValueContainerData.class,
KeyValueContainerData.KEYVALUE_YAML_TAG);
Constructor keyValueDataConstructor = new ContainerDataConstructor();
return new Yaml(keyValueDataConstructor, representer);
default:
throw new StorageContainerException("Unrecognized container Type " +
"format " + containerType, ContainerProtos.Result
.UNKNOWN_CONTAINER_TYPE);
}
}
/**
* Representer class to define which fields need to be stored in yaml file.
*/
private static class ContainerDataRepresenter extends Representer {
@Override
protected Set<Property> getProperties(Class<? extends Object> type)
throws IntrospectionException {
Set<Property> set = super.getProperties(type);
Set<Property> filtered = new TreeSet<Property>();
// When a new Container type is added, we need to add what fields need
// to be filtered here
if (type.equals(KeyValueContainerData.class)) {
List<String> yamlFields = KeyValueContainerData.getYamlFields();
// filter properties
for (Property prop : set) {
String name = prop.getName();
if (yamlFields.contains(name)) {
filtered.add(prop);
}
}
}
return filtered;
}
}
/**
* Constructor class for KeyValueData, which will be used by Yaml.
*/
private static class ContainerDataConstructor extends Constructor {
ContainerDataConstructor() {
//Adding our own specific constructors for tags.
// When a new Container type is added, we need to add yamlConstructor
// for that
this.yamlConstructors.put(
KEYVALUE_YAML_TAG, new ConstructKeyValueContainerData());
this.yamlConstructors.put(Tag.INT, new ConstructLong());
}
private class ConstructKeyValueContainerData extends AbstractConstruct {
public Object construct(Node node) {
MappingNode mnode = (MappingNode) node;
Map<Object, Object> nodes = constructMapping(mnode);
//Needed this, as TAG.INT type is by default converted to Long.
long layOutVersion = (long) nodes.get(OzoneConsts.LAYOUTVERSION);
int lv = (int) layOutVersion;
long size = (long) nodes.get(OzoneConsts.MAX_SIZE);
//When a new field is added, it needs to be added here.
KeyValueContainerData kvData = new KeyValueContainerData(
(long) nodes.get(OzoneConsts.CONTAINER_ID), lv, size);
kvData.setContainerDBType((String)nodes.get(
OzoneConsts.CONTAINER_DB_TYPE));
kvData.setMetadataPath((String) nodes.get(
OzoneConsts.METADATA_PATH));
kvData.setChunksPath((String) nodes.get(OzoneConsts.CHUNKS_PATH));
Map<String, String> meta = (Map) nodes.get(OzoneConsts.METADATA);
kvData.setMetadata(meta);
kvData.setChecksum((String) nodes.get(OzoneConsts.CHECKSUM));
String state = (String) nodes.get(OzoneConsts.STATE);
switch (state) {
case "OPEN":
kvData.setState(ContainerProtos.ContainerLifeCycleState.OPEN);
break;
case "CLOSING":
kvData.setState(ContainerProtos.ContainerLifeCycleState.CLOSING);
break;
case "CLOSED":
kvData.setState(ContainerProtos.ContainerLifeCycleState.CLOSED);
break;
default:
throw new IllegalStateException("Unexpected " +
"ContainerLifeCycleState " + state + " for the containerId " +
nodes.get(OzoneConsts.CONTAINER_ID));
}
return kvData;
}
}
//Below code is taken from snake yaml, as snakeyaml tries to fit the
// number if it fits in integer, otherwise returns long. So, slightly
// modified the code to return long in all cases.
private class ConstructLong extends AbstractConstruct {
public Object construct(Node node) {
String value = constructScalar((ScalarNode) node).toString()
.replaceAll("_", "");
int sign = +1;
char first = value.charAt(0);
if (first == '-') {
sign = -1;
value = value.substring(1);
} else if (first == '+') {
value = value.substring(1);
}
int base = 10;
if ("0".equals(value)) {
return Long.valueOf(0);
} else if (value.startsWith("0b")) {
value = value.substring(2);
base = 2;
} else if (value.startsWith("0x")) {
value = value.substring(2);
base = 16;
} else if (value.startsWith("0")) {
value = value.substring(1);
base = 8;
} else if (value.indexOf(':') != -1) {
String[] digits = value.split(":");
int bes = 1;
int val = 0;
for (int i = 0, j = digits.length; i < j; i++) {
val += (Long.parseLong(digits[(j - i) - 1]) * bes);
bes *= 60;
}
return createNumber(sign, String.valueOf(val), 10);
} else {
return createNumber(sign, value, 10);
}
return createNumber(sign, value, base);
}
}
private Number createNumber(int sign, String number, int radix) {
Number result;
if (sign < 0) {
number = "-" + number;
}
result = Long.valueOf(number, radix);
return result;
}
}
}
| ucare-uchicago/hadoop | hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerDataYaml.java | Java | apache-2.0 | 11,153 |
<?php
/*
* Copyright 2014 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.
*/
namespace Google\Service\Dialogflow;
class GoogleCloudDialogflowV2IntentMessageText extends \Google\Collection
{
protected $collection_key = 'text';
/**
* @var string[]
*/
public $text;
/**
* @param string[]
*/
public function setText($text)
{
$this->text = $text;
}
/**
* @return string[]
*/
public function getText()
{
return $this->text;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudDialogflowV2IntentMessageText::class, 'Google_Service_Dialogflow_GoogleCloudDialogflowV2IntentMessageText');
| googleapis/google-api-php-client-services | src/Dialogflow/GoogleCloudDialogflowV2IntentMessageText.php | PHP | apache-2.0 | 1,208 |
/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you 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.
*/
package org.jboss.netty.channel.socket.nio;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import java.net.SocketAddress;
class NioServerSocketPipelineSink extends AbstractNioChannelSink {
public void eventSunk(
ChannelPipeline pipeline, ChannelEvent e) throws Exception {
Channel channel = e.getChannel();
if (channel instanceof NioServerSocketChannel) {
handleServerSocket(e);
} else if (channel instanceof NioSocketChannel) {
handleAcceptedSocket(e);
}
}
private static void handleServerSocket(ChannelEvent e) {
if (!(e instanceof ChannelStateEvent)) {
return;
}
ChannelStateEvent event = (ChannelStateEvent) e;
NioServerSocketChannel channel =
(NioServerSocketChannel) event.getChannel();
ChannelFuture future = event.getFuture();
ChannelState state = event.getState();
Object value = event.getValue();
switch (state) {
case OPEN:
if (Boolean.FALSE.equals(value)) {
((NioServerBoss) channel.boss).close(channel, future);
}
break;
case BOUND:
if (value != null) {
((NioServerBoss) channel.boss).bind(channel, future, (SocketAddress) value);
} else {
((NioServerBoss) channel.boss).close(channel, future);
}
break;
default:
break;
}
}
private static void handleAcceptedSocket(ChannelEvent e) {
if (e instanceof ChannelStateEvent) {
ChannelStateEvent event = (ChannelStateEvent) e;
NioSocketChannel channel = (NioSocketChannel) event.getChannel();
ChannelFuture future = event.getFuture();
ChannelState state = event.getState();
Object value = event.getValue();
switch (state) {
case OPEN:
if (Boolean.FALSE.equals(value)) {
channel.worker.close(channel, future);
}
break;
case BOUND:
case CONNECTED:
if (value == null) {
channel.worker.close(channel, future);
}
break;
case INTEREST_OPS:
channel.worker.setInterestOps(channel, future, ((Integer) value).intValue());
break;
}
} else if (e instanceof MessageEvent) {
MessageEvent event = (MessageEvent) e;
NioSocketChannel channel = (NioSocketChannel) event.getChannel();
boolean offered = channel.writeBufferQueue.offer(event);
assert offered;
channel.worker.writeFromUserCode(channel);
}
}
}
| KeyNexus/netty | src/main/java/org/jboss/netty/channel/socket/nio/NioServerSocketPipelineSink.java | Java | apache-2.0 | 3,700 |
package com.mjiayou.trebundle;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import com.mjiayou.trebundle.debug.DebugActivity;
import com.mjiayou.trecore.base.TCActivity;
import com.mjiayou.trecore.base.TCApp;
import com.mjiayou.trecore.helper.UmengHelper;
import com.mjiayou.trecorelib.manager.ActivityManager;
import com.mjiayou.trecorelib.manager.CrashHandler;
public class MainActivity extends TCActivity {
/**
* startActivity
*/
public static void open(Context context) {
Intent intent = new Intent(context, MainActivity.class);
context.startActivity(intent);
}
@Override
protected int getLayoutId() {
return R.layout.activity_main;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 初始化异常捕获
CrashHandler.get().init(mActivity, new CrashHandler.OnCaughtExceptionListener() {
@Override
public boolean onCaughtException(Thread thread, Throwable throwable) {
UmengHelper.reportError(TCApp.get(), throwable);
return false;
}
});
// mTitleBar
getTitleBar().setTitleOnly(getString(R.string.app_name));
getTitleBar().addRightTextView("Debug", new View.OnClickListener() {
@Override
public void onClick(View view) {
DebugActivity.open(mContext);
}
});
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (ActivityManager.get().pressAgainToExit(mActivity, keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
}
| treason258/TreBundle | app/src/main/java/com/mjiayou/trebundle/MainActivity.java | Java | apache-2.0 | 1,825 |