code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
/* Copyright 2018 The TensorFlow 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.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_GPU_CUDNN_CONV_ALGORITHM_PICKER_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_GPU_CUDNN_CONV_ALGORITHM_PICKER_H_
#include "absl/time/time.h"
#include "absl/types/optional.h"
#include "tensorflow/compiler/xla/service/compiler.h"
#include "tensorflow/compiler/xla/service/device_memory_allocator.h"
#include "tensorflow/compiler/xla/service/gpu/cudnn_conv_runner.h"
#include "tensorflow/compiler/xla/service/hlo_instructions.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/compiler/xla/service/hlo_pass_interface.h"
#include "tensorflow/core/platform/stream_executor_no_cuda.h"
namespace xla {
namespace gpu {
// Modifies CustomCalls to cudnn convolutions, choosing the best algorithm for
// each and adding explicit scratch space to the CustomCalls.
class CudnnConvAlgorithmPicker : public HloModulePass {
public:
// If the `allocator` parameter is not null, we will use it to allocate temp
// memory while timing the various convolution algorithms. If it's null,
// we'll use the default allocator on the StreamExecutor.
CudnnConvAlgorithmPicker(se::StreamExecutor* stream_exec,
DeviceMemoryAllocator* allocator, Compiler* compiler)
: stream_exec_(stream_exec), allocator_(allocator), compiler_(compiler) {}
absl::string_view name() const override {
return "cudnn-conv-algorithm-picker";
}
StatusOr<bool> Run(HloModule* module) override;
private:
struct AutotuneResult {
int64 algorithm;
bool tensor_ops_enabled;
int64 scratch_bytes;
absl::Duration runtime;
};
StatusOr<bool> RunOnComputation(HloComputation* computation);
StatusOr<bool> RunOnInstruction(HloInstruction* instr);
StatusOr<AutotuneResult> PickBestAlgorithm(
const HloCustomCallInstruction* instr);
se::StreamExecutor* stream_exec_; // never null
DeviceMemoryAllocator* allocator_; // may be null
Compiler* compiler_;
};
} // namespace gpu
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_SERVICE_GPU_CUDNN_CONV_ALGORITHM_PICKER_H_
| apark263/tensorflow | tensorflow/compiler/xla/service/gpu/cudnn_conv_algorithm_picker.h | C | apache-2.0 | 2,779 |
import { Http, Headers, Response, RequestOptions } from '@angular/http';
import { IConfig } from '../models/config.interface';
export class ConfigurationLoader {
private CONF: { [id: string] : IConfig } = {
"DEV": {
APP_URL: "http://localhost:3000/",
API_URL: "http://localhost:8089" + "/school/",
LOG_LEVEL: "ALL",
MOCK: true
},
"PROD":{
APP_URL: "http://localhost:3000/",
API_URL: window.location.origin + "/school/",
LOG_LEVEL: "NONE",
MOCK: false
}
};
load(env: string): IConfig{
let envConf = this.CONF[env];
return {
APP_URL: envConf.APP_URL,
API_URL: envConf.API_URL,
LOG_LEVEL: envConf.LOG_LEVEL,
MOCK: envConf.MOCK
}
}
} | llarreta/larretasources | school-ui/src/main/webapp/src/app/services/configuration-loader.service.ts | TypeScript | apache-2.0 | 850 |
/*
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.hazelcast.spi.impl.operationservice.impl;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.internal.util.RootCauseMatcher;
import com.hazelcast.spi.impl.InternalCompletableFuture;
import com.hazelcast.spi.impl.operationservice.OperationService;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import java.util.concurrent.CompletionException;
import static com.hazelcast.test.Accessors.getAddress;
import static com.hazelcast.test.Accessors.getOperationService;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class Invocation_NestedRemoteTest extends Invocation_NestedAbstractTest {
private static final String RESPONSE = "someresponse";
@Rule
public ExpectedException expected = ExpectedException.none();
@Test
public void invokeOnPartition_outerGeneric_innerGeneric_forbidden() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(1).newInstances();
HazelcastInstance local = cluster[0];
OperationService operationService = getOperationService(local);
InnerOperation innerOperation = new InnerOperation(RESPONSE, GENERIC_OPERATION);
OuterOperation outerOperation = new OuterOperation(innerOperation, GENERIC_OPERATION);
expected.expect(Exception.class);
InternalCompletableFuture<Object> future =
operationService.invokeOnPartition(null, outerOperation, outerOperation.getPartitionId());
future.join();
}
@Test
public void invokeOnPartition_outerRemote_innerGeneric() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
int partitionId = getPartitionId(remote);
InnerOperation innerOperation = new InnerOperation(RESPONSE, GENERIC_OPERATION);
OuterOperation outerOperation = new OuterOperation(innerOperation, partitionId);
InternalCompletableFuture future = operationService.invokeOnPartition(null, outerOperation, partitionId);
assertEquals(RESPONSE, future.join());
}
@Test
public void invokeOnPartition_outerRemote_innerSameInstance_samePartition() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
int partitionId = getPartitionId(remote);
InnerOperation innerOperation = new InnerOperation(RESPONSE, partitionId);
OuterOperation outerOperation = new OuterOperation(innerOperation, partitionId);
InternalCompletableFuture future = operationService.invokeOnPartition(null, outerOperation, partitionId);
assertEquals(RESPONSE, future.join());
}
@Test
public void invokeOnPartition_outerRemote_innerSameInstance_callsDifferentPartition_mappedToSameThread() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
int outerPartitionId = getPartitionId(remote);
int innerPartitionId = randomPartitionIdMappedToSameThreadAsGivenPartitionIdOnInstance(outerPartitionId, remote,
operationService);
InnerOperation innerOperation = new InnerOperation(RESPONSE, innerPartitionId);
OuterOperation outerOperation = new OuterOperation(innerOperation, outerPartitionId);
InternalCompletableFuture future = operationService.invokeOnPartition(null, outerOperation, outerPartitionId);
expected.expect(CompletionException.class);
expected.expect(new RootCauseMatcher(IllegalThreadStateException.class));
expected.expectMessage("cannot make remote call");
future.join();
}
@Test
public void invokeOnPartition_outerRemote_innerDifferentInstance_forbidden() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
int outerPartitionId = getPartitionId(remote);
int innerPartitionId = getPartitionId(local);
assertNotEquals("partitions should be different", innerPartitionId, outerPartitionId);
InnerOperation innerOperation = new InnerOperation(RESPONSE, innerPartitionId);
OuterOperation outerOperation = new OuterOperation(innerOperation, outerPartitionId);
InternalCompletableFuture future = operationService.invokeOnPartition(null, outerOperation, outerPartitionId);
expected.expect(CompletionException.class);
expected.expect(new RootCauseMatcher(IllegalThreadStateException.class));
expected.expectMessage("cannot make remote call");
future.join();
}
@Test
public void invokeOnPartition_outerLocal_innerDifferentInstance_forbidden() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
int outerPartitionId = getPartitionId(local);
int innerPartitionId = getPartitionId(remote);
assertNotEquals("partitions should be different", innerPartitionId, outerPartitionId);
InnerOperation innerOperation = new InnerOperation(RESPONSE, innerPartitionId);
OuterOperation outerOperation = new OuterOperation(innerOperation, outerPartitionId);
InternalCompletableFuture future = operationService.invokeOnPartition(null, outerOperation, outerPartitionId);
expected.expect(CompletionException.class);
expected.expect(new RootCauseMatcher(IllegalThreadStateException.class));
expected.expectMessage("cannot make remote call");
future.join();
}
@Test
public void invokeOnTarget_outerGeneric_innerGeneric() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
InnerOperation innerOperation = new InnerOperation(RESPONSE, GENERIC_OPERATION);
OuterOperation outerOperation = new OuterOperation(innerOperation, GENERIC_OPERATION);
InternalCompletableFuture future = operationService.invokeOnTarget(null, outerOperation, getAddress(remote));
assertEquals(RESPONSE, future.join());
}
@Test
public void invokeOnTarget_outerGeneric_innerSameInstance() {
HazelcastInstance[] cluster = createHazelcastInstanceFactory(2).newInstances();
HazelcastInstance local = cluster[0];
HazelcastInstance remote = cluster[1];
OperationService operationService = getOperationService(local);
InnerOperation innerOperation = new InnerOperation(RESPONSE, 0);
OuterOperation outerOperation = new OuterOperation(innerOperation, GENERIC_OPERATION);
InternalCompletableFuture future = operationService.invokeOnTarget(null, outerOperation, getAddress(remote));
assertEquals(RESPONSE, future.join());
}
}
| mdogan/hazelcast | hazelcast/src/test/java/com/hazelcast/spi/impl/operationservice/impl/Invocation_NestedRemoteTest.java | Java | apache-2.0 | 8,595 |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.device.battery;
import org.chromium.base.Log;
import org.chromium.device.mojom.BatteryMonitor;
import org.chromium.device.mojom.BatteryStatus;
import org.chromium.mojo.system.MojoException;
/**
* Android implementation of the battery monitor interface defined in
* services/device/public/interfaces/battery_monitor.mojom.
*/
public class BatteryMonitorImpl implements BatteryMonitor {
private static final String TAG = "BatteryMonitorImpl";
// Factory that created this instance and notifies it about battery status changes.
private final BatteryMonitorFactory mFactory;
private QueryNextStatusResponse mCallback;
private BatteryStatus mStatus;
private boolean mHasStatusToReport;
private boolean mSubscribed;
public BatteryMonitorImpl(BatteryMonitorFactory batteryMonitorFactory) {
mFactory = batteryMonitorFactory;
mHasStatusToReport = false;
mSubscribed = true;
}
private void unsubscribe() {
if (mSubscribed) {
mFactory.unsubscribe(this);
mSubscribed = false;
}
}
@Override
public void close() {
unsubscribe();
}
@Override
public void onConnectionError(MojoException e) {
unsubscribe();
}
@Override
public void queryNextStatus(QueryNextStatusResponse callback) {
if (mCallback != null) {
Log.e(TAG, "Overlapped call to queryNextStatus!");
unsubscribe();
return;
}
mCallback = callback;
if (mHasStatusToReport) {
reportStatus();
}
}
void didChange(BatteryStatus batteryStatus) {
mStatus = batteryStatus;
mHasStatusToReport = true;
if (mCallback != null) {
reportStatus();
}
}
void reportStatus() {
mCallback.call(mStatus);
mCallback = null;
mHasStatusToReport = false;
}
}
| mogoweb/365browser | app/src/main/java/org/chromium/device/battery/BatteryMonitorImpl.java | Java | apache-2.0 | 2,111 |
/*
Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
The MySQL Connector/J is licensed under the terms of the GPLv2
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors.
There are special exceptions to the terms and conditions of the GPLv2 as it is applied to
this software, see the FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
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; version 2
of the License.
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 St, Fifth
Floor, Boston, MA 02110-1301 USA
*/
package com.mysql.jdbc;
import java.sql.SQLException;
import java.sql.Types;
/**
* A ResultSetMetaData object can be used to find out about the types and
* properties of the columns in a ResultSet
*
* @author Mark Matthews
* @version $Id: ResultSetMetaData.java,v 1.1.2.1 2005/05/13 18:58:38 mmatthews
* Exp $
*
* @see java.sql.ResultSetMetaData
*/
public class ResultSetMetaData implements java.sql.ResultSetMetaData {
private static int clampedGetLength(Field f) {
long fieldLength = f.getLength();
if (fieldLength > Integer.MAX_VALUE) {
fieldLength = Integer.MAX_VALUE;
}
return (int) fieldLength;
}
/**
* Checks if the SQL Type is a Decimal/Number Type
*
* @param type
* SQL Type
*
* @return ...
*/
private static final boolean isDecimalType(int type) {
switch (type) {
case Types.BIT:
case Types.TINYINT:
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
case Types.FLOAT:
case Types.REAL:
case Types.DOUBLE:
case Types.NUMERIC:
case Types.DECIMAL:
return true;
}
return false;
}
Field[] fields;
boolean useOldAliasBehavior = false;
boolean treatYearAsDate = true;
private ExceptionInterceptor exceptionInterceptor;
/**
* Initialize for a result with a tuple set and a field descriptor set
*
* @param fields
* the array of field descriptors
*/
public ResultSetMetaData(Field[] fields, boolean useOldAliasBehavior, boolean treatYearAsDate, ExceptionInterceptor exceptionInterceptor) {
this.fields = fields;
this.useOldAliasBehavior = useOldAliasBehavior;
this.treatYearAsDate = treatYearAsDate;
this.exceptionInterceptor = exceptionInterceptor;
}
/**
* What's a column's table's catalog name?
*
* @param column
* the first column is 1, the second is 2...
*
* @return catalog name, or "" if not applicable
*
* @throws SQLException
* if a database access error occurs
*/
public String getCatalogName(int column) throws SQLException {
Field f = getField(column);
String database = f.getDatabaseName();
return (database == null) ? "" : database; //$NON-NLS-1$
}
/**
* What's the Java character encoding name for the given column?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the Java character encoding name for the given column, or null if
* no Java character encoding maps to the MySQL character set for
* the given column.
*
* @throws SQLException
* if an invalid column index is given.
*/
public String getColumnCharacterEncoding(int column) throws SQLException {
String mysqlName = getColumnCharacterSet(column);
String javaName = null;
if (mysqlName != null) {
try {
javaName = CharsetMapping.getJavaEncodingForMysqlCharset(mysqlName);
} catch (RuntimeException ex) {
SQLException sqlEx = SQLError.createSQLException(ex.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, null);
sqlEx.initCause(ex);
throw sqlEx;
}
}
return javaName;
}
/**
* What's the MySQL character set name for the given column?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the MySQL character set name for the given column
*
* @throws SQLException
* if an invalid column index is given.
*/
public String getColumnCharacterSet(int column) throws SQLException {
return getField(column).getEncoding();
}
// --------------------------JDBC 2.0-----------------------------------
/**
* JDBC 2.0
*
* <p>
* Return the fully qualified name of the Java class whose instances are
* manufactured if ResultSet.getObject() is called to retrieve a value from
* the column. ResultSet.getObject() may return a subClass of the class
* returned by this method.
* </p>
*
* @param column
* the column number to retrieve information for
*
* @return the fully qualified name of the Java class whose instances are
* manufactured if ResultSet.getObject() is called to retrieve a
* value from the column.
*
* @throws SQLException
* if an error occurs
*/
public String getColumnClassName(int column) throws SQLException {
Field f = getField(column);
return getClassNameForJavaType(f.getSQLType(),
f.isUnsigned(),
f.getMysqlType(),
f.isBinary() || f.isBlob(),
f.isOpaqueBinary(), treatYearAsDate);
}
/**
* Whats the number of columns in the ResultSet?
*
* @return the number
*
* @throws SQLException
* if a database access error occurs
*/
public int getColumnCount() throws SQLException {
return this.fields.length;
}
/**
* What is the column's normal maximum width in characters?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the maximum width
*
* @throws SQLException
* if a database access error occurs
*/
public int getColumnDisplaySize(int column) throws SQLException {
Field f = getField(column);
int lengthInBytes = clampedGetLength(f);
return lengthInBytes / f.getMaxBytesPerCharacter();
}
/**
* What is the suggested column title for use in printouts and displays?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the column label
*
* @throws SQLException
* if a database access error occurs
*/
public String getColumnLabel(int column) throws SQLException {
if (this.useOldAliasBehavior) {
return getColumnName(column);
}
return getField(column).getColumnLabel();
}
/**
* What's a column's name?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the column name
*
* @throws SQLException
* if a databvase access error occurs
*/
public String getColumnName(int column) throws SQLException {
if (this.useOldAliasBehavior) {
return getField(column).getName();
}
String name = getField(column).getNameNoAliases();
if (name != null && name.length() == 0) {
return getField(column).getName();
}
return name;
}
/**
* What is a column's SQL Type? (java.sql.Type int)
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the java.sql.Type value
*
* @throws SQLException
* if a database access error occurs
*
* @see java.sql.Types
*/
public int getColumnType(int column) throws SQLException {
return getField(column).getSQLType();
}
/**
* Whats is the column's data source specific type name?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return the type name
*
* @throws SQLException
* if a database access error occurs
*/
public String getColumnTypeName(int column) throws java.sql.SQLException {
Field field = getField(column);
int mysqlType = field.getMysqlType();
int jdbcType = field.getSQLType();
switch (mysqlType) {
case MysqlDefs.FIELD_TYPE_BIT:
return "BIT";
case MysqlDefs.FIELD_TYPE_DECIMAL:
case MysqlDefs.FIELD_TYPE_NEW_DECIMAL:
return field.isUnsigned() ? "DECIMAL UNSIGNED" : "DECIMAL";
case MysqlDefs.FIELD_TYPE_TINY:
return field.isUnsigned() ? "TINYINT UNSIGNED" : "TINYINT";
case MysqlDefs.FIELD_TYPE_SHORT:
return field.isUnsigned() ? "SMALLINT UNSIGNED" : "SMALLINT";
case MysqlDefs.FIELD_TYPE_LONG:
return field.isUnsigned() ? "INT UNSIGNED" : "INT";
case MysqlDefs.FIELD_TYPE_FLOAT:
return field.isUnsigned() ? "FLOAT UNSIGNED" : "FLOAT";
case MysqlDefs.FIELD_TYPE_DOUBLE:
return field.isUnsigned() ? "DOUBLE UNSIGNED" : "DOUBLE";
case MysqlDefs.FIELD_TYPE_NULL:
return "NULL"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_TIMESTAMP:
return "TIMESTAMP"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_LONGLONG:
return field.isUnsigned() ? "BIGINT UNSIGNED" : "BIGINT";
case MysqlDefs.FIELD_TYPE_INT24:
return field.isUnsigned() ? "MEDIUMINT UNSIGNED" : "MEDIUMINT";
case MysqlDefs.FIELD_TYPE_DATE:
return "DATE"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_TIME:
return "TIME"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_DATETIME:
return "DATETIME"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_TINY_BLOB:
return "TINYBLOB"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_MEDIUM_BLOB:
return "MEDIUMBLOB"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_LONG_BLOB:
return "LONGBLOB"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_BLOB:
if (getField(column).isBinary()) {
return "BLOB";//$NON-NLS-1$
}
return "TEXT";//$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_VARCHAR:
return "VARCHAR"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_VAR_STRING:
if (jdbcType == Types.VARBINARY) {
return "VARBINARY";
}
return "VARCHAR"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_STRING:
if (jdbcType == Types.BINARY) {
return "BINARY";
}
return "CHAR"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_ENUM:
return "ENUM"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_YEAR:
return "YEAR"; // $NON_NLS-1$
case MysqlDefs.FIELD_TYPE_SET:
return "SET"; //$NON-NLS-1$
case MysqlDefs.FIELD_TYPE_GEOMETRY:
return "GEOMETRY"; //$NON-NLS-1$
default:
return "UNKNOWN"; //$NON-NLS-1$
}
}
/**
* Returns the field instance for the given column index
*
* @param columnIndex
* the column number to retrieve a field instance for
*
* @return the field instance for the given column index
*
* @throws SQLException
* if an error occurs
*/
protected Field getField(int columnIndex) throws SQLException {
if ((columnIndex < 1) || (columnIndex > this.fields.length)) {
throw SQLError.createSQLException(Messages.getString("ResultSetMetaData.46"), //$NON-NLS-1$
SQLError.SQL_STATE_INVALID_COLUMN_NUMBER, this.exceptionInterceptor);
}
return this.fields[columnIndex - 1];
}
/**
* What is a column's number of decimal digits.
*
* @param column
* the first column is 1, the second is 2...
*
* @return the precision
*
* @throws SQLException
* if a database access error occurs
*/
public int getPrecision(int column) throws SQLException {
Field f = getField(column);
// if (f.getMysqlType() == MysqlDefs.FIELD_TYPE_NEW_DECIMAL) {
// return f.getLength();
// }
if (isDecimalType(f.getSQLType())) {
if (f.getDecimals() > 0) {
return clampedGetLength(f) - 1 + f.getPrecisionAdjustFactor();
}
return clampedGetLength(f) + f.getPrecisionAdjustFactor();
}
switch (f.getMysqlType()) {
case MysqlDefs.FIELD_TYPE_TINY_BLOB:
case MysqlDefs.FIELD_TYPE_BLOB:
case MysqlDefs.FIELD_TYPE_MEDIUM_BLOB:
case MysqlDefs.FIELD_TYPE_LONG_BLOB:
return clampedGetLength(f); // this may change in the future
// for now, the server only
// returns FIELD_TYPE_BLOB for _all_
// BLOB types, but varying lengths
// indicating the _maximum_ size
// for each BLOB type.
default:
return clampedGetLength(f) / f.getMaxBytesPerCharacter();
}
}
/**
* What is a column's number of digits to the right of the decimal point?
*
* @param column
* the first column is 1, the second is 2...
*
* @return the scale
*
* @throws SQLException
* if a database access error occurs
*/
public int getScale(int column) throws SQLException {
Field f = getField(column);
if (isDecimalType(f.getSQLType())) {
return f.getDecimals();
}
return 0;
}
/**
* What is a column's table's schema? This relies on us knowing the table
* name. The JDBC specification allows us to return "" if this is not
* applicable.
*
* @param column
* the first column is 1, the second is 2...
*
* @return the Schema
*
* @throws SQLException
* if a database access error occurs
*/
public String getSchemaName(int column) throws SQLException {
return ""; //$NON-NLS-1$
}
/**
* Whats a column's table's name?
*
* @param column
* the first column is 1, the second is 2...
*
* @return column name, or "" if not applicable
*
* @throws SQLException
* if a database access error occurs
*/
public String getTableName(int column) throws SQLException {
if (this.useOldAliasBehavior) {
return getField(column).getTableName();
}
return getField(column).getTableNameNoAliases();
}
/**
* Is the column automatically numbered (and thus read-only)
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isAutoIncrement(int column) throws SQLException {
Field f = getField(column);
return f.isAutoIncrement();
}
/**
* Does a column's case matter?
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if so
*
* @throws java.sql.SQLException
* if a database access error occurs
*/
public boolean isCaseSensitive(int column) throws java.sql.SQLException {
Field field = getField(column);
int sqlType = field.getSQLType();
switch (sqlType) {
case Types.BIT:
case Types.TINYINT:
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
case Types.FLOAT:
case Types.REAL:
case Types.DOUBLE:
case Types.DATE:
case Types.TIME:
case Types.TIMESTAMP:
return false;
case Types.CHAR:
case Types.VARCHAR:
case Types.LONGVARCHAR:
if (field.isBinary()) {
return true;
}
String collationName = field.getCollation();
return ((collationName != null) && !collationName.endsWith("_ci"));
default:
return true;
}
}
/**
* Is the column a cash value?
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if its a cash column
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isCurrency(int column) throws SQLException {
return false;
}
/**
* Will a write on this column definately succeed?
*
* @param column
* the first column is 1, the second is 2, etc..
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isDefinitelyWritable(int column) throws SQLException {
return isWritable(column);
}
/**
* Can you put a NULL in this column?
*
* @param column
* the first column is 1, the second is 2...
*
* @return one of the columnNullable values
*
* @throws SQLException
* if a database access error occurs
*/
public int isNullable(int column) throws SQLException {
if (!getField(column).isNotNull()) {
return java.sql.ResultSetMetaData.columnNullable;
}
return java.sql.ResultSetMetaData.columnNoNulls;
}
/**
* Is the column definitely not writable?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isReadOnly(int column) throws SQLException {
return getField(column).isReadOnly();
}
/**
* Can the column be used in a WHERE clause? Basically for this, I split the
* functions into two types: recognised types (which are always useable),
* and OTHER types (which may or may not be useable). The OTHER types, for
* now, I will assume they are useable. We should really query the catalog
* to see if they are useable.
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if they can be used in a WHERE clause
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isSearchable(int column) throws SQLException {
return true;
}
/**
* Is the column a signed number?
*
* @param column
* the first column is 1, the second is 2...
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isSigned(int column) throws SQLException {
Field f = getField(column);
int sqlType = f.getSQLType();
switch (sqlType) {
case Types.TINYINT:
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
case Types.FLOAT:
case Types.REAL:
case Types.DOUBLE:
case Types.NUMERIC:
case Types.DECIMAL:
return !f.isUnsigned();
case Types.DATE:
case Types.TIME:
case Types.TIMESTAMP:
return false;
default:
return false;
}
}
/**
* Is it possible for a write on the column to succeed?
*
* @param column
* the first column is 1, the second is 2, etc.
*
* @return true if so
*
* @throws SQLException
* if a database access error occurs
*/
public boolean isWritable(int column) throws SQLException {
return !isReadOnly(column);
}
/**
* Returns a string representation of this object
*
* @return ...
*/
public String toString() {
StringBuffer toStringBuf = new StringBuffer();
toStringBuf.append(super.toString());
toStringBuf.append(" - Field level information: "); //$NON-NLS-1$
for (int i = 0; i < this.fields.length; i++) {
toStringBuf.append("\n\t"); //$NON-NLS-1$
toStringBuf.append(this.fields[i].toString());
}
return toStringBuf.toString();
}
static String getClassNameForJavaType(int javaType, boolean isUnsigned, int mysqlTypeIfKnown,
boolean isBinaryOrBlob, boolean isOpaqueBinary, boolean treatYearAsDate) {
switch (javaType) {
case Types.BIT:
case Types.BOOLEAN:
return "java.lang.Boolean";
case Types.TINYINT:
if (isUnsigned) {
return "java.lang.Integer";
}
return "java.lang.Integer";
case Types.SMALLINT:
if (isUnsigned) {
return "java.lang.Integer";
}
return "java.lang.Integer";
case Types.INTEGER:
if (!isUnsigned ||
mysqlTypeIfKnown == MysqlDefs.FIELD_TYPE_INT24) {
return "java.lang.Integer";
}
return "java.lang.Long";
case Types.BIGINT:
if (!isUnsigned) {
return "java.lang.Long";
}
return "java.math.BigInteger";
case Types.DECIMAL:
case Types.NUMERIC:
return "java.math.BigDecimal";
case Types.REAL:
return "java.lang.Float";
case Types.FLOAT:
case Types.DOUBLE:
return "java.lang.Double";
case Types.CHAR:
case Types.VARCHAR:
case Types.LONGVARCHAR:
if (!isOpaqueBinary) {
return "java.lang.String";
}
return "[B";
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
if (mysqlTypeIfKnown == MysqlDefs.FIELD_TYPE_GEOMETRY) {
return "[B";
} else if (isBinaryOrBlob) {
return "[B";
} else {
return "java.lang.String";
}
case Types.DATE:
return (treatYearAsDate || mysqlTypeIfKnown != MysqlDefs.FIELD_TYPE_YEAR) ? "java.sql.Date"
: "java.lang.Short";
case Types.TIME:
return "java.sql.Time";
case Types.TIMESTAMP:
return "java.sql.Timestamp";
default:
return "java.lang.Object";
}
}
/**
* Returns true if this either implements the interface argument or is directly or indirectly a wrapper
* for an object that does. Returns false otherwise. If this implements the interface then return true,
* else if this is a wrapper then return the result of recursively calling <code>isWrapperFor</code> on the wrapped
* object. If this does not implement the interface and is not a wrapper, return false.
* This method should be implemented as a low-cost operation compared to <code>unwrap</code> so that
* callers can use this method to avoid expensive <code>unwrap</code> calls that may fail. If this method
* returns true then calling <code>unwrap</code> with the same argument should succeed.
*
* @param interfaces a Class defining an interface.
* @return true if this implements the interface or directly or indirectly wraps an object that does.
* @throws java.sql.SQLException if an error occurs while determining whether this is a wrapper
* for an object with the given interface.
* @since 1.6
*/
public boolean isWrapperFor(Class<?> iface) throws SQLException {
// This works for classes that aren't actually wrapping
// anything
return iface.isInstance(this);
}
/**
* Returns an object that implements the given interface to allow access to non-standard methods,
* or standard methods not exposed by the proxy.
* The result may be either the object found to implement the interface or a proxy for that object.
* If the receiver implements the interface then that is the object. If the receiver is a wrapper
* and the wrapped object implements the interface then that is the object. Otherwise the object is
* the result of calling <code>unwrap</code> recursively on the wrapped object. If the receiver is not a
* wrapper and does not implement the interface, then an <code>SQLException</code> is thrown.
*
* @param iface A Class defining an interface that the result must implement.
* @return an object that implements the interface. May be a proxy for the actual implementing object.
* @throws java.sql.SQLException If no object found that implements the interface
* @since 1.6
*/
public Object unwrap(Class<?> iface) throws java.sql.SQLException {
try {
// This works for classes that aren't actually wrapping
// anything
return Util.cast(iface, this);
} catch (ClassCastException cce) {
throw SQLError.createSQLException("Unable to unwrap to " + iface.toString(),
SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
}
}
}
| shubhanshu-gupta/Apache-Solr | example/solr/collection1/lib/mysql-connector-java-5.1.32/src/com/mysql/jdbc/ResultSetMetaData.java | Java | apache-2.0 | 22,984 |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.10
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.badlogic.gdx.physics.bullet.softbody;
public class SWIGTYPE_p_btMatrix3x3 {
private long swigCPtr;
protected SWIGTYPE_p_btMatrix3x3(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_btMatrix3x3() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_btMatrix3x3 obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}
| ryoenji/libgdx | extensions/gdx-bullet/jni/swig-src/softbody/com/badlogic/gdx/physics/bullet/softbody/SWIGTYPE_p_btMatrix3x3.java | Java | apache-2.0 | 757 |
/*
* Copyright 2020 Spotify AB.
*
* 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.spotify.scio.elasticsearch
import java.io.{InputStream, OutputStream}
import com.spotify.scio.coders._
import org.apache.beam.sdk.coders.{AtomicCoder, CoderException}
import org.elasticsearch.action.DocWriteRequest
import org.elasticsearch.action.delete.DeleteRequest
import org.elasticsearch.action.index.IndexRequest
import org.elasticsearch.action.update.UpdateRequest
import org.elasticsearch.common.io.stream.{
InputStreamStreamInput,
OutputStreamStreamOutput,
StreamInput,
Writeable
}
trait CoderInstances {
private val INDEX_REQ_INDEX = 0
private val UPDATE_REQ_INDEX = 1
private val DELETE_REQ_INDEX = 2
private val KRYO_INDEX = 3
private lazy val kryoCoder = Coder.kryo[DocWriteRequest[_]]
private lazy val kryoBCoder = CoderMaterializer.beamWithDefault(kryoCoder)
implicit val docWriteRequestCoder: Coder[DocWriteRequest[_]] =
Coder.beam[DocWriteRequest[_]](new AtomicCoder[DocWriteRequest[_]] {
override def encode(value: DocWriteRequest[_], outStream: OutputStream): Unit =
value match {
case i: IndexRequest =>
outStream.write(INDEX_REQ_INDEX)
indexRequestBCoder.encode(i, outStream)
case u: UpdateRequest =>
outStream.write(UPDATE_REQ_INDEX)
updateRequestBCoder.encode(u, outStream)
case d: DeleteRequest =>
outStream.write(DELETE_REQ_INDEX)
deleteRequestBCoder.encode(d, outStream)
case _ =>
outStream.write(KRYO_INDEX)
kryoBCoder.encode(value, outStream)
}
override def decode(inStream: InputStream): DocWriteRequest[_] = {
val request = inStream.read() match {
case INDEX_REQ_INDEX => indexRequestBCoder.decode(inStream)
case UPDATE_REQ_INDEX => updateRequestBCoder.decode(inStream)
case DELETE_REQ_INDEX => deleteRequestBCoder.decode(inStream)
case KRYO_INDEX => kryoBCoder.decode(inStream)
case n => throw new CoderException(s"Unknown index $n")
}
request.asInstanceOf[DocWriteRequest[_]]
}
})
private def writableBCoder[T <: Writeable](
constructor: StreamInput => T
): org.apache.beam.sdk.coders.Coder[T] = new AtomicCoder[T] {
override def encode(value: T, outStream: OutputStream): Unit =
value.writeTo(new OutputStreamStreamOutput(outStream))
override def decode(inStream: InputStream): T =
constructor(new InputStreamStreamInput(inStream))
}
private val indexRequestBCoder = writableBCoder[IndexRequest](new IndexRequest(_))
implicit val indexRequestCoder: Coder[IndexRequest] =
Coder.beam[IndexRequest](indexRequestBCoder)
private val deleteRequestBCoder = writableBCoder[DeleteRequest](new DeleteRequest(_))
implicit val deleteRequestCoder: Coder[DeleteRequest] =
Coder.beam[DeleteRequest](deleteRequestBCoder)
private val updateRequestBCoder = writableBCoder[UpdateRequest](new UpdateRequest(_))
implicit val updateRequestCoder: Coder[UpdateRequest] =
Coder.beam[UpdateRequest](updateRequestBCoder)
}
| spotify/scio | scio-elasticsearch/es7/src/main/scala/com/spotify/scio/elasticsearch/CoderInstances.scala | Scala | apache-2.0 | 3,702 |
## helm plugin list
list installed Helm plugins
### Synopsis
list installed Helm plugins
```
helm plugin list
```
### Options inherited from parent commands
```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--kubeconfig string absolute path to the kubeconfig file to use
--tiller-connection-timeout int the duration (in seconds) Helm will wait to establish a connection to tiller (default 300)
--tiller-namespace string namespace of Tiller (default "kube-system")
```
### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins
###### Auto generated by spf13/cobra on 17-Jun-2018
| technosophos/k8s-helm | docs/helm/helm_plugin_list.md | Markdown | apache-2.0 | 938 |
/*
* 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.cdi.test;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.cdi.CdiCamelExtension;
import org.apache.camel.cdi.Uri;
import org.apache.camel.cdi.bean.InjectedEndpointRoute;
import org.apache.camel.component.mock.MockEndpoint;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied;
@RunWith(Arquillian.class)
public class InjectedEndpointTest {
@Inject
@Uri("direct:inbound")
private ProducerTemplate inbound;
@Inject
private MockEndpoint outbound;
@Deployment
public static Archive<?> deployment() {
return ShrinkWrap.create(JavaArchive.class)
// Camel CDI
.addPackage(CdiCamelExtension.class.getPackage())
// Test class
.addClass(InjectedEndpointRoute.class)
// Bean archive deployment descriptor
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
@Test
public void sendMessageToInbound() throws InterruptedException {
outbound.expectedMessageCount(1);
outbound.expectedBodiesReceived("test");
inbound.sendBody("test");
assertIsSatisfied(2L, TimeUnit.SECONDS, outbound);
}
}
| davidkarlsen/camel | components/camel-cdi/src/test/java/org/apache/camel/cdi/test/InjectedEndpointTest.java | Java | apache-2.0 | 2,505 |
# Copyright 2017 The TensorFlow 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.
# ==============================================================================
"""Tests for api module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import gc
import imp
import os
import re
import textwrap
import types
import numpy as np
from tensorflow.python.autograph import utils
from tensorflow.python.autograph.core import ag_ctx
from tensorflow.python.autograph.core import converter
from tensorflow.python.autograph.impl import api
from tensorflow.python.autograph.pyct import inspect_utils
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.eager import def_function
from tensorflow.python.eager import function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import test_util
from tensorflow.python.keras.engine import sequential
from tensorflow.python.keras.layers import core
from tensorflow.python.ops import gen_math_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import test
from tensorflow.python.util import function_utils
from tensorflow.python.util import tf_decorator
from tensorflow.python.util import tf_inspect
tf = utils.fake_tf()
global_n = 2
class TestResource(object):
def __init__(self):
self.x = 3
class ApiTest(test.TestCase):
@test_util.run_deprecated_v1
def test_decorator_recursive(self):
class TestClass(object):
def called_member(self, a):
if a < 0:
a = -a
return a
@api.convert(recursive=True)
def test_method(self, x, s, a):
while tf.reduce_sum(x) > s:
x //= self.called_member(a)
return x
tc = TestClass()
with self.cached_session() as sess:
x = tc.test_method(
constant_op.constant([2, 4]), constant_op.constant(1),
constant_op.constant(-2))
self.assertListEqual([0, 1], self.evaluate(x).tolist())
@test_util.run_deprecated_v1
def test_decorator_not_recursive(self):
class TestClass(object):
def called_member(self, a):
return tf.negative(a)
@api.convert(recursive=False)
def test_method(self, x, s, a):
while tf.reduce_sum(x) > s:
x //= self.called_member(a)
return x
tc = TestClass()
with self.cached_session() as sess:
x = tc.test_method(
constant_op.constant([2, 4]), constant_op.constant(1),
constant_op.constant(-2))
self.assertListEqual([0, 1], self.evaluate(x).tolist())
@test_util.run_deprecated_v1
def test_convert_then_do_not_convert(self):
class TestClass(object):
@api.do_not_convert
def called_member(self, a):
return tf.negative(a)
@api.convert(recursive=True)
def test_method(self, x, s, a):
while tf.reduce_sum(x) > s:
x //= self.called_member(a)
return x
tc = TestClass()
x = tc.test_method(
constant_op.constant((2, 4)), constant_op.constant(1),
constant_op.constant(-2))
self.assertAllEqual((0, 1), self.evaluate(x))
@test_util.run_deprecated_v1
def test_decorator_calls_decorated(self):
class TestClass(object):
@api.convert()
def called_member(self, a):
if a < 0:
a = -a
return a
@api.convert(recursive=True)
def test_method(self, x, s, a):
while tf.reduce_sum(x) > s:
x //= self.called_member(a)
return x
tc = TestClass()
with self.cached_session() as sess:
x = tc.test_method(
constant_op.constant([2, 4]), constant_op.constant(1),
constant_op.constant(-2))
self.assertListEqual([0, 1], self.evaluate(x).tolist())
def test_decorator_preserves_argspec(self):
class TestClass(object):
def test_method(self, a):
if a < 0:
a = -a
return a
test_method_converted = api.convert()(test_method)
tc = TestClass()
self.assertListEqual(
list(tf_inspect.getfullargspec(tc.test_method)),
list(tf_inspect.getfullargspec(tc.test_method_converted)))
def test_do_not_convert_argspec(self):
class TestClass(object):
def test_method(self, x, y):
z = x + y
return z
test_method_whitelisted = api.do_not_convert(test_method)
tc = TestClass()
self.assertTrue(tf_inspect.ismethod(tc.test_method_whitelisted))
# Because the wrapped function is not generated, we can't preserve its
# arg spec.
self.assertEqual((),
tuple(function_utils.fn_args(tc.test_method_whitelisted)))
def test_do_not_convert_callable_object(self):
class TestClass(object):
def __call__(self):
return 1
tc = TestClass()
self.assertEqual(1, api.do_not_convert(tc)())
@test_util.run_deprecated_v1
def test_convert_call_site_decorator(self):
class TestClass(object):
def called_member(self, a):
if a < 0:
a = -a
return a
@api.convert(recursive=True)
def test_method(self, x, s, a):
while tf.reduce_sum(x) > s:
x //= api.converted_call(self.called_member,
converter.ConversionOptions(recursive=True),
(a,), {})
return x
tc = TestClass()
x = tc.test_method(
constant_op.constant([2, 4]), constant_op.constant(1),
constant_op.constant(-2))
self.assertListEqual([0, 1], self.evaluate(x).tolist())
def test_converted_call_builtin(self):
x = api.converted_call(range, converter.ConversionOptions(recursive=True),
(3,), {})
self.assertEqual((0, 1, 2), tuple(x))
x = api.converted_call(re.compile,
converter.ConversionOptions(recursive=True),
('mnas_v4_a.*\\/.*(weights|kernel):0$',), {})
self.assertIsNotNone(x.match('mnas_v4_a/weights:0'))
def test_converted_call_function(self):
def test_fn(x):
if x < 0:
return -x
return x
x = api.converted_call(test_fn, converter.ConversionOptions(recursive=True),
(constant_op.constant(-1),), {})
self.assertEqual(1, self.evaluate(x))
@test_util.run_v1_only('b/120545219')
def test_converted_call_functools_partial(self):
def test_fn(x, y, z):
if x < 0:
return -x, -y, -z
return x, y, z
x = api.converted_call(
functools.partial(test_fn, constant_op.constant(-1), z=-3),
converter.ConversionOptions(recursive=True),
(constant_op.constant(-2),), {})
self.assertEqual((1, 2, 3), self.evaluate(x))
x = api.converted_call(
functools.partial(
functools.partial(test_fn, constant_op.constant(-1)), z=-3),
converter.ConversionOptions(recursive=True),
(constant_op.constant(-2),), {})
self.assertEqual((1, 2, 3), self.evaluate(x))
def test_converted_call_method(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def test_method(self):
if self.x < 0:
return -self.x
return self.x
tc = TestClass(constant_op.constant(-1))
x = api.converted_call(tc.test_method,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(1, self.evaluate(x))
def test_converted_call_synthetic_method(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def test_function(self):
if self.x < 0:
return -self.x
return self.x
tc = TestClass(constant_op.constant(-1))
test_method = types.MethodType(test_function, tc)
x = api.converted_call(test_method,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(1, self.evaluate(x))
def test_converted_call_method_wrapper(self):
class TestClass(object):
def foo(self):
pass
tc = TestClass()
# `method.__get__()` returns a so-called method-wrapper.
wrapper = api.converted_call(tc.foo.__get__,
converter.ConversionOptions(recursive=True),
(tc,), {})
self.assertEqual(wrapper, tc.foo)
def test_converted_call_method_as_object_attribute(self):
class AnotherClass(object):
def __init__(self):
self.another_class_attr = constant_op.constant(1)
def method(self):
if self.another_class_attr > 0:
return self.another_class_attr + 1
return self.another_class_attr + 10
class TestClass(object):
def __init__(self, another_obj_method):
self.another_obj_method = another_obj_method
obj = AnotherClass()
tc = TestClass(obj.method)
x = api.converted_call(tc.another_obj_method,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(self.evaluate(x), 2)
def test_converted_call_method_converts_recursively(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def other_method(self):
if self.x < 0:
return -self.x
return self.x
def test_method(self):
return self.other_method()
tc = TestClass(constant_op.constant(-1))
x = api.converted_call(tc.test_method,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(1, self.evaluate(x))
def test_converted_call_method_by_class(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def test_method(self):
if self.x < 0:
return -self.x
return self.x
tc = TestClass(constant_op.constant(-1))
x = api.converted_call(TestClass.test_method,
converter.ConversionOptions(recursive=True), (tc,),
{})
self.assertEqual(1, self.evaluate(x))
def test_converted_call_callable_object(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def __call__(self):
if self.x < 0:
return -self.x
return self.x
tc = TestClass(constant_op.constant(-1))
x = api.converted_call(tc, converter.ConversionOptions(recursive=True), (),
{})
self.assertEqual(1, self.evaluate(x))
def test_converted_call_callable_metaclass(self):
class TestMetaclass(type):
x = constant_op.constant(-1)
def __call__(cls):
if cls.x < 0:
cls.x = -cls.x
return cls
tc = TestMetaclass('TestClass', (), {})
# This functools.partial will hide the class form the constructor
# check. Not ideal. See b/120224672.
tc = functools.partial(tc)
converted_tc = api.converted_call(
tc, converter.ConversionOptions(recursive=True), (), {})
self.assertIsInstance(converted_tc, TestMetaclass)
self.assertEqual(1, self.evaluate(converted_tc.x))
@test_util.run_deprecated_v1
def test_converted_call_constructor(self):
class TestClass(object):
def __init__(self, x):
self.x = x
def test_method(self):
if self.x < 0:
return -self.x
return self.x
tc = api.converted_call(TestClass,
converter.ConversionOptions(recursive=True),
(constant_op.constant(-1),), {})
# tc is still a TestClass - constructors are whitelisted.
# TODO(b/124016764): Support this use case.
# The error below is specific to the `if` statement not being converted.
with self.assertRaises(TypeError):
tc.test_method()
def test_converted_call_mangled_properties(self):
class TestClass(object):
def __init__(self, x):
self.__private = x
def test_method(self):
if self.__private < 0:
return self.__private
return self.__private
tc = TestClass(constant_op.constant(-1))
# The error below is specific to the `if` statement not being converted.
with self.assertRaisesRegex(NotImplementedError, 'Mangled names'):
api.converted_call(tc.test_method,
converter.ConversionOptions(recursive=True), (), {})
tc.test_method()
def test_converted_call_already_converted(self):
def f(x):
return x == 0
x = api.converted_call(f, converter.ConversionOptions(recursive=True),
(constant_op.constant(0),), {})
self.assertTrue(self.evaluate(x))
converted_f = api.to_graph(
f, experimental_optional_features=converter.Feature.ALL)
x = api.converted_call(converted_f,
converter.ConversionOptions(recursive=True),
(constant_op.constant(0),), {})
self.assertTrue(self.evaluate(x))
def test_converted_call_then_already_converted_dynamic(self):
@api.convert()
def g(x):
if x > 0:
return x
else:
return -x
def f(g, x):
return g(x)
x = api.converted_call(f, converter.ConversionOptions(recursive=True),
(g, constant_op.constant(1)), {})
self.assertEqual(self.evaluate(x), 1)
def test_converted_call_forced_when_explicitly_whitelisted(self):
@api.do_not_convert()
def f(x):
return x + 1
x = api.converted_call(
f, converter.ConversionOptions(recursive=True, user_requested=True),
(constant_op.constant(0),), {})
self.assertTrue(self.evaluate(x))
converted_f = api.to_graph(
f, experimental_optional_features=converter.Feature.ALL)
x = api.converted_call(converted_f,
converter.ConversionOptions(recursive=True), (0,),
{})
self.assertEqual(x, 1)
@test_util.run_deprecated_v1
def test_converted_call_no_user_code(self):
def f(x):
return len(x)
opts = converter.ConversionOptions(internal_convert_user_code=False)
# f should not be converted, causing len to error out.
with self.assertRaisesRegexp(Exception, 'len is not well defined'):
api.converted_call(f, opts, (constant_op.constant([0]),), {})
# len on the other hand should work fine.
x = api.converted_call(len, opts, (constant_op.constant([0]),), {})
# The constant has static shape so the result is a primitive not a Tensor.
self.assertEqual(x, 1)
def test_converted_call_no_kwargs_allowed(self):
def f(*args):
# Note: np.broadcast rejects any **kwargs, even *{}
return np.broadcast(args[:1])
opts = converter.ConversionOptions(internal_convert_user_code=False)
self.assertIsNotNone(api.converted_call(f, opts, (1, 2, 3, 4), None))
def test_converted_call_whitelisted_method(self):
opts = converter.ConversionOptions(recursive=True)
model = sequential.Sequential([core.Dense(2)])
x = api.converted_call(model.call, opts, (constant_op.constant([[0.0]]),),
{'training': True})
self.evaluate(variables.global_variables_initializer())
self.assertAllEqual([[0.0, 0.0]], self.evaluate(x))
def test_converted_call_whitelisted_method_via_owner(self):
opts = converter.ConversionOptions(recursive=True)
model = sequential.Sequential([core.Dense(2)])
x = api.converted_call(model.call, opts, (constant_op.constant([[0.0]]),),
{'training': True})
self.evaluate(variables.global_variables_initializer())
self.assertAllEqual([[0.0, 0.0]], self.evaluate(x))
def test_converted_call_numpy(self):
opts = converter.ConversionOptions(recursive=True)
x = api.converted_call(np.arange, opts, (5,), {})
self.assertAllEqual(x, list(range(5)))
def test_converted_call_tf_op_forced(self):
# TODO(mdan): Add the missing level of support to LOGICAL_EXPRESSIONS.
opts = converter.ConversionOptions(
user_requested=True, optional_features=None)
x = api.converted_call(gen_math_ops.add, opts, (1, 1), {})
self.assertAllEqual(self.evaluate(x), 2)
def test_converted_call_exec_generated_code(self):
temp_mod = imp.new_module('test_module')
dynamic_code = """
def foo(x):
return x + 1
"""
exec(textwrap.dedent(dynamic_code), temp_mod.__dict__) # pylint:disable=exec-used
opts = converter.ConversionOptions(optional_features=None)
x = api.converted_call(temp_mod.foo, opts, (1,), {})
self.assertAllEqual(x, 2)
def test_converted_call_namedtuple(self):
opts = converter.ConversionOptions(recursive=True)
x = api.converted_call(collections.namedtuple, opts,
('TestNamedtuple', ('a', 'b')), {})
self.assertTrue(inspect_utils.isnamedtuple(x))
def test_converted_call_namedtuple_via_collections(self):
opts = converter.ConversionOptions(recursive=True)
x = api.converted_call(collections.namedtuple, opts,
('TestNamedtuple', ('a', 'b')), {})
self.assertTrue(inspect_utils.isnamedtuple(x))
def test_converted_call_namedtuple_subclass_bound_method(self):
class TestClass(collections.namedtuple('TestNamedtuple', ('a', 'b'))):
def test_method(self, x):
while tf.reduce_sum(x) > self.a:
x //= self.b
return x
opts = converter.ConversionOptions(recursive=True)
obj = TestClass(5, 2)
x = api.converted_call(obj.test_method, opts,
(constant_op.constant([2, 4]),), {})
self.assertAllEqual(self.evaluate(x), [1, 2])
def test_converted_call_namedtuple_method(self):
class TestClass(collections.namedtuple('TestNamedtuple', ('a', 'b'))):
pass
opts = converter.ConversionOptions(recursive=True)
obj = TestClass(5, 2)
# _asdict is a documented method of namedtuple.
x = api.converted_call(obj._asdict, opts, (), {})
self.assertDictEqual(x, {'a': 5, 'b': 2})
def test_converted_call_namedtuple_subclass_unbound_method(self):
class TestClass(collections.namedtuple('TestNamedtuple', ('a', 'b'))):
def test_method(self, x):
while tf.reduce_sum(x) > self.a:
x //= self.b
return x
opts = converter.ConversionOptions(recursive=True)
obj = TestClass(5, 2)
x = api.converted_call(TestClass.test_method, opts,
(obj, constant_op.constant([2, 4])), {})
self.assertAllEqual(self.evaluate(x), [1, 2])
def test_converted_call_lambda(self):
opts = converter.ConversionOptions(recursive=True)
l = lambda x: x == 0
x = api.converted_call(l, opts, (constant_op.constant(0),), {})
self.evaluate(variables.global_variables_initializer())
self.assertAllEqual(True, self.evaluate(x))
def test_converted_call_defun_object_method(self):
opts = converter.ConversionOptions(recursive=True)
# pylint:disable=method-hidden
class TestClass(object):
def method(self):
return 1
def prepare(self):
self.method = function.defun(self.method)
# pylint:enable=method-hidden
tc = TestClass()
tc.prepare()
x = api.converted_call(tc.method, opts, (), {})
self.assertAllEqual(1, self.evaluate(x))
def test_converted_call_through_tf_dataset(self):
def other_fn(x):
if x > 0:
return x
return -x
def f():
return dataset_ops.Dataset.range(-3, 3).map(other_fn)
# Dataset iteration only works inside tf.
@def_function.function
def graph_fn():
opts = converter.ConversionOptions(recursive=True)
ds = api.converted_call(f, opts, (), {})
itr = iter(ds)
return next(itr), next(itr), next(itr)
self.assertAllEqual(self.evaluate(graph_fn()), (3, 2, 1))
def assertNoMemoryLeaks(self, f):
object_ids_before = {id(o) for o in gc.get_objects()}
f()
gc.collect()
objects_after = tuple(
o for o in gc.get_objects() if id(o) not in object_ids_before)
self.assertEmpty(
tuple(o for o in objects_after if isinstance(o, TestResource)))
def test_converted_call_no_leaks_via_closure(self):
def test_fn():
res = TestResource()
def f(y):
return res.x + y
opts = converter.ConversionOptions(recursive=True)
api.converted_call(f, opts, (1,), {})
self.assertNoMemoryLeaks(test_fn)
def test_converted_call_no_leaks_via_inner_function_closure(self):
def test_fn():
res = TestResource()
def f(y):
def inner_f():
return res.x + y
return inner_f
opts = converter.ConversionOptions(recursive=True)
api.converted_call(f, opts, (1,), {})()
self.assertNoMemoryLeaks(test_fn)
def test_context_tracking_direct_calls(self):
@api.do_not_convert()
def unconverted_fn():
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.DISABLED)
@api.convert()
def converted_fn():
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.ENABLED)
unconverted_fn()
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.ENABLED)
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.UNSPECIFIED)
converted_fn()
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.UNSPECIFIED)
@api.call_with_unspecified_conversion_status
def unspecified_fn():
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.UNSPECIFIED)
unspecified_fn()
def test_to_graph_basic(self):
def test_fn(x, s):
while tf.reduce_sum(x) > s:
x //= 2
return x
compiled_fn = api.to_graph(test_fn)
with tf.Graph().as_default():
x = compiled_fn(constant_op.constant((4, 8)), 4)
self.assertAllEqual(self.evaluate(x), (1, 2))
@test_util.run_deprecated_v1
def test_to_graph_with_defaults(self):
foo = 4
def test_fn(x, s=foo):
while tf.reduce_sum(x) > s:
x //= 2
return x
compiled_fn = api.to_graph(test_fn)
with self.cached_session() as sess:
x = compiled_fn(constant_op.constant([4, 8]))
self.assertListEqual([1, 2], self.evaluate(x).tolist())
def test_to_graph_with_globals(self):
def test_fn(x):
global global_n
global_n = x + global_n
return global_n
converted_fn = api.to_graph(test_fn)
prev_val = global_n
converted_fn(10)
self.assertGreater(global_n, prev_val)
def test_to_graph_with_kwargs_clashing_converted_call(self):
def called_fn(**kwargs):
return kwargs['f'] + kwargs['owner']
def test_fn():
# These arg names intentionally match converted_call's
return called_fn(f=1, owner=2)
compiled_fn = api.to_graph(test_fn)
self.assertEqual(compiled_fn(), 3)
def test_to_graph_with_kwargs_clashing_unconverted_call(self):
@api.do_not_convert
def called_fn(**kwargs):
return kwargs['f'] + kwargs['owner']
def test_fn():
# These arg names intentionally match _call_unconverted's
return called_fn(f=1, owner=2)
compiled_fn = api.to_graph(test_fn)
self.assertEqual(compiled_fn(), 3)
def test_to_graph_caching(self):
def test_fn(x):
if x > 0:
return x
else:
return -x
converted_functions = tuple(api.to_graph(test_fn) for _ in (-1, 0, 1))
# All outputs are from the same module. We can't use __module__ because
# that's reset when we instantiate the function (see conversion.py).
# TODO(mdan): Can and should we overwrite __module__ instead?
module_names = frozenset(f.ag_module for f in converted_functions)
self.assertEqual(len(module_names), 1)
self.assertNotIn('__main__', module_names)
self.assertEqual(len(frozenset(id(f) for f in converted_functions)), 3)
def test_to_graph_caching_different_options(self):
def called_fn():
pass
def test_fn():
return called_fn()
converted_recursive = api.to_graph(test_fn, recursive=True)
converted_non_recursive = api.to_graph(test_fn, recursive=False)
self.assertNotEqual(converted_recursive.ag_module,
converted_non_recursive.ag_module)
self.assertRegex(tf_inspect.getsource(converted_recursive),
'FunctionScope(.*recursive=True.*)')
self.assertRegex(tf_inspect.getsource(converted_non_recursive),
'FunctionScope(.*recursive=False.*)')
def test_to_graph_preserves_bindings(self):
y = 3
def test_fn():
return y
converted = api.to_graph(test_fn)
self.assertEqual(converted(), 3)
y = 7
self.assertEqual(converted(), 7)
def test_to_graph_source_map(self):
def test_fn(y):
return y**2
self.assertTrue(hasattr(api.to_graph(test_fn), 'ag_source_map'))
def test_to_graph_sets_conversion_context(self):
def g():
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.ENABLED)
return 0
# Note: the autograph=False sets the contect to Status.DISABLED. The test
# verifies that to_graph overrides that.
@def_function.function(autograph=False)
def f():
converted_g = api.to_graph(g)
converted_g()
f()
def test_to_code_basic(self):
def test_fn(x, s):
while tf.reduce_sum(x) > s:
x /= 2
return x
# Just check that the output is parseable Python code.
self.assertIsNotNone(parser.parse_str(api.to_code(test_fn)))
def test_to_code_with_wrapped_function(self):
@def_function.function
def test_fn(x, s):
while tf.reduce_sum(x) > s:
x /= 2
return x
with self.assertRaisesRegex(Exception, 'try passing.*python_function'):
api.to_code(test_fn)
def test_tf_convert_direct(self):
def f():
if tf.reduce_sum([1, 2]) > 0:
return -1
return 1
# Note: the autograph setting of tf.function has nothing to do with the
# test case. We just disable it to avoid confusion.
@def_function.function(autograph=False)
def test_fn(ctx):
return api.tf_convert(f, ctx)()
self.assertEqual(
self.evaluate(
test_fn(ag_ctx.ControlStatusCtx(status=ag_ctx.Status.ENABLED))), -1)
with self.assertRaisesRegex(TypeError, 'tf.Tensor.*bool'):
# The code in `f` is only valid with AutoGraph.
test_fn(ag_ctx.ControlStatusCtx(status=ag_ctx.Status.DISABLED))
def test_tf_convert_unspecified_not_converted_by_default(self):
def f():
self.assertEqual(ag_ctx.control_status_ctx().status,
ag_ctx.Status.UNSPECIFIED)
if tf.reduce_sum([1, 2]) > 0:
return -1
return 1
@def_function.function
def test_fn(ctx):
return api.tf_convert(f, ctx, convert_by_default=False)()
with self.assertRaisesRegex(TypeError, 'tf.Tensor.*bool'):
# The code in `f` is only valid with AutoGraph.
test_fn(ag_ctx.ControlStatusCtx(status=ag_ctx.Status.UNSPECIFIED))
def test_tf_convert_whitelisted_method(self):
model = sequential.Sequential([core.Dense(2)])
converted_call = api.tf_convert(
model.call, ag_ctx.ControlStatusCtx(status=ag_ctx.Status.ENABLED))
_, converted_target = tf_decorator.unwrap(converted_call)
self.assertIs(converted_target.__func__, model.call.__func__)
def test_tf_convert_wrapped(self):
def f():
if tf.reduce_sum([1, 2]) > 0:
return -1
return 1
@functools.wraps(f)
def wrapper(*args, **kwargs):
return wrapper.__wrapped__(*args, **kwargs)
decorated_f = tf_decorator.make_decorator(f, wrapper)
# Note: the autograph setting of tf has nothing to do with the
# test case. We just disable it to avoid confusion.
@def_function.function(autograph=False)
def test_fn(ctx):
return api.tf_convert(decorated_f, ctx)()
self.assertEqual(
self.evaluate(
test_fn(ag_ctx.ControlStatusCtx(status=ag_ctx.Status.ENABLED))), -1)
# tf_convert mutates the decorator, so we need to create a new one for
# another test.
decorated_f = tf_decorator.make_decorator(f, wrapper)
with self.assertRaisesRegex(TypeError, 'tf.Tensor.*bool'):
# The code in `f` is only valid with AutoGraph.
test_fn(ag_ctx.ControlStatusCtx(status=ag_ctx.Status.DISABLED))
def test_super_with_one_arg(self):
test_case_self = self
class TestBase(object):
def plus_three(self, x):
return x + 3
class TestSubclass(TestBase):
def plus_three(self, x):
test_case_self.fail('This should never be called.')
def one_arg(self, x):
test_base_unbound = super(TestSubclass)
test_base = test_base_unbound.__get__(self, TestSubclass)
return test_base.plus_three(x)
tc = api.converted_call(TestSubclass,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(5, tc.one_arg(2))
def test_super_with_two_args(self):
test_case_self = self
class TestBase(object):
def plus_three(self, x):
return x + 3
class TestSubclass(TestBase):
def plus_three(self, x):
test_case_self.fail('This should never be called.')
def two_args(self, x):
return super(TestSubclass, self).plus_three(x)
tc = api.converted_call(TestSubclass,
converter.ConversionOptions(recursive=True), (), {})
self.assertEqual(5, tc.two_args(2))
if __name__ == '__main__':
os.environ['AUTOGRAPH_STRICT_CONVERSION'] = '1'
test.main()
| chemelnucfin/tensorflow | tensorflow/python/autograph/impl/api_test.py | Python | apache-2.0 | 30,339 |
# Simple script used to easily search all packages in conda for their
# dependency requirements
# TODO also search through output of ldd
# TODO update conda info syntax for different channels
if [ -z "$CONDA_ROOT" ]; then
# TODO create our own environment
echo "Please set CONDA_ROOT so that I know where to search for conda libraries"
echo "I expect CONDA_ROOT to be the path to the current conda environment."
echo "Also FYI I will probably mess up the current conda environment."
exit 1
fi
if [ -z "$1" ]; then
echo "Please give me a package name to search for"
exit 1
fi
PKG_NAME="$1"
if [ -n "$2" ]; then
echo "Searching in channel $2"
CONDA_CHANNEL="$2"
fi
# These are the packages of interest to search the dependencies for
# TODO use this
PACKAGES_OF_INTEREST=( libgcc-ng libprotobuf numpy )
# We will run `conda install` and `conda uninstall` a lot, but we don't want
# this very noisy output to clutter the user experience
VERBOSE_LOG='read_conda_versions.log'
echo "Conda install/uninstall log for $PKG_NAME" > $VERBOSE_LOG
#
# Build up the name of the installed library to call `nm` on
#
PKG_INSTALLED_LIB="$PKG_NAME"
# opencv installs a bunch of libraries. We'll just check libopencv_core
if [[ $PKG_NAME == opencv ]]; then
PKG_INSTALLED_LIB="${PKG_INSTALLED_LIB}_core"
fi
# Most packages prepend a 'lib' to the package name, but libprotobuf is an
# exception
if [[ $PKG_NAME != lib* ]]; then
PKG_INSTALLED_LIB="lib${PKG_INSTALLED_LIB}"
fi
# The shared library suffix differs on macOS an Linux
if [[ "$(uname)" == Darwin ]]; then
PKG_INSTALLED_LIB="${PKG_INSTALLED_LIB}.dylib"
else
PKG_INSTALLED_LIB="${PKG_INSTALLED_LIB}.so"
fi
echo "Determined the library name of $PKG_NAME to be $PKG_INSTALLED_LIB"
echo "Determined the library name of $PKG_NAME to be $PKG_INSTALLED_LIB" >> $VERBOSE_LOG
#
# Get all available packages with conda-search
#
# Split the output from conda search into an array, one line per package (plus
# the header)
conda_search_packages=()
while read -r line; do conda_search_packages+=("$line"); done <<< "$(conda search $PKG_NAME $CONDA_CHANNEL)"
### Typical `conda search` output looks like
### Loading channels: done
### Name Version Build Channel
### protobuf 2.6.1 py27_0 defaults
### 2.6.1 py27_1 defaults
### 3.2.0 py27_0 defaults
### 3.2.0 py35_0 defaults
### 3.2.0 py36_0 defaults
### 3.4.1 py27h66c1d77_0 defaults
### 3.4.1 py35h9d33684_0 defaults
### 3.4.1 py36h314970b_0 defaults
### 3.5.1 py27h0a44026_0 defaults
### 3.5.1 py35h0a44026_0 defaults
### 3.5.1 py36h0a44026_0 defaults
##
### Typical `conda info` output looks like
### protobuf 3.5.1 py36h0a44026_0
### -----------------------------
### file name : protobuf-3.5.1-py36h0a44026_0.tar.bz2
### name : protobuf
### version : 3.5.1
### build string: py36h0a44026_0
### build number: 0
### channel : https://repo.continuum.io/pkgs/main/osx-64
### size : 589 KB
### arch : None
### constrains : ()
### license : New BSD License
### license_family: BSD
### md5 : 7dbdb06612e21c42fbb8a62354e13e10
### platform : None
### subdir : osx-64
### timestamp : 1519951502766
### url : https://repo.continuum.io/pkgs/main/osx-64/protobuf-3.5.1-py36h0a44026_0.tar.bz2
### dependencies:
### libcxx >=4.0.1
### libprotobuf >=3.5.1,<3.6.0a0
### python >=3.6,<3.7.0a0
### six
# Echo what packages we'll look through.
echo "Processing these packages:"
for pkg in "${conda_search_packages[@]:2}"; do
echo " $pkg"
done
#
# Look up each package in conda info, then install it and search the exported
# symbols for signs of cxx11
#
for pkg in "${conda_search_packages[@]:2}"; do
echo "Processing $pkg" >> $VERBOSE_LOG
# Split each line into an array and build the package specification
# <package_name (1st line only)> maj.min.patch build_string channel_name
line_parts=( $pkg )
if [[ ${line_parts[0]} == $PKG_NAME ]]; then
# First line of output
PKG_VERSION="${line_parts[1]}"
PKG_BUILD_STR="${line_parts[2]}"
else
PKG_VERSION="${line_parts[0]}"
PKG_BUILD_STR="${line_parts[1]}"
fi
PKG_SPEC="$PKG_NAME=$PKG_VERSION=$PKG_BUILD_STR"
# Output current pkg spec
echo
echo "${PKG_SPEC}:"
echo "Determined that the package spec is $PKG_SPEC" >> $VERBOSE_LOG
# Split the output of conda_info into an array of lines
pkg_dependencies=()
while read -r line; do pkg_dependencies+=("$line"); done <<< "$(conda info "$PKG_SPEC" $CONDA_CHANNEL)"
# List all the listed dependencies in `conda info`
if [ "${#pkg_dependencies[@]}" -gt 19 ]; then
echo " Listed dependencies:"
echo " Listed dependencies:" >> $VERBOSE_LOG
for pkg_dependency in "${pkg_dependencies[@]:20}"; do
echo " $pkg_dependency"
echo " $pkg_dependency" >> $VERBOSE_LOG
done
else
echo " No listed dependencies in conda-info" >> $VERBOSE_LOG
fi
# But sometimes (a lot of the time) the gcc with which a package was built
# against is not listed in dependencies. So we try to figure it out manually
# We install this exact package, and then grep the exported symbols for signs
# of cxx11
echo "Calling conda-uninstall on $PKG_NAME" >> $VERBOSE_LOG
echo "conda uninstall -y $PKG_NAME --quiet" >> $VERBOSE_LOG
conda uninstall -y "$PKG_NAME" --quiet >> $VERBOSE_LOG 2>&1
echo "Calling conda-install on $PKG_SPEC" >> $VERBOSE_LOG
echo "conda install -y $PKG_SPEC --quiet --no-deps $CONDA_CHANNEL" >> $VERBOSE_LOG
conda install -y "$PKG_SPEC" --quiet --no-deps $CONDA_CHANNEL >> $VERBOSE_LOG 2>&1
if [ $? -eq 0 ]; then
# Only grep the exported symbols if the library was installed correctly
MENTIONS_CXX11="$(nm "$CONDA_ROOT/lib/$PKG_INSTALLED_LIB" | grep cxx11 | wc -l)"
if [ $MENTIONS_CXX11 -gt 0 ]; then
echo " This package is built against the recent gcc ABI ($MENTIONS_CXX11 mentions of cxx11)"
echo "$CONDA_ROOT/lib/$PKG_INSTALLED_LIB mentions cxx11 $MENTIONS_CXX11 times" >> $VERBOSE_LOG
fi
else
echo "Error installing $PKG_SPEC , continuing"
echo "Error installing $PKG_SPEC , continuing" >> $VERBOSE_LOG
fi
done
| xzturn/caffe2 | scripts/read_conda_versions.sh | Shell | apache-2.0 | 6,719 |
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './slide-toggle-module';
export * from './slide-toggle';
export * from './mat-exports';
| tongpa/pypollmanage | pypollmanage/public/javascript/node_modules/@angular_ols/material/typings/slide-toggle/public_api.d.ts | TypeScript | apache-2.0 | 305 |
(function() {
function Message($firebaseArray) {
var ref = firebase.database().ref().child("messages");
var messages = $firebaseArray(ref);
return {
getByRoomId: function(roomId) {
return $firebaseArray(ref.orderByChild('roomId').equalTo(roomId));
}
};
}
angular
.module('blocChat')
.factory('Message', ['$firebaseArray', Message]);
})(); | benartw86/Bloc-Chat | dist/scripts/services/message.js | JavaScript | apache-2.0 | 429 |
<?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\AlertCenter;
class MailPhishing extends \Google\Collection
{
protected $collection_key = 'messages';
protected $domainIdType = DomainId::class;
protected $domainIdDataType = '';
/**
* @var bool
*/
public $isInternal;
protected $maliciousEntityType = MaliciousEntity::class;
protected $maliciousEntityDataType = '';
protected $messagesType = GmailMessageInfo::class;
protected $messagesDataType = 'array';
/**
* @var string
*/
public $systemActionType;
/**
* @param DomainId
*/
public function setDomainId(DomainId $domainId)
{
$this->domainId = $domainId;
}
/**
* @return DomainId
*/
public function getDomainId()
{
return $this->domainId;
}
/**
* @param bool
*/
public function setIsInternal($isInternal)
{
$this->isInternal = $isInternal;
}
/**
* @return bool
*/
public function getIsInternal()
{
return $this->isInternal;
}
/**
* @param MaliciousEntity
*/
public function setMaliciousEntity(MaliciousEntity $maliciousEntity)
{
$this->maliciousEntity = $maliciousEntity;
}
/**
* @return MaliciousEntity
*/
public function getMaliciousEntity()
{
return $this->maliciousEntity;
}
/**
* @param GmailMessageInfo[]
*/
public function setMessages($messages)
{
$this->messages = $messages;
}
/**
* @return GmailMessageInfo[]
*/
public function getMessages()
{
return $this->messages;
}
/**
* @param string
*/
public function setSystemActionType($systemActionType)
{
$this->systemActionType = $systemActionType;
}
/**
* @return string
*/
public function getSystemActionType()
{
return $this->systemActionType;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MailPhishing::class, 'Google_Service_AlertCenter_MailPhishing');
| googleapis/google-api-php-client-services | src/AlertCenter/MailPhishing.php | PHP | apache-2.0 | 2,507 |
package io.subutai.common.protocol;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
/**
* P2P helper class
*/
public class P2PConnections
{
@JsonProperty( "connections" )
private Set<P2PConnection> connections = new HashSet<>();
public P2PConnections( @JsonProperty( "connections" ) final Set<P2PConnection> connections )
{
Preconditions.checkNotNull( connections );
this.connections = connections;
}
public P2PConnections()
{
}
public void addConnection( P2PConnection p2PConnection )
{
Preconditions.checkNotNull( p2PConnection, "P2P connection can not be null." );
connections.add( p2PConnection );
}
public Set<P2PConnection> getConnections()
{
return this.connections;
}
public P2PConnection findByHash( final String hash )
{
Preconditions.checkNotNull( hash );
for ( P2PConnection p2PConnection : getConnections() )
{
if ( p2PConnection.getHash().equalsIgnoreCase( hash ) )
{
return p2PConnection;
}
}
return null;
}
public P2PConnection findByIp( final String ip )
{
Preconditions.checkArgument( !StringUtils.isBlank( ip ) );
for ( P2PConnection p2PConnection : getConnections() )
{
if ( p2PConnection.getIp().equalsIgnoreCase( ip ) )
{
return p2PConnection;
}
}
return null;
}
}
| subutai-io/Subutai | management/server/subutai-common/src/main/java/io/subutai/common/protocol/P2PConnections.java | Java | apache-2.0 | 1,701 |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack.datastreams.rest;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.xpack.core.action.PromoteDataStreamAction;
import java.io.IOException;
import java.util.List;
public class RestPromoteDataStreamAction extends BaseRestHandler {
@Override
public String getName() {
return "promote_data_stream_action";
}
@Override
public List<Route> routes() {
return List.of(new Route(RestRequest.Method.POST, "/_data_stream/_promote/{name}"));
}
@Override
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {
PromoteDataStreamAction.Request request = new PromoteDataStreamAction.Request(restRequest.param("name"));
return channel -> client.execute(PromoteDataStreamAction.INSTANCE, request, new RestToXContentListener<>(channel));
}
}
| nknize/elasticsearch | x-pack/plugin/data-streams/src/main/java/org/elasticsearch/xpack/datastreams/rest/RestPromoteDataStreamAction.java | Java | apache-2.0 | 1,299 |
/**
*
* Copyright 2003-2007 Jive Software 2020-2022 Florian Schmaus.
*
* 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.jivesoftware.smackx.xdata.provider;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.parsing.SmackParsingException;
import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smack.roster.packet.RosterPacket;
import org.jivesoftware.smack.roster.provider.RosterPacketProvider;
import org.jivesoftware.smack.util.EqualsUtil;
import org.jivesoftware.smack.util.HashCode;
import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smack.xml.XmlPullParserException;
import org.jivesoftware.smackx.formtypes.FormFieldRegistry;
import org.jivesoftware.smackx.xdata.AbstractMultiFormField;
import org.jivesoftware.smackx.xdata.AbstractSingleStringValueFormField;
import org.jivesoftware.smackx.xdata.BooleanFormField;
import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.FormFieldChildElement;
import org.jivesoftware.smackx.xdata.FormFieldWithOptions;
import org.jivesoftware.smackx.xdata.JidMultiFormField;
import org.jivesoftware.smackx.xdata.JidSingleFormField;
import org.jivesoftware.smackx.xdata.ListMultiFormField;
import org.jivesoftware.smackx.xdata.ListSingleFormField;
import org.jivesoftware.smackx.xdata.TextSingleFormField;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jivesoftware.smackx.xdatalayout.packet.DataLayout;
import org.jivesoftware.smackx.xdatalayout.provider.DataLayoutProvider;
/**
* The DataFormProvider parses DataForm packets.
*
* @author Gaston Dombiak
*/
public class DataFormProvider extends ExtensionElementProvider<DataForm> {
private static final Logger LOGGER = Logger.getLogger(DataFormProvider.class.getName());
public static final DataFormProvider INSTANCE = new DataFormProvider();
@Override
public DataForm parse(XmlPullParser parser, int initialDepth, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
DataForm.Type dataFormType = DataForm.Type.fromString(parser.getAttributeValue("", "type"));
DataForm.Builder dataForm = DataForm.builder(dataFormType);
String formType = null;
DataForm.ReportedData reportedData = null;
outerloop: while (true) {
XmlPullParser.Event eventType = parser.next();
switch (eventType) {
case START_ELEMENT:
String name = parser.getName();
String namespace = parser.getNamespace();
XmlEnvironment elementXmlEnvironment = XmlEnvironment.from(parser, xmlEnvironment);
switch (name) {
case "instructions":
dataForm.addInstruction(parser.nextText());
break;
case "title":
dataForm.setTitle(parser.nextText());
break;
case "field":
// Note that we parse this form field without any potential reportedData. We only use reportedData
// to lookup form field types of fields under <item/>.
FormField formField = parseField(parser, elementXmlEnvironment, formType);
TextSingleFormField hiddenFormTypeField = formField.asHiddenFormTypeFieldIfPossible();
if (hiddenFormTypeField != null) {
if (formType != null) {
throw new SmackParsingException("Multiple hidden form type fields");
}
formType = hiddenFormTypeField.getValue();
}
dataForm.addField(formField);
break;
case "item":
DataForm.Item item = parseItem(parser, elementXmlEnvironment, formType, reportedData);
dataForm.addItem(item);
break;
case "reported":
if (reportedData != null) {
throw new SmackParsingException("Data form with multiple <reported/> elements");
}
reportedData = parseReported(parser, elementXmlEnvironment, formType);
dataForm.setReportedData(reportedData);
break;
// See XEP-133 Example 32 for a corner case where the data form contains this extension.
case RosterPacket.ELEMENT:
if (namespace.equals(RosterPacket.NAMESPACE)) {
dataForm.addExtensionElement(RosterPacketProvider.INSTANCE.parse(parser));
}
break;
// See XEP-141 Data Forms Layout
case DataLayout.ELEMENT:
if (namespace.equals(DataLayout.NAMESPACE)) {
dataForm.addExtensionElement(DataLayoutProvider.parse(parser));
}
break;
}
break;
case END_ELEMENT:
if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
default:
// Catch all for incomplete switch (MissingCasesInEnumSwitch) statement.
break;
}
}
return dataForm.build();
}
private static FormField parseField(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType)
throws XmlPullParserException, IOException, SmackParsingException {
return parseField(parser, xmlEnvironment, formType, null);
}
private static final class FieldNameAndFormType {
private final String fieldName;
private final String formType;
private FieldNameAndFormType(String fieldName, String formType) {
this.fieldName = fieldName;
this.formType = formType;
}
private final HashCode.Cache hashCodeCache = new HashCode.Cache();
@Override
public int hashCode() {
return hashCodeCache.getHashCode(b ->
b.append(fieldName)
.append(formType)
.build()
);
}
@Override
public boolean equals(Object other) {
return EqualsUtil.equals(this, other, (e, o) ->
e.append(fieldName, o.fieldName)
.append(formType, o.formType)
);
}
}
private static final Set<FieldNameAndFormType> UNKNOWN_FIELDS = new CopyOnWriteArraySet<>();
private static FormField parseField(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType, DataForm.ReportedData reportedData)
throws XmlPullParserException, IOException, SmackParsingException {
final int initialDepth = parser.getDepth();
final String fieldName = parser.getAttributeValue("var");
final String label = parser.getAttributeValue("", "label");
FormField.Type type = null;
{
String fieldTypeString = parser.getAttributeValue("type");
if (fieldTypeString != null) {
type = FormField.Type.fromString(fieldTypeString);
}
}
List<FormField.Value> values = new ArrayList<>();
List<FormField.Option> options = new ArrayList<>();
List<FormFieldChildElement> childElements = new ArrayList<>();
boolean required = false;
outerloop: while (true) {
XmlPullParser.TagEvent eventType = parser.nextTag();
switch (eventType) {
case START_ELEMENT:
QName qname = parser.getQName();
if (qname.equals(FormField.Value.QNAME)) {
FormField.Value value = parseValue(parser);
values.add(value);
} else if (qname.equals(FormField.Option.QNAME)) {
FormField.Option option = parseOption(parser);
options.add(option);
} else if (qname.equals(FormField.Required.QNAME)) {
required = true;
} else {
FormFieldChildElementProvider<?> provider = FormFieldChildElementProviderManager.getFormFieldChildElementProvider(
qname);
if (provider == null) {
LOGGER.warning("Unknown form field child element " + qname + " ignored");
continue;
}
FormFieldChildElement formFieldChildElement = provider.parse(parser,
XmlEnvironment.from(parser, xmlEnvironment));
childElements.add(formFieldChildElement);
}
break;
case END_ELEMENT:
if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
}
}
// Data forms of type 'result' may contain <reported/> and <item/> elements. If this is the case, then the type
// of the <field/>s within the <item/> elements is determined by the information found in <reported/>. See
// XEP-0004 § 3.4 and SMACK-902
if (type == null && reportedData != null) {
FormField reportedFormField = reportedData.getField(fieldName);
if (reportedFormField != null) {
type = reportedFormField.getType();
}
}
if (type == null) {
// The field name 'FORM_TYPE' is magic.
if (fieldName.equals(FormField.FORM_TYPE)) {
type = FormField.Type.hidden;
} else {
// If no field type was explicitly provided, then we need to lookup the
// field's type in the registry.
type = FormFieldRegistry.lookup(formType, fieldName);
if (type == null) {
FieldNameAndFormType fieldNameAndFormType = new FieldNameAndFormType(fieldName, formType);
if (!UNKNOWN_FIELDS.contains(fieldNameAndFormType)) {
LOGGER.warning("The Field '" + fieldName + "' from FORM_TYPE '" + formType
+ "' is not registered. Field type is unknown, assuming text-single.");
UNKNOWN_FIELDS.add(fieldNameAndFormType);
}
// As per XEP-0004, text-single is the default form field type, which we use as emergency fallback here.
type = FormField.Type.text_single;
}
}
}
FormField.Builder<?, ?> builder;
switch (type) {
case bool:
builder = parseBooleanFormField(fieldName, values);
break;
case fixed:
builder = parseSingleKindFormField(FormField.fixedBuilder(fieldName), values);
break;
case hidden:
builder = parseSingleKindFormField(FormField.hiddenBuilder(fieldName), values);
break;
case jid_multi:
JidMultiFormField.Builder jidMultiBuilder = FormField.jidMultiBuilder(fieldName);
for (FormField.Value value : values) {
jidMultiBuilder.addValue(value);
}
builder = jidMultiBuilder;
break;
case jid_single:
ensureAtMostSingleValue(type, values);
JidSingleFormField.Builder jidSingleBuilder = FormField.jidSingleBuilder(fieldName);
if (!values.isEmpty()) {
FormField.Value value = values.get(0);
jidSingleBuilder.setValue(value);
}
builder = jidSingleBuilder;
break;
case list_multi:
ListMultiFormField.Builder listMultiBuilder = FormField.listMultiBuilder(fieldName);
addOptionsToBuilder(options, listMultiBuilder);
builder = parseMultiKindFormField(listMultiBuilder, values);
break;
case list_single:
ListSingleFormField.Builder listSingleBuilder = FormField.listSingleBuilder(fieldName);
addOptionsToBuilder(options, listSingleBuilder);
builder = parseSingleKindFormField(listSingleBuilder, values);
break;
case text_multi:
builder = parseMultiKindFormField(FormField.textMultiBuilder(fieldName), values);
break;
case text_private:
builder = parseSingleKindFormField(FormField.textPrivateBuilder(fieldName), values);
break;
case text_single:
builder = parseSingleKindFormField(FormField.textSingleBuilder(fieldName), values);
break;
default:
// Should never happen, as we cover all types in the switch/case.
throw new AssertionError("Unknown type " + type);
}
switch (type) {
case list_multi:
case list_single:
break;
default:
if (!options.isEmpty()) {
throw new SmackParsingException("Form fields of type " + type + " must not have options. This one had "
+ options.size());
}
break;
}
if (label != null) {
builder.setLabel(label);
}
builder.setRequired(required);
builder.addFormFieldChildElements(childElements);
return builder.build();
}
private static FormField.Builder<?, ?> parseBooleanFormField(String fieldName, List<FormField.Value> values) throws SmackParsingException {
BooleanFormField.Builder builder = FormField.booleanBuilder(fieldName);
ensureAtMostSingleValue(builder.getType(), values);
if (values.size() == 1) {
FormField.Value value = values.get(0);
builder.setValue(value);
}
return builder;
}
private static AbstractSingleStringValueFormField.Builder<?, ?> parseSingleKindFormField(
AbstractSingleStringValueFormField.Builder<?, ?> builder, List<FormField.Value> values)
throws SmackParsingException {
ensureAtMostSingleValue(builder.getType(), values);
if (values.size() == 1) {
String value = values.get(0).getValue().toString();
builder.setValue(value);
}
return builder;
}
private static AbstractMultiFormField.Builder<?, ?> parseMultiKindFormField(AbstractMultiFormField.Builder<?, ?> builder,
List<FormField.Value> values) {
for (FormField.Value value : values) {
String rawValue = value.getValue().toString();
builder.addValue(rawValue);
}
return builder;
}
private static DataForm.Item parseItem(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType,
DataForm.ReportedData reportedData)
throws XmlPullParserException, IOException, SmackParsingException {
final int initialDepth = parser.getDepth();
List<FormField> fields = new ArrayList<>();
outerloop: while (true) {
XmlPullParser.TagEvent eventType = parser.nextTag();
switch (eventType) {
case START_ELEMENT:
String name = parser.getName();
switch (name) {
case "field":
FormField field = parseField(parser, XmlEnvironment.from(parser, xmlEnvironment), formType,
reportedData);
fields.add(field);
break;
}
break;
case END_ELEMENT:
if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
}
}
return new DataForm.Item(fields);
}
private static DataForm.ReportedData parseReported(XmlPullParser parser, XmlEnvironment xmlEnvironment, String formType)
throws XmlPullParserException, IOException, SmackParsingException {
final int initialDepth = parser.getDepth();
List<FormField> fields = new ArrayList<>();
outerloop: while (true) {
XmlPullParser.TagEvent eventType = parser.nextTag();
switch (eventType) {
case START_ELEMENT:
String name = parser.getName();
switch (name) {
case "field":
FormField field = parseField(parser, XmlEnvironment.from(parser, xmlEnvironment), formType);
fields.add(field);
break;
}
break;
case END_ELEMENT:
if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
}
}
return new DataForm.ReportedData(fields);
}
public static FormField.Value parseValue(XmlPullParser parser) throws IOException, XmlPullParserException {
String value = parser.nextText();
return new FormField.Value(value);
}
public static FormField.Option parseOption(XmlPullParser parser) throws IOException, XmlPullParserException {
int initialDepth = parser.getDepth();
FormField.Option option = null;
String label = parser.getAttributeValue("", "label");
outerloop: while (true) {
XmlPullParser.TagEvent eventType = parser.nextTag();
switch (eventType) {
case START_ELEMENT:
String name = parser.getName();
switch (name) {
case "value":
option = new FormField.Option(label, parser.nextText());
break;
}
break;
case END_ELEMENT:
if (parser.getDepth() == initialDepth) {
break outerloop;
}
break;
}
}
return option;
}
private static void ensureAtMostSingleValue(FormField.Type type, List<FormField.Value> values) throws SmackParsingException {
if (values.size() > 1) {
throw new SmackParsingException(type + " fields can have at most one value, this one had " + values.size());
}
}
private static void addOptionsToBuilder(Collection<FormField.Option> options, FormFieldWithOptions.Builder<?> builder) {
for (FormField.Option option : options) {
builder.addOption(option);
}
}
}
| igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/provider/DataFormProvider.java | Java | apache-2.0 | 19,524 |
// 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/dialogflow/v2beta1/participant.proto
package dialogflow
import (
context "context"
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
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"
_ "google.golang.org/protobuf/types/known/anypb"
_ "google.golang.org/protobuf/types/known/durationpb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
structpb "google.golang.org/protobuf/types/known/structpb"
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)
)
// Enumeration of the roles a participant can play in a conversation.
type Participant_Role int32
const (
// Participant role not set.
Participant_ROLE_UNSPECIFIED Participant_Role = 0
// Participant is a human agent.
Participant_HUMAN_AGENT Participant_Role = 1
// Participant is an automated agent, such as a Dialogflow agent.
Participant_AUTOMATED_AGENT Participant_Role = 2
// Participant is an end user that has called or chatted with
// Dialogflow services.
Participant_END_USER Participant_Role = 3
)
// Enum value maps for Participant_Role.
var (
Participant_Role_name = map[int32]string{
0: "ROLE_UNSPECIFIED",
1: "HUMAN_AGENT",
2: "AUTOMATED_AGENT",
3: "END_USER",
}
Participant_Role_value = map[string]int32{
"ROLE_UNSPECIFIED": 0,
"HUMAN_AGENT": 1,
"AUTOMATED_AGENT": 2,
"END_USER": 3,
}
)
func (x Participant_Role) Enum() *Participant_Role {
p := new(Participant_Role)
*p = x
return p
}
func (x Participant_Role) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Participant_Role) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[0].Descriptor()
}
func (Participant_Role) Type() protoreflect.EnumType {
return &file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[0]
}
func (x Participant_Role) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Participant_Role.Descriptor instead.
func (Participant_Role) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{0, 0}
}
// Represents different automated agent reply types.
type AutomatedAgentReply_AutomatedAgentReplyType int32
const (
// Not specified. This should never happen.
AutomatedAgentReply_AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED AutomatedAgentReply_AutomatedAgentReplyType = 0
// Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables
// `return_partial_response` can be returned as partial reply.
// WARNING: partial reply is not eligible for barge-in.
AutomatedAgentReply_PARTIAL AutomatedAgentReply_AutomatedAgentReplyType = 1
// Final reply.
AutomatedAgentReply_FINAL AutomatedAgentReply_AutomatedAgentReplyType = 2
)
// Enum value maps for AutomatedAgentReply_AutomatedAgentReplyType.
var (
AutomatedAgentReply_AutomatedAgentReplyType_name = map[int32]string{
0: "AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED",
1: "PARTIAL",
2: "FINAL",
}
AutomatedAgentReply_AutomatedAgentReplyType_value = map[string]int32{
"AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED": 0,
"PARTIAL": 1,
"FINAL": 2,
}
)
func (x AutomatedAgentReply_AutomatedAgentReplyType) Enum() *AutomatedAgentReply_AutomatedAgentReplyType {
p := new(AutomatedAgentReply_AutomatedAgentReplyType)
*p = x
return p
}
func (x AutomatedAgentReply_AutomatedAgentReplyType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (AutomatedAgentReply_AutomatedAgentReplyType) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[1].Descriptor()
}
func (AutomatedAgentReply_AutomatedAgentReplyType) Type() protoreflect.EnumType {
return &file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[1]
}
func (x AutomatedAgentReply_AutomatedAgentReplyType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use AutomatedAgentReply_AutomatedAgentReplyType.Descriptor instead.
func (AutomatedAgentReply_AutomatedAgentReplyType) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{8, 0}
}
// Defines the type of Human Agent Assistant feature.
type SuggestionFeature_Type int32
const (
// Unspecified feature type.
SuggestionFeature_TYPE_UNSPECIFIED SuggestionFeature_Type = 0
// Run article suggestion model.
SuggestionFeature_ARTICLE_SUGGESTION SuggestionFeature_Type = 1
// Run FAQ model.
SuggestionFeature_FAQ SuggestionFeature_Type = 2
// Run smart reply model.
SuggestionFeature_SMART_REPLY SuggestionFeature_Type = 3
)
// Enum value maps for SuggestionFeature_Type.
var (
SuggestionFeature_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "ARTICLE_SUGGESTION",
2: "FAQ",
3: "SMART_REPLY",
}
SuggestionFeature_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"ARTICLE_SUGGESTION": 1,
"FAQ": 2,
"SMART_REPLY": 3,
}
)
func (x SuggestionFeature_Type) Enum() *SuggestionFeature_Type {
p := new(SuggestionFeature_Type)
*p = x
return p
}
func (x SuggestionFeature_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (SuggestionFeature_Type) Descriptor() protoreflect.EnumDescriptor {
return file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[2].Descriptor()
}
func (SuggestionFeature_Type) Type() protoreflect.EnumType {
return &file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes[2]
}
func (x SuggestionFeature_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use SuggestionFeature_Type.Descriptor instead.
func (SuggestionFeature_Type) EnumDescriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{9, 0}
}
// Represents a conversation participant (human agent, virtual agent, end-user).
type Participant struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Optional. The unique identifier of this participant.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Immutable. The role this participant plays in the conversation. This field must be set
// during participant creation and is then immutable.
Role Participant_Role `protobuf:"varint,2,opt,name=role,proto3,enum=google.cloud.dialogflow.v2beta1.Participant_Role" json:"role,omitempty"`
// Optional. Obfuscated user id that should be associated with the created participant.
//
// You can specify a user id as follows:
//
// 1. If you set this field in
// [CreateParticipantRequest][google.cloud.dialogflow.v2beta1.CreateParticipantRequest.participant] or
// [UpdateParticipantRequest][google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.participant],
// Dialogflow adds the obfuscated user id with the participant.
//
// 2. If you set this field in
// [AnalyzeContent][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.obfuscated_external_user_id] or
// [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
// Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2beta1.Participant.obfuscated_external_user_id].
//
// Dialogflow uses this user id for following purposes:
// 1) Billing and measurement. If user with the same
// obfuscated_external_user_id is created in a later conversation, dialogflow
// will know it's the same user. 2) Agent assist suggestion personalization.
// For example, Dialogflow can use it to provide personalized smart reply
// suggestions for this user.
//
// Note:
//
// * Please never pass raw user ids to Dialogflow. Always obfuscate your user
// id first.
// * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
// hash function like SHA-512.
// * The length of the user id must be <= 256 characters.
ObfuscatedExternalUserId string `protobuf:"bytes,7,opt,name=obfuscated_external_user_id,json=obfuscatedExternalUserId,proto3" json:"obfuscated_external_user_id,omitempty"`
// Optional. Key-value filters on the metadata of documents returned by article
// suggestion. If specified, article suggestion only returns suggested
// documents that match all filters in their [Document.metadata][google.cloud.dialogflow.v2beta1.Document.metadata]. Multiple
// values for a metadata key should be concatenated by comma. For example,
// filters to match all documents that have 'US' or 'CA' in their market
// metadata values and 'agent' in their user metadata values will be
// ```
// documents_metadata_filters {
// key: "market"
// value: "US,CA"
// }
// documents_metadata_filters {
// key: "user"
// value: "agent"
// }
// ```
DocumentsMetadataFilters map[string]string `protobuf:"bytes,8,rep,name=documents_metadata_filters,json=documentsMetadataFilters,proto3" json:"documents_metadata_filters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *Participant) Reset() {
*x = Participant{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Participant) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Participant) ProtoMessage() {}
func (x *Participant) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 Participant.ProtoReflect.Descriptor instead.
func (*Participant) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{0}
}
func (x *Participant) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Participant) GetRole() Participant_Role {
if x != nil {
return x.Role
}
return Participant_ROLE_UNSPECIFIED
}
func (x *Participant) GetObfuscatedExternalUserId() string {
if x != nil {
return x.ObfuscatedExternalUserId
}
return ""
}
func (x *Participant) GetDocumentsMetadataFilters() map[string]string {
if x != nil {
return x.DocumentsMetadataFilters
}
return nil
}
// Represents a message posted into a conversation.
type Message struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Optional. The unique identifier of the message.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Required. The message content.
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
// Optional. The message language.
// This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
// language tag. Example: "en-US".
LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"`
// Output only. The participant that sends this message.
Participant string `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"`
// Output only. The role of the participant.
ParticipantRole Participant_Role `protobuf:"varint,5,opt,name=participant_role,json=participantRole,proto3,enum=google.cloud.dialogflow.v2beta1.Participant_Role" json:"participant_role,omitempty"`
// Output only. The time when the message was created in Contact Center AI.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Optional. The time when the message was sent.
SendTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=send_time,json=sendTime,proto3" json:"send_time,omitempty"`
// Output only. The annotation for the message.
MessageAnnotation *MessageAnnotation `protobuf:"bytes,7,opt,name=message_annotation,json=messageAnnotation,proto3" json:"message_annotation,omitempty"`
// Output only. The sentiment analysis result for the message.
SentimentAnalysis *SentimentAnalysisResult `protobuf:"bytes,8,opt,name=sentiment_analysis,json=sentimentAnalysis,proto3" json:"sentiment_analysis,omitempty"`
}
func (x *Message) Reset() {
*x = Message{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Message) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Message) ProtoMessage() {}
func (x *Message) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 Message.ProtoReflect.Descriptor instead.
func (*Message) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{1}
}
func (x *Message) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Message) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *Message) GetLanguageCode() string {
if x != nil {
return x.LanguageCode
}
return ""
}
func (x *Message) GetParticipant() string {
if x != nil {
return x.Participant
}
return ""
}
func (x *Message) GetParticipantRole() Participant_Role {
if x != nil {
return x.ParticipantRole
}
return Participant_ROLE_UNSPECIFIED
}
func (x *Message) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *Message) GetSendTime() *timestamppb.Timestamp {
if x != nil {
return x.SendTime
}
return nil
}
func (x *Message) GetMessageAnnotation() *MessageAnnotation {
if x != nil {
return x.MessageAnnotation
}
return nil
}
func (x *Message) GetSentimentAnalysis() *SentimentAnalysisResult {
if x != nil {
return x.SentimentAnalysis
}
return nil
}
// The request message for [Participants.CreateParticipant][google.cloud.dialogflow.v2beta1.Participants.CreateParticipant].
type CreateParticipantRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. Resource identifier of the conversation adding the participant.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Required. The participant to create.
Participant *Participant `protobuf:"bytes,2,opt,name=participant,proto3" json:"participant,omitempty"`
}
func (x *CreateParticipantRequest) Reset() {
*x = CreateParticipantRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateParticipantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateParticipantRequest) ProtoMessage() {}
func (x *CreateParticipantRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 CreateParticipantRequest.ProtoReflect.Descriptor instead.
func (*CreateParticipantRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{2}
}
func (x *CreateParticipantRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CreateParticipantRequest) GetParticipant() *Participant {
if x != nil {
return x.Participant
}
return nil
}
// The request message for [Participants.GetParticipant][google.cloud.dialogflow.v2beta1.Participants.GetParticipant].
type GetParticipantRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant. Format:
// `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
// ID>/participants/<Participant ID>`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
}
func (x *GetParticipantRequest) Reset() {
*x = GetParticipantRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetParticipantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetParticipantRequest) ProtoMessage() {}
func (x *GetParticipantRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 GetParticipantRequest.ProtoReflect.Descriptor instead.
func (*GetParticipantRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{3}
}
func (x *GetParticipantRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// The request message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants].
type ListParticipantsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The conversation to list all participants from.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The maximum number of items to return in a single page. By
// default 100 and at most 1000.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. The next_page_token value returned from a previous list request.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
}
func (x *ListParticipantsRequest) Reset() {
*x = ListParticipantsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListParticipantsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListParticipantsRequest) ProtoMessage() {}
func (x *ListParticipantsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ListParticipantsRequest.ProtoReflect.Descriptor instead.
func (*ListParticipantsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{4}
}
func (x *ListParticipantsRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ListParticipantsRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListParticipantsRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
// The response message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants].
type ListParticipantsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The list of participants. There is a maximum number of items
// returned based on the page_size field in the request.
Participants []*Participant `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"`
// Token to retrieve the next page of results or empty if there are no
// more results in the list.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *ListParticipantsResponse) Reset() {
*x = ListParticipantsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListParticipantsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListParticipantsResponse) ProtoMessage() {}
func (x *ListParticipantsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ListParticipantsResponse.ProtoReflect.Descriptor instead.
func (*ListParticipantsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{5}
}
func (x *ListParticipantsResponse) GetParticipants() []*Participant {
if x != nil {
return x.Participants
}
return nil
}
func (x *ListParticipantsResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The request message for [Participants.UpdateParticipant][google.cloud.dialogflow.v2beta1.Participants.UpdateParticipant].
type UpdateParticipantRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The participant to update.
Participant *Participant `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
// Required. The mask to specify which fields to update.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
}
func (x *UpdateParticipantRequest) Reset() {
*x = UpdateParticipantRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateParticipantRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateParticipantRequest) ProtoMessage() {}
func (x *UpdateParticipantRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 UpdateParticipantRequest.ProtoReflect.Descriptor instead.
func (*UpdateParticipantRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{6}
}
func (x *UpdateParticipantRequest) GetParticipant() *Participant {
if x != nil {
return x.Participant
}
return nil
}
func (x *UpdateParticipantRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.UpdateMask
}
return nil
}
// Represents the natural language speech audio to be played to the end user.
type OutputAudio struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. Instructs the speech synthesizer how to generate the speech
// audio.
Config *OutputAudioConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
// Required. The natural language speech audio.
Audio []byte `protobuf:"bytes,2,opt,name=audio,proto3" json:"audio,omitempty"`
}
func (x *OutputAudio) Reset() {
*x = OutputAudio{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OutputAudio) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OutputAudio) ProtoMessage() {}
func (x *OutputAudio) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 OutputAudio.ProtoReflect.Descriptor instead.
func (*OutputAudio) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{7}
}
func (x *OutputAudio) GetConfig() *OutputAudioConfig {
if x != nil {
return x.Config
}
return nil
}
func (x *OutputAudio) GetAudio() []byte {
if x != nil {
return x.Audio
}
return nil
}
// Represents a response from an automated agent.
type AutomatedAgentReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required.
//
// Types that are assignable to Response:
// *AutomatedAgentReply_DetectIntentResponse
Response isAutomatedAgentReply_Response `protobuf_oneof:"response"`
// Response messages from the automated agent.
ResponseMessages []*ResponseMessage `protobuf:"bytes,3,rep,name=response_messages,json=responseMessages,proto3" json:"response_messages,omitempty"`
// Info on the query match for the automated agent response.
//
// Types that are assignable to Match:
// *AutomatedAgentReply_Intent
// *AutomatedAgentReply_Event
Match isAutomatedAgentReply_Match `protobuf_oneof:"match"`
// The confidence of the match. Values range from 0.0 (completely uncertain)
// to 1.0 (completely certain).
// This value is for informational purpose only and is only used to help match
// the best intent within the classification threshold. This value may change
// for the same end-user expression at any time due to a model retraining or
// change in implementation.
MatchConfidence float32 `protobuf:"fixed32,9,opt,name=match_confidence,json=matchConfidence,proto3" json:"match_confidence,omitempty"`
// The collection of current parameters at the time of this response.
Parameters *structpb.Struct `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"`
// The collection of current Dialogflow CX agent session parameters at the
// time of this response.
// Deprecated: Use `parameters` instead.
//
// Deprecated: Do not use.
CxSessionParameters *structpb.Struct `protobuf:"bytes,6,opt,name=cx_session_parameters,json=cxSessionParameters,proto3" json:"cx_session_parameters,omitempty"`
// AutomatedAgentReply type.
AutomatedAgentReplyType AutomatedAgentReply_AutomatedAgentReplyType `protobuf:"varint,7,opt,name=automated_agent_reply_type,json=automatedAgentReplyType,proto3,enum=google.cloud.dialogflow.v2beta1.AutomatedAgentReply_AutomatedAgentReplyType" json:"automated_agent_reply_type,omitempty"`
// Indicates whether the partial automated agent reply is interruptible when a
// later reply message arrives. e.g. if the agent specified some music as
// partial response, it can be cancelled.
AllowCancellation bool `protobuf:"varint,8,opt,name=allow_cancellation,json=allowCancellation,proto3" json:"allow_cancellation,omitempty"`
}
func (x *AutomatedAgentReply) Reset() {
*x = AutomatedAgentReply{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AutomatedAgentReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AutomatedAgentReply) ProtoMessage() {}
func (x *AutomatedAgentReply) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 AutomatedAgentReply.ProtoReflect.Descriptor instead.
func (*AutomatedAgentReply) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{8}
}
func (m *AutomatedAgentReply) GetResponse() isAutomatedAgentReply_Response {
if m != nil {
return m.Response
}
return nil
}
func (x *AutomatedAgentReply) GetDetectIntentResponse() *DetectIntentResponse {
if x, ok := x.GetResponse().(*AutomatedAgentReply_DetectIntentResponse); ok {
return x.DetectIntentResponse
}
return nil
}
func (x *AutomatedAgentReply) GetResponseMessages() []*ResponseMessage {
if x != nil {
return x.ResponseMessages
}
return nil
}
func (m *AutomatedAgentReply) GetMatch() isAutomatedAgentReply_Match {
if m != nil {
return m.Match
}
return nil
}
func (x *AutomatedAgentReply) GetIntent() string {
if x, ok := x.GetMatch().(*AutomatedAgentReply_Intent); ok {
return x.Intent
}
return ""
}
func (x *AutomatedAgentReply) GetEvent() string {
if x, ok := x.GetMatch().(*AutomatedAgentReply_Event); ok {
return x.Event
}
return ""
}
func (x *AutomatedAgentReply) GetMatchConfidence() float32 {
if x != nil {
return x.MatchConfidence
}
return 0
}
func (x *AutomatedAgentReply) GetParameters() *structpb.Struct {
if x != nil {
return x.Parameters
}
return nil
}
// Deprecated: Do not use.
func (x *AutomatedAgentReply) GetCxSessionParameters() *structpb.Struct {
if x != nil {
return x.CxSessionParameters
}
return nil
}
func (x *AutomatedAgentReply) GetAutomatedAgentReplyType() AutomatedAgentReply_AutomatedAgentReplyType {
if x != nil {
return x.AutomatedAgentReplyType
}
return AutomatedAgentReply_AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED
}
func (x *AutomatedAgentReply) GetAllowCancellation() bool {
if x != nil {
return x.AllowCancellation
}
return false
}
type isAutomatedAgentReply_Response interface {
isAutomatedAgentReply_Response()
}
type AutomatedAgentReply_DetectIntentResponse struct {
// Response of the Dialogflow [Sessions.DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] call.
DetectIntentResponse *DetectIntentResponse `protobuf:"bytes,1,opt,name=detect_intent_response,json=detectIntentResponse,proto3,oneof"`
}
func (*AutomatedAgentReply_DetectIntentResponse) isAutomatedAgentReply_Response() {}
type isAutomatedAgentReply_Match interface {
isAutomatedAgentReply_Match()
}
type AutomatedAgentReply_Intent struct {
// Name of the intent if an intent is matched for the query.
// For a V2 query, the value format is `projects/<Project ID>/locations/
// <Location ID>/agent/intents/<Intent ID>`.
// For a V3 query, the value format is `projects/<Project ID>/locations/
// <Location ID>/agents/<Agent ID>/intents/<Intent ID>`.
Intent string `protobuf:"bytes,4,opt,name=intent,proto3,oneof"`
}
type AutomatedAgentReply_Event struct {
// Event name if an event is triggered for the query.
Event string `protobuf:"bytes,5,opt,name=event,proto3,oneof"`
}
func (*AutomatedAgentReply_Intent) isAutomatedAgentReply_Match() {}
func (*AutomatedAgentReply_Event) isAutomatedAgentReply_Match() {}
// The type of Human Agent Assistant API suggestion to perform, and the maximum
// number of results to return for that type. Multiple `Feature` objects can
// be specified in the `features` list.
type SuggestionFeature struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Type of Human Agent Assistant API feature to request.
Type SuggestionFeature_Type `protobuf:"varint,1,opt,name=type,proto3,enum=google.cloud.dialogflow.v2beta1.SuggestionFeature_Type" json:"type,omitempty"`
}
func (x *SuggestionFeature) Reset() {
*x = SuggestionFeature{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestionFeature) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestionFeature) ProtoMessage() {}
func (x *SuggestionFeature) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestionFeature.ProtoReflect.Descriptor instead.
func (*SuggestionFeature) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{9}
}
func (x *SuggestionFeature) GetType() SuggestionFeature_Type {
if x != nil {
return x.Type
}
return SuggestionFeature_TYPE_UNSPECIFIED
}
// Represents the parameters of human assist query.
type AssistQueryParameters struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Key-value filters on the metadata of documents returned by article
// suggestion. If specified, article suggestion only returns suggested
// documents that match all filters in their [Document.metadata][google.cloud.dialogflow.v2beta1.Document.metadata]. Multiple
// values for a metadata key should be concatenated by comma. For example,
// filters to match all documents that have 'US' or 'CA' in their market
// metadata values and 'agent' in their user metadata values will be
// ```
// documents_metadata_filters {
// key: "market"
// value: "US,CA"
// }
// documents_metadata_filters {
// key: "user"
// value: "agent"
// }
// ```
DocumentsMetadataFilters map[string]string `protobuf:"bytes,1,rep,name=documents_metadata_filters,json=documentsMetadataFilters,proto3" json:"documents_metadata_filters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *AssistQueryParameters) Reset() {
*x = AssistQueryParameters{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AssistQueryParameters) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AssistQueryParameters) ProtoMessage() {}
func (x *AssistQueryParameters) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 AssistQueryParameters.ProtoReflect.Descriptor instead.
func (*AssistQueryParameters) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{10}
}
func (x *AssistQueryParameters) GetDocumentsMetadataFilters() map[string]string {
if x != nil {
return x.DocumentsMetadataFilters
}
return nil
}
// The request message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent].
type AnalyzeContentRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant this text comes from.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Participant string `protobuf:"bytes,1,opt,name=participant,proto3" json:"participant,omitempty"`
// Required. The input content.
//
// Types that are assignable to Input:
// *AnalyzeContentRequest_TextInput
// *AnalyzeContentRequest_EventInput
Input isAnalyzeContentRequest_Input `protobuf_oneof:"input"`
// Speech synthesis configuration.
// The speech synthesis settings for a virtual agent that may be configured
// for the associated conversation profile are not used when calling
// AnalyzeContent. If this configuration is not supplied, speech synthesis
// is disabled.
ReplyAudioConfig *OutputAudioConfig `protobuf:"bytes,5,opt,name=reply_audio_config,json=replyAudioConfig,proto3" json:"reply_audio_config,omitempty"`
// Parameters for a Dialogflow virtual-agent query.
QueryParams *QueryParameters `protobuf:"bytes,9,opt,name=query_params,json=queryParams,proto3" json:"query_params,omitempty"`
// Parameters for a human assist query.
AssistQueryParams *AssistQueryParameters `protobuf:"bytes,14,opt,name=assist_query_params,json=assistQueryParams,proto3" json:"assist_query_params,omitempty"`
// Optional. The send time of the message from end user or human agent's
// perspective. It is used for identifying the same message under one
// participant.
//
// Given two messages under the same participant:
// - If send time are different regardless of whether the content of the
// messages are exactly the same, the conversation will regard them as
// two distinct messages sent by the participant.
// - If send time is the same regardless of whether the content of the
// messages are exactly the same, the conversation will regard them as
// same message, and ignore the message received later.
//
// If the value is not provided, a new request will always be regarded as a
// new message without any de-duplication.
MessageSendTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=message_send_time,json=messageSendTime,proto3" json:"message_send_time,omitempty"`
// A unique identifier for this request. Restricted to 36 ASCII characters.
// A random UUID is recommended.
// This request is only idempotent if a `request_id` is provided.
RequestId string `protobuf:"bytes,11,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
}
func (x *AnalyzeContentRequest) Reset() {
*x = AnalyzeContentRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AnalyzeContentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AnalyzeContentRequest) ProtoMessage() {}
func (x *AnalyzeContentRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 AnalyzeContentRequest.ProtoReflect.Descriptor instead.
func (*AnalyzeContentRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{11}
}
func (x *AnalyzeContentRequest) GetParticipant() string {
if x != nil {
return x.Participant
}
return ""
}
func (m *AnalyzeContentRequest) GetInput() isAnalyzeContentRequest_Input {
if m != nil {
return m.Input
}
return nil
}
func (x *AnalyzeContentRequest) GetTextInput() *TextInput {
if x, ok := x.GetInput().(*AnalyzeContentRequest_TextInput); ok {
return x.TextInput
}
return nil
}
func (x *AnalyzeContentRequest) GetEventInput() *EventInput {
if x, ok := x.GetInput().(*AnalyzeContentRequest_EventInput); ok {
return x.EventInput
}
return nil
}
func (x *AnalyzeContentRequest) GetReplyAudioConfig() *OutputAudioConfig {
if x != nil {
return x.ReplyAudioConfig
}
return nil
}
func (x *AnalyzeContentRequest) GetQueryParams() *QueryParameters {
if x != nil {
return x.QueryParams
}
return nil
}
func (x *AnalyzeContentRequest) GetAssistQueryParams() *AssistQueryParameters {
if x != nil {
return x.AssistQueryParams
}
return nil
}
func (x *AnalyzeContentRequest) GetMessageSendTime() *timestamppb.Timestamp {
if x != nil {
return x.MessageSendTime
}
return nil
}
func (x *AnalyzeContentRequest) GetRequestId() string {
if x != nil {
return x.RequestId
}
return ""
}
type isAnalyzeContentRequest_Input interface {
isAnalyzeContentRequest_Input()
}
type AnalyzeContentRequest_TextInput struct {
// The natural language text to be processed.
TextInput *TextInput `protobuf:"bytes,6,opt,name=text_input,json=textInput,proto3,oneof"`
}
type AnalyzeContentRequest_EventInput struct {
// An input event to send to Dialogflow.
EventInput *EventInput `protobuf:"bytes,8,opt,name=event_input,json=eventInput,proto3,oneof"`
}
func (*AnalyzeContentRequest_TextInput) isAnalyzeContentRequest_Input() {}
func (*AnalyzeContentRequest_EventInput) isAnalyzeContentRequest_Input() {}
// The message in the response that indicates the parameters of DTMF.
type DtmfParameters struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Indicates whether DTMF input can be handled in the next request.
AcceptsDtmfInput bool `protobuf:"varint,1,opt,name=accepts_dtmf_input,json=acceptsDtmfInput,proto3" json:"accepts_dtmf_input,omitempty"`
}
func (x *DtmfParameters) Reset() {
*x = DtmfParameters{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DtmfParameters) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DtmfParameters) ProtoMessage() {}
func (x *DtmfParameters) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 DtmfParameters.ProtoReflect.Descriptor instead.
func (*DtmfParameters) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{12}
}
func (x *DtmfParameters) GetAcceptsDtmfInput() bool {
if x != nil {
return x.AcceptsDtmfInput
}
return false
}
// The response message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent].
type AnalyzeContentResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The output text content.
// This field is set if the automated agent responded with text to show to
// the user.
ReplyText string `protobuf:"bytes,1,opt,name=reply_text,json=replyText,proto3" json:"reply_text,omitempty"`
// Optional. The audio data bytes encoded as specified in the request.
// This field is set if:
//
// - `reply_audio_config` was specified in the request, or
// - The automated agent responded with audio to play to the user. In such
// case, `reply_audio.config` contains settings used to synthesize the
// speech.
//
// In some scenarios, multiple output audio fields may be present in the
// response structure. In these cases, only the top-most-level audio output
// has content.
ReplyAudio *OutputAudio `protobuf:"bytes,2,opt,name=reply_audio,json=replyAudio,proto3" json:"reply_audio,omitempty"`
// Optional. Only set if a Dialogflow automated agent has responded.
// Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
// and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
// are always empty, use [reply_audio][google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.reply_audio] instead.
AutomatedAgentReply *AutomatedAgentReply `protobuf:"bytes,3,opt,name=automated_agent_reply,json=automatedAgentReply,proto3" json:"automated_agent_reply,omitempty"`
// Output only. Message analyzed by CCAI.
Message *Message `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
// The suggestions for most recent human agent. The order is the same as
// [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
// [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.human_agent_suggestion_config].
HumanAgentSuggestionResults []*SuggestionResult `protobuf:"bytes,6,rep,name=human_agent_suggestion_results,json=humanAgentSuggestionResults,proto3" json:"human_agent_suggestion_results,omitempty"`
// The suggestions for end user. The order is the same as
// [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
// [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.end_user_suggestion_config].
EndUserSuggestionResults []*SuggestionResult `protobuf:"bytes,7,rep,name=end_user_suggestion_results,json=endUserSuggestionResults,proto3" json:"end_user_suggestion_results,omitempty"`
// Indicates the parameters of DTMF.
DtmfParameters *DtmfParameters `protobuf:"bytes,9,opt,name=dtmf_parameters,json=dtmfParameters,proto3" json:"dtmf_parameters,omitempty"`
}
func (x *AnalyzeContentResponse) Reset() {
*x = AnalyzeContentResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AnalyzeContentResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AnalyzeContentResponse) ProtoMessage() {}
func (x *AnalyzeContentResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 AnalyzeContentResponse.ProtoReflect.Descriptor instead.
func (*AnalyzeContentResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{13}
}
func (x *AnalyzeContentResponse) GetReplyText() string {
if x != nil {
return x.ReplyText
}
return ""
}
func (x *AnalyzeContentResponse) GetReplyAudio() *OutputAudio {
if x != nil {
return x.ReplyAudio
}
return nil
}
func (x *AnalyzeContentResponse) GetAutomatedAgentReply() *AutomatedAgentReply {
if x != nil {
return x.AutomatedAgentReply
}
return nil
}
func (x *AnalyzeContentResponse) GetMessage() *Message {
if x != nil {
return x.Message
}
return nil
}
func (x *AnalyzeContentResponse) GetHumanAgentSuggestionResults() []*SuggestionResult {
if x != nil {
return x.HumanAgentSuggestionResults
}
return nil
}
func (x *AnalyzeContentResponse) GetEndUserSuggestionResults() []*SuggestionResult {
if x != nil {
return x.EndUserSuggestionResults
}
return nil
}
func (x *AnalyzeContentResponse) GetDtmfParameters() *DtmfParameters {
if x != nil {
return x.DtmfParameters
}
return nil
}
// Represents a part of a message possibly annotated with an entity. The part
// can be an entity or purely a part of the message between two entities or
// message start/end.
type AnnotatedMessagePart struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. A part of a message possibly annotated with an entity.
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
// Optional. The [Dialogflow system entity
// type](https://cloud.google.com/dialogflow/docs/reference/system-entities)
// of this message part. If this is empty, Dialogflow could not annotate the
// phrase part with a system entity.
EntityType string `protobuf:"bytes,2,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"`
// Optional. The [Dialogflow system entity formatted value
// ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of
// this message part. For example for a system entity of type
// `@sys.unit-currency`, this may contain:
// <pre>
// {
// "amount": 5,
// "currency": "USD"
// }
// </pre>
FormattedValue *structpb.Value `protobuf:"bytes,3,opt,name=formatted_value,json=formattedValue,proto3" json:"formatted_value,omitempty"`
}
func (x *AnnotatedMessagePart) Reset() {
*x = AnnotatedMessagePart{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AnnotatedMessagePart) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AnnotatedMessagePart) ProtoMessage() {}
func (x *AnnotatedMessagePart) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 AnnotatedMessagePart.ProtoReflect.Descriptor instead.
func (*AnnotatedMessagePart) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{14}
}
func (x *AnnotatedMessagePart) GetText() string {
if x != nil {
return x.Text
}
return ""
}
func (x *AnnotatedMessagePart) GetEntityType() string {
if x != nil {
return x.EntityType
}
return ""
}
func (x *AnnotatedMessagePart) GetFormattedValue() *structpb.Value {
if x != nil {
return x.FormattedValue
}
return nil
}
// Represents the result of annotation for the message.
type MessageAnnotation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Optional. The collection of annotated message parts ordered by their
// position in the message. You can recover the annotated message by
// concatenating [AnnotatedMessagePart.text].
Parts []*AnnotatedMessagePart `protobuf:"bytes,1,rep,name=parts,proto3" json:"parts,omitempty"`
// Required. Indicates whether the text message contains entities.
ContainEntities bool `protobuf:"varint,2,opt,name=contain_entities,json=containEntities,proto3" json:"contain_entities,omitempty"`
}
func (x *MessageAnnotation) Reset() {
*x = MessageAnnotation{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageAnnotation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageAnnotation) ProtoMessage() {}
func (x *MessageAnnotation) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 MessageAnnotation.ProtoReflect.Descriptor instead.
func (*MessageAnnotation) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{15}
}
func (x *MessageAnnotation) GetParts() []*AnnotatedMessagePart {
if x != nil {
return x.Parts
}
return nil
}
func (x *MessageAnnotation) GetContainEntities() bool {
if x != nil {
return x.ContainEntities
}
return false
}
// Represents article answer.
type ArticleAnswer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The article title.
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// The article URI.
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
// Output only. Article snippets.
Snippets []string `protobuf:"bytes,3,rep,name=snippets,proto3" json:"snippets,omitempty"`
// A map that contains metadata about the answer and the
// document from which it originates.
Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// The name of answer record, in the format of
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
// ID>"
AnswerRecord string `protobuf:"bytes,6,opt,name=answer_record,json=answerRecord,proto3" json:"answer_record,omitempty"`
}
func (x *ArticleAnswer) Reset() {
*x = ArticleAnswer{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ArticleAnswer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ArticleAnswer) ProtoMessage() {}
func (x *ArticleAnswer) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ArticleAnswer.ProtoReflect.Descriptor instead.
func (*ArticleAnswer) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{16}
}
func (x *ArticleAnswer) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *ArticleAnswer) GetUri() string {
if x != nil {
return x.Uri
}
return ""
}
func (x *ArticleAnswer) GetSnippets() []string {
if x != nil {
return x.Snippets
}
return nil
}
func (x *ArticleAnswer) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
func (x *ArticleAnswer) GetAnswerRecord() string {
if x != nil {
return x.AnswerRecord
}
return ""
}
// Represents answer from "frequently asked questions".
type FaqAnswer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The piece of text from the `source` knowledge base document.
Answer string `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
// The system's confidence score that this Knowledge answer is a good match
// for this conversational query, range from 0.0 (completely uncertain)
// to 1.0 (completely certain).
Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
// The corresponding FAQ question.
Question string `protobuf:"bytes,3,opt,name=question,proto3" json:"question,omitempty"`
// Indicates which Knowledge Document this answer was extracted
// from.
// Format: `projects/<Project ID>/locations/<Location
// ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"`
// A map that contains metadata about the answer and the
// document from which it originates.
Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// The name of answer record, in the format of
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
// ID>"
AnswerRecord string `protobuf:"bytes,6,opt,name=answer_record,json=answerRecord,proto3" json:"answer_record,omitempty"`
}
func (x *FaqAnswer) Reset() {
*x = FaqAnswer{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FaqAnswer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FaqAnswer) ProtoMessage() {}
func (x *FaqAnswer) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 FaqAnswer.ProtoReflect.Descriptor instead.
func (*FaqAnswer) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{17}
}
func (x *FaqAnswer) GetAnswer() string {
if x != nil {
return x.Answer
}
return ""
}
func (x *FaqAnswer) GetConfidence() float32 {
if x != nil {
return x.Confidence
}
return 0
}
func (x *FaqAnswer) GetQuestion() string {
if x != nil {
return x.Question
}
return ""
}
func (x *FaqAnswer) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
func (x *FaqAnswer) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
func (x *FaqAnswer) GetAnswerRecord() string {
if x != nil {
return x.AnswerRecord
}
return ""
}
// Represents a smart reply answer.
type SmartReplyAnswer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The content of the reply.
Reply string `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"`
// Smart reply confidence.
// The system's confidence score that this reply is a good match for
// this conversation, as a value from 0.0 (completely uncertain) to 1.0
// (completely certain).
Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
// The name of answer record, in the format of
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record
// ID>"
AnswerRecord string `protobuf:"bytes,3,opt,name=answer_record,json=answerRecord,proto3" json:"answer_record,omitempty"`
}
func (x *SmartReplyAnswer) Reset() {
*x = SmartReplyAnswer{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SmartReplyAnswer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SmartReplyAnswer) ProtoMessage() {}
func (x *SmartReplyAnswer) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SmartReplyAnswer.ProtoReflect.Descriptor instead.
func (*SmartReplyAnswer) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{18}
}
func (x *SmartReplyAnswer) GetReply() string {
if x != nil {
return x.Reply
}
return ""
}
func (x *SmartReplyAnswer) GetConfidence() float32 {
if x != nil {
return x.Confidence
}
return 0
}
func (x *SmartReplyAnswer) GetAnswerRecord() string {
if x != nil {
return x.AnswerRecord
}
return ""
}
// One response of different type of suggestion response which is used in
// the response of [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] and
// [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent], as well as [HumanAgentAssistantEvent][google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent].
type SuggestionResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Different type of suggestion response.
//
// Types that are assignable to SuggestionResponse:
// *SuggestionResult_Error
// *SuggestionResult_SuggestArticlesResponse
// *SuggestionResult_SuggestFaqAnswersResponse
// *SuggestionResult_SuggestSmartRepliesResponse
SuggestionResponse isSuggestionResult_SuggestionResponse `protobuf_oneof:"suggestion_response"`
}
func (x *SuggestionResult) Reset() {
*x = SuggestionResult{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestionResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestionResult) ProtoMessage() {}
func (x *SuggestionResult) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestionResult.ProtoReflect.Descriptor instead.
func (*SuggestionResult) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{19}
}
func (m *SuggestionResult) GetSuggestionResponse() isSuggestionResult_SuggestionResponse {
if m != nil {
return m.SuggestionResponse
}
return nil
}
func (x *SuggestionResult) GetError() *status.Status {
if x, ok := x.GetSuggestionResponse().(*SuggestionResult_Error); ok {
return x.Error
}
return nil
}
func (x *SuggestionResult) GetSuggestArticlesResponse() *SuggestArticlesResponse {
if x, ok := x.GetSuggestionResponse().(*SuggestionResult_SuggestArticlesResponse); ok {
return x.SuggestArticlesResponse
}
return nil
}
func (x *SuggestionResult) GetSuggestFaqAnswersResponse() *SuggestFaqAnswersResponse {
if x, ok := x.GetSuggestionResponse().(*SuggestionResult_SuggestFaqAnswersResponse); ok {
return x.SuggestFaqAnswersResponse
}
return nil
}
func (x *SuggestionResult) GetSuggestSmartRepliesResponse() *SuggestSmartRepliesResponse {
if x, ok := x.GetSuggestionResponse().(*SuggestionResult_SuggestSmartRepliesResponse); ok {
return x.SuggestSmartRepliesResponse
}
return nil
}
type isSuggestionResult_SuggestionResponse interface {
isSuggestionResult_SuggestionResponse()
}
type SuggestionResult_Error struct {
// Error status if the request failed.
Error *status.Status `protobuf:"bytes,1,opt,name=error,proto3,oneof"`
}
type SuggestionResult_SuggestArticlesResponse struct {
// SuggestArticlesResponse if request is for ARTICLE_SUGGESTION.
SuggestArticlesResponse *SuggestArticlesResponse `protobuf:"bytes,2,opt,name=suggest_articles_response,json=suggestArticlesResponse,proto3,oneof"`
}
type SuggestionResult_SuggestFaqAnswersResponse struct {
// SuggestFaqAnswersResponse if request is for FAQ_ANSWER.
SuggestFaqAnswersResponse *SuggestFaqAnswersResponse `protobuf:"bytes,3,opt,name=suggest_faq_answers_response,json=suggestFaqAnswersResponse,proto3,oneof"`
}
type SuggestionResult_SuggestSmartRepliesResponse struct {
// SuggestSmartRepliesResponse if request is for SMART_REPLY.
SuggestSmartRepliesResponse *SuggestSmartRepliesResponse `protobuf:"bytes,4,opt,name=suggest_smart_replies_response,json=suggestSmartRepliesResponse,proto3,oneof"`
}
func (*SuggestionResult_Error) isSuggestionResult_SuggestionResponse() {}
func (*SuggestionResult_SuggestArticlesResponse) isSuggestionResult_SuggestionResponse() {}
func (*SuggestionResult_SuggestFaqAnswersResponse) isSuggestionResult_SuggestionResponse() {}
func (*SuggestionResult_SuggestSmartRepliesResponse) isSuggestionResult_SuggestionResponse() {}
// The request message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles].
type SuggestArticlesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant to fetch suggestion for.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The name of the latest conversation message to compile suggestion
// for. If empty, it will be the latest message of the conversation.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Optional. Max number of messages prior to and including
// [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message] to use as context
// when compiling the suggestion. By default 20 and at most 50.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
// Optional. Parameters for a human assist query.
AssistQueryParams *AssistQueryParameters `protobuf:"bytes,4,opt,name=assist_query_params,json=assistQueryParams,proto3" json:"assist_query_params,omitempty"`
}
func (x *SuggestArticlesRequest) Reset() {
*x = SuggestArticlesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestArticlesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestArticlesRequest) ProtoMessage() {}
func (x *SuggestArticlesRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestArticlesRequest.ProtoReflect.Descriptor instead.
func (*SuggestArticlesRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{20}
}
func (x *SuggestArticlesRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *SuggestArticlesRequest) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestArticlesRequest) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
func (x *SuggestArticlesRequest) GetAssistQueryParams() *AssistQueryParameters {
if x != nil {
return x.AssistQueryParams
}
return nil
}
// The response message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles].
type SuggestArticlesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Articles ordered by score in descending order.
ArticleAnswers []*ArticleAnswer `protobuf:"bytes,1,rep,name=article_answers,json=articleAnswers,proto3" json:"article_answers,omitempty"`
// The name of the latest conversation message used to compile
// suggestion for.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Number of messages prior to and including
// [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.latest_message] to compile the
// suggestion. It may be smaller than the
// [SuggestArticlesResponse.context_size][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.context_size] field in the request if there
// aren't that many messages in the conversation.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *SuggestArticlesResponse) Reset() {
*x = SuggestArticlesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestArticlesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestArticlesResponse) ProtoMessage() {}
func (x *SuggestArticlesResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestArticlesResponse.ProtoReflect.Descriptor instead.
func (*SuggestArticlesResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{21}
}
func (x *SuggestArticlesResponse) GetArticleAnswers() []*ArticleAnswer {
if x != nil {
return x.ArticleAnswers
}
return nil
}
func (x *SuggestArticlesResponse) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestArticlesResponse) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers].
type SuggestFaqAnswersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant to fetch suggestion for.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The name of the latest conversation message to compile suggestion
// for. If empty, it will be the latest message of the conversation.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Optional. Max number of messages prior to and including
// [latest_message] to use as context when compiling the
// suggestion. By default 20 and at most 50.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
// Optional. Parameters for a human assist query.
AssistQueryParams *AssistQueryParameters `protobuf:"bytes,4,opt,name=assist_query_params,json=assistQueryParams,proto3" json:"assist_query_params,omitempty"`
}
func (x *SuggestFaqAnswersRequest) Reset() {
*x = SuggestFaqAnswersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestFaqAnswersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestFaqAnswersRequest) ProtoMessage() {}
func (x *SuggestFaqAnswersRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestFaqAnswersRequest.ProtoReflect.Descriptor instead.
func (*SuggestFaqAnswersRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{22}
}
func (x *SuggestFaqAnswersRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *SuggestFaqAnswersRequest) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestFaqAnswersRequest) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
func (x *SuggestFaqAnswersRequest) GetAssistQueryParams() *AssistQueryParameters {
if x != nil {
return x.AssistQueryParams
}
return nil
}
// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers].
type SuggestFaqAnswersResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Answers extracted from FAQ documents.
FaqAnswers []*FaqAnswer `protobuf:"bytes,1,rep,name=faq_answers,json=faqAnswers,proto3" json:"faq_answers,omitempty"`
// The name of the latest conversation message used to compile
// suggestion for.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Number of messages prior to and including
// [latest_message][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.latest_message] to compile the
// suggestion. It may be smaller than the
// [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.context_size] field in the request if there
// aren't that many messages in the conversation.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *SuggestFaqAnswersResponse) Reset() {
*x = SuggestFaqAnswersResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestFaqAnswersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestFaqAnswersResponse) ProtoMessage() {}
func (x *SuggestFaqAnswersResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestFaqAnswersResponse.ProtoReflect.Descriptor instead.
func (*SuggestFaqAnswersResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{23}
}
func (x *SuggestFaqAnswersResponse) GetFaqAnswers() []*FaqAnswer {
if x != nil {
return x.FaqAnswers
}
return nil
}
func (x *SuggestFaqAnswersResponse) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestFaqAnswersResponse) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// The request message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies].
type SuggestSmartRepliesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant to fetch suggestion for.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The current natural language text segment to compile suggestion
// for. This provides a way for user to get follow up smart reply suggestion
// after a smart reply selection, without sending a text message.
CurrentTextInput *TextInput `protobuf:"bytes,4,opt,name=current_text_input,json=currentTextInput,proto3" json:"current_text_input,omitempty"`
// The name of the latest conversation message to compile suggestion
// for. If empty, it will be the latest message of the conversation.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Optional. Max number of messages prior to and including
// [latest_message] to use as context when compiling the
// suggestion. By default 20 and at most 50.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *SuggestSmartRepliesRequest) Reset() {
*x = SuggestSmartRepliesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestSmartRepliesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestSmartRepliesRequest) ProtoMessage() {}
func (x *SuggestSmartRepliesRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestSmartRepliesRequest.ProtoReflect.Descriptor instead.
func (*SuggestSmartRepliesRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{24}
}
func (x *SuggestSmartRepliesRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *SuggestSmartRepliesRequest) GetCurrentTextInput() *TextInput {
if x != nil {
return x.CurrentTextInput
}
return nil
}
func (x *SuggestSmartRepliesRequest) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestSmartRepliesRequest) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// The response message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies].
type SuggestSmartRepliesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Multiple reply options provided by smart reply service. The
// order is based on the rank of the model prediction.
// The maximum number of the returned replies is set in SmartReplyConfig.
SmartReplyAnswers []*SmartReplyAnswer `protobuf:"bytes,1,rep,name=smart_reply_answers,json=smartReplyAnswers,proto3" json:"smart_reply_answers,omitempty"`
// The name of the latest conversation message used to compile
// suggestion for.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Number of messages prior to and including
// [latest_message][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.latest_message] to compile the
// suggestion. It may be smaller than the
// [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.context_size] field in the request if there
// aren't that many messages in the conversation.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *SuggestSmartRepliesResponse) Reset() {
*x = SuggestSmartRepliesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SuggestSmartRepliesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SuggestSmartRepliesResponse) ProtoMessage() {}
func (x *SuggestSmartRepliesResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 SuggestSmartRepliesResponse.ProtoReflect.Descriptor instead.
func (*SuggestSmartRepliesResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{25}
}
func (x *SuggestSmartRepliesResponse) GetSmartReplyAnswers() []*SmartReplyAnswer {
if x != nil {
return x.SmartReplyAnswers
}
return nil
}
func (x *SuggestSmartRepliesResponse) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *SuggestSmartRepliesResponse) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// Represents a suggestion for a human agent.
//
// Deprecated: Do not use.
type Suggestion struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The name of this suggestion.
// Format:
// `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
// ID>/participants/*/suggestions/<Suggestion ID>`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Output only. Articles ordered by score in descending order.
Articles []*Suggestion_Article `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"`
// Output only. Answers extracted from FAQ documents.
FaqAnswers []*Suggestion_FaqAnswer `protobuf:"bytes,4,rep,name=faq_answers,json=faqAnswers,proto3" json:"faq_answers,omitempty"`
// Output only. The time the suggestion was created.
CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// Output only. Latest message used as context to compile this suggestion.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,7,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
}
func (x *Suggestion) Reset() {
*x = Suggestion{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Suggestion) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Suggestion) ProtoMessage() {}
func (x *Suggestion) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 Suggestion.ProtoReflect.Descriptor instead.
func (*Suggestion) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{26}
}
func (x *Suggestion) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Suggestion) GetArticles() []*Suggestion_Article {
if x != nil {
return x.Articles
}
return nil
}
func (x *Suggestion) GetFaqAnswers() []*Suggestion_FaqAnswer {
if x != nil {
return x.FaqAnswers
}
return nil
}
func (x *Suggestion) GetCreateTime() *timestamppb.Timestamp {
if x != nil {
return x.CreateTime
}
return nil
}
func (x *Suggestion) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
// The request message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions].
//
// Deprecated: Do not use.
type ListSuggestionsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant to fetch suggestions for.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The maximum number of items to return in a single page. The
// default value is 100; the maximum value is 1000.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. The next_page_token value returned from a previous list request.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Optional. Filter on suggestions fields. Currently predicates on
// `create_time` and `create_time_epoch_microseconds` are supported.
// `create_time` only support milliseconds accuracy. E.g.,
// `create_time_epoch_microseconds > 1551790877964485` or
// `create_time > "2017-01-15T01:30:15.01Z"`
//
// For more information about filtering, see
// [API Filtering](https://aip.dev/160).
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
}
func (x *ListSuggestionsRequest) Reset() {
*x = ListSuggestionsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListSuggestionsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListSuggestionsRequest) ProtoMessage() {}
func (x *ListSuggestionsRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ListSuggestionsRequest.ProtoReflect.Descriptor instead.
func (*ListSuggestionsRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{27}
}
func (x *ListSuggestionsRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *ListSuggestionsRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListSuggestionsRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
func (x *ListSuggestionsRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
// The response message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions].
//
// Deprecated: Do not use.
type ListSuggestionsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The list of suggestions. There will be a maximum number of items
// returned based on the page_size field in the request. `suggestions` is
// sorted by `create_time` in descending order.
Suggestions []*Suggestion `protobuf:"bytes,1,rep,name=suggestions,proto3" json:"suggestions,omitempty"`
// Optional. Token to retrieve the next page of results or empty if there are
// no more results in the list.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *ListSuggestionsResponse) Reset() {
*x = ListSuggestionsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListSuggestionsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListSuggestionsResponse) ProtoMessage() {}
func (x *ListSuggestionsResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ListSuggestionsResponse.ProtoReflect.Descriptor instead.
func (*ListSuggestionsResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{28}
}
func (x *ListSuggestionsResponse) GetSuggestions() []*Suggestion {
if x != nil {
return x.Suggestions
}
return nil
}
func (x *ListSuggestionsResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
// The request message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion].
//
// Deprecated: Do not use.
type CompileSuggestionRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The name of the participant to fetch suggestion for.
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Optional. The name of the latest conversation message to compile suggestion
// for. If empty, it will be the latest message of the conversation.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Optional. Max number of messages prior to and including
// [latest_message] to use as context when compiling the
// suggestion. If zero or less than zero, 20 is used.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *CompileSuggestionRequest) Reset() {
*x = CompileSuggestionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CompileSuggestionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CompileSuggestionRequest) ProtoMessage() {}
func (x *CompileSuggestionRequest) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 CompileSuggestionRequest.ProtoReflect.Descriptor instead.
func (*CompileSuggestionRequest) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{29}
}
func (x *CompileSuggestionRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
func (x *CompileSuggestionRequest) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *CompileSuggestionRequest) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// The response message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion].
//
// Deprecated: Do not use.
type CompileSuggestionResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The compiled suggestion.
Suggestion *Suggestion `protobuf:"bytes,1,opt,name=suggestion,proto3" json:"suggestion,omitempty"`
// The name of the latest conversation message used to compile
// suggestion for.
//
// Format: `projects/<Project ID>/locations/<Location
// ID>/conversations/<Conversation ID>/messages/<Message ID>`.
LatestMessage string `protobuf:"bytes,2,opt,name=latest_message,json=latestMessage,proto3" json:"latest_message,omitempty"`
// Number of messages prior to and including
// [latest_message][google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.latest_message]
// to compile the suggestion. It may be smaller than the
// [CompileSuggestionRequest.context_size][google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.context_size] field in the request if
// there aren't that many messages in the conversation.
ContextSize int32 `protobuf:"varint,3,opt,name=context_size,json=contextSize,proto3" json:"context_size,omitempty"`
}
func (x *CompileSuggestionResponse) Reset() {
*x = CompileSuggestionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CompileSuggestionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CompileSuggestionResponse) ProtoMessage() {}
func (x *CompileSuggestionResponse) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 CompileSuggestionResponse.ProtoReflect.Descriptor instead.
func (*CompileSuggestionResponse) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{30}
}
func (x *CompileSuggestionResponse) GetSuggestion() *Suggestion {
if x != nil {
return x.Suggestion
}
return nil
}
func (x *CompileSuggestionResponse) GetLatestMessage() string {
if x != nil {
return x.LatestMessage
}
return ""
}
func (x *CompileSuggestionResponse) GetContextSize() int32 {
if x != nil {
return x.ContextSize
}
return 0
}
// Response messages from an automated agent.
type ResponseMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The rich response message.
//
// Types that are assignable to Message:
// *ResponseMessage_Text_
// *ResponseMessage_Payload
// *ResponseMessage_LiveAgentHandoff_
// *ResponseMessage_EndInteraction_
// *ResponseMessage_TelephonyTransferCall_
Message isResponseMessage_Message `protobuf_oneof:"message"`
}
func (x *ResponseMessage) Reset() {
*x = ResponseMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseMessage) ProtoMessage() {}
func (x *ResponseMessage) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ResponseMessage.ProtoReflect.Descriptor instead.
func (*ResponseMessage) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{31}
}
func (m *ResponseMessage) GetMessage() isResponseMessage_Message {
if m != nil {
return m.Message
}
return nil
}
func (x *ResponseMessage) GetText() *ResponseMessage_Text {
if x, ok := x.GetMessage().(*ResponseMessage_Text_); ok {
return x.Text
}
return nil
}
func (x *ResponseMessage) GetPayload() *structpb.Struct {
if x, ok := x.GetMessage().(*ResponseMessage_Payload); ok {
return x.Payload
}
return nil
}
func (x *ResponseMessage) GetLiveAgentHandoff() *ResponseMessage_LiveAgentHandoff {
if x, ok := x.GetMessage().(*ResponseMessage_LiveAgentHandoff_); ok {
return x.LiveAgentHandoff
}
return nil
}
func (x *ResponseMessage) GetEndInteraction() *ResponseMessage_EndInteraction {
if x, ok := x.GetMessage().(*ResponseMessage_EndInteraction_); ok {
return x.EndInteraction
}
return nil
}
func (x *ResponseMessage) GetTelephonyTransferCall() *ResponseMessage_TelephonyTransferCall {
if x, ok := x.GetMessage().(*ResponseMessage_TelephonyTransferCall_); ok {
return x.TelephonyTransferCall
}
return nil
}
type isResponseMessage_Message interface {
isResponseMessage_Message()
}
type ResponseMessage_Text_ struct {
// Returns a text response.
Text *ResponseMessage_Text `protobuf:"bytes,1,opt,name=text,proto3,oneof"`
}
type ResponseMessage_Payload struct {
// Returns a response containing a custom, platform-specific payload.
Payload *structpb.Struct `protobuf:"bytes,2,opt,name=payload,proto3,oneof"`
}
type ResponseMessage_LiveAgentHandoff_ struct {
// Hands off conversation to a live agent.
LiveAgentHandoff *ResponseMessage_LiveAgentHandoff `protobuf:"bytes,3,opt,name=live_agent_handoff,json=liveAgentHandoff,proto3,oneof"`
}
type ResponseMessage_EndInteraction_ struct {
// A signal that indicates the interaction with the Dialogflow agent has
// ended.
EndInteraction *ResponseMessage_EndInteraction `protobuf:"bytes,4,opt,name=end_interaction,json=endInteraction,proto3,oneof"`
}
type ResponseMessage_TelephonyTransferCall_ struct {
// A signal that the client should transfer the phone call connected to
// this agent to a third-party endpoint.
TelephonyTransferCall *ResponseMessage_TelephonyTransferCall `protobuf:"bytes,6,opt,name=telephony_transfer_call,json=telephonyTransferCall,proto3,oneof"`
}
func (*ResponseMessage_Text_) isResponseMessage_Message() {}
func (*ResponseMessage_Payload) isResponseMessage_Message() {}
func (*ResponseMessage_LiveAgentHandoff_) isResponseMessage_Message() {}
func (*ResponseMessage_EndInteraction_) isResponseMessage_Message() {}
func (*ResponseMessage_TelephonyTransferCall_) isResponseMessage_Message() {}
// Represents suggested article.
type Suggestion_Article struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The article title.
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Output only. The article URI.
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
// Output only. Article snippets.
Snippets []string `protobuf:"bytes,3,rep,name=snippets,proto3" json:"snippets,omitempty"`
// Output only. A map that contains metadata about the answer and the
// document from which it originates.
Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Output only. The name of answer record, in the format of
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer
// Record ID>"
AnswerRecord string `protobuf:"bytes,6,opt,name=answer_record,json=answerRecord,proto3" json:"answer_record,omitempty"`
}
func (x *Suggestion_Article) Reset() {
*x = Suggestion_Article{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Suggestion_Article) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Suggestion_Article) ProtoMessage() {}
func (x *Suggestion_Article) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 Suggestion_Article.ProtoReflect.Descriptor instead.
func (*Suggestion_Article) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{26, 0}
}
func (x *Suggestion_Article) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *Suggestion_Article) GetUri() string {
if x != nil {
return x.Uri
}
return ""
}
func (x *Suggestion_Article) GetSnippets() []string {
if x != nil {
return x.Snippets
}
return nil
}
func (x *Suggestion_Article) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Suggestion_Article) GetAnswerRecord() string {
if x != nil {
return x.AnswerRecord
}
return ""
}
// Represents suggested answer from "frequently asked questions".
type Suggestion_FaqAnswer struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The piece of text from the `source` knowledge base document.
Answer string `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
// The system's confidence score that this Knowledge answer is a good match
// for this conversational query, range from 0.0 (completely uncertain)
// to 1.0 (completely certain).
Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"`
// Output only. The corresponding FAQ question.
Question string `protobuf:"bytes,3,opt,name=question,proto3" json:"question,omitempty"`
// Output only. Indicates which Knowledge Document this answer was extracted
// from.
// Format: `projects/<Project ID>/locations/<Location
// ID>/agent/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.
Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"`
// Output only. A map that contains metadata about the answer and the
// document from which it originates.
Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Output only. The name of answer record, in the format of
// "projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer
// Record ID>"
AnswerRecord string `protobuf:"bytes,6,opt,name=answer_record,json=answerRecord,proto3" json:"answer_record,omitempty"`
}
func (x *Suggestion_FaqAnswer) Reset() {
*x = Suggestion_FaqAnswer{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Suggestion_FaqAnswer) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Suggestion_FaqAnswer) ProtoMessage() {}
func (x *Suggestion_FaqAnswer) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 Suggestion_FaqAnswer.ProtoReflect.Descriptor instead.
func (*Suggestion_FaqAnswer) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{26, 1}
}
func (x *Suggestion_FaqAnswer) GetAnswer() string {
if x != nil {
return x.Answer
}
return ""
}
func (x *Suggestion_FaqAnswer) GetConfidence() float32 {
if x != nil {
return x.Confidence
}
return 0
}
func (x *Suggestion_FaqAnswer) GetQuestion() string {
if x != nil {
return x.Question
}
return ""
}
func (x *Suggestion_FaqAnswer) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
func (x *Suggestion_FaqAnswer) GetMetadata() map[string]string {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Suggestion_FaqAnswer) GetAnswerRecord() string {
if x != nil {
return x.AnswerRecord
}
return ""
}
// The text response message.
type ResponseMessage_Text struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A collection of text responses.
Text []string `protobuf:"bytes,1,rep,name=text,proto3" json:"text,omitempty"`
}
func (x *ResponseMessage_Text) Reset() {
*x = ResponseMessage_Text{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[40]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseMessage_Text) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseMessage_Text) ProtoMessage() {}
func (x *ResponseMessage_Text) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ResponseMessage_Text.ProtoReflect.Descriptor instead.
func (*ResponseMessage_Text) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{31, 0}
}
func (x *ResponseMessage_Text) GetText() []string {
if x != nil {
return x.Text
}
return nil
}
// Indicates that the conversation should be handed off to a human agent.
//
// Dialogflow only uses this to determine which conversations were handed off
// to a human agent for measurement purposes. What else to do with this signal
// is up to you and your handoff procedures.
//
// You may set this, for example:
// * In the entry fulfillment of a CX Page if entering the page indicates
// something went extremely wrong in the conversation.
// * In a webhook response when you determine that the customer issue can only
// be handled by a human.
type ResponseMessage_LiveAgentHandoff struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Custom metadata for your handoff procedure. Dialogflow doesn't impose
// any structure on this.
Metadata *structpb.Struct `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
func (x *ResponseMessage_LiveAgentHandoff) Reset() {
*x = ResponseMessage_LiveAgentHandoff{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[41]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseMessage_LiveAgentHandoff) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseMessage_LiveAgentHandoff) ProtoMessage() {}
func (x *ResponseMessage_LiveAgentHandoff) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ResponseMessage_LiveAgentHandoff.ProtoReflect.Descriptor instead.
func (*ResponseMessage_LiveAgentHandoff) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{31, 1}
}
func (x *ResponseMessage_LiveAgentHandoff) GetMetadata() *structpb.Struct {
if x != nil {
return x.Metadata
}
return nil
}
// Indicates that interaction with the Dialogflow agent has ended.
type ResponseMessage_EndInteraction struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ResponseMessage_EndInteraction) Reset() {
*x = ResponseMessage_EndInteraction{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[42]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseMessage_EndInteraction) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseMessage_EndInteraction) ProtoMessage() {}
func (x *ResponseMessage_EndInteraction) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ResponseMessage_EndInteraction.ProtoReflect.Descriptor instead.
func (*ResponseMessage_EndInteraction) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{31, 2}
}
// Represents the signal that telles the client to transfer the phone call
// connected to the agent to a third-party endpoint.
type ResponseMessage_TelephonyTransferCall struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Endpoint to transfer the call to.
//
// Types that are assignable to Endpoint:
// *ResponseMessage_TelephonyTransferCall_PhoneNumber
// *ResponseMessage_TelephonyTransferCall_SipUri
Endpoint isResponseMessage_TelephonyTransferCall_Endpoint `protobuf_oneof:"endpoint"`
}
func (x *ResponseMessage_TelephonyTransferCall) Reset() {
*x = ResponseMessage_TelephonyTransferCall{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[43]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseMessage_TelephonyTransferCall) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseMessage_TelephonyTransferCall) ProtoMessage() {}
func (x *ResponseMessage_TelephonyTransferCall) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_dialogflow_v2beta1_participant_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 ResponseMessage_TelephonyTransferCall.ProtoReflect.Descriptor instead.
func (*ResponseMessage_TelephonyTransferCall) Descriptor() ([]byte, []int) {
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP(), []int{31, 3}
}
func (m *ResponseMessage_TelephonyTransferCall) GetEndpoint() isResponseMessage_TelephonyTransferCall_Endpoint {
if m != nil {
return m.Endpoint
}
return nil
}
func (x *ResponseMessage_TelephonyTransferCall) GetPhoneNumber() string {
if x, ok := x.GetEndpoint().(*ResponseMessage_TelephonyTransferCall_PhoneNumber); ok {
return x.PhoneNumber
}
return ""
}
func (x *ResponseMessage_TelephonyTransferCall) GetSipUri() string {
if x, ok := x.GetEndpoint().(*ResponseMessage_TelephonyTransferCall_SipUri); ok {
return x.SipUri
}
return ""
}
type isResponseMessage_TelephonyTransferCall_Endpoint interface {
isResponseMessage_TelephonyTransferCall_Endpoint()
}
type ResponseMessage_TelephonyTransferCall_PhoneNumber struct {
// Transfer the call to a phone number
// in [E.164 format](https://en.wikipedia.org/wiki/E.164).
PhoneNumber string `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3,oneof"`
}
type ResponseMessage_TelephonyTransferCall_SipUri struct {
// Transfer the call to a SIP endpoint.
SipUri string `protobuf:"bytes,2,opt,name=sip_uri,json=sipUri,proto3,oneof"`
}
func (*ResponseMessage_TelephonyTransferCall_PhoneNumber) isResponseMessage_TelephonyTransferCall_Endpoint() {
}
func (*ResponseMessage_TelephonyTransferCall_SipUri) isResponseMessage_TelephonyTransferCall_Endpoint() {
}
var File_google_cloud_dialogflow_v2beta1_participant_proto protoreflect.FileDescriptor
var file_google_cloud_dialogflow_v2beta1_participant_proto_rawDesc = []byte{
0x0a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62,
0x65, 0x74, 0x61, 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, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77,
0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x63, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2f,
0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 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, 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, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 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, 0xc0, 0x05, 0x0a, 0x0b, 0x50,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x4a, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2e,
0x52, 0x6f, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12,
0x42, 0x0a, 0x1b, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x6f, 0x62, 0x66, 0x75, 0x73,
0x63, 0x61, 0x74, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x73, 0x65,
0x72, 0x49, 0x64, 0x12, 0x8d, 0x01, 0x0a, 0x1a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65,
0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c,
0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69,
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x64, 0x6f, 0x63, 0x75, 0x6d,
0x65, 0x6e, 0x74, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74,
0x65, 0x72, 0x73, 0x1a, 0x4b, 0x0a, 0x1d, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0x50, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f,
0x0a, 0x0b, 0x48, 0x55, 0x4d, 0x41, 0x4e, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12,
0x13, 0x0a, 0x0f, 0x41, 0x55, 0x54, 0x4f, 0x4d, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x47, 0x45,
0x4e, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x44, 0x5f, 0x55, 0x53, 0x45, 0x52,
0x10, 0x03, 0x3a, 0xd8, 0x01, 0xea, 0x41, 0xd4, 0x01, 0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x12, 0x4a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x7d, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x7b,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x7d, 0x12, 0x5f, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d,
0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x7d, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f,
0x7b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x7d, 0x22, 0x92, 0x06,
0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f,
0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x6c,
0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x70,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
0x6e, 0x74, 0x12, 0x61, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c,
0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42,
0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f,
0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 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, 0x3c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x5f,
0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 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, 0x01, 0x52, 0x08, 0x73, 0x65, 0x6e,
0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x66, 0x0a, 0x12, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6c, 0x0a,
0x12, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x6e, 0x61, 0x6c, 0x79,
0x73, 0x69, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x74,
0x69, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6d,
0x65, 0x6e, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x3a, 0xc4, 0x01, 0xea, 0x41,
0xc0, 0x01, 0x0a, 0x21, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x42, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72,
0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f,
0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x7d, 0x12, 0x57, 0x70, 0x72, 0x6f, 0x6a, 0x65,
0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x7d, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x2f, 0x7b, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x7d, 0x22, 0xb6, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x12, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x06,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63,
0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x5a, 0x0a, 0x15, 0x47,
0x65, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c,
0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69,
0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74,
0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x12, 0x25, 0x64, 0x69, 0x61,
0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
0x6e, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61,
0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0,
0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a,
0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x22, 0x94, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a,
0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 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, 0xb1, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 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, 0x22, 0x6f, 0x0a, 0x0b, 0x4f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x06, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x75, 0x74,
0x70, 0x75, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x22, 0xa0, 0x06, 0x0a,
0x13, 0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x12, 0x6d, 0x0a, 0x16, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x5f, 0x69,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x64,
0x65, 0x74, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69,
0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x73, 0x12, 0x3f, 0x0a, 0x06, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x42, 0x25, 0xfa, 0x41, 0x22, 0x0a, 0x20, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, 0x06, 0x69, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18,
0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,
0x74, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72,
0x75, 0x63, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12,
0x4f, 0x0a, 0x15, 0x63, 0x78, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61,
0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x02, 0x18, 0x01, 0x52, 0x13, 0x63, 0x78, 0x53,
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
0x12, 0x89, 0x01, 0x0a, 0x1a, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61,
0x67, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x4c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e,
0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65,
0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x6f,
0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54,
0x79, 0x70, 0x65, 0x52, 0x17, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x12,
0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x43,
0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x17, 0x41,
0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x26, 0x41, 0x55, 0x54, 0x4f, 0x4d, 0x41,
0x54, 0x45, 0x44, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x59, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x41, 0x52, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x01, 0x12,
0x09, 0x0a, 0x05, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22,
0xb0, 0x01, 0x0a, 0x11, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x65,
0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
0x70, 0x65, 0x22, 0x4e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
0x12, 0x16, 0x0a, 0x12, 0x41, 0x52, 0x54, 0x49, 0x43, 0x4c, 0x45, 0x5f, 0x53, 0x55, 0x47, 0x47,
0x45, 0x53, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x41, 0x51, 0x10,
0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x4d, 0x41, 0x52, 0x54, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x59,
0x10, 0x03, 0x22, 0xf9, 0x01, 0x0a, 0x15, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65,
0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x92, 0x01, 0x0a,
0x1a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x54, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50,
0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
0x6e, 0x74, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65,
0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x18, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
0x74, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72,
0x73, 0x1a, 0x4b, 0x0a, 0x1d, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x94,
0x05, 0x0a, 0x15, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0,
0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f,
0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x0b, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x0a, 0x74, 0x65, 0x78,
0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61,
0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x54, 0x65, 0x78, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x65, 0x78,
0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x4e, 0x0a, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f,
0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x60, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f,
0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x41, 0x75, 0x64,
0x69, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x53, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72,
0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69,
0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
0x52, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x66, 0x0a,
0x13, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61,
0x72, 0x61, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73,
0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
0x72, 0x73, 0x52, 0x11, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x46, 0x0a, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x5f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 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, 0x0f, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a,
0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x42, 0x07, 0x0a, 0x05,
0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3e, 0x0a, 0x0e, 0x44, 0x74, 0x6d, 0x66, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x63, 0x63, 0x65, 0x70,
0x74, 0x73, 0x5f, 0x64, 0x74, 0x6d, 0x66, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x44, 0x74, 0x6d, 0x66,
0x49, 0x6e, 0x70, 0x75, 0x74, 0x22, 0xf8, 0x04, 0x0a, 0x16, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x7a,
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x65, 0x78, 0x74, 0x12,
0x4d, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x41, 0x75, 0x64,
0x69, 0x6f, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x12, 0x68,
0x0a, 0x15, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x67, 0x65, 0x6e,
0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61,
0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x52, 0x13, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x76, 0x0a, 0x1e,
0x68, 0x75, 0x6d, 0x61, 0x6e, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x06,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x1b, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x12, 0x70, 0x0a, 0x1b, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72,
0x5f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x18, 0x65, 0x6e,
0x64, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x64, 0x74, 0x6d, 0x66, 0x5f, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x44, 0x74, 0x6d, 0x66, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
0x52, 0x0e, 0x64, 0x74, 0x6d, 0x66, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
0x22, 0x8c, 0x01, 0x0a, 0x14, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a,
0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3f,
0x0a, 0x0f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
0x0e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22,
0x8b, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x74, 0x52, 0x05, 0x70, 0x61, 0x72,
0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x65, 0x6e,
0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x63, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x8f, 0x02,
0x0a, 0x0d, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12,
0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6e, 0x69, 0x70, 0x70,
0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6e, 0x69, 0x70, 0x70,
0x65, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18,
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e,
0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x41,
0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a,
0x0d, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22,
0xaf, 0x02, 0x0a, 0x09, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x16, 0x0a,
0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61,
0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65,
0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69,
0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x08, 0x6d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x61,
0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,
0x23, 0x0a, 0x0d, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65,
0x63, 0x6f, 0x72, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x01, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x0a,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02,
0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x0d,
0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x42, 0x2b, 0xfa, 0x41, 0x28, 0x0a, 0x26, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0xd2,
0x03, 0x0a, 0x10, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12,
0x76, 0x0a, 0x19, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x63,
0x6c, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69,
0x63, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x17,
0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7d, 0x0a, 0x1c, 0x73, 0x75, 0x67, 0x67, 0x65,
0x73, 0x74, 0x5f, 0x66, 0x61, 0x71, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x5f, 0x72,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61,
0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x19, 0x73, 0x75, 0x67,
0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, 0x1e, 0x73, 0x75, 0x67, 0x67, 0x65,
0x73, 0x74, 0x5f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73,
0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65,
0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52,
0x1b, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70,
0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x15, 0x0a, 0x13,
0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0xc6, 0x02, 0x0a, 0x16, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41,
0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45,
0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d,
0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27, 0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c,
0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x50, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0,
0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f,
0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0,
0x41, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12,
0x6b, 0x0a, 0x13, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c,
0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41,
0x73, 0x73, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65,
0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x61, 0x73, 0x73, 0x69, 0x73,
0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xbc, 0x01, 0x0a,
0x17, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0f, 0x61, 0x72, 0x74, 0x69,
0x63, 0x6c, 0x65, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65,
0x72, 0x52, 0x0e, 0x61, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72,
0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73,
0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xc8, 0x02, 0x0a, 0x18,
0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x27,
0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12,
0x50, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a,
0x21, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x61, 0x73, 0x73,
0x69, 0x73, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77,
0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x51,
0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03,
0xe0, 0x41, 0x01, 0x52, 0x11, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x19, 0x53, 0x75, 0x67, 0x67, 0x65,
0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x66, 0x61, 0x71, 0x5f, 0x61, 0x6e, 0x73, 0x77,
0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x61, 0x71, 0x41,
0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x0a, 0x66, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72,
0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73,
0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xaf, 0x02, 0x0a, 0x1a,
0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c,
0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xe0, 0x41, 0x02, 0xfa,
0x41, 0x27, 0x0a, 0x25, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
0x74, 0x12, 0x58, 0x0a, 0x12, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x65, 0x78,
0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61,
0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e,
0x54, 0x65, 0x78, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65,
0x6e, 0x74, 0x54, 0x65, 0x78, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x4d, 0x0a, 0x0e, 0x6c,
0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x74,
0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xf2, 0x01,
0x0a, 0x1b, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65,
0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a,
0x13, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x61, 0x6e, 0x73,
0x77, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x6d, 0x61,
0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x11, 0x73,
0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73,
0x12, 0x4d, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69,
0x7a, 0x65, 0x22, 0xff, 0x06, 0x0a, 0x0a, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x08, 0x61, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f,
0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73,
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x52, 0x08, 0x61, 0x72,
0x74, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x12, 0x56, 0x0a, 0x0b, 0x66, 0x61, 0x71, 0x5f, 0x61, 0x6e,
0x73, 0x77, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75,
0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77,
0x65, 0x72, 0x52, 0x0a, 0x66, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x12, 0x3b,
0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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,
0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6c,
0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x1a, 0x8e, 0x02, 0x0a, 0x07, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65,
0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65,
0x74, 0x73, 0x12, 0x5d, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x2e, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x61, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f,
0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72,
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x1a, 0xba, 0x02, 0x0a, 0x09, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65,
0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x63,
0x6f, 0x6e, 0x66, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x71, 0x75, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x5f, 0x0a,
0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x43, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x61, 0x71,
0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23,
0x0a, 0x0d, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x63,
0x6f, 0x72, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x3a, 0x02, 0x18, 0x01, 0x22, 0x88, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67,
0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x3a, 0x02, 0x18, 0x01, 0x22,
0x94, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0b, 0x73,
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74,
0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x73,
0x75, 0x67, 0x67, 0x65, 0x73, 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, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x80, 0x01, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x69,
0x6c, 0x65, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6c,
0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x69,
0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78,
0x74, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x19, 0x43, 0x6f,
0x6d, 0x70, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0a, 0x73, 0x75, 0x67, 0x67, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75,
0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x61,
0x74, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x02,
0x18, 0x01, 0x22, 0xdc, 0x05, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x4b, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74,
0x65, 0x78, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52,
0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x71, 0x0a, 0x12, 0x6c, 0x69, 0x76, 0x65,
0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6f, 0x66, 0x66, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4c, 0x69, 0x76, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74,
0x48, 0x61, 0x6e, 0x64, 0x6f, 0x66, 0x66, 0x48, 0x00, 0x52, 0x10, 0x6c, 0x69, 0x76, 0x65, 0x41,
0x67, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6f, 0x66, 0x66, 0x12, 0x6a, 0x0a, 0x0f, 0x65,
0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65,
0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x17, 0x74, 0x65, 0x6c, 0x65,
0x70, 0x68, 0x6f, 0x6e, 0x79, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x63,
0x61, 0x6c, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x65, 0x6c, 0x65,
0x70, 0x68, 0x6f, 0x6e, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x61, 0x6c,
0x6c, 0x48, 0x00, 0x52, 0x15, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x79, 0x54, 0x72,
0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x1a, 0x1a, 0x0a, 0x04, 0x54, 0x65,
0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x47, 0x0a, 0x10, 0x4c, 0x69, 0x76, 0x65, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6f, 0x66, 0x66, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a,
0x10, 0x0a, 0x0e, 0x45, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x1a, 0x63, 0x0a, 0x15, 0x54, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x79, 0x54, 0x72,
0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x70, 0x68,
0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x48, 0x00, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12,
0x19, 0x0a, 0x07, 0x73, 0x69, 0x70, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x70, 0x55, 0x72, 0x69, 0x42, 0x0a, 0x0a, 0x08, 0x65, 0x6e,
0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x32, 0xc8, 0x19, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x73, 0x12, 0xb9, 0x02, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c,
0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x22, 0xba, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x9e, 0x01, 0x22, 0x39, 0x2f, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72,
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63,
0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x3a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x5a, 0x54, 0x22, 0x45, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 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,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x3a, 0x0b, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0xda, 0x41, 0x12, 0x70, 0x61, 0x72, 0x65,
0x6e, 0x74, 0x2c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x8b,
0x02, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x92, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x84,
0x01, 0x12, 0x39, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e,
0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61, 0x72,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x47, 0x12, 0x45,
0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 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, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x73, 0x2f, 0x2a, 0x7d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x9e, 0x02, 0x0a,
0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74,
0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x94, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x84, 0x01,
0x12, 0x39, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x5a, 0x47, 0x12, 0x45, 0x2f,
0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 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, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x73, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xd6, 0x02,
0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69,
0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0xd7, 0x01, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0xb6, 0x01, 0x32, 0x45, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2f, 0x7b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2e, 0x6e, 0x61,
0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x0b, 0x70,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5a, 0x60, 0x32, 0x51, 0x2f, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70,
0x61, 0x6e, 0x74, 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, 0x2f,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a,
0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0xda, 0x41, 0x17, 0x70,
0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0xf4, 0x02, 0x0a, 0x0e, 0x41, 0x6e, 0x61, 0x6c, 0x79,
0x7a, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x6e, 0x61, 0x6c,
0x79, 0x7a, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf0, 0x01, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0xb6, 0x01, 0x22, 0x4f, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61,
0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x43, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0x5a, 0x60, 0x22, 0x5b, 0x2f, 0x76, 0x32, 0x62,
0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 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, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69,
0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65,
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0xda, 0x41, 0x16, 0x70, 0x61, 0x72,
0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x69, 0x6e,
0x70, 0x75, 0x74, 0xda, 0x41, 0x17, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x2c, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0xdd, 0x02,
0x0a, 0x0f, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65,
0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65,
0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63,
0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67,
0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67,
0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd6, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xc6, 0x01, 0x22, 0x57,
0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41,
0x72, 0x74, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x5a, 0x68, 0x22, 0x63, 0x2f, 0x76,
0x32, 0x62, 0x65, 0x74, 0x61, 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, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x3a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x41, 0x72, 0x74, 0x69, 0x63, 0x6c, 0x65,
0x73, 0x3a, 0x01, 0x2a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xe7, 0x02,
0x0a, 0x11, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77,
0x65, 0x72, 0x73, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f,
0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32,
0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71,
0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69,
0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31,
0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65,
0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xda, 0x01, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0xca, 0x01, 0x22, 0x59, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a,
0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x75,
0x67, 0x67, 0x65, 0x73, 0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x3a,
0x01, 0x2a, 0x5a, 0x6a, 0x22, 0x65, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 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, 0x2f, 0x70, 0x61,
0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x75,
0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73,
0x74, 0x46, 0x61, 0x71, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x73, 0x3a, 0x01, 0x2a, 0xda, 0x41,
0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xf1, 0x02, 0x0a, 0x13, 0x53, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12,
0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65,
0x70, 0x6c, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c,
0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53,
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xde, 0x01, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0xce, 0x01, 0x22, 0x5b, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f,
0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a,
0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x75,
0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65,
0x73, 0x3a, 0x01, 0x2a, 0x5a, 0x6c, 0x22, 0x67, 0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 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, 0x2f,
0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f,
0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x73, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x3a,
0x01, 0x2a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0xd8, 0x01, 0x0a, 0x0f,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64,
0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61,
0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c,
0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53,
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x52, 0x88, 0x02, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x12, 0x47, 0x2f,
0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76, 0x65,
0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74, 0x69,
0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xe9, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x69,
0x6c, 0x65, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c,
0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43,
0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f,
0x77, 0x2e, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c,
0x65, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x5d, 0x88, 0x02, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x54, 0x22, 0x4f,
0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x6f, 0x6e, 0x76,
0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x61, 0x72, 0x74,
0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x75, 0x67, 0x67,
0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x3a,
0x01, 0x2a, 0x1a, 0x78, 0xca, 0x41, 0x19, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f,
0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0xd2, 0x41, 0x59, 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, 0x2c, 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, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x42, 0xae, 0x01, 0x0a,
0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75,
0x64, 0x2e, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x76, 0x32, 0x62,
0x65, 0x74, 0x61, 0x31, 0x42, 0x10, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e,
0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 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, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66, 0x6c, 0x6f, 0x77,
0x2f, 0x76, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x61, 0x6c, 0x6f, 0x67, 0x66,
0x6c, 0x6f, 0x77, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x02, 0x44, 0x46, 0xaa, 0x02, 0x1f, 0x47, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x44, 0x69, 0x61, 0x6c, 0x6f,
0x67, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x56, 0x32, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescOnce sync.Once
file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescData = file_google_cloud_dialogflow_v2beta1_participant_proto_rawDesc
)
func file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescGZIP() []byte {
file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescOnce.Do(func() {
file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescData)
})
return file_google_cloud_dialogflow_v2beta1_participant_proto_rawDescData
}
var file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes = make([]protoimpl.MessageInfo, 44)
var file_google_cloud_dialogflow_v2beta1_participant_proto_goTypes = []interface{}{
(Participant_Role)(0), // 0: google.cloud.dialogflow.v2beta1.Participant.Role
(AutomatedAgentReply_AutomatedAgentReplyType)(0), // 1: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.AutomatedAgentReplyType
(SuggestionFeature_Type)(0), // 2: google.cloud.dialogflow.v2beta1.SuggestionFeature.Type
(*Participant)(nil), // 3: google.cloud.dialogflow.v2beta1.Participant
(*Message)(nil), // 4: google.cloud.dialogflow.v2beta1.Message
(*CreateParticipantRequest)(nil), // 5: google.cloud.dialogflow.v2beta1.CreateParticipantRequest
(*GetParticipantRequest)(nil), // 6: google.cloud.dialogflow.v2beta1.GetParticipantRequest
(*ListParticipantsRequest)(nil), // 7: google.cloud.dialogflow.v2beta1.ListParticipantsRequest
(*ListParticipantsResponse)(nil), // 8: google.cloud.dialogflow.v2beta1.ListParticipantsResponse
(*UpdateParticipantRequest)(nil), // 9: google.cloud.dialogflow.v2beta1.UpdateParticipantRequest
(*OutputAudio)(nil), // 10: google.cloud.dialogflow.v2beta1.OutputAudio
(*AutomatedAgentReply)(nil), // 11: google.cloud.dialogflow.v2beta1.AutomatedAgentReply
(*SuggestionFeature)(nil), // 12: google.cloud.dialogflow.v2beta1.SuggestionFeature
(*AssistQueryParameters)(nil), // 13: google.cloud.dialogflow.v2beta1.AssistQueryParameters
(*AnalyzeContentRequest)(nil), // 14: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest
(*DtmfParameters)(nil), // 15: google.cloud.dialogflow.v2beta1.DtmfParameters
(*AnalyzeContentResponse)(nil), // 16: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse
(*AnnotatedMessagePart)(nil), // 17: google.cloud.dialogflow.v2beta1.AnnotatedMessagePart
(*MessageAnnotation)(nil), // 18: google.cloud.dialogflow.v2beta1.MessageAnnotation
(*ArticleAnswer)(nil), // 19: google.cloud.dialogflow.v2beta1.ArticleAnswer
(*FaqAnswer)(nil), // 20: google.cloud.dialogflow.v2beta1.FaqAnswer
(*SmartReplyAnswer)(nil), // 21: google.cloud.dialogflow.v2beta1.SmartReplyAnswer
(*SuggestionResult)(nil), // 22: google.cloud.dialogflow.v2beta1.SuggestionResult
(*SuggestArticlesRequest)(nil), // 23: google.cloud.dialogflow.v2beta1.SuggestArticlesRequest
(*SuggestArticlesResponse)(nil), // 24: google.cloud.dialogflow.v2beta1.SuggestArticlesResponse
(*SuggestFaqAnswersRequest)(nil), // 25: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest
(*SuggestFaqAnswersResponse)(nil), // 26: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse
(*SuggestSmartRepliesRequest)(nil), // 27: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest
(*SuggestSmartRepliesResponse)(nil), // 28: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse
(*Suggestion)(nil), // 29: google.cloud.dialogflow.v2beta1.Suggestion
(*ListSuggestionsRequest)(nil), // 30: google.cloud.dialogflow.v2beta1.ListSuggestionsRequest
(*ListSuggestionsResponse)(nil), // 31: google.cloud.dialogflow.v2beta1.ListSuggestionsResponse
(*CompileSuggestionRequest)(nil), // 32: google.cloud.dialogflow.v2beta1.CompileSuggestionRequest
(*CompileSuggestionResponse)(nil), // 33: google.cloud.dialogflow.v2beta1.CompileSuggestionResponse
(*ResponseMessage)(nil), // 34: google.cloud.dialogflow.v2beta1.ResponseMessage
nil, // 35: google.cloud.dialogflow.v2beta1.Participant.DocumentsMetadataFiltersEntry
nil, // 36: google.cloud.dialogflow.v2beta1.AssistQueryParameters.DocumentsMetadataFiltersEntry
nil, // 37: google.cloud.dialogflow.v2beta1.ArticleAnswer.MetadataEntry
nil, // 38: google.cloud.dialogflow.v2beta1.FaqAnswer.MetadataEntry
(*Suggestion_Article)(nil), // 39: google.cloud.dialogflow.v2beta1.Suggestion.Article
(*Suggestion_FaqAnswer)(nil), // 40: google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer
nil, // 41: google.cloud.dialogflow.v2beta1.Suggestion.Article.MetadataEntry
nil, // 42: google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.MetadataEntry
(*ResponseMessage_Text)(nil), // 43: google.cloud.dialogflow.v2beta1.ResponseMessage.Text
(*ResponseMessage_LiveAgentHandoff)(nil), // 44: google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff
(*ResponseMessage_EndInteraction)(nil), // 45: google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction
(*ResponseMessage_TelephonyTransferCall)(nil), // 46: google.cloud.dialogflow.v2beta1.ResponseMessage.TelephonyTransferCall
(*timestamppb.Timestamp)(nil), // 47: google.protobuf.Timestamp
(*SentimentAnalysisResult)(nil), // 48: google.cloud.dialogflow.v2beta1.SentimentAnalysisResult
(*fieldmaskpb.FieldMask)(nil), // 49: google.protobuf.FieldMask
(*OutputAudioConfig)(nil), // 50: google.cloud.dialogflow.v2beta1.OutputAudioConfig
(*DetectIntentResponse)(nil), // 51: google.cloud.dialogflow.v2beta1.DetectIntentResponse
(*structpb.Struct)(nil), // 52: google.protobuf.Struct
(*TextInput)(nil), // 53: google.cloud.dialogflow.v2beta1.TextInput
(*EventInput)(nil), // 54: google.cloud.dialogflow.v2beta1.EventInput
(*QueryParameters)(nil), // 55: google.cloud.dialogflow.v2beta1.QueryParameters
(*structpb.Value)(nil), // 56: google.protobuf.Value
(*status.Status)(nil), // 57: google.rpc.Status
}
var file_google_cloud_dialogflow_v2beta1_participant_proto_depIdxs = []int32{
0, // 0: google.cloud.dialogflow.v2beta1.Participant.role:type_name -> google.cloud.dialogflow.v2beta1.Participant.Role
35, // 1: google.cloud.dialogflow.v2beta1.Participant.documents_metadata_filters:type_name -> google.cloud.dialogflow.v2beta1.Participant.DocumentsMetadataFiltersEntry
0, // 2: google.cloud.dialogflow.v2beta1.Message.participant_role:type_name -> google.cloud.dialogflow.v2beta1.Participant.Role
47, // 3: google.cloud.dialogflow.v2beta1.Message.create_time:type_name -> google.protobuf.Timestamp
47, // 4: google.cloud.dialogflow.v2beta1.Message.send_time:type_name -> google.protobuf.Timestamp
18, // 5: google.cloud.dialogflow.v2beta1.Message.message_annotation:type_name -> google.cloud.dialogflow.v2beta1.MessageAnnotation
48, // 6: google.cloud.dialogflow.v2beta1.Message.sentiment_analysis:type_name -> google.cloud.dialogflow.v2beta1.SentimentAnalysisResult
3, // 7: google.cloud.dialogflow.v2beta1.CreateParticipantRequest.participant:type_name -> google.cloud.dialogflow.v2beta1.Participant
3, // 8: google.cloud.dialogflow.v2beta1.ListParticipantsResponse.participants:type_name -> google.cloud.dialogflow.v2beta1.Participant
3, // 9: google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.participant:type_name -> google.cloud.dialogflow.v2beta1.Participant
49, // 10: google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.update_mask:type_name -> google.protobuf.FieldMask
50, // 11: google.cloud.dialogflow.v2beta1.OutputAudio.config:type_name -> google.cloud.dialogflow.v2beta1.OutputAudioConfig
51, // 12: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.detect_intent_response:type_name -> google.cloud.dialogflow.v2beta1.DetectIntentResponse
34, // 13: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.response_messages:type_name -> google.cloud.dialogflow.v2beta1.ResponseMessage
52, // 14: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.parameters:type_name -> google.protobuf.Struct
52, // 15: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.cx_session_parameters:type_name -> google.protobuf.Struct
1, // 16: google.cloud.dialogflow.v2beta1.AutomatedAgentReply.automated_agent_reply_type:type_name -> google.cloud.dialogflow.v2beta1.AutomatedAgentReply.AutomatedAgentReplyType
2, // 17: google.cloud.dialogflow.v2beta1.SuggestionFeature.type:type_name -> google.cloud.dialogflow.v2beta1.SuggestionFeature.Type
36, // 18: google.cloud.dialogflow.v2beta1.AssistQueryParameters.documents_metadata_filters:type_name -> google.cloud.dialogflow.v2beta1.AssistQueryParameters.DocumentsMetadataFiltersEntry
53, // 19: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.text_input:type_name -> google.cloud.dialogflow.v2beta1.TextInput
54, // 20: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.event_input:type_name -> google.cloud.dialogflow.v2beta1.EventInput
50, // 21: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.reply_audio_config:type_name -> google.cloud.dialogflow.v2beta1.OutputAudioConfig
55, // 22: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.query_params:type_name -> google.cloud.dialogflow.v2beta1.QueryParameters
13, // 23: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.assist_query_params:type_name -> google.cloud.dialogflow.v2beta1.AssistQueryParameters
47, // 24: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.message_send_time:type_name -> google.protobuf.Timestamp
10, // 25: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.reply_audio:type_name -> google.cloud.dialogflow.v2beta1.OutputAudio
11, // 26: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.automated_agent_reply:type_name -> google.cloud.dialogflow.v2beta1.AutomatedAgentReply
4, // 27: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.message:type_name -> google.cloud.dialogflow.v2beta1.Message
22, // 28: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.human_agent_suggestion_results:type_name -> google.cloud.dialogflow.v2beta1.SuggestionResult
22, // 29: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.end_user_suggestion_results:type_name -> google.cloud.dialogflow.v2beta1.SuggestionResult
15, // 30: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.dtmf_parameters:type_name -> google.cloud.dialogflow.v2beta1.DtmfParameters
56, // 31: google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.formatted_value:type_name -> google.protobuf.Value
17, // 32: google.cloud.dialogflow.v2beta1.MessageAnnotation.parts:type_name -> google.cloud.dialogflow.v2beta1.AnnotatedMessagePart
37, // 33: google.cloud.dialogflow.v2beta1.ArticleAnswer.metadata:type_name -> google.cloud.dialogflow.v2beta1.ArticleAnswer.MetadataEntry
38, // 34: google.cloud.dialogflow.v2beta1.FaqAnswer.metadata:type_name -> google.cloud.dialogflow.v2beta1.FaqAnswer.MetadataEntry
57, // 35: google.cloud.dialogflow.v2beta1.SuggestionResult.error:type_name -> google.rpc.Status
24, // 36: google.cloud.dialogflow.v2beta1.SuggestionResult.suggest_articles_response:type_name -> google.cloud.dialogflow.v2beta1.SuggestArticlesResponse
26, // 37: google.cloud.dialogflow.v2beta1.SuggestionResult.suggest_faq_answers_response:type_name -> google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse
28, // 38: google.cloud.dialogflow.v2beta1.SuggestionResult.suggest_smart_replies_response:type_name -> google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse
13, // 39: google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.assist_query_params:type_name -> google.cloud.dialogflow.v2beta1.AssistQueryParameters
19, // 40: google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.article_answers:type_name -> google.cloud.dialogflow.v2beta1.ArticleAnswer
13, // 41: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.assist_query_params:type_name -> google.cloud.dialogflow.v2beta1.AssistQueryParameters
20, // 42: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.faq_answers:type_name -> google.cloud.dialogflow.v2beta1.FaqAnswer
53, // 43: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.current_text_input:type_name -> google.cloud.dialogflow.v2beta1.TextInput
21, // 44: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.smart_reply_answers:type_name -> google.cloud.dialogflow.v2beta1.SmartReplyAnswer
39, // 45: google.cloud.dialogflow.v2beta1.Suggestion.articles:type_name -> google.cloud.dialogflow.v2beta1.Suggestion.Article
40, // 46: google.cloud.dialogflow.v2beta1.Suggestion.faq_answers:type_name -> google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer
47, // 47: google.cloud.dialogflow.v2beta1.Suggestion.create_time:type_name -> google.protobuf.Timestamp
29, // 48: google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.suggestions:type_name -> google.cloud.dialogflow.v2beta1.Suggestion
29, // 49: google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.suggestion:type_name -> google.cloud.dialogflow.v2beta1.Suggestion
43, // 50: google.cloud.dialogflow.v2beta1.ResponseMessage.text:type_name -> google.cloud.dialogflow.v2beta1.ResponseMessage.Text
52, // 51: google.cloud.dialogflow.v2beta1.ResponseMessage.payload:type_name -> google.protobuf.Struct
44, // 52: google.cloud.dialogflow.v2beta1.ResponseMessage.live_agent_handoff:type_name -> google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff
45, // 53: google.cloud.dialogflow.v2beta1.ResponseMessage.end_interaction:type_name -> google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction
46, // 54: google.cloud.dialogflow.v2beta1.ResponseMessage.telephony_transfer_call:type_name -> google.cloud.dialogflow.v2beta1.ResponseMessage.TelephonyTransferCall
41, // 55: google.cloud.dialogflow.v2beta1.Suggestion.Article.metadata:type_name -> google.cloud.dialogflow.v2beta1.Suggestion.Article.MetadataEntry
42, // 56: google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.metadata:type_name -> google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.MetadataEntry
52, // 57: google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.metadata:type_name -> google.protobuf.Struct
5, // 58: google.cloud.dialogflow.v2beta1.Participants.CreateParticipant:input_type -> google.cloud.dialogflow.v2beta1.CreateParticipantRequest
6, // 59: google.cloud.dialogflow.v2beta1.Participants.GetParticipant:input_type -> google.cloud.dialogflow.v2beta1.GetParticipantRequest
7, // 60: google.cloud.dialogflow.v2beta1.Participants.ListParticipants:input_type -> google.cloud.dialogflow.v2beta1.ListParticipantsRequest
9, // 61: google.cloud.dialogflow.v2beta1.Participants.UpdateParticipant:input_type -> google.cloud.dialogflow.v2beta1.UpdateParticipantRequest
14, // 62: google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent:input_type -> google.cloud.dialogflow.v2beta1.AnalyzeContentRequest
23, // 63: google.cloud.dialogflow.v2beta1.Participants.SuggestArticles:input_type -> google.cloud.dialogflow.v2beta1.SuggestArticlesRequest
25, // 64: google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers:input_type -> google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest
27, // 65: google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies:input_type -> google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest
30, // 66: google.cloud.dialogflow.v2beta1.Participants.ListSuggestions:input_type -> google.cloud.dialogflow.v2beta1.ListSuggestionsRequest
32, // 67: google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion:input_type -> google.cloud.dialogflow.v2beta1.CompileSuggestionRequest
3, // 68: google.cloud.dialogflow.v2beta1.Participants.CreateParticipant:output_type -> google.cloud.dialogflow.v2beta1.Participant
3, // 69: google.cloud.dialogflow.v2beta1.Participants.GetParticipant:output_type -> google.cloud.dialogflow.v2beta1.Participant
8, // 70: google.cloud.dialogflow.v2beta1.Participants.ListParticipants:output_type -> google.cloud.dialogflow.v2beta1.ListParticipantsResponse
3, // 71: google.cloud.dialogflow.v2beta1.Participants.UpdateParticipant:output_type -> google.cloud.dialogflow.v2beta1.Participant
16, // 72: google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent:output_type -> google.cloud.dialogflow.v2beta1.AnalyzeContentResponse
24, // 73: google.cloud.dialogflow.v2beta1.Participants.SuggestArticles:output_type -> google.cloud.dialogflow.v2beta1.SuggestArticlesResponse
26, // 74: google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers:output_type -> google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse
28, // 75: google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies:output_type -> google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse
31, // 76: google.cloud.dialogflow.v2beta1.Participants.ListSuggestions:output_type -> google.cloud.dialogflow.v2beta1.ListSuggestionsResponse
33, // 77: google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion:output_type -> google.cloud.dialogflow.v2beta1.CompileSuggestionResponse
68, // [68:78] is the sub-list for method output_type
58, // [58:68] is the sub-list for method input_type
58, // [58:58] is the sub-list for extension type_name
58, // [58:58] is the sub-list for extension extendee
0, // [0:58] is the sub-list for field type_name
}
func init() { file_google_cloud_dialogflow_v2beta1_participant_proto_init() }
func file_google_cloud_dialogflow_v2beta1_participant_proto_init() {
if File_google_cloud_dialogflow_v2beta1_participant_proto != nil {
return
}
file_google_cloud_dialogflow_v2beta1_audio_config_proto_init()
file_google_cloud_dialogflow_v2beta1_gcs_proto_init()
file_google_cloud_dialogflow_v2beta1_session_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Participant); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Message); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateParticipantRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetParticipantRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListParticipantsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListParticipantsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateParticipantRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OutputAudio); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AutomatedAgentReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestionFeature); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AssistQueryParameters); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AnalyzeContentRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DtmfParameters); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AnalyzeContentResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AnnotatedMessagePart); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageAnnotation); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ArticleAnswer); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FaqAnswer); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SmartReplyAnswer); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestionResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestArticlesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestArticlesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestFaqAnswersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestFaqAnswersResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestSmartRepliesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuggestSmartRepliesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Suggestion); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListSuggestionsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListSuggestionsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CompileSuggestionRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CompileSuggestionResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResponseMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Suggestion_Article); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Suggestion_FaqAnswer); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResponseMessage_Text); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResponseMessage_LiveAgentHandoff); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResponseMessage_EndInteraction); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ResponseMessage_TelephonyTransferCall); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[8].OneofWrappers = []interface{}{
(*AutomatedAgentReply_DetectIntentResponse)(nil),
(*AutomatedAgentReply_Intent)(nil),
(*AutomatedAgentReply_Event)(nil),
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[11].OneofWrappers = []interface{}{
(*AnalyzeContentRequest_TextInput)(nil),
(*AnalyzeContentRequest_EventInput)(nil),
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[19].OneofWrappers = []interface{}{
(*SuggestionResult_Error)(nil),
(*SuggestionResult_SuggestArticlesResponse)(nil),
(*SuggestionResult_SuggestFaqAnswersResponse)(nil),
(*SuggestionResult_SuggestSmartRepliesResponse)(nil),
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[31].OneofWrappers = []interface{}{
(*ResponseMessage_Text_)(nil),
(*ResponseMessage_Payload)(nil),
(*ResponseMessage_LiveAgentHandoff_)(nil),
(*ResponseMessage_EndInteraction_)(nil),
(*ResponseMessage_TelephonyTransferCall_)(nil),
}
file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes[43].OneofWrappers = []interface{}{
(*ResponseMessage_TelephonyTransferCall_PhoneNumber)(nil),
(*ResponseMessage_TelephonyTransferCall_SipUri)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_google_cloud_dialogflow_v2beta1_participant_proto_rawDesc,
NumEnums: 3,
NumMessages: 44,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_google_cloud_dialogflow_v2beta1_participant_proto_goTypes,
DependencyIndexes: file_google_cloud_dialogflow_v2beta1_participant_proto_depIdxs,
EnumInfos: file_google_cloud_dialogflow_v2beta1_participant_proto_enumTypes,
MessageInfos: file_google_cloud_dialogflow_v2beta1_participant_proto_msgTypes,
}.Build()
File_google_cloud_dialogflow_v2beta1_participant_proto = out.File
file_google_cloud_dialogflow_v2beta1_participant_proto_rawDesc = nil
file_google_cloud_dialogflow_v2beta1_participant_proto_goTypes = nil
file_google_cloud_dialogflow_v2beta1_participant_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
// ParticipantsClient is the client API for Participants service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ParticipantsClient interface {
// Creates a new participant in a conversation.
CreateParticipant(ctx context.Context, in *CreateParticipantRequest, opts ...grpc.CallOption) (*Participant, error)
// Retrieves a conversation participant.
GetParticipant(ctx context.Context, in *GetParticipantRequest, opts ...grpc.CallOption) (*Participant, error)
// Returns the list of all participants in the specified conversation.
ListParticipants(ctx context.Context, in *ListParticipantsRequest, opts ...grpc.CallOption) (*ListParticipantsResponse, error)
// Updates the specified participant.
UpdateParticipant(ctx context.Context, in *UpdateParticipantRequest, opts ...grpc.CallOption) (*Participant, error)
// Adds a text (chat, for example), or audio (phone recording, for example)
// message from a participant into the conversation.
//
// Note: Always use agent versions for production traffic
// sent to virtual agents. See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
AnalyzeContent(ctx context.Context, in *AnalyzeContentRequest, opts ...grpc.CallOption) (*AnalyzeContentResponse, error)
// Gets suggested articles for a participant based on specific historical
// messages.
//
// Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
// suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
// based on the provided conversation context in the real time.
SuggestArticles(ctx context.Context, in *SuggestArticlesRequest, opts ...grpc.CallOption) (*SuggestArticlesResponse, error)
// Gets suggested faq answers for a participant based on specific historical
// messages.
SuggestFaqAnswers(ctx context.Context, in *SuggestFaqAnswersRequest, opts ...grpc.CallOption) (*SuggestFaqAnswersResponse, error)
// Gets smart replies for a participant based on specific historical
// messages.
SuggestSmartReplies(ctx context.Context, in *SuggestSmartRepliesRequest, opts ...grpc.CallOption) (*SuggestSmartRepliesResponse, error)
// Deprecated: Do not use.
// Deprecated: Use inline suggestion, event based suggestion or
// Suggestion* API instead.
// See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
// details.
// Removal Date: 2020-09-01.
//
// Retrieves suggestions for live agents.
//
// This method should be used by human agent client software to fetch auto
// generated suggestions in real-time, while the conversation with an end user
// is in progress. The functionality is implemented in terms of the
// [list
// pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination)
// design pattern. The client app should use the `next_page_token` field
// to fetch the next batch of suggestions. `suggestions` are sorted by
// `create_time` in descending order.
// To fetch latest suggestion, just set `page_size` to 1.
// To fetch new suggestions without duplication, send request with filter
// `create_time_epoch_microseconds > [first item's create_time of previous
// request]` and empty page_token.
ListSuggestions(ctx context.Context, in *ListSuggestionsRequest, opts ...grpc.CallOption) (*ListSuggestionsResponse, error)
// Deprecated: Do not use.
// Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
//
// Gets suggestions for a participant based on specific historical
// messages.
//
// Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
// suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
// based on the provided conversation context in the real time.
CompileSuggestion(ctx context.Context, in *CompileSuggestionRequest, opts ...grpc.CallOption) (*CompileSuggestionResponse, error)
}
type participantsClient struct {
cc grpc.ClientConnInterface
}
func NewParticipantsClient(cc grpc.ClientConnInterface) ParticipantsClient {
return &participantsClient{cc}
}
func (c *participantsClient) CreateParticipant(ctx context.Context, in *CreateParticipantRequest, opts ...grpc.CallOption) (*Participant, error) {
out := new(Participant)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/CreateParticipant", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) GetParticipant(ctx context.Context, in *GetParticipantRequest, opts ...grpc.CallOption) (*Participant, error) {
out := new(Participant)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/GetParticipant", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) ListParticipants(ctx context.Context, in *ListParticipantsRequest, opts ...grpc.CallOption) (*ListParticipantsResponse, error) {
out := new(ListParticipantsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/ListParticipants", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) UpdateParticipant(ctx context.Context, in *UpdateParticipantRequest, opts ...grpc.CallOption) (*Participant, error) {
out := new(Participant)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/UpdateParticipant", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) AnalyzeContent(ctx context.Context, in *AnalyzeContentRequest, opts ...grpc.CallOption) (*AnalyzeContentResponse, error) {
out := new(AnalyzeContentResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/AnalyzeContent", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) SuggestArticles(ctx context.Context, in *SuggestArticlesRequest, opts ...grpc.CallOption) (*SuggestArticlesResponse, error) {
out := new(SuggestArticlesResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/SuggestArticles", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) SuggestFaqAnswers(ctx context.Context, in *SuggestFaqAnswersRequest, opts ...grpc.CallOption) (*SuggestFaqAnswersResponse, error) {
out := new(SuggestFaqAnswersResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/SuggestFaqAnswers", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *participantsClient) SuggestSmartReplies(ctx context.Context, in *SuggestSmartRepliesRequest, opts ...grpc.CallOption) (*SuggestSmartRepliesResponse, error) {
out := new(SuggestSmartRepliesResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/SuggestSmartReplies", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Deprecated: Do not use.
func (c *participantsClient) ListSuggestions(ctx context.Context, in *ListSuggestionsRequest, opts ...grpc.CallOption) (*ListSuggestionsResponse, error) {
out := new(ListSuggestionsResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/ListSuggestions", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Deprecated: Do not use.
func (c *participantsClient) CompileSuggestion(ctx context.Context, in *CompileSuggestionRequest, opts ...grpc.CallOption) (*CompileSuggestionResponse, error) {
out := new(CompileSuggestionResponse)
err := c.cc.Invoke(ctx, "/google.cloud.dialogflow.v2beta1.Participants/CompileSuggestion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ParticipantsServer is the server API for Participants service.
type ParticipantsServer interface {
// Creates a new participant in a conversation.
CreateParticipant(context.Context, *CreateParticipantRequest) (*Participant, error)
// Retrieves a conversation participant.
GetParticipant(context.Context, *GetParticipantRequest) (*Participant, error)
// Returns the list of all participants in the specified conversation.
ListParticipants(context.Context, *ListParticipantsRequest) (*ListParticipantsResponse, error)
// Updates the specified participant.
UpdateParticipant(context.Context, *UpdateParticipantRequest) (*Participant, error)
// Adds a text (chat, for example), or audio (phone recording, for example)
// message from a participant into the conversation.
//
// Note: Always use agent versions for production traffic
// sent to virtual agents. See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
AnalyzeContent(context.Context, *AnalyzeContentRequest) (*AnalyzeContentResponse, error)
// Gets suggested articles for a participant based on specific historical
// messages.
//
// Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
// suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
// based on the provided conversation context in the real time.
SuggestArticles(context.Context, *SuggestArticlesRequest) (*SuggestArticlesResponse, error)
// Gets suggested faq answers for a participant based on specific historical
// messages.
SuggestFaqAnswers(context.Context, *SuggestFaqAnswersRequest) (*SuggestFaqAnswersResponse, error)
// Gets smart replies for a participant based on specific historical
// messages.
SuggestSmartReplies(context.Context, *SuggestSmartRepliesRequest) (*SuggestSmartRepliesResponse, error)
// Deprecated: Do not use.
// Deprecated: Use inline suggestion, event based suggestion or
// Suggestion* API instead.
// See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more
// details.
// Removal Date: 2020-09-01.
//
// Retrieves suggestions for live agents.
//
// This method should be used by human agent client software to fetch auto
// generated suggestions in real-time, while the conversation with an end user
// is in progress. The functionality is implemented in terms of the
// [list
// pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination)
// design pattern. The client app should use the `next_page_token` field
// to fetch the next batch of suggestions. `suggestions` are sorted by
// `create_time` in descending order.
// To fetch latest suggestion, just set `page_size` to 1.
// To fetch new suggestions without duplication, send request with filter
// `create_time_epoch_microseconds > [first item's create_time of previous
// request]` and empty page_token.
ListSuggestions(context.Context, *ListSuggestionsRequest) (*ListSuggestionsResponse, error)
// Deprecated: Do not use.
// Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead.
//
// Gets suggestions for a participant based on specific historical
// messages.
//
// Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated
// suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion
// based on the provided conversation context in the real time.
CompileSuggestion(context.Context, *CompileSuggestionRequest) (*CompileSuggestionResponse, error)
}
// UnimplementedParticipantsServer can be embedded to have forward compatible implementations.
type UnimplementedParticipantsServer struct {
}
func (*UnimplementedParticipantsServer) CreateParticipant(context.Context, *CreateParticipantRequest) (*Participant, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CreateParticipant not implemented")
}
func (*UnimplementedParticipantsServer) GetParticipant(context.Context, *GetParticipantRequest) (*Participant, error) {
return nil, status1.Errorf(codes.Unimplemented, "method GetParticipant not implemented")
}
func (*UnimplementedParticipantsServer) ListParticipants(context.Context, *ListParticipantsRequest) (*ListParticipantsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListParticipants not implemented")
}
func (*UnimplementedParticipantsServer) UpdateParticipant(context.Context, *UpdateParticipantRequest) (*Participant, error) {
return nil, status1.Errorf(codes.Unimplemented, "method UpdateParticipant not implemented")
}
func (*UnimplementedParticipantsServer) AnalyzeContent(context.Context, *AnalyzeContentRequest) (*AnalyzeContentResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method AnalyzeContent not implemented")
}
func (*UnimplementedParticipantsServer) SuggestArticles(context.Context, *SuggestArticlesRequest) (*SuggestArticlesResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method SuggestArticles not implemented")
}
func (*UnimplementedParticipantsServer) SuggestFaqAnswers(context.Context, *SuggestFaqAnswersRequest) (*SuggestFaqAnswersResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method SuggestFaqAnswers not implemented")
}
func (*UnimplementedParticipantsServer) SuggestSmartReplies(context.Context, *SuggestSmartRepliesRequest) (*SuggestSmartRepliesResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method SuggestSmartReplies not implemented")
}
func (*UnimplementedParticipantsServer) ListSuggestions(context.Context, *ListSuggestionsRequest) (*ListSuggestionsResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method ListSuggestions not implemented")
}
func (*UnimplementedParticipantsServer) CompileSuggestion(context.Context, *CompileSuggestionRequest) (*CompileSuggestionResponse, error) {
return nil, status1.Errorf(codes.Unimplemented, "method CompileSuggestion not implemented")
}
func RegisterParticipantsServer(s *grpc.Server, srv ParticipantsServer) {
s.RegisterService(&_Participants_serviceDesc, srv)
}
func _Participants_CreateParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateParticipantRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).CreateParticipant(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/CreateParticipant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).CreateParticipant(ctx, req.(*CreateParticipantRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_GetParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetParticipantRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).GetParticipant(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/GetParticipant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).GetParticipant(ctx, req.(*GetParticipantRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_ListParticipants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListParticipantsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).ListParticipants(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/ListParticipants",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).ListParticipants(ctx, req.(*ListParticipantsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_UpdateParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateParticipantRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).UpdateParticipant(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/UpdateParticipant",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).UpdateParticipant(ctx, req.(*UpdateParticipantRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_AnalyzeContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AnalyzeContentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).AnalyzeContent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/AnalyzeContent",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).AnalyzeContent(ctx, req.(*AnalyzeContentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_SuggestArticles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SuggestArticlesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).SuggestArticles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/SuggestArticles",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).SuggestArticles(ctx, req.(*SuggestArticlesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_SuggestFaqAnswers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SuggestFaqAnswersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).SuggestFaqAnswers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/SuggestFaqAnswers",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).SuggestFaqAnswers(ctx, req.(*SuggestFaqAnswersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_SuggestSmartReplies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SuggestSmartRepliesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).SuggestSmartReplies(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/SuggestSmartReplies",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).SuggestSmartReplies(ctx, req.(*SuggestSmartRepliesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_ListSuggestions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSuggestionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).ListSuggestions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/ListSuggestions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).ListSuggestions(ctx, req.(*ListSuggestionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Participants_CompileSuggestion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CompileSuggestionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ParticipantsServer).CompileSuggestion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.dialogflow.v2beta1.Participants/CompileSuggestion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ParticipantsServer).CompileSuggestion(ctx, req.(*CompileSuggestionRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Participants_serviceDesc = grpc.ServiceDesc{
ServiceName: "google.cloud.dialogflow.v2beta1.Participants",
HandlerType: (*ParticipantsServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateParticipant",
Handler: _Participants_CreateParticipant_Handler,
},
{
MethodName: "GetParticipant",
Handler: _Participants_GetParticipant_Handler,
},
{
MethodName: "ListParticipants",
Handler: _Participants_ListParticipants_Handler,
},
{
MethodName: "UpdateParticipant",
Handler: _Participants_UpdateParticipant_Handler,
},
{
MethodName: "AnalyzeContent",
Handler: _Participants_AnalyzeContent_Handler,
},
{
MethodName: "SuggestArticles",
Handler: _Participants_SuggestArticles_Handler,
},
{
MethodName: "SuggestFaqAnswers",
Handler: _Participants_SuggestFaqAnswers_Handler,
},
{
MethodName: "SuggestSmartReplies",
Handler: _Participants_SuggestSmartReplies_Handler,
},
{
MethodName: "ListSuggestions",
Handler: _Participants_ListSuggestions_Handler,
},
{
MethodName: "CompileSuggestion",
Handler: _Participants_CompileSuggestion_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "google/cloud/dialogflow/v2beta1/participant.proto",
}
| googleapis/go-genproto | googleapis/cloud/dialogflow/v2beta1/participant.pb.go | GO | apache-2.0 | 257,075 |
# Find nosetests; see shaderc_add_nosetests() from utils.cmake for opting in to
# nosetests in a specific directory.
if(NOT COMMAND find_host_package)
macro(find_host_package)
find_package(${ARGN})
endmacro()
endif()
if(NOT COMMAND find_host_program)
macro(find_host_program)
find_program(${ARGN})
endmacro()
endif()
find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH})
if (NOT NOSETESTS_EXE)
message(STATUS "nosetests was not found - python code will not be tested")
endif()
# Find asciidoctor; see shaderc_add_asciidoc() from utils.cmake for
# adding documents.
find_program(ASCIIDOCTOR_EXE NAMES asciidoctor)
if (NOT ASCIIDOCTOR_EXE)
message(STATUS "asciidoctor was not found - no documentation will be"
" generated")
endif()
# On Windows, CMake by default compiles with the shared CRT.
# Ensure that gmock compiles the same, otherwise failures will occur.
if(WIN32)
# TODO(awoloszyn): Once we support selecting CRT versions,
# make sure this matches correctly.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif(WIN32)
if (ANDROID)
# For android let's preemptively find the correct packages so that
# child projects (glslang, googletest) do not fail to find them.
# Tests in glslc and SPIRV-Tools tests require Python 3, or a Python 2
# with the "future" package. Require Python 3 because we can't force
# developers to manually install the "future" package.
find_host_package(PythonInterp 3 REQUIRED)
find_host_package(BISON)
else()
find_package(PythonInterp 3 REQUIRED)
endif()
option(ENABLE_CODE_COVERAGE "Enable collecting code coverage." OFF)
if (ENABLE_CODE_COVERAGE)
message(STATUS "Shaderc: code coverage report is on.")
if (NOT UNIX)
message(FATAL_ERROR "Code coverage on non-UNIX system not supported yet.")
endif()
if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(FATAL_ERROR "Code coverage with non-Debug build can be misleading.")
endif()
find_program(LCOV_EXE NAMES lcov)
if (NOT LCOV_EXE)
message(FATAL_ERROR "lcov was not found")
endif()
find_program(GENHTML_EXE NAMES genhtml)
if (NOT GENHTML_EXE)
message(FATAL_ERROR "genhtml was not found")
endif()
set(LCOV_BASE_DIR ${CMAKE_BINARY_DIR})
set(LCOV_INFO_FILE ${LCOV_BASE_DIR}/lcov.info)
set(COVERAGE_STAT_HTML_DIR ${LCOV_BASE_DIR}/coverage-report)
add_custom_target(clean-coverage
# Remove all gcov .gcda files in the directory recursively.
COMMAND ${LCOV_EXE} --directory . --zerocounters -q
# Remove all lcov .info files.
COMMAND ${CMAKE_COMMAND} -E remove ${LCOV_INFO_FILE}
# Remove all html report files.
COMMAND ${CMAKE_COMMAND} -E remove_directory ${COVERAGE_STAT_HTML_DIR}
# TODO(antiagainst): the following two commands are here to remedy the
# problem of "reached unexpected end of file" experienced by lcov.
# The symptom is that some .gcno files are wrong after code change and
# recompiling. We don't know the exact reason yet. Figure it out.
# Remove all .gcno files in the directory recursively.
COMMAND ${PYTHON_EXECUTABLE}
${shaderc_SOURCE_DIR}/utils/remove-file-by-suffix.py . ".gcno"
# .gcno files are not tracked by CMake. So no recompiling is triggered
# even if they are missing. Unfortunately, we just removed all of them
# in the above.
COMMAND ${CMAKE_COMMAND} --build . --target clean
WORKING_DIRECTORY ${LCOV_BASE_DIR}
COMMENT "Clean coverage files"
)
add_custom_target(report-coverage
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}
# Run all tests.
COMMAND ctest --output-on-failure
# Collect coverage data from gcov .gcda files.
COMMAND ${LCOV_EXE} --directory . --capture -o ${LCOV_INFO_FILE}
# Remove coverage info for system header files.
COMMAND ${LCOV_EXE}
--remove ${LCOV_INFO_FILE} '/usr/include/*' -o ${LCOV_INFO_FILE}
# Remove coverage info for external and third_party code.
COMMAND ${LCOV_EXE}
--remove ${LCOV_INFO_FILE} '${shaderc_SOURCE_DIR}/ext/*'
-o ${LCOV_INFO_FILE}
COMMAND ${LCOV_EXE}
--remove ${LCOV_INFO_FILE} '${shaderc_SOURCE_DIR}/third_party/*'
-o ${LCOV_INFO_FILE}
# Remove coverage info for tests.
COMMAND ${LCOV_EXE}
--remove ${LCOV_INFO_FILE} '*_test.cc' -o ${LCOV_INFO_FILE}
# Generate html report file.
COMMAND ${GENHTML_EXE}
${LCOV_INFO_FILE} -t "Coverage Report" -o ${COVERAGE_STAT_HTML_DIR}
DEPENDS clean-coverage
WORKING_DIRECTORY ${LCOV_BASE_DIR}
COMMENT "Collect and analyze coverage data"
)
endif()
option(DISABLE_RTTI "Disable RTTI in builds")
if(DISABLE_RTTI)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif(UNIX)
endif(DISABLE_RTTI)
option(DISABLE_EXCEPTIONS "Disables exceptions in builds")
if(DISABLE_EXCEPTIONS)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
endif(UNIX)
endif(DISABLE_EXCEPTIONS)
| antiagainst/shaderc | cmake/setup_build.cmake | CMake | apache-2.0 | 4,925 |
package com.sproutigy.commons.binary.impl;
import com.sproutigy.commons.binary.Binary;
import java.io.IOException;
import java.io.InputStream;
/**
* @author LukeAheadNET
*/
public abstract class AbstractStreamableBinary extends Binary {
public AbstractStreamableBinary() {
}
public AbstractStreamableBinary(long length) {
super(length);
}
@Override
public byte[] asByteArray(boolean modifiable) throws IOException {
long length = this.length;
InputStream in = asStream();
try {
return readBytesFromStream(in, length);
} finally {
in.close();
}
}
@Override
public abstract InputStream asStream() throws IOException;
@Override
public Binary subrange(long offset, long length) throws IOException {
InputStream stream = asStream();
try {
long skipped = stream.skip(offset);
if (skipped < offset) {
throw new IndexOutOfBoundsException("Out of data range");
}
return Binary.from(readBytesFromStream(stream, length));
} finally {
stream.close();
}
}
}
| Sproutigy/Java-Commons-RawData | src/main/java/com/sproutigy/commons/binary/impl/AbstractStreamableBinary.java | Java | apache-2.0 | 1,186 |
/*
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.
*/
/* Fixed Data in ROM - Field and Curve parameters */
package ANSSI
// Base Bits= 56
var Modulus = [...]Chunk{0xFCF353D86E9C03, 0xADBCABC8CA6DE8, 0xE8CE42435B3961, 0xB3AD58F10126D, 0xF1FD178C}
var R2modp = [...]Chunk{0x18D2374288CC9C, 0x4929E67646BD2B, 0x220E6C1D6F7F2D, 0x751B1FDABCE02E, 0xE7401B78}
const MConst Chunk = 0x97483A164E1155
const CURVE_Cof_I int = 1
var CURVE_Cof = [...]Chunk{0x1, 0x0, 0x0, 0x0, 0x0}
const CURVE_A int = -3
const CURVE_B_I int = 0
var CURVE_B = [...]Chunk{0x75ED967B7BB73F, 0xC9AE4B1A18030, 0x754A44C00FDFEC, 0x5428A9300D4ABA, 0xEE353FCA}
var CURVE_Order = [...]Chunk{0xFDD459C6D655E1, 0x67E140D2BF941F, 0xE8CE42435B53DC, 0xB3AD58F10126D, 0xF1FD178C}
var CURVE_Gx = [...]Chunk{0xC97A2DD98F5CFF, 0xD2DCAF98B70164, 0x4749D423958C27, 0x56C139EB31183D, 0xB6B3D4C3}
var CURVE_Gy = [...]Chunk{0x115A1554062CFB, 0xC307E8E4C9E183, 0xF0F3ECEF8C2701, 0xC8B204911F9271, 0x6142E0F7}
| miracl/amcl | version3/go/ROM_ANSSI_64.go | GO | apache-2.0 | 1,672 |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_Mono_Security_Cryptography_SymmetricTrans1394030013.h"
// System.UInt32[]
struct UInt32U5BU5D_t59386216;
// System.Byte[]
struct ByteU5BU5D_t3397334013;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Security.Cryptography.RijndaelTransform
struct RijndaelTransform_t1067822295 : public SymmetricTransform_t1394030013
{
public:
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::expandedKey
UInt32U5BU5D_t59386216* ___expandedKey_12;
// System.Int32 System.Security.Cryptography.RijndaelTransform::Nb
int32_t ___Nb_13;
// System.Int32 System.Security.Cryptography.RijndaelTransform::Nk
int32_t ___Nk_14;
// System.Int32 System.Security.Cryptography.RijndaelTransform::Nr
int32_t ___Nr_15;
public:
inline static int32_t get_offset_of_expandedKey_12() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295, ___expandedKey_12)); }
inline UInt32U5BU5D_t59386216* get_expandedKey_12() const { return ___expandedKey_12; }
inline UInt32U5BU5D_t59386216** get_address_of_expandedKey_12() { return &___expandedKey_12; }
inline void set_expandedKey_12(UInt32U5BU5D_t59386216* value)
{
___expandedKey_12 = value;
Il2CppCodeGenWriteBarrier(&___expandedKey_12, value);
}
inline static int32_t get_offset_of_Nb_13() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295, ___Nb_13)); }
inline int32_t get_Nb_13() const { return ___Nb_13; }
inline int32_t* get_address_of_Nb_13() { return &___Nb_13; }
inline void set_Nb_13(int32_t value)
{
___Nb_13 = value;
}
inline static int32_t get_offset_of_Nk_14() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295, ___Nk_14)); }
inline int32_t get_Nk_14() const { return ___Nk_14; }
inline int32_t* get_address_of_Nk_14() { return &___Nk_14; }
inline void set_Nk_14(int32_t value)
{
___Nk_14 = value;
}
inline static int32_t get_offset_of_Nr_15() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295, ___Nr_15)); }
inline int32_t get_Nr_15() const { return ___Nr_15; }
inline int32_t* get_address_of_Nr_15() { return &___Nr_15; }
inline void set_Nr_15(int32_t value)
{
___Nr_15 = value;
}
};
struct RijndaelTransform_t1067822295_StaticFields
{
public:
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::Rcon
UInt32U5BU5D_t59386216* ___Rcon_16;
// System.Byte[] System.Security.Cryptography.RijndaelTransform::SBox
ByteU5BU5D_t3397334013* ___SBox_17;
// System.Byte[] System.Security.Cryptography.RijndaelTransform::iSBox
ByteU5BU5D_t3397334013* ___iSBox_18;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::T0
UInt32U5BU5D_t59386216* ___T0_19;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::T1
UInt32U5BU5D_t59386216* ___T1_20;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::T2
UInt32U5BU5D_t59386216* ___T2_21;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::T3
UInt32U5BU5D_t59386216* ___T3_22;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::iT0
UInt32U5BU5D_t59386216* ___iT0_23;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::iT1
UInt32U5BU5D_t59386216* ___iT1_24;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::iT2
UInt32U5BU5D_t59386216* ___iT2_25;
// System.UInt32[] System.Security.Cryptography.RijndaelTransform::iT3
UInt32U5BU5D_t59386216* ___iT3_26;
public:
inline static int32_t get_offset_of_Rcon_16() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___Rcon_16)); }
inline UInt32U5BU5D_t59386216* get_Rcon_16() const { return ___Rcon_16; }
inline UInt32U5BU5D_t59386216** get_address_of_Rcon_16() { return &___Rcon_16; }
inline void set_Rcon_16(UInt32U5BU5D_t59386216* value)
{
___Rcon_16 = value;
Il2CppCodeGenWriteBarrier(&___Rcon_16, value);
}
inline static int32_t get_offset_of_SBox_17() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___SBox_17)); }
inline ByteU5BU5D_t3397334013* get_SBox_17() const { return ___SBox_17; }
inline ByteU5BU5D_t3397334013** get_address_of_SBox_17() { return &___SBox_17; }
inline void set_SBox_17(ByteU5BU5D_t3397334013* value)
{
___SBox_17 = value;
Il2CppCodeGenWriteBarrier(&___SBox_17, value);
}
inline static int32_t get_offset_of_iSBox_18() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___iSBox_18)); }
inline ByteU5BU5D_t3397334013* get_iSBox_18() const { return ___iSBox_18; }
inline ByteU5BU5D_t3397334013** get_address_of_iSBox_18() { return &___iSBox_18; }
inline void set_iSBox_18(ByteU5BU5D_t3397334013* value)
{
___iSBox_18 = value;
Il2CppCodeGenWriteBarrier(&___iSBox_18, value);
}
inline static int32_t get_offset_of_T0_19() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___T0_19)); }
inline UInt32U5BU5D_t59386216* get_T0_19() const { return ___T0_19; }
inline UInt32U5BU5D_t59386216** get_address_of_T0_19() { return &___T0_19; }
inline void set_T0_19(UInt32U5BU5D_t59386216* value)
{
___T0_19 = value;
Il2CppCodeGenWriteBarrier(&___T0_19, value);
}
inline static int32_t get_offset_of_T1_20() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___T1_20)); }
inline UInt32U5BU5D_t59386216* get_T1_20() const { return ___T1_20; }
inline UInt32U5BU5D_t59386216** get_address_of_T1_20() { return &___T1_20; }
inline void set_T1_20(UInt32U5BU5D_t59386216* value)
{
___T1_20 = value;
Il2CppCodeGenWriteBarrier(&___T1_20, value);
}
inline static int32_t get_offset_of_T2_21() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___T2_21)); }
inline UInt32U5BU5D_t59386216* get_T2_21() const { return ___T2_21; }
inline UInt32U5BU5D_t59386216** get_address_of_T2_21() { return &___T2_21; }
inline void set_T2_21(UInt32U5BU5D_t59386216* value)
{
___T2_21 = value;
Il2CppCodeGenWriteBarrier(&___T2_21, value);
}
inline static int32_t get_offset_of_T3_22() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___T3_22)); }
inline UInt32U5BU5D_t59386216* get_T3_22() const { return ___T3_22; }
inline UInt32U5BU5D_t59386216** get_address_of_T3_22() { return &___T3_22; }
inline void set_T3_22(UInt32U5BU5D_t59386216* value)
{
___T3_22 = value;
Il2CppCodeGenWriteBarrier(&___T3_22, value);
}
inline static int32_t get_offset_of_iT0_23() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___iT0_23)); }
inline UInt32U5BU5D_t59386216* get_iT0_23() const { return ___iT0_23; }
inline UInt32U5BU5D_t59386216** get_address_of_iT0_23() { return &___iT0_23; }
inline void set_iT0_23(UInt32U5BU5D_t59386216* value)
{
___iT0_23 = value;
Il2CppCodeGenWriteBarrier(&___iT0_23, value);
}
inline static int32_t get_offset_of_iT1_24() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___iT1_24)); }
inline UInt32U5BU5D_t59386216* get_iT1_24() const { return ___iT1_24; }
inline UInt32U5BU5D_t59386216** get_address_of_iT1_24() { return &___iT1_24; }
inline void set_iT1_24(UInt32U5BU5D_t59386216* value)
{
___iT1_24 = value;
Il2CppCodeGenWriteBarrier(&___iT1_24, value);
}
inline static int32_t get_offset_of_iT2_25() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___iT2_25)); }
inline UInt32U5BU5D_t59386216* get_iT2_25() const { return ___iT2_25; }
inline UInt32U5BU5D_t59386216** get_address_of_iT2_25() { return &___iT2_25; }
inline void set_iT2_25(UInt32U5BU5D_t59386216* value)
{
___iT2_25 = value;
Il2CppCodeGenWriteBarrier(&___iT2_25, value);
}
inline static int32_t get_offset_of_iT3_26() { return static_cast<int32_t>(offsetof(RijndaelTransform_t1067822295_StaticFields, ___iT3_26)); }
inline UInt32U5BU5D_t59386216* get_iT3_26() const { return ___iT3_26; }
inline UInt32U5BU5D_t59386216** get_address_of_iT3_26() { return &___iT3_26; }
inline void set_iT3_26(UInt32U5BU5D_t59386216* value)
{
___iT3_26 = value;
Il2CppCodeGenWriteBarrier(&___iT3_26, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| WestlakeAPC/unity-game | Xcode Project/Classes/Native/mscorlib_System_Security_Cryptography_RijndaelTran1067822295.h | C | apache-2.0 | 8,451 |
using Aardvark.Base;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
// Important: .NET 4.5 contains full zip support.
namespace Aardvark.Base.Coder.Legacy
{
/// <summary>
/// Important: .NET 4.5 contains full zip support.
/// Read-Only access to ZipFiles.
/// </summary>
public class ZipFile : IDisposable
{
#region private fields
private struct SubFileHeader
{
public int ZipFileIndex;
public long LocalHeaderOffset;
public long LocalHeaderSize;
public long CompressedSize;
public long UncompressedSize;
}
private string[] m_ZipFileNames = new string[0];
private WeakReference[] m_ZipFileStreams = new WeakReference[0];
private SymbolDict<SubFileHeader> m_Files = new SymbolDict<SubFileHeader>();
private SymbolSet m_Directories = new SymbolSet();
private bool m_contentCaseSensitive = false;
#endregion
#region public properties or fields
/// <summary>
/// Returns the Name of the Container Parts.
/// if different parts: e.g. OPC.z01, OPC.z02, ..., OPC.zip
/// if single part: e.g. OPC.zip
/// </summary>
public string[] ZipFileNames
{
get { return m_ZipFileNames; }
}
public string MainZipFileName
{
get { return m_ZipFileNames.Last(); }
}
/// <summary>
/// Names of files inside of the ZipFile.
/// </summary>
public IEnumerable<string> FileNames
{
get { return m_Files.Keys.Select(sym => sym.ToString()); }
}
/// <summary>
/// Naems of directories inside of the ZipFile.
/// </summary>
public IEnumerable<string> DirectoryNames
{
get { return m_Directories.Keys.Select(sym => sym.ToString()); }
}
#endregion
public ZipFile() { }
/// <summary>
/// Initializes container.
/// </summary>
/// <param name="containerPath"></param>
public ZipFile(string containerPath)
{
Init(containerPath);
}
/// <summary>
/// </summary>
/// <param name="contentCaseSensitive">Load and handle content case sensitive.</param>
public ZipFile(bool contentCaseSensitive)
{
m_contentCaseSensitive = contentCaseSensitive;
}
/// <summary>
/// Reads Zip file central directory for later access.
/// </summary>
/// <param name="containerPath">Path to main zip container (e.g. MyZip.zip).</param>
/// <returns></returns>
public bool Init(string containerPath)
{
if (string.IsNullOrWhiteSpace(containerPath)) throw new ArgumentNullException(nameof(containerPath));
Report.BeginTimed("Init Zip container '" + containerPath + "'.");
FileStream mainFileStream = null;
FileStream[] zipStreams = new FileStream[0];
try
{
mainFileStream = File.Open(containerPath, FileMode.Open, FileAccess.Read, FileShare.None);
// Load End Of Central Directory Record
var zipEoCDR = new TZipEndOfCentralDirectoryRecord();
zipEoCDR.Load(mainFileStream);
if (zipEoCDR.Position < 0)
throw new Exception("ZipFile: couldn't find central directory record.");
int numberOfEntries = zipEoCDR.cd_totalEntries;
long cd_offset = zipEoCDR.cd_offset;
int cd_diskId = zipEoCDR.cd_diskId;
// init number of zip containers
m_ZipFileNames = new string[zipEoCDR.cd_diskId + 1];
m_ZipFileNames[zipEoCDR.cd_diskId] = containerPath;
zipStreams = new FileStream[zipEoCDR.cd_diskId + 1];
zipStreams[zipEoCDR.cd_diskId] = mainFileStream;
// Load all parts of a multi zip
if (zipEoCDR.cd_diskId > 0)
{
Report.Line("Is multi zip container.");
// Segment 1 = filename.z01
// Segment n-1 = filename.z(n-1)
// Segment n = filename.zip
var baseName =
0 == containerPath.Substring(containerPath.Length - 4).ToLower().CompareTo(".zip") ?
containerPath.Substring(0, containerPath.Length - 4) :
containerPath;
baseName += ".z";
for (int i = 0; i < zipEoCDR.cd_diskId; i++)
{
m_ZipFileNames[i] = baseName + (i+1).ToString("D2");
zipStreams[i] = File.Open(m_ZipFileNames[i], FileMode.Open, FileAccess.Read, FileShare.None);
}
}
// Try to load Zip64 End Of Central Directory Locator
var zip64Locator = new TZip64EndOfCentralDirectoryLocator();
zip64Locator.Load(mainFileStream, zipEoCDR.Position);
if (zip64Locator.IsValid)
{
Report.Line("Is Zip64 container.");
// Load Zip64 End of Central Directory Record
var zip64EoCDR = new TZip64EndOfCentralDirectoryRecord();
zip64EoCDR.Load(
zipStreams[zip64Locator.ecd64_diskId],
(long)zip64Locator.ecd64_relOffset
);
numberOfEntries = (int)zip64EoCDR.cd_totalEntries;
cd_offset = (long)zip64EoCDR.cd_offset;
cd_diskId = (int)zip64EoCDR.cd_diskId;
}
// Load file headers in central directory
this.ReadZipCentralDirectoryFileHeaders(zipStreams, cd_diskId, cd_offset, numberOfEntries);
// save weak links to streams
m_ZipFileStreams = new WeakReference[zipStreams.Length];
for (int i = 0; i < zipStreams.Length; i++)
m_ZipFileStreams[i] = new WeakReference(zipStreams[i]);
}
catch (Exception)
{
Report.Warn("Error initializing container.");
Report.End();
foreach (var stream in zipStreams)
if (stream != null) stream.Close();
if (mainFileStream != null) mainFileStream.Close();
return false;
}
Report.End("Init Zip container finished.");
return true;
}
public static bool IsZipFile(string fileName)
{
if (string.IsNullOrWhiteSpace(fileName)) throw new ArgumentNullException(nameof(fileName));
using (var fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.None))
{
// Load End Of Central Directory Record
var zipEoCDR = new TZipEndOfCentralDirectoryRecord();
zipEoCDR.Load(fileStream);
if (zipEoCDR.Position > 0) return true;
}
return false;
}
/// <summary>
/// Tests if a requested file, indexed by fileName, exists in the ContainerFile.
/// </summary>
/// <param name="fileName">Name of the requested file.</param>
/// <returns>Indication wheter the file exists or not.</returns>
public bool FileExists(string fileName)
{
fileName = SanitizeFilename(fileName);
return m_Files.ContainsKey(fileName);
}
/// <summary>
/// Tests if a requested directory, indexed by its path, exists in the ContainerFile.
/// </summary>
/// <param name="path">Path of the requested directory.</param>
/// <returns>Indication wheter the directory exists or not.</returns>
public bool DirectoryExists(string path)
{
path = SanitizeFilename(path);
return this.m_Directories.Contains(path);
}
/// <summary>
/// Get directories of local path in ZipFile.
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public string[] GetDirectories(string path)
{
path = SanitizeFilename(path);
var dirs = m_Directories
.Select(dirSym => dirSym.ToString())
.Where(dir => dir.StartsWith(path));
if (dirs.IsEmpty()) throw new DirectoryNotFoundException();
var dirLevel = path.Count(c => c == '\\');
return dirs
.Where(dir => dir.Count(c => c == '\\') == dirLevel + 1)
.ToArray();
}
/// <summary>
/// Get files of local path in ZipFile.
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public string[] GetFiles(string path)
{
path = SanitizeFilename(path);
var dirs = m_Files.Keys
.Select(dirSym => dirSym.ToString())
.Where(dir => dir.StartsWith(path));
if (dirs.IsEmpty()) throw new DirectoryNotFoundException();
var dirLevel = path.Count(c => c == '\\');
return dirs
.Where(dir => dir.Count(c => c == '\\') == dirLevel + 1)
.ToArray();
}
public Stream GetStream(string fileName)
{
fileName = SanitizeFilename(fileName);
return GetStream((Symbol)fileName);
}
public Stream GetStream(Symbol fileName)
{
SubFileHeader fileHeader;
if (m_Files.TryGetValue(fileName, out fileHeader))
{
var totalStreamsLength = 0L;
var fileIndex = fileHeader.ZipFileIndex;
var fileStreams = new List<FileStream>();
// check header size
if (fileHeader.LocalHeaderSize <= 0)
{
var fileStream = GetZipFileStream(fileIndex);
fileStream.Seek(fileHeader.LocalHeaderOffset, SeekOrigin.Begin);
var localFileHeader = new TZipLocalFileHeader();
localFileHeader.Load(fileStream);
fileHeader.LocalHeaderSize = localFileHeader.Length;
}
// open streams
while (totalStreamsLength < (fileHeader.LocalHeaderOffset + fileHeader.LocalHeaderSize + fileHeader.CompressedSize))
{
fileStreams.Add(GetZipFileStream(fileIndex++));
totalStreamsLength += fileStreams.Last().Length;
}
return new UberStream(fileStreams.ToArray(), fileHeader.LocalHeaderOffset + fileHeader.LocalHeaderSize, fileHeader.UncompressedSize);
}
else return null;
}
public void CloseAllFileStreams()
{
for (int i = 0; i < m_ZipFileStreams.Length; i++)
{
if (m_ZipFileStreams[i].Target != null)
{
var stream = m_ZipFileStreams[i].Target as FileStream;
stream.Close();
m_ZipFileStreams[i].Target = null;
}
}
}
#region implement IDisposable
public void Dispose()
{
CloseAllFileStreams();
}
#endregion
#region private methods
private FileStream GetZipFileStream(int fileIndex)
{
FileStream stream = null;
if (m_ZipFileStreams[fileIndex].Target != null)
stream = m_ZipFileStreams[fileIndex].Target as FileStream;
if (stream == null || !stream.CanRead)
{
if (stream != null) stream.Close();
stream = File.Open(m_ZipFileNames[fileIndex],
FileMode.Open, FileAccess.Read, FileShare.Read);
m_ZipFileStreams[fileIndex].Target = stream;
}
return stream;
}
/// <summary>
/// Reads directory of ZipFiles.
/// </summary>
/// <param name="streams">FileStreams of zip container.</param>
/// <param name="cd_diskId">Id of central directory in streams.</param>
/// <param name="cd_offset">Offset of central directory in stream.</param>
/// <param name="numberOfEntries">Number of entries in central directory.</param>
private void ReadZipCentralDirectoryFileHeaders(FileStream[] streams, int cd_diskId, long cd_offset, int numberOfEntries)
{
var mainFileStream = streams[cd_diskId];
mainFileStream.Seek(cd_offset, SeekOrigin.Begin);
//Deserialize stream data according to number of Entries
for (uint i = 0; i < numberOfEntries; i++)
{
var cd_fileHeader = new TZipCentralDirectoryFileHeader();
cd_fileHeader.Load(mainFileStream);
// is file or directory?
var fileName = SanitizeFilename(cd_fileHeader.filename);
if (fileName.Last() != '\\')
{
m_Files.Add(fileName,
new SubFileHeader()
{
ZipFileIndex = cd_fileHeader.diskStart,
CompressedSize = (long)cd_fileHeader.sizeComp,
UncompressedSize = (long)cd_fileHeader.sizeUncomp,
LocalHeaderOffset = (long)cd_fileHeader.hdrRelOffset,
LocalHeaderSize = 0
});
}
else
{
this.m_Directories.Add(fileName.Substring(0, cd_fileHeader.filename.Length - 1));
}
}
}
private string SanitizeFilename(string fileName)
{
if (!m_contentCaseSensitive)
fileName = fileName.ToLower();
return fileName
.Replace('/', '\\');
//.Replace('?', 'ä');
}
#endregion
}
}
| vrvis/aardvark.base | src/Aardvark.Base.IO/ZipFileContainer.cs | C# | apache-2.0 | 14,425 |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2018 Authors of Cilium
package cmd
import (
"github.com/spf13/cobra"
)
// nodeCmd represents the node command
var nodeCmd = &cobra.Command{
Use: "node",
Short: "Manage cluster nodes",
}
func init() {
rootCmd.AddCommand(nodeCmd)
}
| tklauser/cilium | cilium/cmd/node.go | GO | apache-2.0 | 292 |
/*
* File: rtwtypes.h
*
* MATLAB Coder version : 2.6
* C/C++ source code generated on : 28-Aug-2015 10:33:25
*/
#ifndef __RTWTYPES_H__
#define __RTWTYPES_H__
#ifndef __TMWTYPES__
#define __TMWTYPES__
/*=======================================================================*
* Target hardware information
* Device type: Generic->MATLAB Host Computer
* Number of bits: char: 8 short: 16 int: 32
* long: 32 long long: 64
* native word size: 32
* Byte ordering: LittleEndian
* Signed integer division rounds to: Zero
* Shift right on a signed integer as arithmetic shift: on
*=======================================================================*/
/*=======================================================================*
* Fixed width word size data types: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
* real32_T, real64_T - 32 and 64 bit floating point numbers *
*=======================================================================*/
typedef signed char int8_T;
typedef unsigned char uint8_T;
typedef short int16_T;
typedef unsigned short uint16_T;
typedef int int32_T;
typedef unsigned int uint32_T;
typedef long long int64_T;
typedef unsigned long long uint64_T;
typedef float real32_T;
typedef double real64_T;
/*===========================================================================*
* Generic type definitions: real_T, time_T, boolean_T, int_T, uint_T, *
* ulong_T, ulonglong_T, char_T and byte_T. *
*===========================================================================*/
typedef double real_T;
typedef double time_T;
typedef unsigned char boolean_T;
typedef int int_T;
typedef unsigned int uint_T;
typedef unsigned long ulong_T;
typedef unsigned long long ulonglong_T;
typedef char char_T;
typedef char_T byte_T;
/*===========================================================================*
* Complex number type definitions *
*===========================================================================*/
#define CREAL_T
typedef struct {
real32_T re;
real32_T im;
} creal32_T;
typedef struct {
real64_T re;
real64_T im;
} creal64_T;
typedef struct {
real_T re;
real_T im;
} creal_T;
typedef struct {
int8_T re;
int8_T im;
} cint8_T;
typedef struct {
uint8_T re;
uint8_T im;
} cuint8_T;
typedef struct {
int16_T re;
int16_T im;
} cint16_T;
typedef struct {
uint16_T re;
uint16_T im;
} cuint16_T;
typedef struct {
int32_T re;
int32_T im;
} cint32_T;
typedef struct {
uint32_T re;
uint32_T im;
} cuint32_T;
typedef struct {
int64_T re;
int64_T im;
} cint64_T;
typedef struct {
uint64_T re;
uint64_T im;
} cuint64_T;
/*=======================================================================*
* Min and Max: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
#define MAX_int8_T ((int8_T)(127))
#define MIN_int8_T ((int8_T)(-128))
#define MAX_uint8_T ((uint8_T)(255))
#define MIN_uint8_T ((uint8_T)(0))
#define MAX_int16_T ((int16_T)(32767))
#define MIN_int16_T ((int16_T)(-32768))
#define MAX_uint16_T ((uint16_T)(65535))
#define MIN_uint16_T ((uint16_T)(0))
#define MAX_int32_T ((int32_T)(2147483647))
#define MIN_int32_T ((int32_T)(-2147483647-1))
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU))
#define MIN_uint32_T ((uint32_T)(0))
#define MAX_int64_T ((int64_T)(9223372036854775807LL))
#define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
#define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
#define MIN_uint64_T ((uint64_T)(0ULL))
/* Logical type definitions */
#if !defined(__cplusplus) && !defined(__true_false_are_keywords)
# ifndef false
# define false (0U)
# endif
# ifndef true
# define true (1U)
# endif
#endif
/*
* Maximum length of a MATLAB identifier (function/variable)
* including the null-termination character. Referenced by
* rt_logging.c and rt_matrx.c.
*/
#define TMW_NAME_LENGTH_MAX 64
#endif
#endif
/*
* File trailer for rtwtypes.h
*
* [EOF]
*/
| tn0432/ardrone2islabdriver | navdata_islab/transform_mag/rtwtypes.h | C | apache-2.0 | 4,905 |
/*
This file is part of the VRender library.
Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
Version 1.0.0, released on June 27, 2005.
http://artis.imag.fr/Members/Cyril.Soler/VRender
VRender 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.
VRender 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 VRender; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/****************************************************************************
Copyright (C) 2002-2011 Gilles Debunne. All rights reserved.
This file is part of the QGLViewer library version 2.3.10.
http://www.libqglviewer.com - contact@libqglviewer.com
This file may be used under the terms of the GNU General Public License
versions 2.0 or 3.0 as published by the Free Software Foundation and
appearing in the LICENSE file included in the packaging of this file.
In addition, as a special exception, Gilles Debunne gives you certain
additional rights, described in the file GPL_EXCEPTION in this package.
libQGLViewer uses dual licensing. Commercial/proprietary software must
purchase a libQGLViewer Commercial License.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************************/
#ifndef _VRENDER_H_
#define _VRENDER_H_
#include "../config.h"
#if QT_VERSION >= 0x040000
# include <QTextStream>
# include <QString>
#else
# include <qtextstream.h>
# include <qstring.h>
#endif
#include "../qglviewer.h"
namespace vrender
{
class VRenderParams ;
typedef void (*RenderCB)(void *) ;
typedef void (*ProgressFunction)(float,const QString&) ;
void VectorialRender(RenderCB DrawFunc, void *callback_params, VRenderParams& render_params) ;
class VRenderParams
{
public:
VRenderParams() ;
~VRenderParams() ;
enum VRenderSortMethod { NoSorting, BSPSort, TopologicalSort, AdvancedTopologicalSort };
enum VRenderFormat { EPS, PS, XFIG, SVG };
enum VRenderOption { CullHiddenFaces = 0x1,
OptimizeBackFaceCulling = 0x4,
RenderBlackAndWhite = 0x8,
AddBackground = 0x10,
TightenBoundingBox = 0x20 } ;
int sortMethod() { return _sortMethod; }
void setSortMethod(VRenderParams::VRenderSortMethod s) { _sortMethod = s ; }
int format() { return _format; }
void setFormat(VRenderFormat f) { _format = f; }
const QString filename() { return _filename ; }
void setFilename(const QString& filename) ;
void setOption(VRenderOption,bool) ;
bool isEnabled(VRenderOption) ;
void setProgressFunction(ProgressFunction pf) { _progress_function = pf ; }
private:
int _error;
VRenderSortMethod _sortMethod;
VRenderFormat _format ;
ProgressFunction _progress_function ;
unsigned int _options; // _DrawMode; _ClearBG; _TightenBB;
QString _filename;
friend void VectorialRender( RenderCB render_callback,
void *callback_params,
VRenderParams& vparams);
friend class ParserGL ;
friend class Exporter ;
friend class BSPSortMethod ;
friend class VisibilityOptimizer ;
friend class TopologicalSortMethod ;
friend class TopologicalSortUtils ;
int& error() { return _error ; }
int& size() { static int size=1000000; return size ; }
void progress(float,const QString&) ;
};
}
#endif
| billhj/Etoile2015 | extern/QGLViewer/VRender/VRender.h | C | apache-2.0 | 3,902 |
/*
* 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.servicecomb.service.center.client.model;
public class MicroserviceResponse {
private Microservice service;
public Microservice getService() {
return service;
}
public void setService(Microservice service) {
this.service = service;
}
}
| ServiceComb/java-chassis | clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/model/MicroserviceResponse.java | Java | apache-2.0 | 1,078 |
--TEST--
Decimal128: [basx055] strings without E cannot generate E in result
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php
DO NOT EDIT THIS FILE
--FILE--
<?php
require_once __DIR__ . '/../utils/basic.inc';
$canonicalBson = hex2bin('180000001364000500000000000000000000000000303000');
$canonicalExtJson = '{"d" : {"$numberDecimal" : "5E-8"}}';
$degenerateExtJson = '{"d" : {"$numberDecimal" : "0.00000005"}}';
// Canonical BSON -> Native -> Canonical BSON
echo bin2hex(fromPHP(toPHP($canonicalBson))), "\n";
// Canonical BSON -> Canonical extJSON
echo json_canonicalize(toCanonicalExtendedJSON($canonicalBson)), "\n";
// Canonical extJSON -> Canonical BSON
echo bin2hex(fromJSON($canonicalExtJson)), "\n";
// Degenerate extJSON -> Canonical BSON
echo bin2hex(fromJSON($degenerateExtJson)), "\n";
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
180000001364000500000000000000000000000000303000
{"d":{"$numberDecimal":"5E-8"}}
180000001364000500000000000000000000000000303000
180000001364000500000000000000000000000000303000
===DONE=== | jmikola/mongo-php-driver | tests/bson-corpus/decimal128-4-valid-006.phpt | PHP | apache-2.0 | 1,056 |
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* 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.
*/
#include "main/glheader.h"
#include "main/context.h"
#include "main/formats.h"
#include "main/format_unpack.h"
#include "main/format_pack.h"
#include "main/macros.h"
#include "main/imports.h"
#include "s_context.h"
#include "s_depth.h"
#include "s_span.h"
#define Z_TEST(COMPARE) \
do { \
GLuint i; \
for (i = 0; i < n; i++) { \
if (mask[i]) { \
if (COMPARE) { \
/* pass */ \
if (write) { \
zbuffer[i] = zfrag[i]; \
} \
passed++; \
} \
else { \
/* fail */ \
mask[i] = 0; \
} \
} \
} \
} while (0)
/**
* Do depth test for an array of 16-bit Z values.
* @param zbuffer array of Z buffer values (16-bit)
* @param zfrag array of fragment Z values (use 16-bit in 32-bit uint)
* @param mask which fragments are alive, killed afterward
* @return number of fragments which pass the test.
*/
static GLuint
depth_test_span16( struct gl_context *ctx, GLuint n,
GLushort zbuffer[], const GLuint zfrag[], GLubyte mask[] )
{
const GLboolean write = ctx->Depth.Mask;
GLuint passed = 0;
/* switch cases ordered from most frequent to less frequent */
switch (ctx->Depth.Func) {
case GL_LESS:
Z_TEST(zfrag[i] < zbuffer[i]);
break;
case GL_LEQUAL:
Z_TEST(zfrag[i] <= zbuffer[i]);
break;
case GL_GEQUAL:
Z_TEST(zfrag[i] >= zbuffer[i]);
break;
case GL_GREATER:
Z_TEST(zfrag[i] > zbuffer[i]);
break;
case GL_NOTEQUAL:
Z_TEST(zfrag[i] != zbuffer[i]);
break;
case GL_EQUAL:
Z_TEST(zfrag[i] == zbuffer[i]);
break;
case GL_ALWAYS:
Z_TEST(1);
break;
case GL_NEVER:
memset(mask, 0, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in depth_test_span16");
}
return passed;
}
/**
* Do depth test for an array of 32-bit Z values.
* @param zbuffer array of Z buffer values (32-bit)
* @param zfrag array of fragment Z values (use 32-bits in 32-bit uint)
* @param mask which fragments are alive, killed afterward
* @return number of fragments which pass the test.
*/
static GLuint
depth_test_span32( struct gl_context *ctx, GLuint n,
GLuint zbuffer[], const GLuint zfrag[], GLubyte mask[])
{
const GLboolean write = ctx->Depth.Mask;
GLuint passed = 0;
/* switch cases ordered from most frequent to less frequent */
switch (ctx->Depth.Func) {
case GL_LESS:
Z_TEST(zfrag[i] < zbuffer[i]);
break;
case GL_LEQUAL:
Z_TEST(zfrag[i] <= zbuffer[i]);
break;
case GL_GEQUAL:
Z_TEST(zfrag[i] >= zbuffer[i]);
break;
case GL_GREATER:
Z_TEST(zfrag[i] > zbuffer[i]);
break;
case GL_NOTEQUAL:
Z_TEST(zfrag[i] != zbuffer[i]);
break;
case GL_EQUAL:
Z_TEST(zfrag[i] == zbuffer[i]);
break;
case GL_ALWAYS:
Z_TEST(1);
break;
case GL_NEVER:
memset(mask, 0, n * sizeof(GLubyte));
break;
default:
_mesa_problem(ctx, "Bad depth func in depth_test_span32");
}
return passed;
}
/**
* Clamp fragment Z values to the depth near/far range (glDepthRange()).
* This is used when GL_ARB_depth_clamp/GL_DEPTH_CLAMP is turned on.
* In that case, vertexes are not clipped against the near/far planes
* so rasterization will produce fragment Z values outside the usual
* [0,1] range.
*/
void
_swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
const GLuint count = span->end;
GLint *zValues = (GLint *) span->array->z; /* sign change */
GLint min, max;
GLfloat min_f, max_f;
GLuint i;
if (ctx->ViewportArray[0].Near < ctx->ViewportArray[0].Far) {
min_f = ctx->ViewportArray[0].Near;
max_f = ctx->ViewportArray[0].Far;
} else {
min_f = ctx->ViewportArray[0].Far;
max_f = ctx->ViewportArray[0].Near;
}
/* Convert floating point values in [0,1] to device Z coordinates in
* [0, DepthMax].
* ex: If the Z buffer has 24 bits, DepthMax = 0xffffff.
*
* XXX this all falls apart if we have 31 or more bits of Z because
* the triangle rasterization code produces unsigned Z values. Negative
* vertex Z values come out as large fragment Z uints.
*/
min = (GLint) (min_f * fb->_DepthMaxF);
max = (GLint) (max_f * fb->_DepthMaxF);
if (max < 0)
max = 0x7fffffff; /* catch over flow for 30-bit z */
/* Note that we do the comparisons here using signed integers.
*/
for (i = 0; i < count; i++) {
if (zValues[i] < min)
zValues[i] = min;
if (zValues[i] > max)
zValues[i] = max;
}
}
/**
* Get array of 32-bit z values from the depth buffer. With clipping.
* Note: the returned values are always in the range [0, 2^32-1].
*/
static void
get_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
GLuint zbuffer[])
{
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
const GLint w = rb->Width, h = rb->Height;
const GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
zbuffer[i] = *((GLuint *) (map + y[i] * rowStride + x[i] * 4));
}
}
}
else {
const GLint bpp = _mesa_get_format_bytes(rb->Format);
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
const GLubyte *src = map + y[i] * rowStride+ x[i] * bpp;
_mesa_unpack_uint_z_row(rb->Format, 1, src, &zbuffer[i]);
}
}
}
}
/**
* Put an array of 32-bit z values into the depth buffer.
* Note: the z values are always in the range [0, 2^32-1].
*/
static void
put_z32_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
const GLuint zvalues[], const GLubyte mask[])
{
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
const GLint w = rb->Width, h = rb->Height;
GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
GLuint *dst = (GLuint *) (map + y[i] * rowStride + x[i] * 4);
*dst = zvalues[i];
}
}
}
else {
gl_pack_uint_z_func packZ = _mesa_get_pack_uint_z_func(rb->Format);
const GLint bpp = _mesa_get_format_bytes(rb->Format);
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
void *dst = map + y[i] * rowStride + x[i] * bpp;
packZ(zvalues + i, dst);
}
}
}
}
/**
* Apply depth (Z) buffer testing to the span.
* \return approx number of pixels that passed (only zero is reliable)
*/
GLuint
_swrast_depth_test_span(struct gl_context *ctx, SWspan *span)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
const GLint bpp = _mesa_get_format_bytes(rb->Format);
void *zStart;
const GLuint count = span->end;
const GLuint *fragZ = span->array->z;
GLubyte *mask = span->array->mask;
void *zBufferVals;
GLuint *zBufferTemp = NULL;
GLuint passed;
GLuint zBits = _mesa_get_format_bits(rb->Format, GL_DEPTH_BITS);
GLboolean ztest16 = GL_FALSE;
if (span->arrayMask & SPAN_XY)
zStart = NULL;
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
if (rb->Format == MESA_FORMAT_Z_UNORM16 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 16-bit Z values */
zBufferVals = zStart;
ztest16 = GL_TRUE;
}
else if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 32-bit Z values */
zBufferVals = zStart;
}
else {
if (_mesa_get_format_datatype(rb->Format) != GL_UNSIGNED_NORMALIZED) {
_mesa_problem(ctx, "Incorrectly writing swrast's integer depth "
"values to %s depth buffer",
_mesa_get_format_name(rb->Format));
}
/* copy Z buffer values into temp buffer (32-bit Z values) */
zBufferTemp = malloc(count * sizeof(GLuint));
if (!zBufferTemp)
return 0;
if (span->arrayMask & SPAN_XY) {
get_z32_values(ctx, rb, count,
span->array->x, span->array->y, zBufferTemp);
}
else {
_mesa_unpack_uint_z_row(rb->Format, count, zStart, zBufferTemp);
}
if (zBits == 24) {
GLuint i;
/* Convert depth buffer values from 32 to 24 bits to match the
* fragment Z values generated by rasterization.
*/
for (i = 0; i < count; i++) {
zBufferTemp[i] >>= 8;
}
}
else if (zBits == 16) {
GLuint i;
/* Convert depth buffer values from 32 to 16 bits */
for (i = 0; i < count; i++) {
zBufferTemp[i] >>= 16;
}
}
else {
assert(zBits == 32);
}
zBufferVals = zBufferTemp;
}
/* do the depth test either with 16 or 32-bit values */
if (ztest16)
passed = depth_test_span16(ctx, count, zBufferVals, fragZ, mask);
else
passed = depth_test_span32(ctx, count, zBufferVals, fragZ, mask);
if (zBufferTemp) {
/* need to write temp Z values back into the buffer */
/* Convert depth buffer values back to 32-bit values. The least
* significant bits don't matter since they'll get dropped when
* they're packed back into the depth buffer.
*/
if (zBits == 24) {
GLuint i;
for (i = 0; i < count; i++) {
zBufferTemp[i] = (zBufferTemp[i] << 8);
}
}
else if (zBits == 16) {
GLuint i;
for (i = 0; i < count; i++) {
zBufferTemp[i] = zBufferTemp[i] << 16;
}
}
if (span->arrayMask & SPAN_XY) {
/* random locations */
put_z32_values(ctx, rb, count, span->array->x, span->array->y,
zBufferTemp, mask);
}
else {
/* horizontal row */
gl_pack_uint_z_func packZ = _mesa_get_pack_uint_z_func(rb->Format);
GLubyte *dst = zStart;
GLuint i;
for (i = 0; i < count; i++) {
if (mask[i]) {
packZ(&zBufferTemp[i], dst);
}
dst += bpp;
}
}
free(zBufferTemp);
}
if (passed < count) {
span->writeAll = GL_FALSE;
}
return passed;
}
/**
* GL_EXT_depth_bounds_test extension.
* Discard fragments depending on whether the corresponding Z-buffer
* values are outside the depth bounds test range.
* Note: we test the Z buffer values, not the fragment Z values!
* \return GL_TRUE if any fragments pass, GL_FALSE if no fragments pass
*/
GLboolean
_swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
GLubyte *zStart;
GLuint zMin = (GLuint) (ctx->Depth.BoundsMin * fb->_DepthMaxF + 0.5F);
GLuint zMax = (GLuint) (ctx->Depth.BoundsMax * fb->_DepthMaxF + 0.5F);
GLubyte *mask = span->array->mask;
const GLuint count = span->end;
GLuint i;
GLboolean anyPass = GL_FALSE;
GLuint *zBufferTemp;
const GLuint *zBufferVals;
zBufferTemp = malloc(count * sizeof(GLuint));
if (!zBufferTemp) {
/* don't generate a stream of OUT_OF_MEMORY errors here */
return GL_FALSE;
}
if (span->arrayMask & SPAN_XY)
zStart = NULL;
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly access 32-bit values in the depth buffer */
zBufferVals = (const GLuint *) zStart;
}
else {
/* unpack Z values into a temporary array */
if (span->arrayMask & SPAN_XY) {
get_z32_values(ctx, rb, count, span->array->x, span->array->y,
zBufferTemp);
}
else {
_mesa_unpack_uint_z_row(rb->Format, count, zStart, zBufferTemp);
}
zBufferVals = zBufferTemp;
}
/* Now do the tests */
for (i = 0; i < count; i++) {
if (mask[i]) {
if (zBufferVals[i] < zMin || zBufferVals[i] > zMax)
mask[i] = GL_FALSE;
else
anyPass = GL_TRUE;
}
}
free(zBufferTemp);
return anyPass;
}
/**********************************************************************/
/***** Read Depth Buffer *****/
/**********************************************************************/
/**
* Read a span of depth values from the given depth renderbuffer, returning
* the values as GLfloats.
* This function does clipping to prevent reading outside the depth buffer's
* bounds.
*/
void
_swrast_read_depth_span_float(struct gl_context *ctx,
struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLfloat depth[])
{
if (!rb) {
/* really only doing this to prevent FP exceptions later */
memset(depth, 0, n * sizeof(GLfloat));
return;
}
if (y < 0 || y >= (GLint) rb->Height ||
x + n <= 0 || x >= (GLint) rb->Width) {
/* span is completely outside framebuffer */
memset(depth, 0, n * sizeof(GLfloat));
return;
}
if (x < 0) {
GLint dx = -x;
GLint i;
for (i = 0; i < dx; i++)
depth[i] = 0.0;
x = 0;
n -= dx;
depth += dx;
}
if (x + n > (GLint) rb->Width) {
GLint dx = x + n - (GLint) rb->Width;
GLint i;
for (i = 0; i < dx; i++)
depth[n - i - 1] = 0.0;
n -= dx;
}
if (n <= 0) {
return;
}
_mesa_unpack_float_z_row(rb->Format, n, _swrast_pixel_address(rb, x, y),
depth);
}
/**
* Clear the given z/depth renderbuffer. If the buffer is a combined
* depth+stencil buffer, only the Z bits will be touched.
*/
void
_swrast_clear_depth_buffer(struct gl_context *ctx)
{
struct gl_renderbuffer *rb =
ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
GLint x, y, width, height;
GLubyte *map;
GLint rowStride, i, j;
GLbitfield mapMode;
if (!rb || !ctx->Depth.Mask) {
/* no depth buffer, or writing to it is disabled */
return;
}
/* compute region to clear */
x = ctx->DrawBuffer->_Xmin;
y = ctx->DrawBuffer->_Ymin;
width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
mapMode = GL_MAP_WRITE_BIT;
if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT ||
rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT ||
rb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM ||
rb->Format == MESA_FORMAT_X8_UINT_Z24_UNORM) {
mapMode |= GL_MAP_READ_BIT;
}
ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height,
mapMode, &map, &rowStride);
if (!map) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glClear(depth)");
return;
}
switch (rb->Format) {
case MESA_FORMAT_Z_UNORM16:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLushort clearVal = 0;
_mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal);
if (clearVal == 0xffff && width * 2 == rowStride) {
/* common case */
memset(map, 0xff, width * height * 2);
}
else {
for (i = 0; i < height; i++) {
GLushort *row = (GLushort *) map;
for (j = 0; j < width; j++) {
row[j] = clearVal;
}
map += rowStride;
}
}
}
break;
case MESA_FORMAT_Z_UNORM32:
case MESA_FORMAT_Z_FLOAT32:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLuint clearVal = 0;
_mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal);
for (i = 0; i < height; i++) {
GLuint *row = (GLuint *) map;
for (j = 0; j < width; j++) {
row[j] = clearVal;
}
map += rowStride;
}
}
break;
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_Z24_UNORM_X8_UINT:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_X8_UINT_Z24_UNORM:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLuint clearVal = 0;
GLuint mask;
if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT ||
rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT)
mask = 0xff000000;
else
mask = 0xff;
_mesa_pack_float_z_row(rb->Format, 1, &clear, &clearVal);
for (i = 0; i < height; i++) {
GLuint *row = (GLuint *) map;
for (j = 0; j < width; j++) {
row[j] = (row[j] & mask) | clearVal;
}
map += rowStride;
}
}
break;
case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
/* XXX untested */
{
GLfloat clearVal = (GLfloat) ctx->Depth.Clear;
for (i = 0; i < height; i++) {
GLfloat *row = (GLfloat *) map;
for (j = 0; j < width; j++) {
row[j * 2] = clearVal;
}
map += rowStride;
}
}
break;
default:
_mesa_problem(ctx, "Unexpected depth buffer format %s"
" in _swrast_clear_depth_buffer()",
_mesa_get_format_name(rb->Format));
}
ctx->Driver.UnmapRenderbuffer(ctx, rb);
}
/**
* Clear both depth and stencil values in a combined depth+stencil buffer.
*/
void
_swrast_clear_depth_stencil_buffer(struct gl_context *ctx)
{
const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits;
const GLuint writeMask = ctx->Stencil.WriteMask[0];
const GLuint stencilMax = (1 << stencilBits) - 1;
struct gl_renderbuffer *rb =
ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
GLint x, y, width, height;
GLbitfield mapMode;
GLubyte *map;
GLint rowStride, i, j;
/* check that we really have a combined depth+stencil buffer */
assert(rb == ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer);
/* compute region to clear */
x = ctx->DrawBuffer->_Xmin;
y = ctx->DrawBuffer->_Ymin;
width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
mapMode = GL_MAP_WRITE_BIT;
if ((writeMask & stencilMax) != stencilMax) {
/* need to mask stencil values */
mapMode |= GL_MAP_READ_BIT;
}
ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height,
mapMode, &map, &rowStride);
if (!map) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glClear(depth+stencil)");
return;
}
switch (rb->Format) {
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
{
GLfloat zClear = (GLfloat) ctx->Depth.Clear;
GLuint clear = 0, mask;
_mesa_pack_float_z_row(rb->Format, 1, &zClear, &clear);
if (rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) {
mask = ((~writeMask) & 0xff) << 24;
clear |= (ctx->Stencil.Clear & writeMask & 0xff) << 24;
}
else {
mask = ((~writeMask) & 0xff);
clear |= (ctx->Stencil.Clear & writeMask & 0xff);
}
for (i = 0; i < height; i++) {
GLuint *row = (GLuint *) map;
if (mask != 0x0) {
for (j = 0; j < width; j++) {
row[j] = (row[j] & mask) | clear;
}
}
else {
for (j = 0; j < width; j++) {
row[j] = clear;
}
}
map += rowStride;
}
}
break;
case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
/* XXX untested */
{
const GLfloat zClear = (GLfloat) ctx->Depth.Clear;
const GLuint sClear = ctx->Stencil.Clear & writeMask;
const GLuint sMask = (~writeMask) & 0xff;
for (i = 0; i < height; i++) {
GLfloat *zRow = (GLfloat *) map;
GLuint *sRow = (GLuint *) map;
for (j = 0; j < width; j++) {
zRow[j * 2 + 0] = zClear;
}
if (sMask != 0) {
for (j = 0; j < width; j++) {
sRow[j * 2 + 1] = (sRow[j * 2 + 1] & sMask) | sClear;
}
}
else {
for (j = 0; j < width; j++) {
sRow[j * 2 + 1] = sClear;
}
}
map += rowStride;
}
}
break;
default:
_mesa_problem(ctx, "Unexpected depth buffer format %s"
" in _swrast_clear_depth_buffer()",
_mesa_get_format_name(rb->Format));
}
ctx->Driver.UnmapRenderbuffer(ctx, rb);
}
| execunix/vinos | xsrc/external/mit/MesaLib/dist/src/mesa/swrast/s_depth.c | C | apache-2.0 | 23,229 |
/*
* Copyright (C) 2013 OTAPlatform
*
* 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.beerbong.otaplatform.ui.component;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.preference.Preference;
import android.view.View;
import android.widget.Toast;
import com.beerbong.otaplatform.activity.GooActivity;
import com.beerbong.otaplatform.R;
import com.beerbong.otaplatform.manager.ManagerFactory;
import com.beerbong.otaplatform.manager.PreferencesManager;
public class FolderPreference extends Preference implements View.OnLongClickListener {
private GooActivity mActivity;
private String mFolder;
private boolean mWatchlist;
public FolderPreference(GooActivity activity, String folder, boolean watchlist) {
super(activity);
mActivity = activity;
mFolder = folder;
mWatchlist = watchlist;
}
@Override
public boolean onLongClick(View v) {
if (mWatchlist) {
removeWatchlist();
} else {
addWatchlist();
}
return true;
}
private void addWatchlist() {
mActivity.runOnUiThread(new Runnable() {
public void run() {
new AlertDialog.Builder(mActivity)
.setTitle(R.string.watchlist_add_confirm_title)
.setMessage(R.string.watchlist_add_confirm)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
PreferencesManager pManager = ManagerFactory
.getPreferencesManager(mActivity);
String str = pManager.getWatchlist();
if (str.indexOf(mFolder) < 0) {
if ("".equals(str)) {
str = mFolder;
} else {
str += PreferencesManager.SEPARATOR + mFolder;
}
pManager.setWatchlist(str);
Toast.makeText(mActivity, R.string.watchlist_added,
Toast.LENGTH_LONG).show();
} else {
Toast.makeText(mActivity, R.string.watchlist_already,
Toast.LENGTH_LONG).show();
}
}
})
.setNeutralButton(R.string.gapps_folder_select,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
ManagerFactory.getPreferencesManager(mActivity).setGappsFolder(mFolder);
Toast.makeText(mActivity, R.string.gapps_folder_selected,
Toast.LENGTH_LONG).show();
dialog.dismiss();
}
})
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}).show();
}
});
}
private void removeWatchlist() {
mActivity.runOnUiThread(new Runnable() {
public void run() {
new AlertDialog.Builder(mActivity)
.setTitle(R.string.watchlist_remove_confirm_title)
.setMessage(R.string.watchlist_remove_confirm)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
PreferencesManager pManager = ManagerFactory
.getPreferencesManager(mActivity);
String str = pManager.getWatchlist();
if (str.indexOf(mFolder) >= 0) {
if (str.equals(mFolder)) {
str = "";
} else {
str = str.replace(PreferencesManager.SEPARATOR + mFolder, "");
str = str.replace(mFolder + PreferencesManager.SEPARATOR, "");
}
pManager.setWatchlist(str);
Toast.makeText(mActivity, R.string.watchlist_removed,
Toast.LENGTH_LONG).show();
mActivity.refreshWatchlist();
}
}
})
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}).show();
}
});
}
}
| kylinmoddev/android_packages_apps_KylinModUpdater | src/com/beerbong/otaplatform/ui/component/FolderPreference.java | Java | apache-2.0 | 6,741 |
import time
from headset import Headset
from stream import Stream
from common import Version, BytesStatus
class WirelessHeadset(Headset):
"""This class represents the wireless version of the mindwave
Args:
dev: device link
headset: the id of mindwave wireless version
It has the basic functionality to connect, autoconnect and disconnect
"""
def __init__(self, dev=None, headset_id=None, rate=None):
Headset.__init__(self, headset_id)
self.device = dev
self.bauderate = rate
self.stream = Stream(device=self.device, bauderate=rate, version=Version.MINDWAVE)
time.sleep(2)
self.connect()
self.run(self.stream)
# def open(self):
# if not self.stream or not self.stream.IsOpen():
# #self.stream = stream.stream(self.device, baudrate=115200, parity=stream.PARITY_NONE, stopbits=stream.STOPBITS_ONE,
# # bytesize=stream.EIGHTBITS, writeTimeout=0, timeout=3, rtscts=True, xonxoff=False)
# self.stream = serial.Serial(self.device, self.baudrate, timeout=0.001, rtscts=True)
def autoconnect(self):
"""This method autoconnects to the mindwave every."""
self.stream.getStream().write(BytesStatus.AUTOCONNECT)
#the dongle switch to autoconnect mode it must wait 10 second to connect any headset
time.sleep(10)
def connect(self):
"""This method connects to the mindwave with the id."""
if self.id is not None:
# we send a byte to CONNECTED and other byte in hex of headset id
self.stream.getStream().write(''.join([BytesStatus.CONNECT, self.id.decode('hex')]))
else:
self.autoconnect()
def disconnect(self):
"""This method disconnects the mindwave."""
self.stream.getStream().write(BytesStatus.DISCONNECT)
def echo_raw(self):
"""This method prints the raw data from mindwave."""
while 1:
#time.sleep()
data = self.stream.read(1)
for b in data:
print '0x%s, ' % b.encode('hex'),
print "" | jacquelinekay/gsoc-ros-neural | mindwave_driver/src/mindwave_driver/wireless_headset.py | Python | apache-2.0 | 2,166 |
// get the sample user connection
var connectionId = "cmis-sample-connection"
var cmisConnection = cmis.getConnection(connectionId)
if (cmisConnection == null) {
// if no connection exists, talk to the local server
cmisConnection = cmis.getConnection()
}
// get CMIS session
var cmisSession = cmisConnection.getSession();
model.cmisSession = cmisSession;
model.baseTypes = cmisSession.getTypeChildren(null, false).iterator();
if (args.id == null)
{
model.folder = cmisSession.getRootFolder();
}
else
{
model.folder = cmisSession.getObject(args.id);
}
model.connection = cmisConnection;
var operationContext = cmisSession.createOperationContext();
operationContext.setRenditionFilterString("cmis:thumbnail");
model.children = model.folder.getChildren(operationContext).iterator(); | Alfresco/alfresco-ms-office-plugin | webscripts/org/alfresco/cmis/client/sample/cmisdocbrowser.get.js | JavaScript | apache-2.0 | 791 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. 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.
"""Unit tests to cover DfpUtils."""
__author__ = 'api.jdilallo@gmail.com (Joseph DiLallo)'
import os
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.join('..', '..', '..'))
import mock
from adspygoogle import DfpClient
from adspygoogle.common.Errors import ValidationError
from adspygoogle.dfp import DfpUtils
class DfpUtilsTest(unittest.TestCase):
"""Unittest suite for DfpUtils."""
def testDataFileCurrencies(self):
"""Test whether csv data file with currencies is valid."""
cols = 2
for item in DfpUtils.GetCurrencies():
self.assertEqual(len(item), cols)
def testDataFileTimezones(self):
"""Test whether csv data file with timezones is valid."""
cols = 1
for item in DfpUtils.GetTimezones():
self.assertEqual(len(item), cols)
def testGetAllEntitiesByStatement(self):
client = mock.Mock()
line_item_service = mock.Mock()
rval = 'Line items for everyone!'
def VerifyExpectedCall(arg):
self.assertEqual({'values': None,
'query': 'ORDER BY name LIMIT 500 OFFSET 0'}, arg)
return [{'results': [rval]}]
client.GetLineItemService.return_value = line_item_service
line_item_service._service_name = 'LineItemService'
line_item_service.GetLineItemsByStatement.side_effect = VerifyExpectedCall
line_items = DfpUtils.GetAllEntitiesByStatement(
client, 'LineItem', 'ORDER BY name')
self.assertEqual([rval], line_items)
def testGetAllEntitiesByStatementWithLimit(self):
"""Test whether GetAllEntitiesByStatement() fails when LIMIT is provided."""
headers = {
'email': 'fake_email',
'password': 'fake_password',
'applicationName': 'fake_application_name',
'authToken': ' '
}
client = DfpClient(headers=headers)
self.failUnlessRaises(
ValidationError, DfpUtils.GetAllEntitiesByStatement,
client, 'User', 'ORDER BY name LIMIT 1')
def testGetAllEntitiesByStatementWithService(self):
line_item_service = mock.Mock()
rval = 'Line items for everyone!'
def VerifyExpectedCall(arg):
self.assertEqual({'values': None,
'query': 'ORDER BY name LIMIT 500 OFFSET 0'}, arg)
return [{'results': [rval]}]
line_item_service._service_name = 'LineItemService'
line_item_service.GetLineItemsByStatement.side_effect = VerifyExpectedCall
line_items = DfpUtils.GetAllEntitiesByStatementWithService(
line_item_service, 'ORDER BY name')
self.assertEqual([rval], line_items)
def testDownloadPqlResultSetToCsv(self):
pql_service = mock.Mock()
csv_file = tempfile.NamedTemporaryFile()
csv_file_name = csv_file.name
header = [{'labelName': 'Some random header...'},
{'labelName': 'Another header...'}]
rval = [{'values': [{'value': 'Some random PQL response...',
'Value_Type': 'TextValue'},
{'value': {'date': {
'year': '1999', 'month': '04', 'day': '03'}},
'Value_Type': 'DateValue'},
{'value': '123',
'Value_Type': 'NumberValue'},
{'value': {'date': {'year': '2012',
'month': '11',
'day': '05'},
'hour': '12',
'minute': '12',
'second': '12',
'timeZoneID': 'PST8PDT'},
'Value_Type': 'DateTimeValue'}]},
{'values': [{'value': 'A second row of PQL response!',
'Value_Type': 'TextValue'},
{'value': {'date': {
'year': '2009', 'month': '02', 'day': '05'}},
'Value_Type': 'DateValue'},
{'value': '345',
'Value_Type': 'NumberValue'},
{'value': {'date': {'year': '2013',
'month': '01',
'day': '03'},
'hour': '02',
'minute': '02',
'second': '02',
'timeZoneID': 'GMT'},
'Value_Type': 'DateTimeValue'}]}]
def VerifyExpectedCall(arg):
self.assertEqual({'values': None,
'query': ('SELECT Id, Name FROM Line_Item '
'LIMIT 500 OFFSET 0')}, arg)
return [{'rows': rval, 'columnTypes': header}]
pql_service._service_name = 'PublisherQueryLanguageService'
pql_service.select.side_effect = VerifyExpectedCall
file_returned = DfpUtils.DownloadPqlResultSetToCsv(
pql_service, 'SELECT Id, Name FROM Line_Item', csv_file)
self.assertEqual(file_returned.name, csv_file_name)
self.assertEqual(file_returned.readline(),
('"Some random header...",'
'"Another header..."\r\n'))
self.assertEqual(file_returned.readline(),
('"Some random PQL response...",'
'"1999-04-03",'
'123,'
'"2012-11-05T12:12:12-08:00"\r\n'))
self.assertEqual(file_returned.readline(),
('"A second row of PQL response!",'
'"2009-02-05",'
'345,'
'"2013-01-03T02:02:02Z"\r\n'))
csv_file.close()
def testDownloadPqlResultToList(self):
pql_service = mock.Mock()
header = [{'labelName': 'Some random header...'},
{'labelName': 'Another header...'}]
rval = [{'values': [{'value': 'Some random PQL response...',
'Value_Type': 'TextValue'},
{'value': {'date': {
'year': '1999', 'month': '04', 'day': '03'}},
'Value_Type': 'DateValue'},
{'value': '123',
'Value_Type': 'NumberValue'},
{'value': {'date': {'year': '2012',
'month': '11',
'day': '05'},
'hour': '12',
'minute': '12',
'second': '12',
'timeZoneID': 'PST8PDT'},
'Value_Type': 'DateTimeValue'}]},
{'values': [{'value': 'A second row of PQL response!',
'Value_Type': 'TextValue'},
{'value': {'date': {
'year': '2009', 'month': '02', 'day': '05'}},
'Value_Type': 'DateValue'},
{'value': '345',
'Value_Type': 'NumberValue'},
{'value': {'date': {'year': '2013',
'month': '01',
'day': '03'},
'hour': '02',
'minute': '02',
'second': '02',
'timeZoneID': 'GMT'},
'Value_Type': 'DateTimeValue'}]}]
def VerifyExpectedCall(arg):
self.assertEqual({'values': None,
'query': ('SELECT Id, Name FROM Line_Item '
'LIMIT 500 OFFSET 0')}, arg)
return [{'rows': rval, 'columnTypes': header}]
pql_service._service_name = 'PublisherQueryLanguageService'
pql_service.select.side_effect = VerifyExpectedCall
result_set = DfpUtils.DownloadPqlResultToList(
pql_service, 'SELECT Id, Name FROM Line_Item')
row1 = [DfpUtils._ConvertValueForCsv(field) for field in rval[0]['values']]
row2 = [DfpUtils._ConvertValueForCsv(field) for field in rval[1]['values']]
self.assertEqual([[header[0]['labelName'], header[1]['labelName']],
row1, row2], result_set)
def testFilterStatement(self):
values = [{
'key': 'test_key',
'value': {
'xsi_type': 'TextValue',
'value': 'test_value'
}
}]
test_statement = DfpUtils.FilterStatement()
self.assertEqual(test_statement.ToStatement(),
{'query': ' LIMIT 500 OFFSET 0',
'values': None})
test_statement.IncreaseOffsetBy(30)
self.assertEqual(test_statement.ToStatement(),
{'query': ' LIMIT 500 OFFSET 30',
'values': None})
test_statement.offset = 123
test_statement.limit = 5
self.assertEqual(test_statement.ToStatement(),
{'query': ' LIMIT 5 OFFSET 123',
'values': None})
test_statement = DfpUtils.FilterStatement(
'SELECT Id FROM Line_Item WHERE key = :test_key', limit=300, offset=20,
values=values)
self.assertEqual(test_statement.ToStatement(),
{'query': 'SELECT Id FROM Line_Item WHERE key = '
':test_key LIMIT 300 OFFSET 20',
'values': values})
if __name__ == '__main__':
unittest.main()
| caioserra/apiAdwords | tests/adspygoogle/dfp/dfp_utils_test.py | Python | apache-2.0 | 10,061 |
package io.searchbox.action;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Multimap;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import io.searchbox.annotations.JestId;
import io.searchbox.client.JestResult;
import io.searchbox.params.Parameters;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* @author Dogukan Sonmez
* @author cihat keser
*/
public abstract class AbstractAction<T extends JestResult> implements Action<T> {
public static String CHARSET = "utf-8";
protected final static Logger log = LoggerFactory.getLogger(AbstractAction.class);
protected String indexName;
protected String typeName;
protected String nodes;
protected Object payload;
private final ConcurrentMap<String, Object> headerMap = new ConcurrentHashMap<String, Object>();
private final Multimap<String, Object> parameterMap = LinkedHashMultimap.create();
private final Set<String> cleanApiParameters = new LinkedHashSet<String>();
private String URI;
public AbstractAction() {
}
@SuppressWarnings("unchecked")
public AbstractAction(Builder builder) {
parameterMap.putAll(builder.parameters);
headerMap.putAll(builder.headers);
cleanApiParameters.addAll(builder.cleanApiParameters);
if (builder instanceof AbstractMultiIndexActionBuilder) {
indexName = ((AbstractMultiIndexActionBuilder) builder).getJoinedIndices();
if (builder instanceof AbstractMultiTypeActionBuilder) {
indexName = ((AbstractMultiTypeActionBuilder) builder).getJoinedIndices();
typeName = ((AbstractMultiTypeActionBuilder) builder).getJoinedTypes();
}
} else if (builder instanceof AbstractMultiINodeActionBuilder) {
nodes = ((AbstractMultiINodeActionBuilder) builder).getJoinedNodes();
}
}
protected T createNewElasticSearchResult(T result, String responseBody, int statusCode, String reasonPhrase, Gson gson) {
JsonObject jsonMap = parseResponseBody(responseBody);
result.setResponseCode(statusCode);
result.setJsonString(responseBody);
result.setJsonObject(jsonMap);
result.setPathToResult(getPathToResult());
if (isHttpSuccessful(statusCode)) {
result.setSucceeded(true);
log.debug("Request and operation succeeded");
} else {
result.setSucceeded(false);
// provide the generic HTTP status code error, if one hasn't already come in via the JSON response...
// eg.
// IndicesExist will return 404 (with no content at all) for a missing index, but:
// Update will return 404 (with an error message for DocumentMissingException)
if (result.getErrorMessage() == null) {
result.setErrorMessage(statusCode + " " + (reasonPhrase == null ? "null" : reasonPhrase));
}
log.debug("Response is failed. errorMessage is " + result.getErrorMessage());
}
return result;
}
protected boolean isHttpSuccessful(int httpCode) {
return (httpCode / 100) == 2;
}
protected JsonObject parseResponseBody(String responseBody) {
if (responseBody != null && !responseBody.trim().isEmpty()) {
return new JsonParser().parse(responseBody).getAsJsonObject();
}
return new JsonObject();
}
public static String getIdFromSource(Object source) {
if (source == null) return null;
Field[] fields = source.getClass().getDeclaredFields();
for (Field field : fields) {
if (field.isAnnotationPresent(JestId.class)) {
try {
field.setAccessible(true);
Object name = field.get(source);
return name == null ? null : name.toString();
} catch (IllegalAccessException e) {
log.error("Unhandled exception occurred while getting annotated id from source", e);
}
}
}
return null;
}
public Collection<Object> getParameter(String parameter) {
return parameterMap.get(parameter);
}
public Object getHeader(String header) {
return headerMap.get(header);
}
@Override
public Map<String, Object> getHeaders() {
return headerMap;
}
@Override
public String getURI() {
String finalUri = URI;
if (!parameterMap.isEmpty() || !cleanApiParameters.isEmpty()) {
try {
finalUri += buildQueryString();
} catch (UnsupportedEncodingException e) {
// unless CHARSET is overridden with a wrong value in a subclass,
// this exception won't be thrown.
log.error("Error occurred while adding parameters to uri.", e);
}
}
return finalUri;
}
protected void setURI(String URI) {
this.URI = URI;
}
@Override
public String getData(Gson gson) {
if (payload == null) {
return null;
} else if (payload instanceof String) {
return (String) payload;
} else {
return gson.toJson(payload);
}
}
@Override
public String getPathToResult() {
return null;
}
protected String buildURI() {
StringBuilder sb = new StringBuilder();
try {
if (StringUtils.isNotBlank(indexName)) {
sb.append(URLEncoder.encode(indexName, CHARSET));
if (StringUtils.isNotBlank(typeName)) {
sb.append("/").append(URLEncoder.encode(typeName, CHARSET));
}
}
} catch (UnsupportedEncodingException e) {
// unless CHARSET is overridden with a wrong value in a subclass,
// this exception won't be thrown.
log.error("Error occurred while adding index/type to uri", e);
}
return sb.toString();
}
protected String buildQueryString() throws UnsupportedEncodingException {
StringBuilder queryString = new StringBuilder();
if (!cleanApiParameters.isEmpty()) {
queryString.append("/").append(StringUtils.join(cleanApiParameters, ","));
}
queryString.append("?");
for (Map.Entry<String, Object> entry : parameterMap.entries()) {
queryString.append(URLEncoder.encode(entry.getKey(), CHARSET))
.append("=")
.append(URLEncoder.encode(entry.getValue().toString(), CHARSET))
.append("&");
}
// if there are any params -> deletes the final ampersand
// if no params -> deletes the question mark
queryString.deleteCharAt(queryString.length() - 1);
return queryString.toString();
}
@Override
public String toString() {
return new ToStringBuilder(this)
.appendSuper(super.toString())
.append("uri", getURI())
.append("method", getRestMethodName())
.toString();
}
@Override
public int hashCode() {
return new HashCodeBuilder()
.append(getURI())
.append(getRestMethodName())
.append(getHeaders())
.append(payload)
.toHashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
AbstractAction rhs = (AbstractAction) obj;
return new EqualsBuilder()
.append(getURI(), rhs.getURI())
.append(getRestMethodName(), rhs.getRestMethodName())
.append(getHeaders(), rhs.getHeaders())
.append(payload, rhs.payload)
.isEquals();
}
public abstract String getRestMethodName();
@SuppressWarnings("unchecked")
protected static abstract class Builder<T extends Action, K> {
protected Multimap<String, Object> parameters = LinkedHashMultimap.<String, Object>create();
protected Map<String, Object> headers = new LinkedHashMap<String, Object>();
protected Set<String> cleanApiParameters = new LinkedHashSet<String>();
public K addCleanApiParameter(String key) {
cleanApiParameters.add(key);
return (K) this;
}
public K setParameter(String key, Object value) {
parameters.put(key, value);
return (K) this;
}
@Deprecated
public K setParameter(Map<String, Object> parameters) {
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
this.parameters.put(entry.getKey(), entry.getValue());
}
return (K) this;
}
public K setHeader(String key, Object value) {
headers.put(key, value);
return (K) this;
}
public K setHeader(Map<String, Object> headers) {
this.headers.putAll(headers);
return (K) this;
}
public K refresh(boolean refresh) {
return setParameter(Parameters.REFRESH, refresh);
}
/**
* All REST APIs accept the case parameter.
* When set to camelCase, all field names in the result will be returned
* in camel casing, otherwise, underscore casing will be used. Note,
* this does not apply to the source document indexed.
*/
public K resultCasing(String caseParam) {
setParameter(Parameters.RESULT_CASING, caseParam);
return (K) this;
}
abstract public T build();
}
}
| cogniteev/Jest | jest-common/src/main/java/io/searchbox/action/AbstractAction.java | Java | apache-2.0 | 10,395 |
# -*- coding: utf-8 -*-
"""Parser for Windows EventLog (EVT) files."""
import pyevt
from plaso import dependencies
from plaso.events import time_events
from plaso.lib import errors
from plaso.lib import eventdata
from plaso.lib import specification
from plaso.parsers import interface
from plaso.parsers import manager
dependencies.CheckModuleVersion(u'pyevt')
class WinEvtRecordEvent(time_events.PosixTimeEvent):
"""Convenience class for a Windows EventLog (EVT) record event.
Attributes:
computer_name: the computer name stored in the event record.
event_category: the event category.
event_identifier: the event identifier.
event_type: the event type.
facility: the event facility.
message_identifier: the event message identifier.
offset: the data offset of the event record with in the file.
record_number: the event record number.
recovered: boolean value to indicate the record was recovered.
severity: the event severity.
source_name: the name of the event source.
strings: array of event strings.
user_sid: the user security identifier (SID) stored in the event record.
"""
DATA_TYPE = u'windows:evt:record'
def __init__(
self, timestamp, timestamp_description, evt_record, record_number,
event_identifier, recovered=False):
"""Initializes the event.
Args:
timestamp: the POSIX timestamp value.
timestamp_description: a description string for the timestamp value.
evt_record: the EVT record (instance of pyevt.record).
record_number: the event record number.
event_identifier: the event identifier.
recovered: optional boolean value to indicate the record was recovered.
"""
super(WinEvtRecordEvent, self).__init__(timestamp, timestamp_description)
self.offset = evt_record.offset
self.recovered = recovered
if record_number is not None:
self.record_number = evt_record.identifier
# We want the event identifier to match the behavior of that of the EVTX
# event records.
if event_identifier is not None:
self.event_identifier = event_identifier & 0xffff
self.facility = (event_identifier >> 16) & 0x0fff
self.severity = event_identifier >> 30
self.message_identifier = event_identifier
self.event_type = evt_record.event_type
self.event_category = evt_record.event_category
self.source_name = evt_record.source_name
# Computer name is the value stored in the event record and does not
# necessarily corresponds with the actual hostname.
self.computer_name = evt_record.computer_name
self.user_sid = evt_record.user_security_identifier
self.strings = list(evt_record.strings)
class WinEvtParser(interface.SingleFileBaseParser):
"""Parses Windows EventLog (EVT) files."""
_INITIAL_FILE_OFFSET = None
NAME = u'winevt'
DESCRIPTION = u'Parser for Windows EventLog (EVT) files.'
@classmethod
def GetFormatSpecification(cls):
"""Retrieves the format specification.
Returns:
The format specification (instance of FormatSpecification).
"""
format_specification = specification.FormatSpecification(cls.NAME)
format_specification.AddNewSignature(b'LfLe', offset=4)
return format_specification
def _ParseRecord(
self, parser_mediator, record_index, evt_record, recovered=False):
"""Extract data from a Windows EventLog (EVT) record.
Args:
parser_mediator: a parser mediator object (instance of ParserMediator).
record_index: the event record index.
evt_record: an event record (instance of pyevt.record).
recovered: optional boolean value to indicate the record was recovered.
"""
try:
record_number = evt_record.identifier
except OverflowError as exception:
parser_mediator.ProduceParseError((
u'unable to read record identifier from event record: {0:d} '
u'with error: {1:s}').format(record_index, exception))
record_number = None
try:
event_identifier = evt_record.event_identifier
except OverflowError as exception:
parser_mediator.ProduceParseError((
u'unable to read event identifier from event record: {0:d} '
u'with error: {1:s}').format(record_index, exception))
event_identifier = None
try:
creation_time = evt_record.get_creation_time_as_integer()
except OverflowError as exception:
parser_mediator.ProduceParseError((
u'unable to read creation time from event record: {0:d} '
u'with error: {1:s}').format(record_index, exception))
creation_time = None
if creation_time is not None:
event_object = WinEvtRecordEvent(
creation_time, eventdata.EventTimestamp.CREATION_TIME,
evt_record, record_number, event_identifier, recovered=recovered)
parser_mediator.ProduceEvent(event_object)
try:
written_time = evt_record.get_written_time_as_integer()
except OverflowError as exception:
parser_mediator.ProduceParseError((
u'unable to read written time from event record: {0:d} '
u'with error: {1:s}').format(record_index, exception))
written_time = None
if written_time is not None:
event_object = WinEvtRecordEvent(
written_time, eventdata.EventTimestamp.WRITTEN_TIME,
evt_record, record_number, event_identifier, recovered=recovered)
parser_mediator.ProduceEvent(event_object)
# TODO: what if both creation_time and written_time are None.
def ParseFileObject(self, parser_mediator, file_object, **kwargs):
"""Parses a Windows EventLog (EVT) file-like object.
Args:
parser_mediator: a parser mediator object (instance of ParserMediator).
file_object: a file-like object.
Raises:
UnableToParseFile: when the file cannot be parsed.
"""
evt_file = pyevt.file()
evt_file.set_ascii_codepage(parser_mediator.codepage)
try:
evt_file.open_file_object(file_object)
except IOError as exception:
display_name = parser_mediator.GetDisplayName()
raise errors.UnableToParseFile(
u'[{0:s}] unable to parse file {1:s} with error: {2:s}'.format(
self.NAME, display_name, exception))
for record_index, evt_record in enumerate(evt_file.records):
try:
self._ParseRecord(parser_mediator, record_index, evt_record)
except IOError as exception:
parser_mediator.ProduceParseError(
u'unable to parse event record: {0:d} with error: {1:s}'.format(
record_index, exception))
for record_index, evt_record in enumerate(evt_file.recovered_records):
try:
self._ParseRecord(
parser_mediator, record_index, evt_record, recovered=True)
except IOError as exception:
parser_mediator.ProduceParseError((
u'unable to parse recovered event record: {0:d} with error: '
u'{1:s}').format(record_index, exception))
evt_file.close()
manager.ParsersManager.RegisterParser(WinEvtParser)
| ostree/plaso | plaso/parsers/winevt.py | Python | apache-2.0 | 7,068 |
/*
* Copyright 2017 Rundeck, Inc. (http://rundeck.com)
*
* 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.dtolabs.rundeck.core.execution.workflow;
/**
* @author greg
* @since 6/16/17
*/
public interface WorkflowStatusDataResult extends WorkflowStatusResult, WorkflowDataResult {
}
| damageboy/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/WorkflowStatusDataResult.java | Java | apache-2.0 | 811 |
#!/usr/bin/env python
"""A simple wrapper to send email alerts."""
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import logging
import re
import smtplib
import socket
from grr.lib import config_lib
from grr.lib import registry
from grr.lib.rdfvalues import standard as rdf_standard
class EmailAlerterBase(object):
"""The email alerter base class."""
__metaclass__ = registry.MetaclassRegistry
def RemoveHtmlTags(self, data):
p = re.compile(r"<.*?>")
return p.sub("", data)
def AddEmailDomain(self, address):
suffix = config_lib.CONFIG["Logging.domain"]
if isinstance(address, rdf_standard.DomainEmailAddress):
address = str(address)
if suffix and "@" not in address:
return address + "@%s" % suffix
return address
def SplitEmailsAndAppendEmailDomain(self, address_list):
"""Splits a string of comma-separated emails, appending default domain."""
result = []
# Process email addresses, and build up a list.
if isinstance(address_list, rdf_standard.DomainEmailAddress):
address_list = [str(address_list)]
elif isinstance(address_list, basestring):
address_list = [address for address in address_list.split(",") if address]
for address in address_list:
result.append(self.AddEmailDomain(address))
return result
def SendEmail(self,
to_addresses,
from_address,
subject,
message,
attachments=None,
is_html=True,
cc_addresses=None,
message_id=None,
headers=None):
raise NotImplementedError()
class SMTPEmailAlerter(EmailAlerterBase):
def SendEmail(self,
to_addresses,
from_address,
subject,
message,
attachments=None,
is_html=True,
cc_addresses=None,
message_id=None,
headers=None):
"""This method sends an email notification.
Args:
to_addresses: blah@mycompany.com string, list of addresses as csv string,
or rdf_standard.DomainEmailAddress
from_address: blah@mycompany.com string
subject: email subject string
message: message contents string, as HTML or plain text
attachments: iterable of filename string and file data tuples,
e.g. {"/file/name/string": filedata}
is_html: true if message is in HTML format
cc_addresses: blah@mycompany.com string, or list of addresses as
csv string
message_id: smtp message_id. Used to enable conversation threading
headers: dict of str-> str, headers to set
Raises:
RuntimeError: for problems connecting to smtp server.
"""
headers = headers or {}
msg = MIMEMultipart("alternative")
if is_html:
text = self.RemoveHtmlTags(message)
part1 = MIMEText(text, "plain")
msg.attach(part1)
part2 = MIMEText(message, "html")
msg.attach(part2)
else:
part1 = MIMEText(message, "plain")
msg.attach(part1)
if attachments:
for file_name, file_data in attachments.iteritems():
part = MIMEBase("application", "octet-stream")
part.set_payload(file_data)
encoders.encode_base64(part)
part.add_header("Content-Disposition",
"attachment; filename=\"%s\"" % file_name)
msg.attach(part)
msg["Subject"] = subject
from_address = self.AddEmailDomain(from_address)
to_addresses = self.SplitEmailsAndAppendEmailDomain(to_addresses)
cc_addresses = self.SplitEmailsAndAppendEmailDomain(cc_addresses or "")
msg["From"] = from_address
msg["To"] = ",".join(to_addresses)
if cc_addresses:
msg["CC"] = ",".join(cc_addresses)
if message_id:
msg.add_header("Message-ID", message_id)
for header, value in headers.iteritems():
msg.add_header(header, value)
try:
s = smtplib.SMTP(config_lib.CONFIG["Worker.smtp_server"],
int(config_lib.CONFIG["Worker.smtp_port"]))
s.ehlo()
if config_lib.CONFIG["Worker.smtp_starttls"]:
s.starttls()
s.ehlo()
if (config_lib.CONFIG["Worker.smtp_user"] and
config_lib.CONFIG["Worker.smtp_password"]):
s.login(config_lib.CONFIG["Worker.smtp_user"],
config_lib.CONFIG["Worker.smtp_password"])
s.sendmail(from_address, to_addresses + cc_addresses, msg.as_string())
s.quit()
except (socket.error, smtplib.SMTPException) as e:
raise RuntimeError("Could not connect to SMTP server to send email. "
"Please check config option Worker.smtp_server. "
"Currently set to %s. Error: %s" %
(config_lib.CONFIG["Worker.smtp_server"], e))
EMAIL_ALERTER = None
class EmailAlerterInit(registry.InitHook):
def RunOnce(self):
global EMAIL_ALERTER
email_alerter_cls_name = config_lib.CONFIG["Server.email_alerter_class"]
logging.debug("Using email alerter: %s", email_alerter_cls_name)
cls = EmailAlerterBase.GetPlugin(email_alerter_cls_name)
EMAIL_ALERTER = cls()
| pidydx/grr | grr/lib/email_alerts.py | Python | apache-2.0 | 5,328 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Thu Jan 18 00:59:44 GMT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.apache.taverna.server.localworker.remote.RemoteFile (Apache Taverna Server 3.1.0-incubating API)</title>
<meta name="date" content="2018-01-18">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface org.apache.taverna.server.localworker.remote.RemoteFile (Apache Taverna Server 3.1.0-incubating API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/taverna/server/localworker/remote/class-use/RemoteFile.html" target="_top">Frames</a></li>
<li><a href="RemoteFile.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.apache.taverna.server.localworker.remote.RemoteFile" class="title">Uses of Interface<br>org.apache.taverna.server.localworker.remote.RemoteFile</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.taverna.server.localworker.impl">org.apache.taverna.server.localworker.impl</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.taverna.server.localworker.remote">org.apache.taverna.server.localworker.remote</a></td>
<td class="colLast">
<div class="block">Interfaces exported by worker classes to the server.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.taverna.server.localworker.impl">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a> in <a href="../../../../../../../org/apache/taverna/server/localworker/impl/package-summary.html">org.apache.taverna.server.localworker.impl</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/apache/taverna/server/localworker/impl/package-summary.html">org.apache.taverna.server.localworker.impl</a> that implement <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/localworker/impl/FileDelegate.html" title="class in org.apache.taverna.server.localworker.impl">FileDelegate</a></span></code>
<div class="block">This class acts as a remote-aware delegate for the files in a workflow run's
working directory and its subdirectories.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/localworker/impl/package-summary.html">org.apache.taverna.server.localworker.impl</a> that return <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></code></td>
<td class="colLast"><span class="typeNameLabel">DirectoryDelegate.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/localworker/impl/DirectoryDelegate.html#makeEmptyFile-java.lang.String-">makeEmptyFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/localworker/impl/package-summary.html">org.apache.taverna.server.localworker.impl</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">FileDelegate.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/localworker/impl/FileDelegate.html#copy-org.apache.taverna.server.localworker.remote.RemoteFile-">copy</a></span>(<a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a> sourceFile)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.taverna.server.localworker.remote">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a> in <a href="../../../../../../../org/apache/taverna/server/localworker/remote/package-summary.html">org.apache.taverna.server.localworker.remote</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/localworker/remote/package-summary.html">org.apache.taverna.server.localworker.remote</a> that return <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></code></td>
<td class="colLast"><span class="typeNameLabel">RemoteDirectory.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteDirectory.html#makeEmptyFile-java.lang.String-">makeEmptyFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code>
<div class="block">Creates an empty file in this directory.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/apache/taverna/server/localworker/remote/package-summary.html">org.apache.taverna.server.localworker.remote</a> with parameters of type <a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">RemoteFile.</span><code><span class="memberNameLink"><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html#copy-org.apache.taverna.server.localworker.remote.RemoteFile-">copy</a></span>(<a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">RemoteFile</a> sourceFile)</code>
<div class="block">Copy from another file to this one.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/taverna/server/localworker/remote/RemoteFile.html" title="interface in org.apache.taverna.server.localworker.remote">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/taverna/server/localworker/remote/class-use/RemoteFile.html" target="_top">Frames</a></li>
<li><a href="RemoteFile.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015–2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| apache/incubator-taverna-site | content/javadoc/taverna-server/org/apache/taverna/server/localworker/remote/class-use/RemoteFile.html | HTML | apache-2.0 | 13,384 |
/*
* Copyright 2011 CodeGist.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.
*
* ===================================================================
*
* More information at http://www.codegist.org.
*/
package org.codegist.crest.config;
import org.codegist.common.lang.State;
import org.codegist.common.lang.ToStringBuilder;
import org.codegist.common.reflect.Types;
import org.codegist.crest.CRestConfig;
import org.codegist.crest.param.ParamProcessor;
import org.codegist.crest.param.ParamProcessors;
import org.codegist.crest.serializer.Serializer;
import org.codegist.crest.util.ComponentRegistry;
import org.codegist.crest.util.MultiParts;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import static org.codegist.crest.config.ParamConfig.*;
import static org.codegist.crest.config.ParamType.COOKIE;
import static org.codegist.crest.config.ParamType.HEADER;
@SuppressWarnings("unchecked")
class DefaultParamConfigBuilder extends ConfigBuilder implements ParamConfigBuilder {
private final MethodConfigBuilder parent;
private final Class<?> clazz;
private final Type genericType;
private final ComponentRegistry<Class<?>, Serializer> classSerializerRegistry;
private final Class<? extends ParamProcessor> paramProcessor;
private final Map<String,Object> metas = new HashMap<String,Object>();
private String name = null;
private String defaultValue = null;
private ParamType type = ParamType.getDefault();
private String listSeparator = null;
private Class<? extends Serializer> serializer = null;
private Boolean encoded = false;
DefaultParamConfigBuilder(CRestConfig crestConfig, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry, Class<?> clazz, Type genericType) {
this(crestConfig, classSerializerRegistry, clazz, genericType, null);
}
DefaultParamConfigBuilder(CRestConfig crestConfig, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry, Class<?> clazz, Type genericType, MethodConfigBuilder parent) {
super(crestConfig);
this.parent = parent;
this.clazz = Types.getComponentClass(clazz, genericType);
this.genericType = Types.getComponentType(clazz, genericType);
this.classSerializerRegistry = classSerializerRegistry;
this.name = override(PARAM_CONFIG_DEFAULT_NAME, this.name);
this.defaultValue = override(PARAM_CONFIG_DEFAULT_VALUE, this.defaultValue);
this.type = override(PARAM_CONFIG_DEFAULT_TYPE, this.type);
this.listSeparator = override(PARAM_CONFIG_DEFAULT_LIST_SEPARATOR, this.listSeparator);
this.serializer = override(PARAM_CONFIG_DEFAULT_SERIALIZER, this.serializer);
this.encoded = override(PARAM_CONFIG_DEFAULT_ENCODED, this.encoded);
this.paramProcessor = override(PARAM_CONFIG_DEFAULT_PROCESSOR, null);
Map<String,Object> pMetas = override(PARAM_CONFIG_DEFAULT_METAS, this.metas);
if(pMetas != this.metas) {
this.metas.clear();
this.metas.putAll(pMetas);
}
}
/**
* @inheritDoc
*/
public ParamConfig build() throws Exception {
validate();
return new DefaultParamConfig(
genericType,
clazz,
name,
defaultValue,
type,
metas,
serializer != null ? instantiate(serializer) : classSerializerRegistry.get(clazz),
(COOKIE.equals(type) || HEADER.equals(type)) ? true : encoded,
paramProcessor != null ? instantiate(paramProcessor) : ParamProcessors.newInstance(type, listSeparator));
}
private void validate(){
State.notBlank(name, "Parameter name is mandatory. This is probably due to a missing or empty named param annotation (one of the following: @CookieParam, @FormParam, @HeaderParam, @MatrixParam, @MultiPartParam, @PathParam, @QueryParam).\nLocation information:\n%s", this);
}
public ParamConfigBuilder setName(String name) {
this.name = name;
return this;
}
public ParamConfigBuilder setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
return this;
}
public ParamConfigBuilder setType(ParamType type) {
this.type = type;
return this;
}
public ParamConfigBuilder setListSeparator(String listSeparator) {
this.listSeparator = listSeparator;
return this;
}
public ParamConfigBuilder setEncoded(boolean encoded) {
this.encoded = encoded;
return this;
}
public ParamConfigBuilder setMetaDatas(Map<String,Object> metadatas) {
this.metas.clear();
this.metas.putAll(metadatas);
return this;
}
public ParamConfigBuilder setSerializer(Class<? extends Serializer> serializerClass) {
this.serializer = serializerClass;
return this;
}
public ParamConfigBuilder forCookie() {
return setType(ParamType.COOKIE);
}
public ParamConfigBuilder forQuery() {
return setType(ParamType.QUERY);
}
public ParamConfigBuilder forPath() {
return setType(ParamType.PATH);
}
public ParamConfigBuilder forForm() {
return setType(ParamType.FORM);
}
public ParamConfigBuilder forHeader() {
return setType(ParamType.HEADER);
}
public ParamConfigBuilder forMatrix() {
return setType(ParamType.MATRIX);
}
public ParamConfigBuilder forMultiPart() {
MultiParts.asMultipart(this.metas);
return forForm();
}
@Override
public String toString() {
return new ToStringBuilder("Param")
.append("class", clazz)
.append("type", type)
.append("method", parent)
.toString();
}
} | kuFEAR/crest | core/src/main/java/org/codegist/crest/config/DefaultParamConfigBuilder.java | Java | apache-2.0 | 6,423 |
// Copyright 2018 Google Inc. 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.
using GoogleCloudExtension.Services;
using GoogleCloudExtension.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using System.Threading.Tasks;
namespace GoogleCloudExtensionUnitTests.Utils
{
[TestClass]
public class ErrorHandlerUtilsTests : ExtensionTestBase
{
private Mock<IUserPromptService> _promptUserMock;
[TestInitialize]
public void BeforeEach()
{
_promptUserMock = new Mock<IUserPromptService>();
PackageMock.Setup(p => p.UserPromptService).Returns(_promptUserMock.Object);
}
[TestMethod]
public void TestHandleExceptions_DoesNotPromptForSuccess()
{
ErrorHandlerUtils.HandleExceptions(() => { });
_promptUserMock.Verify(p => p.ExceptionPrompt(It.IsAny<Exception>()), Times.Never);
}
[TestMethod]
public void TestHandleExceptions_PromptsForNormalException()
{
var thrownException = new Exception();
ErrorHandlerUtils.HandleExceptions(() => throw thrownException);
_promptUserMock.Verify(p => p.ExceptionPrompt(thrownException), Times.Once);
}
[TestMethod]
public void TestHandleExceptions_ThrowsCriticalException()
{
Assert.ThrowsException<AccessViolationException>(
() => ErrorHandlerUtils.HandleExceptions(() => throw new AccessViolationException()));
_promptUserMock.Verify(p => p.ExceptionPrompt(It.IsAny<Exception>()), Times.Never);
}
[TestMethod]
public void TestHandleExceptionsAsync_DoesNotPromptForSuccess()
{
ErrorHandlerUtils.HandleExceptionsAsync(() => Task.CompletedTask);
_promptUserMock.Verify(p => p.ExceptionPrompt(It.IsAny<Exception>()), Times.Never);
}
[TestMethod]
public void TestHandleExceptionsAsync_PromptsForNormalException()
{
var thrownException = new Exception();
ErrorHandlerUtils.HandleExceptionsAsync(() => Task.FromException(thrownException));
_promptUserMock.Verify(p => p.ExceptionPrompt(thrownException), Times.Once);
}
[TestMethod]
public void TestIsCriticalException_FalseForNormalException()
{
bool result = ErrorHandlerUtils.IsCriticalException(new Exception());
Assert.IsFalse(result);
}
[TestMethod]
public void TestIsCriticalException_TrueForCriticalException()
{
bool result = ErrorHandlerUtils.IsCriticalException(new AccessViolationException());
Assert.IsTrue(result);
}
[TestMethod]
public void TestIsCriticalException_FalseForAggregateExceptionContainingOnlyNormalException()
{
bool result =
ErrorHandlerUtils.IsCriticalException(new AggregateException(new Exception(), new Exception()));
Assert.IsFalse(result);
}
[TestMethod]
public void TestIsCriticalException_FalseForAggregateExceptionContainingACriticalException()
{
bool result = ErrorHandlerUtils.IsCriticalException(
new AggregateException(new AccessViolationException(), new Exception()));
Assert.IsTrue(result);
}
}
}
| GoogleCloudPlatform/google-cloud-visualstudio | GoogleCloudExtension/GoogleCloudExtensionUnitTests/Utils/ErrorHandlerUtilsTests.cs | C# | apache-2.0 | 3,965 |
<!-- This file is machine generated: DO NOT EDIT! -->
# Learn (contrib)
[TOC]
High level API for learning with TensorFlow.
## Estimators
Train and evaluate TensorFlow models.
- - -
### `class tf.contrib.learn.BaseEstimator` {#BaseEstimator}
Abstract BaseEstimator class to train and evaluate TensorFlow models.
Concrete implementation of this class should provide the following functions:
* _get_train_ops
* _get_eval_ops
* _get_predict_ops
`Estimator` implemented below is a good example of how to use this class.
- - -
#### `tf.contrib.learn.BaseEstimator.__init__(model_dir=None, config=None)` {#BaseEstimator.__init__}
Initializes a BaseEstimator instance.
##### Args:
* <b>`model_dir`</b>: Directory to save model parameters, graph and etc. This can
also be used to load checkpoints from the directory into a estimator to
continue training a previously saved model.
* <b>`config`</b>: A RunConfig instance.
- - -
#### `tf.contrib.learn.BaseEstimator.__repr__()` {#BaseEstimator.__repr__}
- - -
#### `tf.contrib.learn.BaseEstimator.config` {#BaseEstimator.config}
- - -
#### `tf.contrib.learn.BaseEstimator.evaluate(*args, **kwargs)` {#BaseEstimator.evaluate}
See `Evaluable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` or `y` is provided, and at least one of
`input_fn` or `feed_fn` is provided.
Or if `metrics` is not `None` or `dict`.
- - -
#### `tf.contrib.learn.BaseEstimator.export(*args, **kwargs)` {#BaseEstimator.export}
Exports inference graph into given dir. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-23.
Instructions for updating:
The signature of the input_fn accepted by export is changing to be consistent with what's used by tf.Learn Estimator's train/evaluate. input_fn (and in most cases, input_feature_key) will become required args, and use_deprecated_input_fn will default to False and be removed altogether.
##### Args:
* <b>`export_dir`</b>: A string containing a directory to write the exported graph
and checkpoints.
* <b>`input_fn`</b>: If `use_deprecated_input_fn` is true, then a function that given
`Tensor` of `Example` strings, parses it into features that are then
passed to the model. Otherwise, a function that takes no argument and
returns a tuple of (features, labels), where features is a dict of
string key to `Tensor` and labels is a `Tensor` that's currently not
used (and so can be `None`).
* <b>`input_feature_key`</b>: Only used if `use_deprecated_input_fn` is false. String
key into the features dict returned by `input_fn` that corresponds to a
the raw `Example` strings `Tensor` that the exported model will take as
input. Can only be `None` if you're using a custom `signature_fn` that
does not use the first arg (examples).
* <b>`use_deprecated_input_fn`</b>: Determines the signature format of `input_fn`.
* <b>`signature_fn`</b>: Function that returns a default signature and a named
signature map, given `Tensor` of `Example` strings, `dict` of `Tensor`s
for features and `Tensor` or `dict` of `Tensor`s for predictions.
* <b>`prediction_key`</b>: The key for a tensor in the `predictions` dict (output
from the `model_fn`) to use as the `predictions` input to the
`signature_fn`. Optional. If `None`, predictions will pass to
`signature_fn` without filtering.
* <b>`default_batch_size`</b>: Default batch size of the `Example` placeholder.
* <b>`exports_to_keep`</b>: Number of exports to keep.
##### Returns:
The string path to the exported directory. NB: this functionality was
added ca. 2016/09/25; clients that depend on the return value may need
to handle the case where this function returns None because subclasses
are not returning a value.
- - -
#### `tf.contrib.learn.BaseEstimator.fit(*args, **kwargs)` {#BaseEstimator.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.BaseEstimator.get_params(deep=True)` {#BaseEstimator.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.BaseEstimator.get_variable_names()` {#BaseEstimator.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.BaseEstimator.get_variable_value(name)` {#BaseEstimator.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.BaseEstimator.model_dir` {#BaseEstimator.model_dir}
- - -
#### `tf.contrib.learn.BaseEstimator.partial_fit(*args, **kwargs)` {#BaseEstimator.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.BaseEstimator.predict(*args, **kwargs)` {#BaseEstimator.predict}
Returns predictions for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x` and 'batch_size' must be `None`.
* <b>`batch_size`</b>: Override default batch size. If set, 'input_fn' must be
'None'.
* <b>`outputs`</b>: list of `str`, name of the output to predict.
If `None`, returns all.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
A numpy array of predicted classes or regression values if the
constructor's `model_fn` returns a `Tensor` for `predictions` or a `dict`
of numpy arrays if `model_fn` returns a `dict`. Returns an iterable of
predictions if as_iterable is True.
##### Raises:
* <b>`ValueError`</b>: If x and input_fn are both provided or both `None`.
- - -
#### `tf.contrib.learn.BaseEstimator.set_params(**params)` {#BaseEstimator.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
### `class tf.contrib.learn.Estimator` {#Estimator}
Estimator class is the basic TensorFlow model trainer/evaluator.
- - -
#### `tf.contrib.learn.Estimator.__init__(model_fn=None, model_dir=None, config=None, params=None, feature_engineering_fn=None)` {#Estimator.__init__}
Constructs an `Estimator` instance.
##### Args:
* <b>`model_fn`</b>: Model function. Follows the signature:
* Args:
* `features`: single `Tensor` or `dict` of `Tensor`s
(depending on data passed to `fit`),
* `labels`: `Tensor` or `dict` of `Tensor`s (for multi-head
models). If mode is `ModeKeys.INFER`, `labels=None` will be
passed. If the `model_fn`'s signature does not accept
`mode`, the `model_fn` must still be able to handle
`labels=None`.
* `mode`: Optional. Specifies if this training, evaluation or
prediction. See `ModeKeys`.
* `params`: Optional `dict` of hyperparameters. Will receive what
is passed to Estimator in `params` parameter. This allows
to configure Estimators from hyper parameter tuning.
* `config`: Optional configuration object. Will receive what is passed
to Estimator in `config` parameter, or the default `config`.
Allows updating things in your model_fn based on configuration
such as `num_ps_replicas`.
* `model_dir`: Optional directory where model parameters, graph etc
are saved. Will receive what is passed to Estimator in
`model_dir` parameter, or the default `model_dir`. Allows
updating things in your model_fn that expect model_dir, such as
training hooks.
* Returns:
`ModelFnOps`
Also supports a legacy signature which returns tuple of:
* predictions: `Tensor`, `SparseTensor` or dictionary of same.
Can also be any type that is convertible to a `Tensor` or
`SparseTensor`, or dictionary of same.
* loss: Scalar loss `Tensor`.
* train_op: Training update `Tensor` or `Operation`.
Supports next three signatures for the function:
* `(features, labels) -> (predictions, loss, train_op)`
* `(features, labels, mode) -> (predictions, loss, train_op)`
* `(features, labels, mode, params) -> (predictions, loss, train_op)`
* `(features, labels, mode, params, config) ->
(predictions, loss, train_op)`
* `(features, labels, mode, params, config, model_dir) ->
(predictions, loss, train_op)`
* <b>`model_dir`</b>: Directory to save model parameters, graph and etc. This can
also be used to load checkpoints from the directory into a estimator to
continue training a previously saved model.
* <b>`config`</b>: Configuration object.
* <b>`params`</b>: `dict` of hyper parameters that will be passed into `model_fn`.
Keys are names of parameters, values are basic python types.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into `model_fn`. Please check `model_fn` for
a definition of features and labels.
##### Raises:
* <b>`ValueError`</b>: parameters of `model_fn` don't match `params`.
- - -
#### `tf.contrib.learn.Estimator.__repr__()` {#Estimator.__repr__}
- - -
#### `tf.contrib.learn.Estimator.config` {#Estimator.config}
- - -
#### `tf.contrib.learn.Estimator.evaluate(*args, **kwargs)` {#Estimator.evaluate}
See `Evaluable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` or `y` is provided, and at least one of
`input_fn` or `feed_fn` is provided.
Or if `metrics` is not `None` or `dict`.
- - -
#### `tf.contrib.learn.Estimator.export(*args, **kwargs)` {#Estimator.export}
Exports inference graph into given dir. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-23.
Instructions for updating:
The signature of the input_fn accepted by export is changing to be consistent with what's used by tf.Learn Estimator's train/evaluate. input_fn (and in most cases, input_feature_key) will become required args, and use_deprecated_input_fn will default to False and be removed altogether.
##### Args:
* <b>`export_dir`</b>: A string containing a directory to write the exported graph
and checkpoints.
* <b>`input_fn`</b>: If `use_deprecated_input_fn` is true, then a function that given
`Tensor` of `Example` strings, parses it into features that are then
passed to the model. Otherwise, a function that takes no argument and
returns a tuple of (features, labels), where features is a dict of
string key to `Tensor` and labels is a `Tensor` that's currently not
used (and so can be `None`).
* <b>`input_feature_key`</b>: Only used if `use_deprecated_input_fn` is false. String
key into the features dict returned by `input_fn` that corresponds to a
the raw `Example` strings `Tensor` that the exported model will take as
input. Can only be `None` if you're using a custom `signature_fn` that
does not use the first arg (examples).
* <b>`use_deprecated_input_fn`</b>: Determines the signature format of `input_fn`.
* <b>`signature_fn`</b>: Function that returns a default signature and a named
signature map, given `Tensor` of `Example` strings, `dict` of `Tensor`s
for features and `Tensor` or `dict` of `Tensor`s for predictions.
* <b>`prediction_key`</b>: The key for a tensor in the `predictions` dict (output
from the `model_fn`) to use as the `predictions` input to the
`signature_fn`. Optional. If `None`, predictions will pass to
`signature_fn` without filtering.
* <b>`default_batch_size`</b>: Default batch size of the `Example` placeholder.
* <b>`exports_to_keep`</b>: Number of exports to keep.
##### Returns:
The string path to the exported directory. NB: this functionality was
added ca. 2016/09/25; clients that depend on the return value may need
to handle the case where this function returns None because subclasses
are not returning a value.
- - -
#### `tf.contrib.learn.Estimator.export_savedmodel(export_dir_base, serving_input_fn, default_output_alternative_key=None, assets_extra=None, as_text=False)` {#Estimator.export_savedmodel}
Exports inference graph as a SavedModel into given dir.
##### Args:
* <b>`export_dir_base`</b>: A string containing a directory to write the exported
graph and checkpoints.
* <b>`serving_input_fn`</b>: A function that takes no argument and
returns an `InputFnOps`.
* <b>`default_output_alternative_key`</b>: the name of the head to serve when none is
specified. Not needed for single-headed models.
* <b>`assets_extra`</b>: A dict specifying how to populate the assets.extra directory
within the exported SavedModel. Each key should give the destination
path (including the filename) relative to the assets.extra directory.
The corresponding value gives the full path of the source file to be
copied. For example, the simple case of copying a single file without
renaming it is specified as
`{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
* <b>`as_text`</b>: whether to write the SavedModel proto in text format.
##### Returns:
The string path to the exported directory.
##### Raises:
* <b>`ValueError`</b>: if an unrecognized export_type is requested.
- - -
#### `tf.contrib.learn.Estimator.fit(*args, **kwargs)` {#Estimator.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.Estimator.get_params(deep=True)` {#Estimator.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.Estimator.get_variable_names()` {#Estimator.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.Estimator.get_variable_value(name)` {#Estimator.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.Estimator.model_dir` {#Estimator.model_dir}
- - -
#### `tf.contrib.learn.Estimator.partial_fit(*args, **kwargs)` {#Estimator.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.Estimator.predict(*args, **kwargs)` {#Estimator.predict}
Returns predictions for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x` and 'batch_size' must be `None`.
* <b>`batch_size`</b>: Override default batch size. If set, 'input_fn' must be
'None'.
* <b>`outputs`</b>: list of `str`, name of the output to predict.
If `None`, returns all.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
A numpy array of predicted classes or regression values if the
constructor's `model_fn` returns a `Tensor` for `predictions` or a `dict`
of numpy arrays if `model_fn` returns a `dict`. Returns an iterable of
predictions if as_iterable is True.
##### Raises:
* <b>`ValueError`</b>: If x and input_fn are both provided or both `None`.
- - -
#### `tf.contrib.learn.Estimator.set_params(**params)` {#Estimator.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
### `class tf.contrib.learn.Trainable` {#Trainable}
Interface for objects that are trainable by, e.g., `Experiment`.
- - -
#### `tf.contrib.learn.Trainable.fit(x=None, y=None, input_fn=None, steps=None, batch_size=None, monitors=None, max_steps=None)` {#Trainable.fit}
Trains a model given training data `x` predictions and `y` labels.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...] or the dictionary of Matrices.
Can be iterator that returns arrays of features or dictionary of arrays of features.
The training input samples for fitting the model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs] or the dictionary of same.
Can be iterator that returns array of labels or dictionary of array of labels.
The training label values (class labels in classification, real numbers in regression).
If set, `input_fn` must be `None`. Note: For classification, label values must
be integers representing the class index (i.e. values from 0 to
n_classes-1).
* <b>`input_fn`</b>: Input function returning a tuple of:
features - `Tensor` or dictionary of string feature name to `Tensor`.
labels - `Tensor` or dictionary of `Tensor` with labels.
If input_fn is set, `x`, `y`, and `batch_size` must be `None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
'steps' works incrementally. If you call two times fit(steps=10) then
training occurs in total 20 steps. If you don't want to have incremental
behaviour please set `max_steps` instead. If set, `max_steps` must be
`None`.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
* <b>`max_steps`</b>: Number of total steps for which to train model. If `None`,
train forever. If set, `steps` must be `None`.
Two calls to `fit(steps=100)` means 200 training
iterations. On the other hand, two calls to `fit(max_steps=100)` means
that the second call will not do any iteration since first call did
all 100 steps.
##### Returns:
`self`, for chaining.
- - -
### `class tf.contrib.learn.Evaluable` {#Evaluable}
Interface for objects that are evaluatable by, e.g., `Experiment`.
- - -
#### `tf.contrib.learn.Evaluable.evaluate(x=None, y=None, input_fn=None, feed_fn=None, batch_size=None, steps=None, metrics=None, name=None, checkpoint_path=None, hooks=None)` {#Evaluable.evaluate}
Evaluates given model with provided evaluation data.
Stop conditions - we evaluate on the given input data until one of the
following:
- If `steps` is provided, and `steps` batches of size `batch_size` are
processed.
- If `input_fn` is provided, and it raises an end-of-input
exception (`OutOfRangeError` or `StopIteration`).
- If `x` is provided, and all items in `x` have been processed.
The return value is a dict containing the metrics specified in `metrics`, as
well as an entry `global_step` which contains the value of the global step
for which this evaluation was performed.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...] or dictionary of many matrices
containing the input samples for fitting the model. Can be iterator that returns
arrays of features or dictionary of array of features. If set, `input_fn` must
be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs] containing the
label values (class labels in classification, real numbers in
regression) or dictionary of multiple vectors/matrices. Can be iterator
that returns array of targets or dictionary of array of targets. If set,
`input_fn` must be `None`. Note: For classification, label values must
be integers representing the class index (i.e. values from 0 to
n_classes-1).
* <b>`input_fn`</b>: Input function returning a tuple of:
features - Dictionary of string feature name to `Tensor` or `Tensor`.
labels - `Tensor` or dictionary of `Tensor` with labels.
If input_fn is set, `x`, `y`, and `batch_size` must be `None`. If
`steps` is not provided, this should raise `OutOfRangeError` or
`StopIteration` after the desired amount of data (e.g., one epoch) has
been provided. See "Stop conditions" above for specifics.
* <b>`feed_fn`</b>: Function creating a feed dict every time it is called. Called
once per iteration. Must be `None` if `input_fn` is provided.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`, if specified. Must be `None` if `input_fn` is
provided.
* <b>`steps`</b>: Number of steps for which to evaluate model. If `None`, evaluate
until `x` is consumed or `input_fn` raises an end-of-input exception.
See "Stop conditions" above for specifics.
* <b>`metrics`</b>: Dict of metrics to run. If None, the default metric functions
are used; if {}, no metrics are used. Otherwise, `metrics` should map
friendly names for the metric to a `MetricSpec` object defining which
model outputs to evaluate against which labels with which metric
function.
Metric ops should support streaming, e.g., returning `update_op` and
`value` tensors. For example, see the options defined in
`../../../metrics/python/ops/metrics_ops.py`.
* <b>`name`</b>: Name of the evaluation if user needs to run multiple evaluations on
different data sets, such as on training data vs test data.
* <b>`checkpoint_path`</b>: Path of a specific checkpoint to evaluate. If `None`, the
latest checkpoint in `model_dir` is used.
* <b>`hooks`</b>: List of `SessionRunHook` subclass instances. Used for callbacks
inside the evaluation call.
##### Returns:
Returns `dict` with evaluation results.
- - -
#### `tf.contrib.learn.Evaluable.model_dir` {#Evaluable.model_dir}
Returns a path in which the eval process will look for checkpoints.
- - -
### `class tf.contrib.learn.ModeKeys` {#ModeKeys}
Standard names for model modes.
The following standard keys are defined:
* `TRAIN`: training mode.
* `EVAL`: evaluation mode.
* `INFER`: inference mode.
- - -
### `class tf.contrib.learn.DNNClassifier` {#DNNClassifier}
A classifier for TensorFlow DNN models.
Example:
```python
sparse_feature_a = sparse_column_with_hash_bucket(...)
sparse_feature_b = sparse_column_with_hash_bucket(...)
sparse_feature_a_emb = embedding_column(sparse_id_column=sparse_feature_a,
...)
sparse_feature_b_emb = embedding_column(sparse_id_column=sparse_feature_b,
...)
estimator = DNNClassifier(
feature_columns=[sparse_feature_a_emb, sparse_feature_b_emb],
hidden_units=[1024, 512, 256])
# Or estimator using the ProximalAdagradOptimizer optimizer with
# regularization.
estimator = DNNClassifier(
feature_columns=[sparse_feature_a_emb, sparse_feature_b_emb],
hidden_units=[1024, 512, 256],
optimizer=tf.train.ProximalAdagradOptimizer(
learning_rate=0.1,
l1_regularization_strength=0.001
))
# Input builders
def input_fn_train: # returns x, y (where y represents label's class index).
pass
estimator.fit(input_fn=input_fn_train)
def input_fn_eval: # returns x, y (where y represents label's class index).
pass
estimator.evaluate(input_fn=input_fn_eval)
estimator.predict(x=x) # returns predicted labels (i.e. label's class index).
```
Input of `fit` and `evaluate` should have following features,
otherwise there will be a `KeyError`:
* if `weight_column_name` is not `None`, a feature with
`key=weight_column_name` whose value is a `Tensor`.
* for each `column` in `feature_columns`:
- if `column` is a `SparseColumn`, a feature with `key=column.name`
whose `value` is a `SparseTensor`.
- if `column` is a `WeightedSparseColumn`, two features: the first with
`key` the id column name, the second with `key` the weight column name.
Both features' `value` must be a `SparseTensor`.
- if `column` is a `RealValuedColumn`, a feature with `key=column.name`
whose `value` is a `Tensor`.
- - -
#### `tf.contrib.learn.DNNClassifier.__init__(hidden_units, feature_columns, model_dir=None, n_classes=2, weight_column_name=None, optimizer=None, activation_fn=relu, dropout=None, gradient_clip_norm=None, enable_centered_bias=False, config=None, feature_engineering_fn=None, embedding_lr_multipliers=None, input_layer_min_slice_size=None)` {#DNNClassifier.__init__}
Initializes a DNNClassifier instance.
##### Args:
* <b>`hidden_units`</b>: List of hidden units per layer. All layers are fully
connected. Ex. `[64, 32]` means first layer has 64 nodes and second one
has 32.
* <b>`feature_columns`</b>: An iterable containing all the feature columns used by
the model. All items in the set should be instances of classes derived
from `FeatureColumn`.
* <b>`model_dir`</b>: Directory to save model parameters, graph and etc. This can
also be used to load checkpoints from the directory into a estimator to
continue training a previously saved model.
* <b>`n_classes`</b>: number of label classes. Default is binary classification.
It must be greater than 1. Note: Class labels are integers representing
the class index (i.e. values from 0 to n_classes-1). For arbitrary
label values (e.g. string labels), convert to class indices first.
* <b>`weight_column_name`</b>: A string defining feature column name representing
weights. It is used to down weight or boost examples during training. It
will be multiplied by the loss of the example.
* <b>`optimizer`</b>: An instance of `tf.Optimizer` used to train the model. If
`None`, will use an Adagrad optimizer.
* <b>`activation_fn`</b>: Activation function applied to each layer. If `None`, will
use `tf.nn.relu`.
* <b>`dropout`</b>: When not `None`, the probability we will drop out a given
coordinate.
* <b>`gradient_clip_norm`</b>: A float > 0. If provided, gradients are
clipped to their global norm with this clipping ratio. See
`tf.clip_by_global_norm` for more details.
* <b>`enable_centered_bias`</b>: A bool. If True, estimator will learn a centered
bias variable for each class. Rest of the model structure learns the
residual after centered bias.
* <b>`config`</b>: `RunConfig` object to configure the runtime settings.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into the model.
* <b>`embedding_lr_multipliers`</b>: Optional. A dictionary from `EmbeddingColumn` to
a `float` multiplier. Multiplier will be used to multiply with
learning rate for the embedding variables.
* <b>`input_layer_min_slice_size`</b>: Optional. The min slice size of input layer
partitions. If not provided, will use the default of 64M.
##### Returns:
A `DNNClassifier` estimator.
##### Raises:
* <b>`ValueError`</b>: If `n_classes` < 2.
- - -
#### `tf.contrib.learn.DNNClassifier.__repr__()` {#DNNClassifier.__repr__}
- - -
#### `tf.contrib.learn.DNNClassifier.bias_` {#DNNClassifier.bias_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
#### `tf.contrib.learn.DNNClassifier.config` {#DNNClassifier.config}
- - -
#### `tf.contrib.learn.DNNClassifier.evaluate(*args, **kwargs)` {#DNNClassifier.evaluate}
See `Evaluable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` or `y` is provided, and at least one of
`input_fn` or `feed_fn` is provided.
Or if `metrics` is not `None` or `dict`.
- - -
#### `tf.contrib.learn.DNNClassifier.export(export_dir, input_fn=None, input_feature_key=None, use_deprecated_input_fn=True, signature_fn=None, default_batch_size=1, exports_to_keep=None)` {#DNNClassifier.export}
See BaseEstimator.export.
- - -
#### `tf.contrib.learn.DNNClassifier.export_savedmodel(export_dir_base, serving_input_fn, default_output_alternative_key=None, assets_extra=None, as_text=False)` {#DNNClassifier.export_savedmodel}
Exports inference graph as a SavedModel into given dir.
##### Args:
* <b>`export_dir_base`</b>: A string containing a directory to write the exported
graph and checkpoints.
* <b>`serving_input_fn`</b>: A function that takes no argument and
returns an `InputFnOps`.
* <b>`default_output_alternative_key`</b>: the name of the head to serve when none is
specified. Not needed for single-headed models.
* <b>`assets_extra`</b>: A dict specifying how to populate the assets.extra directory
within the exported SavedModel. Each key should give the destination
path (including the filename) relative to the assets.extra directory.
The corresponding value gives the full path of the source file to be
copied. For example, the simple case of copying a single file without
renaming it is specified as
`{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
* <b>`as_text`</b>: whether to write the SavedModel proto in text format.
##### Returns:
The string path to the exported directory.
##### Raises:
* <b>`ValueError`</b>: if an unrecognized export_type is requested.
- - -
#### `tf.contrib.learn.DNNClassifier.fit(*args, **kwargs)` {#DNNClassifier.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.DNNClassifier.get_params(deep=True)` {#DNNClassifier.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.DNNClassifier.get_variable_names()` {#DNNClassifier.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.DNNClassifier.get_variable_value(name)` {#DNNClassifier.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.DNNClassifier.model_dir` {#DNNClassifier.model_dir}
- - -
#### `tf.contrib.learn.DNNClassifier.partial_fit(*args, **kwargs)` {#DNNClassifier.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.DNNClassifier.predict(*args, **kwargs)` {#DNNClassifier.predict}
Returns predicted classes for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
##### Args:
* <b>`x`</b>: features.
* <b>`input_fn`</b>: Input function. If set, x must be None.
* <b>`batch_size`</b>: Override default batch size.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
Numpy array of predicted classes with shape [batch_size] (or an iterable
of predicted classes if as_iterable is True). Each predicted class is
represented by its class index (i.e. integer from 0 to n_classes-1).
- - -
#### `tf.contrib.learn.DNNClassifier.predict_classes(*args, **kwargs)` {#DNNClassifier.predict_classes}
Returns predicted classes for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
##### Args:
* <b>`x`</b>: features.
* <b>`input_fn`</b>: Input function. If set, x must be None.
* <b>`batch_size`</b>: Override default batch size.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
Numpy array of predicted classes with shape [batch_size] (or an iterable
of predicted classes if as_iterable is True). Each predicted class is
represented by its class index (i.e. integer from 0 to n_classes-1).
- - -
#### `tf.contrib.learn.DNNClassifier.predict_proba(*args, **kwargs)` {#DNNClassifier.predict_proba}
Returns prediction probabilities for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
##### Args:
* <b>`x`</b>: features.
* <b>`input_fn`</b>: Input function. If set, x and y must be None.
* <b>`batch_size`</b>: Override default batch size.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
Numpy array of predicted probabilities with shape [batch_size, n_classes]
(or an iterable of predicted probabilities if as_iterable is True).
- - -
#### `tf.contrib.learn.DNNClassifier.set_params(**params)` {#DNNClassifier.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
#### `tf.contrib.learn.DNNClassifier.weights_` {#DNNClassifier.weights_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
### `class tf.contrib.learn.DNNRegressor` {#DNNRegressor}
A regressor for TensorFlow DNN models.
Example:
```python
sparse_feature_a = sparse_column_with_hash_bucket(...)
sparse_feature_b = sparse_column_with_hash_bucket(...)
sparse_feature_a_emb = embedding_column(sparse_id_column=sparse_feature_a,
...)
sparse_feature_b_emb = embedding_column(sparse_id_column=sparse_feature_b,
...)
estimator = DNNRegressor(
feature_columns=[sparse_feature_a, sparse_feature_b],
hidden_units=[1024, 512, 256])
# Or estimator using the ProximalAdagradOptimizer optimizer with
# regularization.
estimator = DNNRegressor(
feature_columns=[sparse_feature_a, sparse_feature_b],
hidden_units=[1024, 512, 256],
optimizer=tf.train.ProximalAdagradOptimizer(
learning_rate=0.1,
l1_regularization_strength=0.001
))
# Input builders
def input_fn_train: # returns x, y
pass
estimator.fit(input_fn=input_fn_train)
def input_fn_eval: # returns x, y
pass
estimator.evaluate(input_fn=input_fn_eval)
estimator.predict(x=x)
```
Input of `fit` and `evaluate` should have following features,
otherwise there will be a `KeyError`:
* if `weight_column_name` is not `None`, a feature with
`key=weight_column_name` whose value is a `Tensor`.
* for each `column` in `feature_columns`:
- if `column` is a `SparseColumn`, a feature with `key=column.name`
whose `value` is a `SparseTensor`.
- if `column` is a `WeightedSparseColumn`, two features: the first with
`key` the id column name, the second with `key` the weight column name.
Both features' `value` must be a `SparseTensor`.
- if `column` is a `RealValuedColumn`, a feature with `key=column.name`
whose `value` is a `Tensor`.
- - -
#### `tf.contrib.learn.DNNRegressor.__init__(hidden_units, feature_columns, model_dir=None, weight_column_name=None, optimizer=None, activation_fn=relu, dropout=None, gradient_clip_norm=None, enable_centered_bias=False, config=None, feature_engineering_fn=None, label_dimension=1, embedding_lr_multipliers=None, input_layer_min_slice_size=None)` {#DNNRegressor.__init__}
Initializes a `DNNRegressor` instance.
##### Args:
* <b>`hidden_units`</b>: List of hidden units per layer. All layers are fully
connected. Ex. `[64, 32]` means first layer has 64 nodes and second one
has 32.
* <b>`feature_columns`</b>: An iterable containing all the feature columns used by
the model. All items in the set should be instances of classes derived
from `FeatureColumn`.
* <b>`model_dir`</b>: Directory to save model parameters, graph and etc. This can
also be used to load checkpoints from the directory into a estimator to
continue training a previously saved model.
* <b>`weight_column_name`</b>: A string defining feature column name representing
weights. It is used to down weight or boost examples during training. It
will be multiplied by the loss of the example.
* <b>`optimizer`</b>: An instance of `tf.Optimizer` used to train the model. If
`None`, will use an Adagrad optimizer.
* <b>`activation_fn`</b>: Activation function applied to each layer. If `None`, will
use `tf.nn.relu`.
* <b>`dropout`</b>: When not `None`, the probability we will drop out a given
coordinate.
* <b>`gradient_clip_norm`</b>: A `float` > 0. If provided, gradients are clipped
to their global norm with this clipping ratio. See
`tf.clip_by_global_norm` for more details.
* <b>`enable_centered_bias`</b>: A bool. If True, estimator will learn a centered
bias variable for each class. Rest of the model structure learns the
residual after centered bias.
* <b>`config`</b>: `RunConfig` object to configure the runtime settings.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into the model.
* <b>`label_dimension`</b>: Dimension of the label for multilabels. Defaults to 1.
* <b>`embedding_lr_multipliers`</b>: Optional. A dictionary from `EbeddingColumn` to
a `float` multiplier. Multiplier will be used to multiply with
learning rate for the embedding variables.
* <b>`input_layer_min_slice_size`</b>: Optional. The min slice size of input layer
partitions. If not provided, will use the default of 64M.
##### Returns:
A `DNNRegressor` estimator.
- - -
#### `tf.contrib.learn.DNNRegressor.__repr__()` {#DNNRegressor.__repr__}
- - -
#### `tf.contrib.learn.DNNRegressor.config` {#DNNRegressor.config}
- - -
#### `tf.contrib.learn.DNNRegressor.evaluate(x=None, y=None, input_fn=None, feed_fn=None, batch_size=None, steps=None, metrics=None, name=None, checkpoint_path=None, hooks=None)` {#DNNRegressor.evaluate}
See evaluable.Evaluable.
- - -
#### `tf.contrib.learn.DNNRegressor.export(export_dir, input_fn=None, input_feature_key=None, use_deprecated_input_fn=True, signature_fn=None, default_batch_size=1, exports_to_keep=None)` {#DNNRegressor.export}
See BaseEstimator.export.
- - -
#### `tf.contrib.learn.DNNRegressor.export_savedmodel(export_dir_base, serving_input_fn, default_output_alternative_key=None, assets_extra=None, as_text=False)` {#DNNRegressor.export_savedmodel}
Exports inference graph as a SavedModel into given dir.
##### Args:
* <b>`export_dir_base`</b>: A string containing a directory to write the exported
graph and checkpoints.
* <b>`serving_input_fn`</b>: A function that takes no argument and
returns an `InputFnOps`.
* <b>`default_output_alternative_key`</b>: the name of the head to serve when none is
specified. Not needed for single-headed models.
* <b>`assets_extra`</b>: A dict specifying how to populate the assets.extra directory
within the exported SavedModel. Each key should give the destination
path (including the filename) relative to the assets.extra directory.
The corresponding value gives the full path of the source file to be
copied. For example, the simple case of copying a single file without
renaming it is specified as
`{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
* <b>`as_text`</b>: whether to write the SavedModel proto in text format.
##### Returns:
The string path to the exported directory.
##### Raises:
* <b>`ValueError`</b>: if an unrecognized export_type is requested.
- - -
#### `tf.contrib.learn.DNNRegressor.fit(*args, **kwargs)` {#DNNRegressor.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.DNNRegressor.get_params(deep=True)` {#DNNRegressor.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.DNNRegressor.get_variable_names()` {#DNNRegressor.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.DNNRegressor.get_variable_value(name)` {#DNNRegressor.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.DNNRegressor.model_dir` {#DNNRegressor.model_dir}
- - -
#### `tf.contrib.learn.DNNRegressor.partial_fit(*args, **kwargs)` {#DNNRegressor.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.DNNRegressor.predict(*args, **kwargs)` {#DNNRegressor.predict}
Returns predicted scores for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
##### Args:
* <b>`x`</b>: features.
* <b>`input_fn`</b>: Input function. If set, x must be None.
* <b>`batch_size`</b>: Override default batch size.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
Numpy array of predicted scores (or an iterable of predicted scores if
as_iterable is True). If `label_dimension == 1`, the shape of the output
is `[batch_size]`, otherwise the shape is `[batch_size, label_dimension]`.
- - -
#### `tf.contrib.learn.DNNRegressor.predict_scores(*args, **kwargs)` {#DNNRegressor.predict_scores}
Returns predicted scores for given features. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
##### Args:
* <b>`x`</b>: features.
* <b>`input_fn`</b>: Input function. If set, x must be None.
* <b>`batch_size`</b>: Override default batch size.
* <b>`as_iterable`</b>: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: The inputs must
terminate if you want the iterable to terminate (e.g. be sure to pass
num_epochs=1 if you are using something like read_batch_features).
##### Returns:
Numpy array of predicted scores (or an iterable of predicted scores if
as_iterable is True). If `label_dimension == 1`, the shape of the output
is `[batch_size]`, otherwise the shape is `[batch_size, label_dimension]`.
- - -
#### `tf.contrib.learn.DNNRegressor.set_params(**params)` {#DNNRegressor.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
### `class tf.contrib.learn.LinearClassifier` {#LinearClassifier}
Linear classifier model.
Train a linear model to classify instances into one of multiple possible
classes. When number of possible classes is 2, this is binary classification.
Example:
```python
sparse_column_a = sparse_column_with_hash_bucket(...)
sparse_column_b = sparse_column_with_hash_bucket(...)
sparse_feature_a_x_sparse_feature_b = crossed_column(...)
# Estimator using the default optimizer.
estimator = LinearClassifier(
feature_columns=[sparse_column_a, sparse_feature_a_x_sparse_feature_b])
# Or estimator using the FTRL optimizer with regularization.
estimator = LinearClassifier(
feature_columns=[sparse_column_a, sparse_feature_a_x_sparse_feature_b],
optimizer=tf.train.FtrlOptimizer(
learning_rate=0.1,
l1_regularization_strength=0.001
))
# Or estimator using the SDCAOptimizer.
estimator = LinearClassifier(
feature_columns=[sparse_column_a, sparse_feature_a_x_sparse_feature_b],
optimizer=tf.contrib.linear_optimizer.SDCAOptimizer(
example_id_column='example_id',
num_loss_partitions=...,
symmetric_l2_regularization=2.0
))
# Input builders
def input_fn_train: # returns x, y (where y represents label's class index).
...
def input_fn_eval: # returns x, y (where y represents label's class index).
...
estimator.fit(input_fn=input_fn_train)
estimator.evaluate(input_fn=input_fn_eval)
estimator.predict(x=x) # returns predicted labels (i.e. label's class index).
```
Input of `fit` and `evaluate` should have following features,
otherwise there will be a `KeyError`:
* if `weight_column_name` is not `None`, a feature with
`key=weight_column_name` whose value is a `Tensor`.
* for each `column` in `feature_columns`:
- if `column` is a `SparseColumn`, a feature with `key=column.name`
whose `value` is a `SparseTensor`.
- if `column` is a `WeightedSparseColumn`, two features: the first with
`key` the id column name, the second with `key` the weight column name.
Both features' `value` must be a `SparseTensor`.
- if `column` is a `RealValuedColumn`, a feature with `key=column.name`
whose `value` is a `Tensor`.
- - -
#### `tf.contrib.learn.LinearClassifier.__init__(feature_columns, model_dir=None, n_classes=2, weight_column_name=None, optimizer=None, gradient_clip_norm=None, enable_centered_bias=False, _joint_weight=False, config=None, feature_engineering_fn=None)` {#LinearClassifier.__init__}
Construct a `LinearClassifier` estimator object.
##### Args:
* <b>`feature_columns`</b>: An iterable containing all the feature columns used by
the model. All items in the set should be instances of classes derived
from `FeatureColumn`.
* <b>`model_dir`</b>: Directory to save model parameters, graph and etc. This can
also be used to load checkpoints from the directory into a estimator
to continue training a previously saved model.
* <b>`n_classes`</b>: number of label classes. Default is binary classification.
Note that class labels are integers representing the class index (i.e.
values from 0 to n_classes-1). For arbitrary label values (e.g. string
labels), convert to class indices first.
* <b>`weight_column_name`</b>: A string defining feature column name representing
weights. It is used to down weight or boost examples during training. It
will be multiplied by the loss of the example.
* <b>`optimizer`</b>: The optimizer used to train the model. If specified, it should
be either an instance of `tf.Optimizer` or the SDCAOptimizer. If `None`,
the Ftrl optimizer will be used.
* <b>`gradient_clip_norm`</b>: A `float` > 0. If provided, gradients are clipped
to their global norm with this clipping ratio. See
`tf.clip_by_global_norm` for more details.
* <b>`enable_centered_bias`</b>: A bool. If True, estimator will learn a centered
bias variable for each class. Rest of the model structure learns the
residual after centered bias.
_joint_weight: If True, the weights for all columns will be stored in a
single (possibly partitioned) variable. It's more efficient, but it's
incompatible with SDCAOptimizer, and requires all feature columns are
sparse and use the 'sum' combiner.
* <b>`config`</b>: `RunConfig` object to configure the runtime settings.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into the model.
##### Returns:
A `LinearClassifier` estimator.
##### Raises:
* <b>`ValueError`</b>: if n_classes < 2.
- - -
#### `tf.contrib.learn.LinearClassifier.__repr__()` {#LinearClassifier.__repr__}
- - -
#### `tf.contrib.learn.LinearClassifier.bias_` {#LinearClassifier.bias_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
#### `tf.contrib.learn.LinearClassifier.config` {#LinearClassifier.config}
- - -
#### `tf.contrib.learn.LinearClassifier.evaluate(*args, **kwargs)` {#LinearClassifier.evaluate}
See `Evaluable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` or `y` is provided, and at least one of
`input_fn` or `feed_fn` is provided.
Or if `metrics` is not `None` or `dict`.
- - -
#### `tf.contrib.learn.LinearClassifier.export(export_dir, input_fn=None, input_feature_key=None, use_deprecated_input_fn=True, signature_fn=None, default_batch_size=1, exports_to_keep=None)` {#LinearClassifier.export}
See BaseEstimator.export.
- - -
#### `tf.contrib.learn.LinearClassifier.export_savedmodel(export_dir_base, serving_input_fn, default_output_alternative_key=None, assets_extra=None, as_text=False)` {#LinearClassifier.export_savedmodel}
Exports inference graph as a SavedModel into given dir.
##### Args:
* <b>`export_dir_base`</b>: A string containing a directory to write the exported
graph and checkpoints.
* <b>`serving_input_fn`</b>: A function that takes no argument and
returns an `InputFnOps`.
* <b>`default_output_alternative_key`</b>: the name of the head to serve when none is
specified. Not needed for single-headed models.
* <b>`assets_extra`</b>: A dict specifying how to populate the assets.extra directory
within the exported SavedModel. Each key should give the destination
path (including the filename) relative to the assets.extra directory.
The corresponding value gives the full path of the source file to be
copied. For example, the simple case of copying a single file without
renaming it is specified as
`{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
* <b>`as_text`</b>: whether to write the SavedModel proto in text format.
##### Returns:
The string path to the exported directory.
##### Raises:
* <b>`ValueError`</b>: if an unrecognized export_type is requested.
- - -
#### `tf.contrib.learn.LinearClassifier.fit(*args, **kwargs)` {#LinearClassifier.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.LinearClassifier.get_params(deep=True)` {#LinearClassifier.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.LinearClassifier.get_variable_names()` {#LinearClassifier.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.LinearClassifier.get_variable_value(name)` {#LinearClassifier.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.LinearClassifier.model_dir` {#LinearClassifier.model_dir}
- - -
#### `tf.contrib.learn.LinearClassifier.partial_fit(*args, **kwargs)` {#LinearClassifier.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.LinearClassifier.predict(*args, **kwargs)` {#LinearClassifier.predict}
Runs inference to determine the predicted class (i.e. class index). (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
- - -
#### `tf.contrib.learn.LinearClassifier.predict_classes(*args, **kwargs)` {#LinearClassifier.predict_classes}
Runs inference to determine the predicted class (i.e. class index). (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
- - -
#### `tf.contrib.learn.LinearClassifier.predict_proba(*args, **kwargs)` {#LinearClassifier.predict_proba}
Runs inference to determine the class probability predictions. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
- - -
#### `tf.contrib.learn.LinearClassifier.set_params(**params)` {#LinearClassifier.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
#### `tf.contrib.learn.LinearClassifier.weights_` {#LinearClassifier.weights_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
### `class tf.contrib.learn.LinearRegressor` {#LinearRegressor}
Linear regressor model.
Train a linear regression model to predict label value given observation of
feature values.
Example:
```python
sparse_column_a = sparse_column_with_hash_bucket(...)
sparse_column_b = sparse_column_with_hash_bucket(...)
sparse_feature_a_x_sparse_feature_b = crossed_column(...)
estimator = LinearRegressor(
feature_columns=[sparse_column_a, sparse_feature_a_x_sparse_feature_b])
# Input builders
def input_fn_train: # returns x, y
...
def input_fn_eval: # returns x, y
...
estimator.fit(input_fn=input_fn_train)
estimator.evaluate(input_fn=input_fn_eval)
estimator.predict(x=x)
```
Input of `fit` and `evaluate` should have following features,
otherwise there will be a KeyError:
* if `weight_column_name` is not `None`:
key=weight_column_name, value=a `Tensor`
* for column in `feature_columns`:
- if isinstance(column, `SparseColumn`):
key=column.name, value=a `SparseTensor`
- if isinstance(column, `WeightedSparseColumn`):
{key=id column name, value=a `SparseTensor`,
key=weight column name, value=a `SparseTensor`}
- if isinstance(column, `RealValuedColumn`):
key=column.name, value=a `Tensor`
- - -
#### `tf.contrib.learn.LinearRegressor.__init__(feature_columns, model_dir=None, weight_column_name=None, optimizer=None, gradient_clip_norm=None, enable_centered_bias=False, label_dimension=1, _joint_weights=False, config=None, feature_engineering_fn=None)` {#LinearRegressor.__init__}
Construct a `LinearRegressor` estimator object.
##### Args:
* <b>`feature_columns`</b>: An iterable containing all the feature columns used by
the model. All items in the set should be instances of classes derived
from `FeatureColumn`.
* <b>`model_dir`</b>: Directory to save model parameters, graph, etc. This can
also be used to load checkpoints from the directory into a estimator
to continue training a previously saved model.
* <b>`weight_column_name`</b>: A string defining feature column name representing
weights. It is used to down weight or boost examples during training. It
will be multiplied by the loss of the example.
* <b>`optimizer`</b>: An instance of `tf.Optimizer` used to train the model. If
`None`, will use an Ftrl optimizer.
* <b>`gradient_clip_norm`</b>: A `float` > 0. If provided, gradients are clipped
to their global norm with this clipping ratio. See
`tf.clip_by_global_norm` for more details.
* <b>`enable_centered_bias`</b>: A bool. If True, estimator will learn a centered
bias variable for each class. Rest of the model structure learns the
residual after centered bias.
* <b>`label_dimension`</b>: Dimension of the label for multilabels. Defaults to 1.
_joint_weights: If True use a single (possibly partitioned) variable to
store the weights. It's faster, but requires all feature columns are
sparse and have the 'sum' combiner. Incompatible with SDCAOptimizer.
* <b>`config`</b>: `RunConfig` object to configure the runtime settings.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into the model.
##### Returns:
A `LinearRegressor` estimator.
- - -
#### `tf.contrib.learn.LinearRegressor.__repr__()` {#LinearRegressor.__repr__}
- - -
#### `tf.contrib.learn.LinearRegressor.bias_` {#LinearRegressor.bias_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
#### `tf.contrib.learn.LinearRegressor.config` {#LinearRegressor.config}
- - -
#### `tf.contrib.learn.LinearRegressor.evaluate(*args, **kwargs)` {#LinearRegressor.evaluate}
See `Evaluable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` or `y` is provided, and at least one of
`input_fn` or `feed_fn` is provided.
Or if `metrics` is not `None` or `dict`.
- - -
#### `tf.contrib.learn.LinearRegressor.export(export_dir, input_fn=None, input_feature_key=None, use_deprecated_input_fn=True, signature_fn=None, default_batch_size=1, exports_to_keep=None)` {#LinearRegressor.export}
See BaseEstimator.export.
- - -
#### `tf.contrib.learn.LinearRegressor.export_savedmodel(export_dir_base, serving_input_fn, default_output_alternative_key=None, assets_extra=None, as_text=False)` {#LinearRegressor.export_savedmodel}
Exports inference graph as a SavedModel into given dir.
##### Args:
* <b>`export_dir_base`</b>: A string containing a directory to write the exported
graph and checkpoints.
* <b>`serving_input_fn`</b>: A function that takes no argument and
returns an `InputFnOps`.
* <b>`default_output_alternative_key`</b>: the name of the head to serve when none is
specified. Not needed for single-headed models.
* <b>`assets_extra`</b>: A dict specifying how to populate the assets.extra directory
within the exported SavedModel. Each key should give the destination
path (including the filename) relative to the assets.extra directory.
The corresponding value gives the full path of the source file to be
copied. For example, the simple case of copying a single file without
renaming it is specified as
`{'my_asset_file.txt': '/path/to/my_asset_file.txt'}`.
* <b>`as_text`</b>: whether to write the SavedModel proto in text format.
##### Returns:
The string path to the exported directory.
##### Raises:
* <b>`ValueError`</b>: if an unrecognized export_type is requested.
- - -
#### `tf.contrib.learn.LinearRegressor.fit(*args, **kwargs)` {#LinearRegressor.fit}
See `Trainable`. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
##### Raises:
* <b>`ValueError`</b>: If `x` or `y` are not `None` while `input_fn` is not `None`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
- - -
#### `tf.contrib.learn.LinearRegressor.get_params(deep=True)` {#LinearRegressor.get_params}
Get parameters for this estimator.
##### Args:
* <b>`deep`</b>: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
##### Returns:
params : mapping of string to any
Parameter names mapped to their values.
- - -
#### `tf.contrib.learn.LinearRegressor.get_variable_names()` {#LinearRegressor.get_variable_names}
Returns list of all variable names in this model.
##### Returns:
List of names.
- - -
#### `tf.contrib.learn.LinearRegressor.get_variable_value(name)` {#LinearRegressor.get_variable_value}
Returns value of the variable given by name.
##### Args:
* <b>`name`</b>: string, name of the tensor.
##### Returns:
Numpy array - value of the tensor.
- - -
#### `tf.contrib.learn.LinearRegressor.model_dir` {#LinearRegressor.model_dir}
- - -
#### `tf.contrib.learn.LinearRegressor.partial_fit(*args, **kwargs)` {#LinearRegressor.partial_fit}
Incremental fit on a batch of samples. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01.
Instructions for updating:
Estimator is decoupled from Scikit Learn interface by moving into
separate class SKCompat. Arguments x, y and batch_size are only
available in the SKCompat class, Estimator will only accept input_fn.
##### Example conversion:
est = Estimator(...) -> est = SKCompat(Estimator(...))
This method is expected to be called several times consecutively
on different or the same chunks of the dataset. This either can
implement iterative training or out-of-core/online training.
This is especially useful when the whole dataset is too big to
fit in memory at the same time. Or when model is taking long time
to converge, and you want to split up training into subparts.
##### Args:
* <b>`x`</b>: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
* <b>`y`</b>: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be
iterator that returns array of labels. The training label values
(class labels in classification, real numbers in regression). If set,
`input_fn` must be `None`.
* <b>`input_fn`</b>: Input function. If set, `x`, `y`, and `batch_size` must be
`None`.
* <b>`steps`</b>: Number of steps for which to train model. If `None`, train forever.
* <b>`batch_size`</b>: minibatch size to use on the input, defaults to first
dimension of `x`. Must be `None` if `input_fn` is provided.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
##### Returns:
`self`, for chaining.
##### Raises:
* <b>`ValueError`</b>: If at least one of `x` and `y` is provided, and `input_fn` is
provided.
- - -
#### `tf.contrib.learn.LinearRegressor.predict(*args, **kwargs)` {#LinearRegressor.predict}
Runs inference to determine the predicted scores. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
- - -
#### `tf.contrib.learn.LinearRegressor.predict_scores(*args, **kwargs)` {#LinearRegressor.predict_scores}
Runs inference to determine the predicted scores. (deprecated arguments)
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-09-15.
Instructions for updating:
The default behavior of predict() is changing. The default value for
as_iterable will change to True, and then the flag will be removed
altogether. The behavior of this flag is described below.
- - -
#### `tf.contrib.learn.LinearRegressor.set_params(**params)` {#LinearRegressor.set_params}
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
##### Args:
* <b>`**params`</b>: Parameters.
##### Returns:
self
##### Raises:
* <b>`ValueError`</b>: If params contain invalid names.
- - -
#### `tf.contrib.learn.LinearRegressor.weights_` {#LinearRegressor.weights_}
DEPRECATED FUNCTION
THIS FUNCTION IS DEPRECATED. It will be removed after 2016-10-30.
Instructions for updating:
This method will be removed after the deprecation date. To inspect variables, use get_variable_names() and get_variable_value().
- - -
### `tf.contrib.learn.LogisticRegressor(model_fn, thresholds=None, model_dir=None, config=None, feature_engineering_fn=None)` {#LogisticRegressor}
Builds a logistic regression Estimator for binary classification.
This method provides a basic Estimator with some additional metrics for custom
binary classification models, including AUC, precision/recall and accuracy.
Example:
```python
# See tf.contrib.learn.Estimator(...) for details on model_fn structure
def my_model_fn(...):
pass
estimator = LogisticRegressor(model_fn=my_model_fn)
# Input builders
def input_fn_train:
pass
estimator.fit(input_fn=input_fn_train)
estimator.predict(x=x)
```
##### Args:
* <b>`model_fn`</b>: Model function with the signature:
`(features, labels, mode) -> (predictions, loss, train_op)`.
Expects the returned predictions to be probabilities in [0.0, 1.0].
* <b>`thresholds`</b>: List of floating point thresholds to use for accuracy,
precision, and recall metrics. If `None`, defaults to `[0.5]`.
* <b>`model_dir`</b>: Directory to save model parameters, graphs, etc. This can also
be used to load checkpoints from the directory into a estimator to
continue training a previously saved model.
* <b>`config`</b>: A RunConfig configuration object.
* <b>`feature_engineering_fn`</b>: Feature engineering function. Takes features and
labels which are the output of `input_fn` and
returns features and labels which will be fed
into the model.
##### Returns:
A `tf.contrib.learn.Estimator` instance.
## Graph actions
Perform various training, evaluation, and inference actions on a graph.
- - -
### `class tf.train.NanLossDuringTrainingError` {#NanLossDuringTrainingError}
- - -
#### `tf.train.NanLossDuringTrainingError.__str__()` {#NanLossDuringTrainingError.__str__}
- - -
### `class tf.contrib.learn.RunConfig` {#RunConfig}
This class specifies the configurations for an `Estimator` run.
If you're a Google-internal user using command line flags with
`learn_runner.py` (for instance, to do distributed training or to use
parameter servers), you probably want to use `learn_runner.EstimatorConfig`
instead.
- - -
#### `tf.contrib.learn.RunConfig.__init__(master=None, num_cores=0, log_device_placement=False, gpu_memory_fraction=1, tf_random_seed=None, save_summary_steps=100, save_checkpoints_secs=600, save_checkpoints_steps=None, keep_checkpoint_max=5, keep_checkpoint_every_n_hours=10000, evaluation_master='')` {#RunConfig.__init__}
Constructor.
Note that the superclass `ClusterConfig` may set properties like
`cluster_spec`, `is_chief`, `master` (if `None` in the args),
`num_ps_replicas`, `task_id`, and `task_type` based on the `TF_CONFIG`
environment variable. See `ClusterConfig` for more details.
##### Args:
* <b>`master`</b>: TensorFlow master. Defaults to empty string for local.
* <b>`num_cores`</b>: Number of cores to be used. If 0, the system picks an
appropriate number (default: 0).
* <b>`log_device_placement`</b>: Log the op placement to devices (default: False).
* <b>`gpu_memory_fraction`</b>: Fraction of GPU memory used by the process on
each GPU uniformly on the same machine.
* <b>`tf_random_seed`</b>: Random seed for TensorFlow initializers.
Setting this value allows consistency between reruns.
* <b>`save_summary_steps`</b>: Save summaries every this many steps.
* <b>`save_checkpoints_secs`</b>: Save checkpoints every this many seconds. Can not
be specified with `save_checkpoints_steps`.
* <b>`save_checkpoints_steps`</b>: Save checkpoints every this many steps. Can not be
specified with `save_checkpoints_secs`.
* <b>`keep_checkpoint_max`</b>: The maximum number of recent checkpoint files to
keep. As new files are created, older files are deleted. If None or 0,
all checkpoint files are kept. Defaults to 5 (that is, the 5 most recent
checkpoint files are kept.)
* <b>`keep_checkpoint_every_n_hours`</b>: Number of hours between each checkpoint
to be saved. The default value of 10,000 hours effectively disables
the feature.
* <b>`evaluation_master`</b>: the master on which to perform evaluation.
- - -
#### `tf.contrib.learn.RunConfig.cluster_spec` {#RunConfig.cluster_spec}
- - -
#### `tf.contrib.learn.RunConfig.environment` {#RunConfig.environment}
- - -
#### `tf.contrib.learn.RunConfig.evaluation_master` {#RunConfig.evaluation_master}
- - -
#### `tf.contrib.learn.RunConfig.get_task_id()` {#RunConfig.get_task_id}
Returns task index from `TF_CONFIG` environmental variable.
If you have a ClusterConfig instance, you can just access its task_id
property instead of calling this function and re-parsing the environmental
variable.
##### Returns:
`TF_CONFIG['task']['index']`. Defaults to 0.
- - -
#### `tf.contrib.learn.RunConfig.is_chief` {#RunConfig.is_chief}
- - -
#### `tf.contrib.learn.RunConfig.keep_checkpoint_every_n_hours` {#RunConfig.keep_checkpoint_every_n_hours}
- - -
#### `tf.contrib.learn.RunConfig.keep_checkpoint_max` {#RunConfig.keep_checkpoint_max}
- - -
#### `tf.contrib.learn.RunConfig.master` {#RunConfig.master}
- - -
#### `tf.contrib.learn.RunConfig.num_ps_replicas` {#RunConfig.num_ps_replicas}
- - -
#### `tf.contrib.learn.RunConfig.save_checkpoints_secs` {#RunConfig.save_checkpoints_secs}
- - -
#### `tf.contrib.learn.RunConfig.save_checkpoints_steps` {#RunConfig.save_checkpoints_steps}
- - -
#### `tf.contrib.learn.RunConfig.save_summary_steps` {#RunConfig.save_summary_steps}
- - -
#### `tf.contrib.learn.RunConfig.task_id` {#RunConfig.task_id}
- - -
#### `tf.contrib.learn.RunConfig.task_type` {#RunConfig.task_type}
- - -
#### `tf.contrib.learn.RunConfig.tf_config` {#RunConfig.tf_config}
- - -
#### `tf.contrib.learn.RunConfig.tf_random_seed` {#RunConfig.tf_random_seed}
- - -
### `tf.contrib.learn.evaluate(*args, **kwargs)` {#evaluate}
Evaluate a model loaded from a checkpoint. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15.
Instructions for updating:
graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example.
Given `graph`, a directory to write summaries to (`output_dir`), a checkpoint
to restore variables from, and a `dict` of `Tensor`s to evaluate, run an eval
loop for `max_steps` steps, or until an exception (generally, an
end-of-input signal from a reader operation) is raised from running
`eval_dict`.
In each step of evaluation, all tensors in the `eval_dict` are evaluated, and
every `log_every_steps` steps, they are logged. At the very end of evaluation,
a summary is evaluated (finding the summary ops using `Supervisor`'s logic)
and written to `output_dir`.
##### Args:
* <b>`graph`</b>: A `Graph` to train. It is expected that this graph is not in use
elsewhere.
* <b>`output_dir`</b>: A string containing the directory to write a summary to.
* <b>`checkpoint_path`</b>: A string containing the path to a checkpoint to restore.
Can be `None` if the graph doesn't require loading any variables.
* <b>`eval_dict`</b>: A `dict` mapping string names to tensors to evaluate. It is
evaluated in every logging step. The result of the final evaluation is
returned. If `update_op` is None, then it's evaluated in every step. If
`max_steps` is `None`, this should depend on a reader that will raise an
end-of-input exception when the inputs are exhausted.
* <b>`update_op`</b>: A `Tensor` which is run in every step.
* <b>`global_step_tensor`</b>: A `Variable` containing the global step. If `None`,
one is extracted from the graph using the same logic as in `Supervisor`.
Used to place eval summaries on training curves.
* <b>`supervisor_master`</b>: The master string to use when preparing the session.
* <b>`log_every_steps`</b>: Integer. Output logs every `log_every_steps` evaluation
steps. The logs contain the `eval_dict` and timing information.
* <b>`feed_fn`</b>: A function that is called every iteration to produce a `feed_dict`
passed to `session.run` calls. Optional.
* <b>`max_steps`</b>: Integer. Evaluate `eval_dict` this many times.
##### Returns:
A tuple `(eval_results, global_step)`:
* <b>`eval_results`</b>: A `dict` mapping `string` to numeric values (`int`, `float`)
that are the result of running eval_dict in the last step. `None` if no
eval steps were run.
* <b>`global_step`</b>: The global step this evaluation corresponds to.
##### Raises:
* <b>`ValueError`</b>: if `output_dir` is empty.
- - -
### `tf.contrib.learn.infer(*args, **kwargs)` {#infer}
Restore graph from `restore_checkpoint_path` and run `output_dict` tensors. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15.
Instructions for updating:
graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example.
If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise,
init all variables.
##### Args:
* <b>`restore_checkpoint_path`</b>: A string containing the path to a checkpoint to
restore.
* <b>`output_dict`</b>: A `dict` mapping string names to `Tensor` objects to run.
Tensors must all be from the same graph.
* <b>`feed_dict`</b>: `dict` object mapping `Tensor` objects to input values to feed.
##### Returns:
Dict of values read from `output_dict` tensors. Keys are the same as
`output_dict`, values are the results read from the corresponding `Tensor`
in `output_dict`.
##### Raises:
* <b>`ValueError`</b>: if `output_dict` or `feed_dicts` is None or empty.
- - -
### `tf.contrib.learn.run_feeds(*args, **kwargs)` {#run_feeds}
See run_feeds_iter(). Returns a `list` instead of an iterator. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15.
Instructions for updating:
graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example.
- - -
### `tf.contrib.learn.run_n(*args, **kwargs)` {#run_n}
Run `output_dict` tensors `n` times, with the same `feed_dict` each run. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15.
Instructions for updating:
graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example.
##### Args:
* <b>`output_dict`</b>: A `dict` mapping string names to tensors to run. Must all be
from the same graph.
* <b>`feed_dict`</b>: `dict` of input values to feed each run.
* <b>`restore_checkpoint_path`</b>: A string containing the path to a checkpoint to
restore.
* <b>`n`</b>: Number of times to repeat.
##### Returns:
A list of `n` `dict` objects, each containing values read from `output_dict`
tensors.
- - -
### `tf.contrib.learn.train(*args, **kwargs)` {#train}
Train a model. (deprecated)
THIS FUNCTION IS DEPRECATED. It will be removed after 2017-02-15.
Instructions for updating:
graph_actions.py will be deleted. Use tf.train.* utilities instead. You can use learn/estimators/estimator.py as an example.
Given `graph`, a directory to write outputs to (`output_dir`), and some ops,
run a training loop. The given `train_op` performs one step of training on the
model. The `loss_op` represents the objective function of the training. It is
expected to increment the `global_step_tensor`, a scalar integer tensor
counting training steps. This function uses `Supervisor` to initialize the
graph (from a checkpoint if one is available in `output_dir`), write summaries
defined in the graph, and write regular checkpoints as defined by
`supervisor_save_model_secs`.
Training continues until `global_step_tensor` evaluates to `max_steps`, or, if
`fail_on_nan_loss`, until `loss_op` evaluates to `NaN`. In that case the
program is terminated with exit code 1.
##### Args:
* <b>`graph`</b>: A graph to train. It is expected that this graph is not in use
elsewhere.
* <b>`output_dir`</b>: A directory to write outputs to.
* <b>`train_op`</b>: An op that performs one training step when run.
* <b>`loss_op`</b>: A scalar loss tensor.
* <b>`global_step_tensor`</b>: A tensor representing the global step. If none is given,
one is extracted from the graph using the same logic as in `Supervisor`.
* <b>`init_op`</b>: An op that initializes the graph. If `None`, use `Supervisor`'s
default.
* <b>`init_feed_dict`</b>: A dictionary that maps `Tensor` objects to feed values.
This feed dictionary will be used when `init_op` is evaluated.
* <b>`init_fn`</b>: Optional callable passed to Supervisor to initialize the model.
* <b>`log_every_steps`</b>: Output logs regularly. The logs contain timing data and the
current loss.
* <b>`supervisor_is_chief`</b>: Whether the current process is the chief supervisor in
charge of restoring the model and running standard services.
* <b>`supervisor_master`</b>: The master string to use when preparing the session.
* <b>`supervisor_save_model_secs`</b>: Save a checkpoint every
`supervisor_save_model_secs` seconds when training.
* <b>`keep_checkpoint_max`</b>: The maximum number of recent checkpoint files to
keep. As new files are created, older files are deleted. If None or 0,
all checkpoint files are kept. This is simply passed as the max_to_keep
arg to tf.Saver constructor.
* <b>`supervisor_save_summaries_steps`</b>: Save summaries every
`supervisor_save_summaries_steps` seconds when training.
* <b>`feed_fn`</b>: A function that is called every iteration to produce a `feed_dict`
passed to `session.run` calls. Optional.
* <b>`steps`</b>: Trains for this many steps (e.g. current global step + `steps`).
* <b>`fail_on_nan_loss`</b>: If true, raise `NanLossDuringTrainingError` if `loss_op`
evaluates to `NaN`. If false, continue training as if nothing happened.
* <b>`monitors`</b>: List of `BaseMonitor` subclass instances. Used for callbacks
inside the training loop.
* <b>`max_steps`</b>: Number of total steps for which to train model. If `None`,
train forever. Two calls fit(steps=100) means 200 training iterations.
On the other hand two calls of fit(max_steps=100) means, second call
will not do any iteration since first call did all 100 steps.
##### Returns:
The final loss value.
##### Raises:
* <b>`ValueError`</b>: If `output_dir`, `train_op`, `loss_op`, or `global_step_tensor`
is not provided. See `tf.contrib.framework.get_global_step` for how we
look up the latter if not provided explicitly.
* <b>`NanLossDuringTrainingError`</b>: If `fail_on_nan_loss` is `True`, and loss ever
evaluates to `NaN`.
* <b>`ValueError`</b>: If both `steps` and `max_steps` are not `None`.
## Input processing
Queue and read batched input data.
- - -
### `tf.contrib.learn.extract_dask_data(data)` {#extract_dask_data}
Extract data from dask.Series or dask.DataFrame for predictors.
Given a distributed dask.DataFrame or dask.Series containing columns or names
for one or more predictors, this operation returns a single dask.DataFrame or
dask.Series that can be iterated over.
##### Args:
* <b>`data`</b>: A distributed dask.DataFrame or dask.Series.
##### Returns:
A dask.DataFrame or dask.Series that can be iterated over.
If the supplied argument is neither a dask.DataFrame nor a dask.Series this
operation returns it without modification.
- - -
### `tf.contrib.learn.extract_dask_labels(labels)` {#extract_dask_labels}
Extract data from dask.Series or dask.DataFrame for labels.
Given a distributed dask.DataFrame or dask.Series containing exactly one
column or name, this operation returns a single dask.DataFrame or dask.Series
that can be iterated over.
##### Args:
* <b>`labels`</b>: A distributed dask.DataFrame or dask.Series with exactly one
column or name.
##### Returns:
A dask.DataFrame or dask.Series that can be iterated over.
If the supplied argument is neither a dask.DataFrame nor a dask.Series this
operation returns it without modification.
##### Raises:
* <b>`ValueError`</b>: If the supplied dask.DataFrame contains more than one
column or the supplied dask.Series contains more than
one name.
- - -
### `tf.contrib.learn.extract_pandas_data(data)` {#extract_pandas_data}
Extract data from pandas.DataFrame for predictors.
Given a DataFrame, will extract the values and cast them to float. The
DataFrame is expected to contain values of type int, float or bool.
##### Args:
* <b>`data`</b>: `pandas.DataFrame` containing the data to be extracted.
##### Returns:
A numpy `ndarray` of the DataFrame's values as floats.
##### Raises:
* <b>`ValueError`</b>: if data contains types other than int, float or bool.
- - -
### `tf.contrib.learn.extract_pandas_labels(labels)` {#extract_pandas_labels}
Extract data from pandas.DataFrame for labels.
##### Args:
* <b>`labels`</b>: `pandas.DataFrame` or `pandas.Series` containing one column of
labels to be extracted.
##### Returns:
A numpy `ndarray` of labels from the DataFrame.
##### Raises:
* <b>`ValueError`</b>: if more than one column is found or type is not int, float or
bool.
- - -
### `tf.contrib.learn.extract_pandas_matrix(data)` {#extract_pandas_matrix}
Extracts numpy matrix from pandas DataFrame.
##### Args:
* <b>`data`</b>: `pandas.DataFrame` containing the data to be extracted.
##### Returns:
A numpy `ndarray` of the DataFrame's values.
- - -
### `tf.contrib.learn.infer_real_valued_columns_from_input(x)` {#infer_real_valued_columns_from_input}
Creates `FeatureColumn` objects for inputs defined by input `x`.
This interprets all inputs as dense, fixed-length float values.
##### Args:
* <b>`x`</b>: Real-valued matrix of shape [n_samples, n_features...]. Can be
iterator that returns arrays of features.
##### Returns:
List of `FeatureColumn` objects.
- - -
### `tf.contrib.learn.infer_real_valued_columns_from_input_fn(input_fn)` {#infer_real_valued_columns_from_input_fn}
Creates `FeatureColumn` objects for inputs defined by `input_fn`.
This interprets all inputs as dense, fixed-length float values. This creates
a local graph in which it calls `input_fn` to build the tensors, then discards
it.
##### Args:
* <b>`input_fn`</b>: Input function returning a tuple of:
features - Dictionary of string feature name to `Tensor` or `Tensor`.
labels - `Tensor` of label values.
##### Returns:
List of `FeatureColumn` objects.
- - -
### `tf.contrib.learn.read_batch_examples(file_pattern, batch_size, reader, randomize_input=True, num_epochs=None, queue_capacity=10000, num_threads=1, read_batch_size=1, parse_fn=None, name=None)` {#read_batch_examples}
Adds operations to read, queue, batch `Example` protos.
Given file pattern (or list of files), will setup a queue for file names,
read `Example` proto using provided `reader`, use batch queue to create
batches of examples of size `batch_size`.
All queue runners are added to the queue runners collection, and may be
started via `start_queue_runners`.
All ops are added to the default graph.
Use `parse_fn` if you need to do parsing / processing on single examples.
##### Args:
* <b>`file_pattern`</b>: List of files or pattern of file paths containing
`Example` records. See `tf.gfile.Glob` for pattern rules.
* <b>`batch_size`</b>: An int or scalar `Tensor` specifying the batch size to use.
* <b>`reader`</b>: A function or class that returns an object with
`read` method, (filename tensor) -> (example tensor).
* <b>`randomize_input`</b>: Whether the input should be randomized.
* <b>`num_epochs`</b>: Integer specifying the number of times to read through the
dataset. If `None`, cycles through the dataset forever.
NOTE - If specified, creates a variable that must be initialized, so call
`tf.global_variables_initializer()` as shown in the tests.
* <b>`queue_capacity`</b>: Capacity for input queue.
* <b>`num_threads`</b>: The number of threads enqueuing examples.
* <b>`read_batch_size`</b>: An int or scalar `Tensor` specifying the number of
records to read at once
* <b>`parse_fn`</b>: Parsing function, takes `Example` Tensor returns parsed
representation. If `None`, no parsing is done.
* <b>`name`</b>: Name of resulting op.
##### Returns:
String `Tensor` of batched `Example` proto.
##### Raises:
* <b>`ValueError`</b>: for invalid inputs.
- - -
### `tf.contrib.learn.read_batch_features(file_pattern, batch_size, features, reader, randomize_input=True, num_epochs=None, queue_capacity=10000, feature_queue_capacity=100, reader_num_threads=1, parse_fn=None, name=None)` {#read_batch_features}
Adds operations to read, queue, batch and parse `Example` protos.
Given file pattern (or list of files), will setup a queue for file names,
read `Example` proto using provided `reader`, use batch queue to create
batches of examples of size `batch_size` and parse example given `features`
specification.
All queue runners are added to the queue runners collection, and may be
started via `start_queue_runners`.
All ops are added to the default graph.
##### Args:
* <b>`file_pattern`</b>: List of files or pattern of file paths containing
`Example` records. See `tf.gfile.Glob` for pattern rules.
* <b>`batch_size`</b>: An int or scalar `Tensor` specifying the batch size to use.
* <b>`features`</b>: A `dict` mapping feature keys to `FixedLenFeature` or
`VarLenFeature` values.
* <b>`reader`</b>: A function or class that returns an object with
`read` method, (filename tensor) -> (example tensor).
* <b>`randomize_input`</b>: Whether the input should be randomized.
* <b>`num_epochs`</b>: Integer specifying the number of times to read through the
dataset. If None, cycles through the dataset forever. NOTE - If specified,
creates a variable that must be initialized, so call
tf.local_variables_initializer() as shown in the tests.
* <b>`queue_capacity`</b>: Capacity for input queue.
* <b>`feature_queue_capacity`</b>: Capacity of the parsed features queue. Set this
value to a small number, for example 5 if the parsed features are large.
* <b>`reader_num_threads`</b>: The number of threads to read examples.
* <b>`parse_fn`</b>: Parsing function, takes `Example` Tensor returns parsed
representation. If `None`, no parsing is done.
* <b>`name`</b>: Name of resulting op.
##### Returns:
A dict of `Tensor` or `SparseTensor` objects for each in `features`.
##### Raises:
* <b>`ValueError`</b>: for invalid inputs.
- - -
### `tf.contrib.learn.read_batch_record_features(file_pattern, batch_size, features, randomize_input=True, num_epochs=None, queue_capacity=10000, reader_num_threads=1, name='dequeue_record_examples')` {#read_batch_record_features}
Reads TFRecord, queues, batches and parses `Example` proto.
See more detailed description in `read_examples`.
##### Args:
* <b>`file_pattern`</b>: List of files or pattern of file paths containing
`Example` records. See `tf.gfile.Glob` for pattern rules.
* <b>`batch_size`</b>: An int or scalar `Tensor` specifying the batch size to use.
* <b>`features`</b>: A `dict` mapping feature keys to `FixedLenFeature` or
`VarLenFeature` values.
* <b>`randomize_input`</b>: Whether the input should be randomized.
* <b>`num_epochs`</b>: Integer specifying the number of times to read through the
dataset. If None, cycles through the dataset forever. NOTE - If specified,
creates a variable that must be initialized, so call
tf.local_variables_initializer() as shown in the tests.
* <b>`queue_capacity`</b>: Capacity for input queue.
* <b>`reader_num_threads`</b>: The number of threads to read examples.
* <b>`name`</b>: Name of resulting op.
##### Returns:
A dict of `Tensor` or `SparseTensor` objects for each in `features`.
##### Raises:
* <b>`ValueError`</b>: for invalid inputs.
| scenarios/tensorflow | tensorflow/g3doc/api_docs/python/contrib.learn.md | Markdown | apache-2.0 | 107,842 |
/** @file
GUID is for MTC variable.
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __MTC_VENDOR_GUID_H__
#define __MTC_VENDOR_GUID_H__
//
// Vendor GUID of the variable for the high part of monotonic counter (UINT32).
//
#define MTC_VENDOR_GUID \
{ 0xeb704011, 0x1402, 0x11d3, { 0x8e, 0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } }
//
// Name of the variable for the high part of monotonic counter
//
#define MTC_VARIABLE_NAME L"MTC"
extern EFI_GUID gMtcVendorGuid;
#endif
| google/google-ctf | third_party/edk2/MdeModulePkg/Include/Guid/MtcVendor.h | C | apache-2.0 | 952 |
# IMEI Module - Android [](http://gitt.io/component/ro.mihaiblaga.imei)
Titanium native module for getting a device's IMEI
## Usage
First, download a binary release from https://github.com/mihaiblaga89/ro.mihaiblaga.imei/blob/master/dist/ro.mihaiblaga.imei-android-1.1.0.zip
Then, put the ZIP file in the [Resources
directory](http://docs.appcelerator.com/titanium/3.0/#!/guide/Using_a_Module-section-30082372_UsingaModule-Installingamoduleforasingleproject).
or
Simply use the [gitTio CLI](http://gitt.io/cli):
`$ gittio install ro.mihaiblaga.imei`
Add the following to your project's `tiapp.xml`:
...
<modules>
<module platform="android">ro.mihaiblaga.imei</module>
</modules>
...
then
```javascript
var imeiModule = require('ro.mihaiblaga.imei');
var imei = imeiModule.getImei();
Ti.API.info(imei);
```
**_Note :_** On simulator it returns ```null ```
## isDateAutomatic()
Returns the status of the automatic date checkbox from settings.
**_I know this module is named IMEI, that was it's main purpose. Later I needed the automatic date check as well. When i'll have more time i'll rename the module or separate them_**
```javascript
var imeiModule = require('ro.mihaiblaga.imei');
Ti.API.info(imeiModule.isDateAutomatic());
```
## About
* Me: [Mihai Blaga](http://www.mihaiblaga.ro)
* Twitter: [@blaga_mihai](https://twitter.com/blaga_mihai)
* Work: [AG Prime](http://www.ag-prime.com/)
## License
Apache License
Version 2.0
| mihaiblaga89/ro.mihaiblaga.imei | documentation/index.md | Markdown | apache-2.0 | 1,512 |
/*
* 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.flink.runtime.jobgraph;
import org.apache.flink.api.common.io.GenericInputFormat;
import org.apache.flink.api.common.io.InitializeOnMaster;
import org.apache.flink.api.common.io.InputFormat;
import org.apache.flink.api.common.io.OutputFormat;
import org.apache.flink.api.common.operators.util.UserCodeObjectWrapper;
import org.apache.flink.api.java.io.DiscardingOutputFormat;
import org.apache.flink.core.io.GenericInputSplit;
import org.apache.flink.core.io.InputSplit;
import org.apache.flink.runtime.io.network.partition.ResultPartitionType;
import org.apache.flink.runtime.operators.util.TaskConfig;
import org.apache.flink.util.InstantiationUtil;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.*;
@SuppressWarnings("serial")
public class JobTaskVertexTest {
@Test
public void testConnectDirectly() {
JobVertex source = new JobVertex("source");
JobVertex target = new JobVertex("target");
target.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE, ResultPartitionType.PIPELINED);
assertTrue(source.isInputVertex());
assertFalse(source.isOutputVertex());
assertFalse(target.isInputVertex());
assertTrue(target.isOutputVertex());
assertEquals(1, source.getNumberOfProducedIntermediateDataSets());
assertEquals(1, target.getNumberOfInputs());
assertEquals(target.getInputs().get(0).getSource(), source.getProducedDataSets().get(0));
assertEquals(1, source.getProducedDataSets().get(0).getConsumers().size());
assertEquals(target, source.getProducedDataSets().get(0).getConsumers().get(0).getTarget());
}
@Test
public void testConnectMultipleTargets() {
JobVertex source = new JobVertex("source");
JobVertex target1= new JobVertex("target1");
JobVertex target2 = new JobVertex("target2");
target1.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE, ResultPartitionType.PIPELINED);
target2.connectDataSetAsInput(source.getProducedDataSets().get(0), DistributionPattern.ALL_TO_ALL);
assertTrue(source.isInputVertex());
assertFalse(source.isOutputVertex());
assertFalse(target1.isInputVertex());
assertTrue(target1.isOutputVertex());
assertFalse(target2.isInputVertex());
assertTrue(target2.isOutputVertex());
assertEquals(1, source.getNumberOfProducedIntermediateDataSets());
assertEquals(2, source.getProducedDataSets().get(0).getConsumers().size());
assertEquals(target1.getInputs().get(0).getSource(), source.getProducedDataSets().get(0));
assertEquals(target2.getInputs().get(0).getSource(), source.getProducedDataSets().get(0));
}
@Test
public void testOutputFormatVertex() {
try {
final TestingOutputFormat outputFormat = new TestingOutputFormat();
final OutputFormatVertex of = new OutputFormatVertex("Name");
new TaskConfig(of.getConfiguration()).setStubWrapper(new UserCodeObjectWrapper<OutputFormat<?>>(outputFormat));
final ClassLoader cl = getClass().getClassLoader();
try {
of.initializeOnMaster(cl);
fail("Did not throw expected exception.");
} catch (TestException e) {
// all good
}
OutputFormatVertex copy = InstantiationUtil.clone(of);
try {
copy.initializeOnMaster(cl);
fail("Did not throw expected exception.");
} catch (TestException e) {
// all good
}
}
catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
@Test
public void testInputFormatVertex() {
try {
final TestInputFormat inputFormat = new TestInputFormat();
final InputFormatVertex vertex = new InputFormatVertex("Name");
new TaskConfig(vertex.getConfiguration()).setStubWrapper(new UserCodeObjectWrapper<InputFormat<?, ?>>(inputFormat));
final ClassLoader cl = getClass().getClassLoader();
vertex.initializeOnMaster(cl);
InputSplit[] splits = vertex.getInputSplitSource().createInputSplits(77);
assertNotNull(splits);
assertEquals(1, splits.length);
assertEquals(TestSplit.class, splits[0].getClass());
}
catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
// --------------------------------------------------------------------------------------------
private static final class TestingOutputFormat extends DiscardingOutputFormat<Object> implements InitializeOnMaster {
@Override
public void initializeGlobal(int parallelism) throws IOException {
throw new TestException();
}
}
private static final class TestException extends IOException {}
// --------------------------------------------------------------------------------------------
private static final class TestSplit extends GenericInputSplit {
public TestSplit(int partitionNumber, int totalNumberOfPartitions) {
super(partitionNumber, totalNumberOfPartitions);
}
}
private static final class TestInputFormat extends GenericInputFormat<Object> {
@Override
public boolean reachedEnd() {
return false;
}
@Override
public Object nextRecord(Object reuse) {
return null;
}
@Override
public GenericInputSplit[] createInputSplits(int numSplits) throws IOException {
return new GenericInputSplit[] { new TestSplit(0, 1) };
}
}
}
| zohar-mizrahi/flink | flink-runtime/src/test/java/org/apache/flink/runtime/jobgraph/JobTaskVertexTest.java | Java | apache-2.0 | 5,982 |
/**
* Copyright 2016 Netflix, Inc.
* <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 com.netflix.hystrix.metric;
import org.HdrHistogram.Histogram;
public class CachedValuesHistogram {
private final static int NUMBER_SIGNIFICANT_DIGITS = 3;
private final int mean;
private final int p0;
private final int p5;
private final int p10;
private final int p15;
private final int p20;
private final int p25;
private final int p30;
private final int p35;
private final int p40;
private final int p45;
private final int p50;
private final int p55;
private final int p60;
private final int p65;
private final int p70;
private final int p75;
private final int p80;
private final int p85;
private final int p90;
private final int p95;
private final int p99;
private final int p99_5;
private final int p99_9;
private final int p99_95;
private final int p99_99;
private final int p100;
private final long totalCount;
public static CachedValuesHistogram backedBy(Histogram underlying) {
return new CachedValuesHistogram(underlying);
}
private CachedValuesHistogram(Histogram underlying) {
/**
* Single thread calculates a variety of commonly-accessed quantities.
* This way, all threads can access the cached values without synchronization
* Synchronization is only required for values that are not cached
*/
mean = (int) underlying.getMean();
p0 = (int) underlying.getValueAtPercentile(0);
p5 = (int) underlying.getValueAtPercentile(5);
p10 = (int) underlying.getValueAtPercentile(10);
p15 = (int) underlying.getValueAtPercentile(15);
p20 = (int) underlying.getValueAtPercentile(20);
p25 = (int) underlying.getValueAtPercentile(25);
p30 = (int) underlying.getValueAtPercentile(30);
p35 = (int) underlying.getValueAtPercentile(35);
p40 = (int) underlying.getValueAtPercentile(40);
p45 = (int) underlying.getValueAtPercentile(45);
p50 = (int) underlying.getValueAtPercentile(50);
p55 = (int) underlying.getValueAtPercentile(55);
p60 = (int) underlying.getValueAtPercentile(60);
p65 = (int) underlying.getValueAtPercentile(65);
p70 = (int) underlying.getValueAtPercentile(70);
p75 = (int) underlying.getValueAtPercentile(75);
p80 = (int) underlying.getValueAtPercentile(80);
p85 = (int) underlying.getValueAtPercentile(85);
p90 = (int) underlying.getValueAtPercentile(90);
p95 = (int) underlying.getValueAtPercentile(95);
p99 = (int) underlying.getValueAtPercentile(99);
p99_5 = (int) underlying.getValueAtPercentile(99.5);
p99_9 = (int) underlying.getValueAtPercentile(99.9);
p99_95 = (int) underlying.getValueAtPercentile(99.95);
p99_99 = (int) underlying.getValueAtPercentile(99.99);
p100 = (int) underlying.getValueAtPercentile(100);
totalCount = underlying.getTotalCount();
}
/**
* Return the cached value only
* @return cached distribution mean
*/
public int getMean() {
return mean;
}
/**
* Return the cached value if available.
* Otherwise, we need to synchronize access to the underlying {@link Histogram}
* @param percentile percentile of distribution
* @return value at percentile (from cache if possible)
*/
public int getValueAtPercentile(double percentile) {
int permyriad = (int) percentile * 100;
switch (permyriad) {
case 0: return p0;
case 500: return p5;
case 1000: return p10;
case 1500: return p15;
case 2000: return p20;
case 2500: return p25;
case 3000: return p30;
case 3500: return p35;
case 4000: return p40;
case 4500: return p45;
case 5000: return p50;
case 5500: return p55;
case 6000: return p60;
case 6500: return p65;
case 7000: return p70;
case 7500: return p75;
case 8000: return p80;
case 8500: return p85;
case 9000: return p90;
case 9500: return p95;
case 9900: return p99;
case 9950: return p99_5;
case 9990: return p99_9;
case 9995: return p99_95;
case 9999: return p99_99;
case 10000: return p100;
default: throw new IllegalArgumentException("Percentile (" + percentile + ") is not currently cached");
}
}
public long getTotalCount() {
return totalCount;
}
public static Histogram getNewHistogram() {
return new Histogram(NUMBER_SIGNIFICANT_DIGITS);
}
}
| cs-ester-peixoto/docker-jenkins | hystrix-core/src/main/java/com/netflix/hystrix/metric/CachedValuesHistogram.java | Java | apache-2.0 | 5,382 |
define(
//begin v1.x content
{
"KES_symbol": "Ksh",
"USD_displayName": "Ndola ya Marekani",
"TZS_displayName": "Silingi ya Tanzania",
"ZMW_displayName": "Kwacha ya Zambia",
"MAD_displayName": "Dirham ya Moroko",
"NGN_displayName": "Naira ya Nijeria",
"ZWD_displayName": "Ndola ya Zimbabwe",
"SDG_displayName": "Vaũndi ya Sudani",
"MWK_displayName": "Kwacha ya Malawi",
"KMF_displayName": "Faranga ya Komoro",
"SCR_displayName": "Rupia ya Shelisheli",
"EGP_displayName": "Vaundi ya Misili",
"CVE_displayName": "Eskudo ya Kepuvede",
"LYD_displayName": "Dinari ya Libya",
"CAD_displayName": "Ndola ya Kanada",
"INR_displayName": "Rupia ya India",
"JPY_displayName": "Sarafu ya Kijapani",
"LRD_displayName": "Dola ya Liberia",
"ZAR_displayName": "Randi ya Afrika Kusini",
"AOA_displayName": "Kwanza ya Angola",
"TND_displayName": "Ndinari ya Tunisia",
"GHC_displayName": "Sedi ya Ghana",
"BWP_displayName": "Pula ya Botswana",
"DZD_displayName": "Dinari ya Aljeria",
"ZMK_displayName": "Kwacha ya Zambia (1968-2012)",
"NAD_displayName": "Ndola ya Namibia",
"AED_displayName": "Dirham ya Falme za Kiarabu",
"ETB_displayName": "Bir ya Uhabeshi",
"MZM_displayName": "Metikali ya Msumbiji",
"BIF_displayName": "Faranga ya Burundi",
"RWF_displayName": "Faranga ya Rwanda",
"STD_displayName": "Dobra ya Sao Tome na Principe",
"SZL_displayName": "Lilangeni",
"EUR_displayName": "Yuro",
"ERN_displayName": "Nakfa ya Eritrea",
"SAR_displayName": "Riyal ya Saudia",
"DJF_displayName": "Faranga ya Jibuti",
"CDF_displayName": "Faranga ya Kongo",
"GBP_displayName": "Pauni ya Uingereza",
"CHF_displayName": "Faranga ya Uswisi",
"MUR_displayName": "Rupia ya Morisi",
"SOS_displayName": "Silingi ya Somalia",
"BHD_displayName": "Dinari ya Bahareni",
"XOF_displayName": "Faranga CFA BCEAO",
"GNS_displayName": "Faranga ya Gine",
"SLL_displayName": "Leoni",
"UGX_displayName": "Silingi ya Uganda",
"MGA_displayName": "Ariary ya Bukini",
"AUD_displayName": "Ndola ya Australia",
"KES_displayName": "Silingi ya Kenya",
"SHP_displayName": "Vaũndi ya Santahelena",
"XAF_displayName": "Faranga CFA BEAC",
"LSL_displayName": "Loti ya Lesoto",
"MRO_displayName": "Ugwiya ya Moritania",
"CNY_displayName": "Yuan Renminbi ya China",
"GMD_displayName": "Ndalasi ya Gambia"
}
//end v1.x content
); | abssi/poc-tijari | dojoLib/toolkit/dojo/dojo/cldr/nls/kam/currency.js | JavaScript | apache-2.0 | 2,324 |
package com.iauto.wlink.core.exception;
@SuppressWarnings("serial")
public class InvalidMessageRouterException extends MessageProcessException {
private static final String ERROR_CODE = "INVALID_MESSAGE_ROUTER";
public InvalidMessageRouterException() {
super( ERROR_CODE );
}
}
| xuxiaofei820825/wlink-server | wlink-core-integration-rabbitmq/src/main/java/com/iauto/wlink/core/exception/InvalidMessageRouterException.java | Java | apache-2.0 | 286 |
namespace Snippets4.Azure.Transports.AzureStorageQueues
{
using NServiceBus;
class Usage
{
public Usage()
{
#region AzureStorageQueueTransportWithAzure 5
Configure configure = Configure.With();
configure.UseTransport<AzureStorageQueue>();
#endregion
}
#region AzureStorageQueueTransportWithAzureHost 5
public class EndpointConfig : IConfigureThisEndpoint, UsingTransport<AzureStorageQueue> { }
#endregion
}
} | WojcikMike/docs.particular.net | Snippets/Snippets_4/Azure/Transports/AzureStorageQueues/Usage.cs | C# | apache-2.0 | 529 |
package org.jetbrains.plugins.scala.testingSupport.scalatest.scala2_11.scalatest2_2_1
import org.jetbrains.plugins.scala.SlowTests
import org.jetbrains.plugins.scala.testingSupport.scalatest.fileStructureView._
import org.junit.experimental.categories.Category
/**
* @author Roman.Shein
* @since 20.04.2015.
*/
@Category(Array(classOf[SlowTests]))
class Scalatest2_11_2_2_1_StructureViewTest extends Scalatest2_11_2_2_1_Base with FeatureSpecFileStructureViewTest
with FlatSpecFileStructureViewTest with FreeSpecFileStructureViewTest with FunSuiteFileStructureViewTest
with PropSpecFileStructureViewTest with WordSpecFileStructureViewTest with FunSpecFileStructureViewTest
| triplequote/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/testingSupport/scalatest/scala2_11/scalatest2_2_1/Scalatest2_11_2_2_1_StructureViewTest.scala | Scala | apache-2.0 | 680 |
# Tensorflow Inception Model Chart
TensorFlow is an open source software library for numerical computation using data flow graphs.
* https://www.tensorflow.org/
My hope was to make TensorFlow more accessible by simplifying the following document -- https://tensorflow.github.io/serving/serving_inception.html
## Chart Details
This chart will do the following:
* 1 x TensorFlow inception model server on an external LoadBalancer
## Installing the Chart
To install the chart with the release name `my-release`:
```bash
$ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
$ helm install --name my-release incubator/tensorflow-inception
```
## Configuration
The following table lists the configurable parameters of the TensorFlow inception chart and their default values.
| Parameter | Description | Default |
| ----------------------- | ---------------------------------- | ---------------------------------------------------------- |
| `image.repository` | Container image name | `quay.io/thomasjungblut/tfs-inception` |
| `image.tag` | Container image tag | `tfs-1.8.0-cpu` |
| `replicas` | k8s deployment replicas | `1` |
| `component` | k8s selector key | `tensorflow-inception` |
| `resources` | Set the resource to be allocated and allowed for the Pods | `{}` |
| `servicePort` | k8s service port | `9090` |
| `containerPort` | Container listening port | `9090` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
> **Note**: For the GPU version, use `image.tag=tfs-1.8.0-gpu`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
$ helm install --name my-release -f values.yaml incubator/tensorflow-inception
```
> **Tip**: You can use the default [values.yaml](values.yaml)
## Example
```bash
docker run -v ~/Downloads:/downloads quay.io/lachie83/inception_serving /serving/bazel-bin/tensorflow_serving/example/inception_client --server=$INCEPTION_SERVICE_IP:9090 --image=/downloads/dog.jpg
D1028 17:07:30.650550118 7 ev_posix.c:101] Using polling engine: poll
outputs {
key: "classes"
value {
dtype: DT_STRING
tensor_shape {
dim {
size: 1
}
dim {
size: 5
}
}
string_val: "golden retriever"
string_val: "cocker spaniel, English cocker spaniel, cocker"
string_val: "clumber, clumber spaniel"
string_val: "tennis ball"
string_val: "Labrador retriever"
}
}
outputs {
key: "scores"
value {
dtype: DT_FLOAT
tensor_shape {
dim {
size: 1
}
dim {
size: 5
}
}
float_val: 9.7533788681
float_val: 6.67022132874
float_val: 6.18963956833
float_val: 5.90754127502
float_val: 5.4464302063
}
}
E1028 17:07:33.565394639 7 chttp2_transport.c:1810] close_transport: {"created":"@1477674453.565348591","description":"FD shutdown","file":"src/core/lib/iomgr/ev_poll_posix.c","file_line":427}
```
| GaneshSPatil/charts | incubator/tensorflow-inception/README.md | Markdown | apache-2.0 | 3,618 |
package com.beecavegames.poker.handlers;
import com.beecavegames.GameResponse;
import com.beecavegames.bjc.handlers.GameAction;
import com.beecavegames.common.TableException;
import com.beecavegames.dispatch.Param;
import com.beecavegames.poker.PokerTable;
import com.beecavegames.poker.PokerTablePlayer;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ImBackHandler extends PokerActHandler {
public GameResponse<PokerTable> handle(@Param("gameId") long gameId, @Param("rev") int revision) {
return execute(revision, gameId, new GameAction<PokerTable>() {
@Override
public void doAction(long playerId, PokerTable game) throws TableException {
PokerTablePlayer ptp = game.getPlayer(playerId);
if(ptp != null){
ptp.idleCount = 0;
ptp.sitOut = false;
ptp.keepAliveTime = game.clock.now();
if(ptp.getBalance().isPositive()){
ptp.hasLeft = false;
}
}else{
log.warn("Player tried to come back but was already removed from the table.");
}
}
@Override
public String getName() {
return "back";
}
});
}
}
| sgmiller/hiveelements | gameelements/src/main/java/poker/handlers/ImBackHandler.java | Java | apache-2.0 | 1,094 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>XMLRendererTest xref</title>
<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
</head>
<body>
<div id="overview"><a href="../../../../../testapidocs/net/sourceforge/pmd/renderers/XMLRendererTest.html">View Javadoc</a></div><pre>
<a class="jxr_linenumber" name="L1" href="#L1">1</a> <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L2" href="#L2">2</a> <em class="jxr_javadoccomment"> * BSD-style license; for more info see <a href="http://pmd.sourceforge.net/license.htm" target="alexandria_uri">http://pmd.sourceforge.net/license.htm</a>l</em>
<a class="jxr_linenumber" name="L3" href="#L3">3</a> <em class="jxr_javadoccomment"> */</em>
<a class="jxr_linenumber" name="L4" href="#L4">4</a> <strong class="jxr_keyword">package</strong> net.sourceforge.pmd.renderers;
<a class="jxr_linenumber" name="L5" href="#L5">5</a>
<a class="jxr_linenumber" name="L6" href="#L6">6</a> <strong class="jxr_keyword">import</strong> java.io.StringReader;
<a class="jxr_linenumber" name="L7" href="#L7">7</a>
<a class="jxr_linenumber" name="L8" href="#L8">8</a> <strong class="jxr_keyword">import</strong> javax.xml.parsers.DocumentBuilderFactory;
<a class="jxr_linenumber" name="L9" href="#L9">9</a>
<a class="jxr_linenumber" name="L10" href="#L10">10</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.FooRule;
<a class="jxr_linenumber" name="L11" href="#L11">11</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.PMD;
<a class="jxr_linenumber" name="L12" href="#L12">12</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.Report;
<a class="jxr_linenumber" name="L13" href="#L13">13</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.Report.ProcessingError;
<a class="jxr_linenumber" name="L14" href="#L14">14</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.ReportTest;
<a class="jxr_linenumber" name="L15" href="#L15">15</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.RuleContext;
<a class="jxr_linenumber" name="L16" href="#L16">16</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.RuleViolation;
<a class="jxr_linenumber" name="L17" href="#L17">17</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.lang.ast.DummyNode;
<a class="jxr_linenumber" name="L18" href="#L18">18</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.lang.ast.Node;
<a class="jxr_linenumber" name="L19" href="#L19">19</a> <strong class="jxr_keyword">import</strong> net.sourceforge.pmd.lang.rule.ParametricRuleViolation;
<a class="jxr_linenumber" name="L20" href="#L20">20</a>
<a class="jxr_linenumber" name="L21" href="#L21">21</a> <strong class="jxr_keyword">import</strong> org.junit.Assert;
<a class="jxr_linenumber" name="L22" href="#L22">22</a> <strong class="jxr_keyword">import</strong> org.junit.Test;
<a class="jxr_linenumber" name="L23" href="#L23">23</a> <strong class="jxr_keyword">import</strong> org.w3c.dom.Document;
<a class="jxr_linenumber" name="L24" href="#L24">24</a> <strong class="jxr_keyword">import</strong> org.w3c.dom.NodeList;
<a class="jxr_linenumber" name="L25" href="#L25">25</a> <strong class="jxr_keyword">import</strong> org.xml.sax.InputSource;
<a class="jxr_linenumber" name="L26" href="#L26">26</a>
<a class="jxr_linenumber" name="L27" href="#L27">27</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../net/sourceforge/pmd/renderers/XMLRendererTest.html">XMLRendererTest</a> <strong class="jxr_keyword">extends</strong> <a href="../../../../net/sourceforge/pmd/renderers/AbstractRendererTst.html">AbstractRendererTst</a> {
<a class="jxr_linenumber" name="L28" href="#L28">28</a>
<a class="jxr_linenumber" name="L29" href="#L29">29</a> @Override
<a class="jxr_linenumber" name="L30" href="#L30">30</a> <strong class="jxr_keyword">public</strong> Renderer getRenderer() {
<a class="jxr_linenumber" name="L31" href="#L31">31</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> XMLRenderer();
<a class="jxr_linenumber" name="L32" href="#L32">32</a> }
<a class="jxr_linenumber" name="L33" href="#L33">33</a>
<a class="jxr_linenumber" name="L34" href="#L34">34</a> @Override
<a class="jxr_linenumber" name="L35" href="#L35">35</a> <strong class="jxr_keyword">public</strong> String getExpected() {
<a class="jxr_linenumber" name="L36" href="#L36">36</a> <strong class="jxr_keyword">return</strong> <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span>
<a class="jxr_linenumber" name="L37" href="#L37">37</a> + PMD.EOL
<a class="jxr_linenumber" name="L38" href="#L38">38</a> + <span class="jxr_string">"<pmd version=\""</span>
<a class="jxr_linenumber" name="L39" href="#L39">39</a> + PMD.VERSION
<a class="jxr_linenumber" name="L40" href="#L40">40</a> + <span class="jxr_string">"\" timestamp=\"2014-10-06T19:30:51.262\">"</span>
<a class="jxr_linenumber" name="L41" href="#L41">41</a> + PMD.EOL
<a class="jxr_linenumber" name="L42" href="#L42">42</a> + <span class="jxr_string">"<file name=\"n/a\">"</span>
<a class="jxr_linenumber" name="L43" href="#L43">43</a> + PMD.EOL
<a class="jxr_linenumber" name="L44" href="#L44">44</a> + <span class="jxr_string">"<violation beginline=\"1\" endline=\"1\" begincolumn=\"1\" endcolumn=\"1\" rule=\"Foo\" ruleset=\"RuleSet\" priority=\"5\">"</span>
<a class="jxr_linenumber" name="L45" href="#L45">45</a> + PMD.EOL + <span class="jxr_string">"blah"</span> + PMD.EOL + <span class="jxr_string">"</violation>"</span> + PMD.EOL + <span class="jxr_string">"</file>"</span> + PMD.EOL + <span class="jxr_string">"</pmd>"</span> + PMD.EOL;
<a class="jxr_linenumber" name="L46" href="#L46">46</a> }
<a class="jxr_linenumber" name="L47" href="#L47">47</a>
<a class="jxr_linenumber" name="L48" href="#L48">48</a> @Override
<a class="jxr_linenumber" name="L49" href="#L49">49</a> <strong class="jxr_keyword">public</strong> String getExpectedEmpty() {
<a class="jxr_linenumber" name="L50" href="#L50">50</a> <strong class="jxr_keyword">return</strong> <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span> + PMD.EOL + <span class="jxr_string">"<pmd version=\""</span> + PMD.VERSION
<a class="jxr_linenumber" name="L51" href="#L51">51</a> + <span class="jxr_string">"\" timestamp=\"2014-10-06T19:30:51.262\">"</span> + PMD.EOL + <span class="jxr_string">"</pmd>"</span> + PMD.EOL;
<a class="jxr_linenumber" name="L52" href="#L52">52</a> }
<a class="jxr_linenumber" name="L53" href="#L53">53</a>
<a class="jxr_linenumber" name="L54" href="#L54">54</a> @Override
<a class="jxr_linenumber" name="L55" href="#L55">55</a> <strong class="jxr_keyword">public</strong> String getExpectedMultiple() {
<a class="jxr_linenumber" name="L56" href="#L56">56</a> <strong class="jxr_keyword">return</strong> <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span>
<a class="jxr_linenumber" name="L57" href="#L57">57</a> + PMD.EOL
<a class="jxr_linenumber" name="L58" href="#L58">58</a> + <span class="jxr_string">"<pmd version=\""</span>
<a class="jxr_linenumber" name="L59" href="#L59">59</a> + PMD.VERSION
<a class="jxr_linenumber" name="L60" href="#L60">60</a> + <span class="jxr_string">"\" timestamp=\"2014-10-06T19:30:51.239\">"</span>
<a class="jxr_linenumber" name="L61" href="#L61">61</a> + PMD.EOL
<a class="jxr_linenumber" name="L62" href="#L62">62</a> + <span class="jxr_string">"<file name=\"n/a\">"</span>
<a class="jxr_linenumber" name="L63" href="#L63">63</a> + PMD.EOL
<a class="jxr_linenumber" name="L64" href="#L64">64</a> + <span class="jxr_string">"<violation beginline=\"1\" endline=\"1\" begincolumn=\"1\" endcolumn=\"1\" rule=\"Foo\" ruleset=\"RuleSet\" priority=\"5\">"</span>
<a class="jxr_linenumber" name="L65" href="#L65">65</a> + PMD.EOL
<a class="jxr_linenumber" name="L66" href="#L66">66</a> + <span class="jxr_string">"blah"</span>
<a class="jxr_linenumber" name="L67" href="#L67">67</a> + PMD.EOL
<a class="jxr_linenumber" name="L68" href="#L68">68</a> + <span class="jxr_string">"</violation>"</span>
<a class="jxr_linenumber" name="L69" href="#L69">69</a> + PMD.EOL
<a class="jxr_linenumber" name="L70" href="#L70">70</a> + <span class="jxr_string">"<violation beginline=\"1\" endline=\"1\" begincolumn=\"1\" endcolumn=\"2\" rule=\"Foo\" ruleset=\"RuleSet\" priority=\"5\">"</span>
<a class="jxr_linenumber" name="L71" href="#L71">71</a> + PMD.EOL + <span class="jxr_string">"blah"</span> + PMD.EOL + <span class="jxr_string">"</violation>"</span> + PMD.EOL + <span class="jxr_string">"</file>"</span> + PMD.EOL + <span class="jxr_string">"</pmd>"</span> + PMD.EOL;
<a class="jxr_linenumber" name="L72" href="#L72">72</a> }
<a class="jxr_linenumber" name="L73" href="#L73">73</a>
<a class="jxr_linenumber" name="L74" href="#L74">74</a> @Override
<a class="jxr_linenumber" name="L75" href="#L75">75</a> <strong class="jxr_keyword">public</strong> String getExpectedError(ProcessingError error) {
<a class="jxr_linenumber" name="L76" href="#L76">76</a> <strong class="jxr_keyword">return</strong> <span class="jxr_string">"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"</span> + PMD.EOL + <span class="jxr_string">"<pmd version=\""</span> + PMD.VERSION
<a class="jxr_linenumber" name="L77" href="#L77">77</a> + <span class="jxr_string">"\" timestamp=\"2014-10-06T19:30:51.222\">"</span> + PMD.EOL + <span class="jxr_string">"<error filename=\"file\" msg=\"Error\"/>"</span>
<a class="jxr_linenumber" name="L78" href="#L78">78</a> + PMD.EOL + <span class="jxr_string">"</pmd>"</span> + PMD.EOL;
<a class="jxr_linenumber" name="L79" href="#L79">79</a> }
<a class="jxr_linenumber" name="L80" href="#L80">80</a>
<a class="jxr_linenumber" name="L81" href="#L81">81</a> @Override
<a class="jxr_linenumber" name="L82" href="#L82">82</a> <strong class="jxr_keyword">public</strong> String filter(String expected) {
<a class="jxr_linenumber" name="L83" href="#L83">83</a> String result = expected.replaceAll(<span class="jxr_string">" timestamp=\"[^\"]+\">"</span>, <span class="jxr_string">" timestamp=\"\">"</span>);
<a class="jxr_linenumber" name="L84" href="#L84">84</a> <strong class="jxr_keyword">return</strong> result;
<a class="jxr_linenumber" name="L85" href="#L85">85</a> }
<a class="jxr_linenumber" name="L86" href="#L86">86</a>
<a class="jxr_linenumber" name="L87" href="#L87">87</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> RuleViolation createRuleViolation(String description) {
<a class="jxr_linenumber" name="L88" href="#L88">88</a> <a href="../../../../net/sourceforge/pmd/lang/ast/DummyNode.html">DummyNode</a> node = <strong class="jxr_keyword">new</strong> <a href="../../../../net/sourceforge/pmd/lang/ast/DummyNode.html">DummyNode</a>(1);
<a class="jxr_linenumber" name="L89" href="#L89">89</a> node.testingOnly__setBeginLine(1);
<a class="jxr_linenumber" name="L90" href="#L90">90</a> node.testingOnly__setBeginColumn(1);
<a class="jxr_linenumber" name="L91" href="#L91">91</a> node.testingOnly__setEndLine(1);
<a class="jxr_linenumber" name="L92" href="#L92">92</a> node.testingOnly__setEndColumn(1);
<a class="jxr_linenumber" name="L93" href="#L93">93</a> RuleContext ctx = <strong class="jxr_keyword">new</strong> RuleContext();
<a class="jxr_linenumber" name="L94" href="#L94">94</a> ctx.setSourceCodeFilename(<span class="jxr_string">"n/a"</span>);
<a class="jxr_linenumber" name="L95" href="#L95">95</a> <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> ParametricRuleViolation<Node>(<strong class="jxr_keyword">new</strong> <a href="../../../../net/sourceforge/pmd/FooRule.html">FooRule</a>(), ctx, node, description);
<a class="jxr_linenumber" name="L96" href="#L96">96</a> }
<a class="jxr_linenumber" name="L97" href="#L97">97</a>
<a class="jxr_linenumber" name="L98" href="#L98">98</a> <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> verifyXmlEscaping(Renderer renderer, String shouldContain) <strong class="jxr_keyword">throws</strong> Exception {
<a class="jxr_linenumber" name="L99" href="#L99">99</a> Report report = <strong class="jxr_keyword">new</strong> Report();
<a class="jxr_linenumber" name="L100" href="#L100">100</a> String surrogatePair = <span class="jxr_string">"\ud801\udc1c"</span>;
<a class="jxr_linenumber" name="L101" href="#L101">101</a> String msg = <span class="jxr_string">"The String literal \"Tokenizer "</span> + surrogatePair + <span class="jxr_string">"\" appears..."</span>;
<a class="jxr_linenumber" name="L102" href="#L102">102</a> report.addRuleViolation(createRuleViolation(msg));
<a class="jxr_linenumber" name="L103" href="#L103">103</a> String actual = ReportTest.render(renderer, report);
<a class="jxr_linenumber" name="L104" href="#L104">104</a> Assert.assertTrue(actual.contains(shouldContain));
<a class="jxr_linenumber" name="L105" href="#L105">105</a> Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(<strong class="jxr_keyword">new</strong> InputSource(<strong class="jxr_keyword">new</strong> StringReader(actual)));
<a class="jxr_linenumber" name="L106" href="#L106">106</a> NodeList violations = doc.getElementsByTagName(<span class="jxr_string">"violation"</span>);
<a class="jxr_linenumber" name="L107" href="#L107">107</a> Assert.assertEquals(1, violations.getLength());
<a class="jxr_linenumber" name="L108" href="#L108">108</a> Assert.assertEquals(msg,
<a class="jxr_linenumber" name="L109" href="#L109">109</a> violations.item(0).getTextContent().trim());
<a class="jxr_linenumber" name="L110" href="#L110">110</a> }
<a class="jxr_linenumber" name="L111" href="#L111">111</a>
<a class="jxr_linenumber" name="L112" href="#L112">112</a> @Test
<a class="jxr_linenumber" name="L113" href="#L113">113</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testXMLEscapingWithUTF8() <strong class="jxr_keyword">throws</strong> Exception {
<a class="jxr_linenumber" name="L114" href="#L114">114</a> Renderer renderer = getRenderer();
<a class="jxr_linenumber" name="L115" href="#L115">115</a> renderer.setProperty(XMLRenderer.ENCODING, <span class="jxr_string">"UTF-8"</span>);
<a class="jxr_linenumber" name="L116" href="#L116">116</a> verifyXmlEscaping(renderer, <span class="jxr_string">"\ud801\udc1c"</span>);
<a class="jxr_linenumber" name="L117" href="#L117">117</a> }
<a class="jxr_linenumber" name="L118" href="#L118">118</a>
<a class="jxr_linenumber" name="L119" href="#L119">119</a> @Test
<a class="jxr_linenumber" name="L120" href="#L120">120</a> <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testXMLEscapingWithoutUTF8() <strong class="jxr_keyword">throws</strong> Exception {
<a class="jxr_linenumber" name="L121" href="#L121">121</a> Renderer renderer = getRenderer();
<a class="jxr_linenumber" name="L122" href="#L122">122</a> renderer.setProperty(XMLRenderer.ENCODING, <span class="jxr_string">"ISO-8859-1"</span>);
<a class="jxr_linenumber" name="L123" href="#L123">123</a> verifyXmlEscaping(renderer, <span class="jxr_string">"&#x1041c;"</span>);
<a class="jxr_linenumber" name="L124" href="#L124">124</a> }
<a class="jxr_linenumber" name="L125" href="#L125">125</a> }
</pre>
<hr/>
<div id="footer">Copyright © 2002–2016 <a href="http://pmd.sourceforge.net/">InfoEther</a>. All rights reserved.</div>
</body>
</html>
| jasonwee/videoOnCloud | pmd/pmd-doc-5.5.1/xref-test/net/sourceforge/pmd/renderers/XMLRendererTest.html | HTML | apache-2.0 | 17,258 |
// Copyright 2012 the V8 project authors. All rights reserved.
// 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 Google Inc. 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.
#ifndef V8_AST_H_
#define V8_AST_H_
#include "v8.h"
#include "assembler.h"
#include "factory.h"
#include "isolate.h"
#include "jsregexp.h"
#include "list-inl.h"
#include "runtime.h"
#include "small-pointer-list.h"
#include "smart-array-pointer.h"
#include "token.h"
#include "utils.h"
#include "variables.h"
#include "interface.h"
#include "zone-inl.h"
namespace v8 {
namespace internal {
// The abstract syntax tree is an intermediate, light-weight
// representation of the parsed JavaScript code suitable for
// compilation to native code.
// Nodes are allocated in a separate zone, which allows faster
// allocation and constant-time deallocation of the entire syntax
// tree.
// ----------------------------------------------------------------------------
// Nodes of the abstract syntax tree. Only concrete classes are
// enumerated here.
#define DECLARATION_NODE_LIST(V) \
V(VariableDeclaration) \
V(FunctionDeclaration) \
V(ModuleDeclaration) \
V(ImportDeclaration) \
V(ExportDeclaration) \
#define MODULE_NODE_LIST(V) \
V(ModuleLiteral) \
V(ModuleVariable) \
V(ModulePath) \
V(ModuleUrl)
#define STATEMENT_NODE_LIST(V) \
V(Block) \
V(ExpressionStatement) \
V(EmptyStatement) \
V(IfStatement) \
V(ContinueStatement) \
V(BreakStatement) \
V(ReturnStatement) \
V(WithStatement) \
V(SwitchStatement) \
V(DoWhileStatement) \
V(WhileStatement) \
V(ForStatement) \
V(ForInStatement) \
V(TryCatchStatement) \
V(TryFinallyStatement) \
V(DebuggerStatement)
#define EXPRESSION_NODE_LIST(V) \
V(FunctionLiteral) \
V(SharedFunctionInfoLiteral) \
V(Conditional) \
V(VariableProxy) \
V(Literal) \
V(RegExpLiteral) \
V(ObjectLiteral) \
V(ArrayLiteral) \
V(Assignment) \
V(Throw) \
V(Property) \
V(Call) \
V(CallNew) \
V(CallRuntime) \
V(UnaryOperation) \
V(CountOperation) \
V(BinaryOperation) \
V(CompareOperation) \
V(ThisFunction)
#define AST_NODE_LIST(V) \
DECLARATION_NODE_LIST(V) \
MODULE_NODE_LIST(V) \
STATEMENT_NODE_LIST(V) \
EXPRESSION_NODE_LIST(V)
// Forward declarations
class AstConstructionVisitor;
template<class> class AstNodeFactory;
class AstVisitor;
class Declaration;
class Module;
class BreakableStatement;
class Expression;
class IterationStatement;
class MaterializedLiteral;
class Statement;
class TargetCollector;
class TypeFeedbackOracle;
class RegExpAlternative;
class RegExpAssertion;
class RegExpAtom;
class RegExpBackReference;
class RegExpCapture;
class RegExpCharacterClass;
class RegExpCompiler;
class RegExpDisjunction;
class RegExpEmpty;
class RegExpLookahead;
class RegExpQuantifier;
class RegExpText;
#define DEF_FORWARD_DECLARATION(type) class type;
AST_NODE_LIST(DEF_FORWARD_DECLARATION)
#undef DEF_FORWARD_DECLARATION
// Typedef only introduced to avoid unreadable code.
// Please do appreciate the required space in "> >".
typedef ZoneList<Handle<String> > ZoneStringList;
typedef ZoneList<Handle<Object> > ZoneObjectList;
#define DECLARE_NODE_TYPE(type) \
virtual void Accept(AstVisitor* v); \
virtual AstNode::Type node_type() const { return AstNode::k##type; }
enum AstPropertiesFlag {
kDontInline,
kDontOptimize,
kDontSelfOptimize,
kDontSoftInline
};
class AstProperties BASE_EMBEDDED {
public:
class Flags : public EnumSet<AstPropertiesFlag, int> {};
AstProperties() : node_count_(0) { }
Flags* flags() { return &flags_; }
int node_count() { return node_count_; }
void add_node_count(int count) { node_count_ += count; }
private:
Flags flags_;
int node_count_;
};
class AstNode: public ZoneObject {
public:
#define DECLARE_TYPE_ENUM(type) k##type,
enum Type {
AST_NODE_LIST(DECLARE_TYPE_ENUM)
kInvalid = -1
};
#undef DECLARE_TYPE_ENUM
static const int kNoNumber = -1;
static const int kFunctionEntryId = 2; // Using 0 could disguise errors.
// This AST id identifies the point after the declarations have been
// visited. We need it to capture the environment effects of declarations
// that emit code (function declarations).
static const int kDeclarationsId = 3;
void* operator new(size_t size, Zone* zone) {
return zone->New(static_cast<int>(size));
}
AstNode() { }
virtual ~AstNode() { }
virtual void Accept(AstVisitor* v) = 0;
virtual Type node_type() const { return kInvalid; }
// Type testing & conversion functions overridden by concrete subclasses.
#define DECLARE_NODE_FUNCTIONS(type) \
bool Is##type() { return node_type() == AstNode::k##type; } \
type* As##type() { return Is##type() ? reinterpret_cast<type*>(this) : NULL; }
AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
#undef DECLARE_NODE_FUNCTIONS
virtual Declaration* AsDeclaration() { return NULL; }
virtual Statement* AsStatement() { return NULL; }
virtual Expression* AsExpression() { return NULL; }
virtual TargetCollector* AsTargetCollector() { return NULL; }
virtual BreakableStatement* AsBreakableStatement() { return NULL; }
virtual IterationStatement* AsIterationStatement() { return NULL; }
virtual MaterializedLiteral* AsMaterializedLiteral() { return NULL; }
protected:
static int GetNextId(Isolate* isolate) {
return ReserveIdRange(isolate, 1);
}
static int ReserveIdRange(Isolate* isolate, int n) {
int tmp = isolate->ast_node_id();
isolate->set_ast_node_id(tmp + n);
return tmp;
}
private:
// Hidden to prevent accidental usage. It would have to load the
// current zone from the TLS.
void* operator new(size_t size);
friend class CaseClause; // Generates AST IDs.
};
class Statement: public AstNode {
public:
Statement() : statement_pos_(RelocInfo::kNoPosition) {}
virtual Statement* AsStatement() { return this; }
bool IsEmpty() { return AsEmptyStatement() != NULL; }
void set_statement_pos(int statement_pos) { statement_pos_ = statement_pos; }
int statement_pos() const { return statement_pos_; }
private:
int statement_pos_;
};
class SmallMapList {
public:
SmallMapList() {}
explicit SmallMapList(int capacity) : list_(capacity) {}
void Reserve(int capacity) { list_.Reserve(capacity); }
void Clear() { list_.Clear(); }
bool is_empty() const { return list_.is_empty(); }
int length() const { return list_.length(); }
void Add(Handle<Map> handle) {
list_.Add(handle.location());
}
Handle<Map> at(int i) const {
return Handle<Map>(list_.at(i));
}
Handle<Map> first() const { return at(0); }
Handle<Map> last() const { return at(length() - 1); }
private:
// The list stores pointers to Map*, that is Map**, so it's GC safe.
SmallPointerList<Map*> list_;
DISALLOW_COPY_AND_ASSIGN(SmallMapList);
};
class Expression: public AstNode {
public:
enum Context {
// Not assigned a context yet, or else will not be visited during
// code generation.
kUninitialized,
// Evaluated for its side effects.
kEffect,
// Evaluated for its value (and side effects).
kValue,
// Evaluated for control flow (and side effects).
kTest
};
virtual int position() const {
UNREACHABLE();
return 0;
}
virtual Expression* AsExpression() { return this; }
virtual bool IsValidLeftHandSide() { return false; }
// Helpers for ToBoolean conversion.
virtual bool ToBooleanIsTrue() { return false; }
virtual bool ToBooleanIsFalse() { return false; }
// Symbols that cannot be parsed as array indices are considered property
// names. We do not treat symbols that can be array indexes as property
// names because [] for string objects is handled only by keyed ICs.
virtual bool IsPropertyName() { return false; }
// True iff the result can be safely overwritten (to avoid allocation).
// False for operations that can return one of their operands.
virtual bool ResultOverwriteAllowed() { return false; }
// True iff the expression is a literal represented as a smi.
bool IsSmiLiteral();
// True iff the expression is a string literal.
bool IsStringLiteral();
// True iff the expression is the null literal.
bool IsNullLiteral();
// Type feedback information for assignments and properties.
virtual bool IsMonomorphic() {
UNREACHABLE();
return false;
}
virtual SmallMapList* GetReceiverTypes() {
UNREACHABLE();
return NULL;
}
Handle<Map> GetMonomorphicReceiverType() {
ASSERT(IsMonomorphic());
SmallMapList* types = GetReceiverTypes();
ASSERT(types != NULL && types->length() == 1);
return types->at(0);
}
unsigned id() const { return id_; }
unsigned test_id() const { return test_id_; }
protected:
explicit Expression(Isolate* isolate)
: id_(GetNextId(isolate)),
test_id_(GetNextId(isolate)) {}
private:
int id_;
int test_id_;
};
class BreakableStatement: public Statement {
public:
enum Type {
TARGET_FOR_ANONYMOUS,
TARGET_FOR_NAMED_ONLY
};
// The labels associated with this statement. May be NULL;
// if it is != NULL, guaranteed to contain at least one entry.
ZoneStringList* labels() const { return labels_; }
// Type testing & conversion.
virtual BreakableStatement* AsBreakableStatement() { return this; }
// Code generation
Label* break_target() { return &break_target_; }
// Testers.
bool is_target_for_anonymous() const { return type_ == TARGET_FOR_ANONYMOUS; }
// Bailout support.
int EntryId() const { return entry_id_; }
int ExitId() const { return exit_id_; }
protected:
BreakableStatement(Isolate* isolate, ZoneStringList* labels, Type type)
: labels_(labels),
type_(type),
entry_id_(GetNextId(isolate)),
exit_id_(GetNextId(isolate)) {
ASSERT(labels == NULL || labels->length() > 0);
}
private:
ZoneStringList* labels_;
Type type_;
Label break_target_;
int entry_id_;
int exit_id_;
};
class Block: public BreakableStatement {
public:
DECLARE_NODE_TYPE(Block)
void AddStatement(Statement* statement) { statements_.Add(statement); }
ZoneList<Statement*>* statements() { return &statements_; }
bool is_initializer_block() const { return is_initializer_block_; }
Scope* block_scope() const { return block_scope_; }
void set_block_scope(Scope* block_scope) { block_scope_ = block_scope; }
protected:
template<class> friend class AstNodeFactory;
Block(Isolate* isolate,
ZoneStringList* labels,
int capacity,
bool is_initializer_block)
: BreakableStatement(isolate, labels, TARGET_FOR_NAMED_ONLY),
statements_(capacity),
is_initializer_block_(is_initializer_block),
block_scope_(NULL) {
}
private:
ZoneList<Statement*> statements_;
bool is_initializer_block_;
Scope* block_scope_;
};
class Declaration: public AstNode {
public:
VariableProxy* proxy() const { return proxy_; }
VariableMode mode() const { return mode_; }
Scope* scope() const { return scope_; }
virtual InitializationFlag initialization() const = 0;
virtual bool IsInlineable() const;
virtual Declaration* AsDeclaration() { return this; }
protected:
Declaration(VariableProxy* proxy,
VariableMode mode,
Scope* scope)
: proxy_(proxy),
mode_(mode),
scope_(scope) {
ASSERT(mode == VAR ||
mode == CONST ||
mode == CONST_HARMONY ||
mode == LET);
}
private:
VariableProxy* proxy_;
VariableMode mode_;
// Nested scope from which the declaration originated.
Scope* scope_;
};
class VariableDeclaration: public Declaration {
public:
DECLARE_NODE_TYPE(VariableDeclaration)
virtual InitializationFlag initialization() const {
return mode() == VAR ? kCreatedInitialized : kNeedsInitialization;
}
protected:
template<class> friend class AstNodeFactory;
VariableDeclaration(VariableProxy* proxy,
VariableMode mode,
Scope* scope)
: Declaration(proxy, mode, scope) {
}
};
class FunctionDeclaration: public Declaration {
public:
DECLARE_NODE_TYPE(FunctionDeclaration)
FunctionLiteral* fun() const { return fun_; }
virtual InitializationFlag initialization() const {
return kCreatedInitialized;
}
virtual bool IsInlineable() const;
protected:
template<class> friend class AstNodeFactory;
FunctionDeclaration(VariableProxy* proxy,
VariableMode mode,
FunctionLiteral* fun,
Scope* scope)
: Declaration(proxy, mode, scope),
fun_(fun) {
// At the moment there are no "const functions" in JavaScript...
ASSERT(mode == VAR || mode == LET);
ASSERT(fun != NULL);
}
private:
FunctionLiteral* fun_;
};
class ModuleDeclaration: public Declaration {
public:
DECLARE_NODE_TYPE(ModuleDeclaration)
Module* module() const { return module_; }
virtual InitializationFlag initialization() const {
return kCreatedInitialized;
}
protected:
template<class> friend class AstNodeFactory;
ModuleDeclaration(VariableProxy* proxy,
Module* module,
Scope* scope)
: Declaration(proxy, LET, scope),
module_(module) {
}
private:
Module* module_;
};
class ImportDeclaration: public Declaration {
public:
DECLARE_NODE_TYPE(ImportDeclaration)
Module* module() const { return module_; }
virtual InitializationFlag initialization() const {
return kCreatedInitialized;
}
protected:
template<class> friend class AstNodeFactory;
ImportDeclaration(VariableProxy* proxy,
Module* module,
Scope* scope)
: Declaration(proxy, LET, scope),
module_(module) {
}
private:
Module* module_;
};
class ExportDeclaration: public Declaration {
public:
DECLARE_NODE_TYPE(ExportDeclaration)
virtual InitializationFlag initialization() const {
return kCreatedInitialized;
}
protected:
template<class> friend class AstNodeFactory;
ExportDeclaration(VariableProxy* proxy,
Scope* scope)
: Declaration(proxy, LET, scope) {
}
};
class Module: public AstNode {
public:
Interface* interface() const { return interface_; }
protected:
Module() : interface_(Interface::NewModule()) {}
explicit Module(Interface* interface) : interface_(interface) {}
private:
Interface* interface_;
};
class ModuleLiteral: public Module {
public:
DECLARE_NODE_TYPE(ModuleLiteral)
Block* body() const { return body_; }
protected:
template<class> friend class AstNodeFactory;
ModuleLiteral(Block* body, Interface* interface)
: Module(interface),
body_(body) {
}
private:
Block* body_;
};
class ModuleVariable: public Module {
public:
DECLARE_NODE_TYPE(ModuleVariable)
VariableProxy* proxy() const { return proxy_; }
protected:
template<class> friend class AstNodeFactory;
inline explicit ModuleVariable(VariableProxy* proxy);
private:
VariableProxy* proxy_;
};
class ModulePath: public Module {
public:
DECLARE_NODE_TYPE(ModulePath)
Module* module() const { return module_; }
Handle<String> name() const { return name_; }
protected:
template<class> friend class AstNodeFactory;
ModulePath(Module* module, Handle<String> name)
: module_(module),
name_(name) {
}
private:
Module* module_;
Handle<String> name_;
};
class ModuleUrl: public Module {
public:
DECLARE_NODE_TYPE(ModuleUrl)
Handle<String> url() const { return url_; }
protected:
template<class> friend class AstNodeFactory;
explicit ModuleUrl(Handle<String> url) : url_(url) {
}
private:
Handle<String> url_;
};
class IterationStatement: public BreakableStatement {
public:
// Type testing & conversion.
virtual IterationStatement* AsIterationStatement() { return this; }
Statement* body() const { return body_; }
// Bailout support.
int OsrEntryId() const { return osr_entry_id_; }
virtual int ContinueId() const = 0;
virtual int StackCheckId() const = 0;
// Code generation
Label* continue_target() { return &continue_target_; }
protected:
IterationStatement(Isolate* isolate, ZoneStringList* labels)
: BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS),
body_(NULL),
osr_entry_id_(GetNextId(isolate)) {
}
void Initialize(Statement* body) {
body_ = body;
}
private:
Statement* body_;
Label continue_target_;
int osr_entry_id_;
};
class DoWhileStatement: public IterationStatement {
public:
DECLARE_NODE_TYPE(DoWhileStatement)
void Initialize(Expression* cond, Statement* body) {
IterationStatement::Initialize(body);
cond_ = cond;
}
Expression* cond() const { return cond_; }
// Position where condition expression starts. We need it to make
// the loop's condition a breakable location.
int condition_position() { return condition_position_; }
void set_condition_position(int pos) { condition_position_ = pos; }
// Bailout support.
virtual int ContinueId() const { return continue_id_; }
virtual int StackCheckId() const { return back_edge_id_; }
int BackEdgeId() const { return back_edge_id_; }
protected:
template<class> friend class AstNodeFactory;
DoWhileStatement(Isolate* isolate, ZoneStringList* labels)
: IterationStatement(isolate, labels),
cond_(NULL),
condition_position_(-1),
continue_id_(GetNextId(isolate)),
back_edge_id_(GetNextId(isolate)) {
}
private:
Expression* cond_;
int condition_position_;
int continue_id_;
int back_edge_id_;
};
class WhileStatement: public IterationStatement {
public:
DECLARE_NODE_TYPE(WhileStatement)
void Initialize(Expression* cond, Statement* body) {
IterationStatement::Initialize(body);
cond_ = cond;
}
Expression* cond() const { return cond_; }
bool may_have_function_literal() const {
return may_have_function_literal_;
}
void set_may_have_function_literal(bool value) {
may_have_function_literal_ = value;
}
// Bailout support.
virtual int ContinueId() const { return EntryId(); }
virtual int StackCheckId() const { return body_id_; }
int BodyId() const { return body_id_; }
protected:
template<class> friend class AstNodeFactory;
WhileStatement(Isolate* isolate, ZoneStringList* labels)
: IterationStatement(isolate, labels),
cond_(NULL),
may_have_function_literal_(true),
body_id_(GetNextId(isolate)) {
}
private:
Expression* cond_;
// True if there is a function literal subexpression in the condition.
bool may_have_function_literal_;
int body_id_;
};
class ForStatement: public IterationStatement {
public:
DECLARE_NODE_TYPE(ForStatement)
void Initialize(Statement* init,
Expression* cond,
Statement* next,
Statement* body) {
IterationStatement::Initialize(body);
init_ = init;
cond_ = cond;
next_ = next;
}
Statement* init() const { return init_; }
Expression* cond() const { return cond_; }
Statement* next() const { return next_; }
bool may_have_function_literal() const {
return may_have_function_literal_;
}
void set_may_have_function_literal(bool value) {
may_have_function_literal_ = value;
}
// Bailout support.
virtual int ContinueId() const { return continue_id_; }
virtual int StackCheckId() const { return body_id_; }
int BodyId() const { return body_id_; }
bool is_fast_smi_loop() { return loop_variable_ != NULL; }
Variable* loop_variable() { return loop_variable_; }
void set_loop_variable(Variable* var) { loop_variable_ = var; }
protected:
template<class> friend class AstNodeFactory;
ForStatement(Isolate* isolate, ZoneStringList* labels)
: IterationStatement(isolate, labels),
init_(NULL),
cond_(NULL),
next_(NULL),
may_have_function_literal_(true),
loop_variable_(NULL),
continue_id_(GetNextId(isolate)),
body_id_(GetNextId(isolate)) {
}
private:
Statement* init_;
Expression* cond_;
Statement* next_;
// True if there is a function literal subexpression in the condition.
bool may_have_function_literal_;
Variable* loop_variable_;
int continue_id_;
int body_id_;
};
class ForInStatement: public IterationStatement {
public:
DECLARE_NODE_TYPE(ForInStatement)
void Initialize(Expression* each, Expression* enumerable, Statement* body) {
IterationStatement::Initialize(body);
each_ = each;
enumerable_ = enumerable;
}
Expression* each() const { return each_; }
Expression* enumerable() const { return enumerable_; }
virtual int ContinueId() const { return EntryId(); }
virtual int StackCheckId() const { return body_id_; }
int BodyId() const { return body_id_; }
int PrepareId() const { return prepare_id_; }
protected:
template<class> friend class AstNodeFactory;
ForInStatement(Isolate* isolate, ZoneStringList* labels)
: IterationStatement(isolate, labels),
each_(NULL),
enumerable_(NULL),
body_id_(GetNextId(isolate)),
prepare_id_(GetNextId(isolate)) {
}
private:
Expression* each_;
Expression* enumerable_;
int body_id_;
int prepare_id_;
};
class ExpressionStatement: public Statement {
public:
DECLARE_NODE_TYPE(ExpressionStatement)
void set_expression(Expression* e) { expression_ = e; }
Expression* expression() const { return expression_; }
protected:
template<class> friend class AstNodeFactory;
explicit ExpressionStatement(Expression* expression)
: expression_(expression) { }
private:
Expression* expression_;
};
class ContinueStatement: public Statement {
public:
DECLARE_NODE_TYPE(ContinueStatement)
IterationStatement* target() const { return target_; }
protected:
template<class> friend class AstNodeFactory;
explicit ContinueStatement(IterationStatement* target)
: target_(target) { }
private:
IterationStatement* target_;
};
class BreakStatement: public Statement {
public:
DECLARE_NODE_TYPE(BreakStatement)
BreakableStatement* target() const { return target_; }
protected:
template<class> friend class AstNodeFactory;
explicit BreakStatement(BreakableStatement* target)
: target_(target) { }
private:
BreakableStatement* target_;
};
class ReturnStatement: public Statement {
public:
DECLARE_NODE_TYPE(ReturnStatement)
Expression* expression() const { return expression_; }
protected:
template<class> friend class AstNodeFactory;
explicit ReturnStatement(Expression* expression)
: expression_(expression) { }
private:
Expression* expression_;
};
class WithStatement: public Statement {
public:
DECLARE_NODE_TYPE(WithStatement)
Expression* expression() const { return expression_; }
Statement* statement() const { return statement_; }
protected:
template<class> friend class AstNodeFactory;
WithStatement(Expression* expression, Statement* statement)
: expression_(expression),
statement_(statement) { }
private:
Expression* expression_;
Statement* statement_;
};
class CaseClause: public ZoneObject {
public:
CaseClause(Isolate* isolate,
Expression* label,
ZoneList<Statement*>* statements,
int pos);
bool is_default() const { return label_ == NULL; }
Expression* label() const {
CHECK(!is_default());
return label_;
}
Label* body_target() { return &body_target_; }
ZoneList<Statement*>* statements() const { return statements_; }
int position() const { return position_; }
void set_position(int pos) { position_ = pos; }
int EntryId() { return entry_id_; }
int CompareId() { return compare_id_; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
bool IsSymbolCompare() { return compare_type_ == SYMBOL_ONLY; }
bool IsStringCompare() { return compare_type_ == STRING_ONLY; }
bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
private:
Expression* label_;
Label body_target_;
ZoneList<Statement*>* statements_;
int position_;
enum CompareTypeFeedback {
NONE,
SMI_ONLY,
SYMBOL_ONLY,
STRING_ONLY,
OBJECT_ONLY
};
CompareTypeFeedback compare_type_;
int compare_id_;
int entry_id_;
};
class SwitchStatement: public BreakableStatement {
public:
DECLARE_NODE_TYPE(SwitchStatement)
void Initialize(Expression* tag, ZoneList<CaseClause*>* cases) {
tag_ = tag;
cases_ = cases;
}
Expression* tag() const { return tag_; }
ZoneList<CaseClause*>* cases() const { return cases_; }
protected:
template<class> friend class AstNodeFactory;
SwitchStatement(Isolate* isolate, ZoneStringList* labels)
: BreakableStatement(isolate, labels, TARGET_FOR_ANONYMOUS),
tag_(NULL),
cases_(NULL) { }
private:
Expression* tag_;
ZoneList<CaseClause*>* cases_;
};
// If-statements always have non-null references to their then- and
// else-parts. When parsing if-statements with no explicit else-part,
// the parser implicitly creates an empty statement. Use the
// HasThenStatement() and HasElseStatement() functions to check if a
// given if-statement has a then- or an else-part containing code.
class IfStatement: public Statement {
public:
DECLARE_NODE_TYPE(IfStatement)
bool HasThenStatement() const { return !then_statement()->IsEmpty(); }
bool HasElseStatement() const { return !else_statement()->IsEmpty(); }
Expression* condition() const { return condition_; }
Statement* then_statement() const { return then_statement_; }
Statement* else_statement() const { return else_statement_; }
int IfId() const { return if_id_; }
int ThenId() const { return then_id_; }
int ElseId() const { return else_id_; }
protected:
template<class> friend class AstNodeFactory;
IfStatement(Isolate* isolate,
Expression* condition,
Statement* then_statement,
Statement* else_statement)
: condition_(condition),
then_statement_(then_statement),
else_statement_(else_statement),
if_id_(GetNextId(isolate)),
then_id_(GetNextId(isolate)),
else_id_(GetNextId(isolate)) {
}
private:
Expression* condition_;
Statement* then_statement_;
Statement* else_statement_;
int if_id_;
int then_id_;
int else_id_;
};
// NOTE: TargetCollectors are represented as nodes to fit in the target
// stack in the compiler; this should probably be reworked.
class TargetCollector: public AstNode {
public:
TargetCollector() : targets_(0) { }
// Adds a jump target to the collector. The collector stores a pointer not
// a copy of the target to make binding work, so make sure not to pass in
// references to something on the stack.
void AddTarget(Label* target);
// Virtual behaviour. TargetCollectors are never part of the AST.
virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
virtual TargetCollector* AsTargetCollector() { return this; }
ZoneList<Label*>* targets() { return &targets_; }
private:
ZoneList<Label*> targets_;
};
class TryStatement: public Statement {
public:
void set_escaping_targets(ZoneList<Label*>* targets) {
escaping_targets_ = targets;
}
int index() const { return index_; }
Block* try_block() const { return try_block_; }
ZoneList<Label*>* escaping_targets() const { return escaping_targets_; }
protected:
TryStatement(int index, Block* try_block)
: index_(index),
try_block_(try_block),
escaping_targets_(NULL) { }
private:
// Unique (per-function) index of this handler. This is not an AST ID.
int index_;
Block* try_block_;
ZoneList<Label*>* escaping_targets_;
};
class TryCatchStatement: public TryStatement {
public:
DECLARE_NODE_TYPE(TryCatchStatement)
Scope* scope() { return scope_; }
Variable* variable() { return variable_; }
Block* catch_block() const { return catch_block_; }
protected:
template<class> friend class AstNodeFactory;
TryCatchStatement(int index,
Block* try_block,
Scope* scope,
Variable* variable,
Block* catch_block)
: TryStatement(index, try_block),
scope_(scope),
variable_(variable),
catch_block_(catch_block) {
}
private:
Scope* scope_;
Variable* variable_;
Block* catch_block_;
};
class TryFinallyStatement: public TryStatement {
public:
DECLARE_NODE_TYPE(TryFinallyStatement)
Block* finally_block() const { return finally_block_; }
protected:
template<class> friend class AstNodeFactory;
TryFinallyStatement(int index, Block* try_block, Block* finally_block)
: TryStatement(index, try_block),
finally_block_(finally_block) { }
private:
Block* finally_block_;
};
class DebuggerStatement: public Statement {
public:
DECLARE_NODE_TYPE(DebuggerStatement)
protected:
template<class> friend class AstNodeFactory;
DebuggerStatement() {}
};
class EmptyStatement: public Statement {
public:
DECLARE_NODE_TYPE(EmptyStatement)
protected:
template<class> friend class AstNodeFactory;
EmptyStatement() {}
};
class Literal: public Expression {
public:
DECLARE_NODE_TYPE(Literal)
virtual bool IsPropertyName() {
if (handle_->IsSymbol()) {
uint32_t ignored;
return !String::cast(*handle_)->AsArrayIndex(&ignored);
}
return false;
}
Handle<String> AsPropertyName() {
ASSERT(IsPropertyName());
return Handle<String>::cast(handle_);
}
virtual bool ToBooleanIsTrue() { return handle_->ToBoolean()->IsTrue(); }
virtual bool ToBooleanIsFalse() { return handle_->ToBoolean()->IsFalse(); }
// Identity testers.
bool IsNull() const {
ASSERT(!handle_.is_null());
return handle_->IsNull();
}
bool IsTrue() const {
ASSERT(!handle_.is_null());
return handle_->IsTrue();
}
bool IsFalse() const {
ASSERT(!handle_.is_null());
return handle_->IsFalse();
}
Handle<Object> handle() const { return handle_; }
// Support for using Literal as a HashMap key. NOTE: Currently, this works
// only for string and number literals!
uint32_t Hash() { return ToString()->Hash(); }
static bool Match(void* literal1, void* literal2) {
Handle<String> s1 = static_cast<Literal*>(literal1)->ToString();
Handle<String> s2 = static_cast<Literal*>(literal2)->ToString();
return s1->Equals(*s2);
}
protected:
template<class> friend class AstNodeFactory;
Literal(Isolate* isolate, Handle<Object> handle)
: Expression(isolate),
handle_(handle) { }
private:
Handle<String> ToString();
Handle<Object> handle_;
};
// Base class for literals that needs space in the corresponding JSFunction.
class MaterializedLiteral: public Expression {
public:
virtual MaterializedLiteral* AsMaterializedLiteral() { return this; }
int literal_index() { return literal_index_; }
// A materialized literal is simple if the values consist of only
// constants and simple object and array literals.
bool is_simple() const { return is_simple_; }
int depth() const { return depth_; }
protected:
MaterializedLiteral(Isolate* isolate,
int literal_index,
bool is_simple,
int depth)
: Expression(isolate),
literal_index_(literal_index),
is_simple_(is_simple),
depth_(depth) {}
private:
int literal_index_;
bool is_simple_;
int depth_;
};
// An object literal has a boilerplate object that is used
// for minimizing the work when constructing it at runtime.
class ObjectLiteral: public MaterializedLiteral {
public:
// Property is used for passing information
// about an object literal's properties from the parser
// to the code generator.
class Property: public ZoneObject {
public:
enum Kind {
CONSTANT, // Property with constant value (compile time).
COMPUTED, // Property with computed value (execution time).
MATERIALIZED_LITERAL, // Property value is a materialized literal.
GETTER, SETTER, // Property is an accessor function.
PROTOTYPE // Property is __proto__.
};
Property(Literal* key, Expression* value, Isolate* isolate);
Literal* key() { return key_; }
Expression* value() { return value_; }
Kind kind() { return kind_; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsMonomorphic() { return !receiver_type_.is_null(); }
Handle<Map> GetReceiverType() { return receiver_type_; }
bool IsCompileTimeValue();
void set_emit_store(bool emit_store);
bool emit_store();
protected:
template<class> friend class AstNodeFactory;
Property(bool is_getter, FunctionLiteral* value);
void set_key(Literal* key) { key_ = key; }
private:
Literal* key_;
Expression* value_;
Kind kind_;
bool emit_store_;
Handle<Map> receiver_type_;
};
DECLARE_NODE_TYPE(ObjectLiteral)
Handle<FixedArray> constant_properties() const {
return constant_properties_;
}
ZoneList<Property*>* properties() const { return properties_; }
bool fast_elements() const { return fast_elements_; }
bool has_function() { return has_function_; }
// Mark all computed expressions that are bound to a key that
// is shadowed by a later occurrence of the same key. For the
// marked expressions, no store code is emitted.
void CalculateEmitStore();
enum Flags {
kNoFlags = 0,
kFastElements = 1,
kHasFunction = 1 << 1
};
struct Accessors: public ZoneObject {
Accessors() : getter(NULL), setter(NULL) { }
Expression* getter;
Expression* setter;
};
protected:
template<class> friend class AstNodeFactory;
ObjectLiteral(Isolate* isolate,
Handle<FixedArray> constant_properties,
ZoneList<Property*>* properties,
int literal_index,
bool is_simple,
bool fast_elements,
int depth,
bool has_function)
: MaterializedLiteral(isolate, literal_index, is_simple, depth),
constant_properties_(constant_properties),
properties_(properties),
fast_elements_(fast_elements),
has_function_(has_function) {}
private:
Handle<FixedArray> constant_properties_;
ZoneList<Property*>* properties_;
bool fast_elements_;
bool has_function_;
};
// Node for capturing a regexp literal.
class RegExpLiteral: public MaterializedLiteral {
public:
DECLARE_NODE_TYPE(RegExpLiteral)
Handle<String> pattern() const { return pattern_; }
Handle<String> flags() const { return flags_; }
protected:
template<class> friend class AstNodeFactory;
RegExpLiteral(Isolate* isolate,
Handle<String> pattern,
Handle<String> flags,
int literal_index)
: MaterializedLiteral(isolate, literal_index, false, 1),
pattern_(pattern),
flags_(flags) {}
private:
Handle<String> pattern_;
Handle<String> flags_;
};
// An array literal has a literals object that is used
// for minimizing the work when constructing it at runtime.
class ArrayLiteral: public MaterializedLiteral {
public:
DECLARE_NODE_TYPE(ArrayLiteral)
Handle<FixedArray> constant_elements() const { return constant_elements_; }
ZoneList<Expression*>* values() const { return values_; }
// Return an AST id for an element that is used in simulate instructions.
int GetIdForElement(int i) { return first_element_id_ + i; }
protected:
template<class> friend class AstNodeFactory;
ArrayLiteral(Isolate* isolate,
Handle<FixedArray> constant_elements,
ZoneList<Expression*>* values,
int literal_index,
bool is_simple,
int depth)
: MaterializedLiteral(isolate, literal_index, is_simple, depth),
constant_elements_(constant_elements),
values_(values),
first_element_id_(ReserveIdRange(isolate, values->length())) {}
private:
Handle<FixedArray> constant_elements_;
ZoneList<Expression*>* values_;
int first_element_id_;
};
class VariableProxy: public Expression {
public:
DECLARE_NODE_TYPE(VariableProxy)
virtual bool IsValidLeftHandSide() {
return var_ == NULL ? true : var_->IsValidLeftHandSide();
}
bool IsVariable(Handle<String> n) {
return !is_this() && name().is_identical_to(n);
}
bool IsArguments() { return var_ != NULL && var_->is_arguments(); }
bool IsLValue() {
return is_lvalue_;
}
Handle<String> name() const { return name_; }
Variable* var() const { return var_; }
bool is_this() const { return is_this_; }
int position() const { return position_; }
Interface* interface() const { return interface_; }
void MarkAsTrivial() { is_trivial_ = true; }
void MarkAsLValue() { is_lvalue_ = true; }
// Bind this proxy to the variable var.
void BindTo(Variable* var);
protected:
template<class> friend class AstNodeFactory;
VariableProxy(Isolate* isolate, Variable* var);
VariableProxy(Isolate* isolate,
Handle<String> name,
bool is_this,
int position,
Interface* interface);
Handle<String> name_;
Variable* var_; // resolved variable, or NULL
bool is_this_;
bool is_trivial_;
// True if this variable proxy is being used in an assignment
// or with a increment/decrement operator.
bool is_lvalue_;
int position_;
Interface* interface_;
};
class Property: public Expression {
public:
DECLARE_NODE_TYPE(Property)
virtual bool IsValidLeftHandSide() { return true; }
Expression* obj() const { return obj_; }
Expression* key() const { return key_; }
virtual int position() const { return pos_; }
bool IsStringLength() const { return is_string_length_; }
bool IsStringAccess() const { return is_string_access_; }
bool IsFunctionPrototype() const { return is_function_prototype_; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
virtual bool IsMonomorphic() { return is_monomorphic_; }
virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
bool IsArrayLength() { return is_array_length_; }
bool IsUninitialized() { return is_uninitialized_; }
protected:
template<class> friend class AstNodeFactory;
Property(Isolate* isolate,
Expression* obj,
Expression* key,
int pos)
: Expression(isolate),
obj_(obj),
key_(key),
pos_(pos),
is_monomorphic_(false),
is_uninitialized_(false),
is_array_length_(false),
is_string_length_(false),
is_string_access_(false),
is_function_prototype_(false) { }
private:
Expression* obj_;
Expression* key_;
int pos_;
SmallMapList receiver_types_;
bool is_monomorphic_ : 1;
bool is_uninitialized_ : 1;
bool is_array_length_ : 1;
bool is_string_length_ : 1;
bool is_string_access_ : 1;
bool is_function_prototype_ : 1;
};
class Call: public Expression {
public:
DECLARE_NODE_TYPE(Call)
Expression* expression() const { return expression_; }
ZoneList<Expression*>* arguments() const { return arguments_; }
virtual int position() const { return pos_; }
void RecordTypeFeedback(TypeFeedbackOracle* oracle,
CallKind call_kind);
virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
virtual bool IsMonomorphic() { return is_monomorphic_; }
CheckType check_type() const { return check_type_; }
Handle<JSFunction> target() { return target_; }
Handle<JSObject> holder() { return holder_; }
Handle<JSGlobalPropertyCell> cell() { return cell_; }
bool ComputeTarget(Handle<Map> type, Handle<String> name);
bool ComputeGlobalTarget(Handle<GlobalObject> global, LookupResult* lookup);
// Bailout support.
int ReturnId() const { return return_id_; }
#ifdef DEBUG
// Used to assert that the FullCodeGenerator records the return site.
bool return_is_recorded_;
#endif
protected:
template<class> friend class AstNodeFactory;
Call(Isolate* isolate,
Expression* expression,
ZoneList<Expression*>* arguments,
int pos)
: Expression(isolate),
expression_(expression),
arguments_(arguments),
pos_(pos),
is_monomorphic_(false),
check_type_(RECEIVER_MAP_CHECK),
return_id_(GetNextId(isolate)) { }
private:
Expression* expression_;
ZoneList<Expression*>* arguments_;
int pos_;
bool is_monomorphic_;
CheckType check_type_;
SmallMapList receiver_types_;
Handle<JSFunction> target_;
Handle<JSObject> holder_;
Handle<JSGlobalPropertyCell> cell_;
int return_id_;
};
class CallNew: public Expression {
public:
DECLARE_NODE_TYPE(CallNew)
Expression* expression() const { return expression_; }
ZoneList<Expression*>* arguments() const { return arguments_; }
virtual int position() const { return pos_; }
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
virtual bool IsMonomorphic() { return is_monomorphic_; }
Handle<JSFunction> target() { return target_; }
// Bailout support.
int ReturnId() const { return return_id_; }
protected:
template<class> friend class AstNodeFactory;
CallNew(Isolate* isolate,
Expression* expression,
ZoneList<Expression*>* arguments,
int pos)
: Expression(isolate),
expression_(expression),
arguments_(arguments),
pos_(pos),
is_monomorphic_(false),
return_id_(GetNextId(isolate)) { }
private:
Expression* expression_;
ZoneList<Expression*>* arguments_;
int pos_;
bool is_monomorphic_;
Handle<JSFunction> target_;
int return_id_;
};
// The CallRuntime class does not represent any official JavaScript
// language construct. Instead it is used to call a C or JS function
// with a set of arguments. This is used from the builtins that are
// implemented in JavaScript (see "v8natives.js").
class CallRuntime: public Expression {
public:
DECLARE_NODE_TYPE(CallRuntime)
Handle<String> name() const { return name_; }
const Runtime::Function* function() const { return function_; }
ZoneList<Expression*>* arguments() const { return arguments_; }
bool is_jsruntime() const { return function_ == NULL; }
protected:
template<class> friend class AstNodeFactory;
CallRuntime(Isolate* isolate,
Handle<String> name,
const Runtime::Function* function,
ZoneList<Expression*>* arguments)
: Expression(isolate),
name_(name),
function_(function),
arguments_(arguments) { }
private:
Handle<String> name_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_;
};
class UnaryOperation: public Expression {
public:
DECLARE_NODE_TYPE(UnaryOperation)
virtual bool ResultOverwriteAllowed();
Token::Value op() const { return op_; }
Expression* expression() const { return expression_; }
virtual int position() const { return pos_; }
int MaterializeTrueId() { return materialize_true_id_; }
int MaterializeFalseId() { return materialize_false_id_; }
protected:
template<class> friend class AstNodeFactory;
UnaryOperation(Isolate* isolate,
Token::Value op,
Expression* expression,
int pos)
: Expression(isolate),
op_(op),
expression_(expression),
pos_(pos),
materialize_true_id_(AstNode::kNoNumber),
materialize_false_id_(AstNode::kNoNumber) {
ASSERT(Token::IsUnaryOp(op));
if (op == Token::NOT) {
materialize_true_id_ = GetNextId(isolate);
materialize_false_id_ = GetNextId(isolate);
}
}
private:
Token::Value op_;
Expression* expression_;
int pos_;
// For unary not (Token::NOT), the AST ids where true and false will
// actually be materialized, respectively.
int materialize_true_id_;
int materialize_false_id_;
};
class BinaryOperation: public Expression {
public:
DECLARE_NODE_TYPE(BinaryOperation)
virtual bool ResultOverwriteAllowed();
Token::Value op() const { return op_; }
Expression* left() const { return left_; }
Expression* right() const { return right_; }
virtual int position() const { return pos_; }
// Bailout support.
int RightId() const { return right_id_; }
protected:
template<class> friend class AstNodeFactory;
BinaryOperation(Isolate* isolate,
Token::Value op,
Expression* left,
Expression* right,
int pos)
: Expression(isolate), op_(op), left_(left), right_(right), pos_(pos) {
ASSERT(Token::IsBinaryOp(op));
right_id_ = (op == Token::AND || op == Token::OR)
? GetNextId(isolate)
: AstNode::kNoNumber;
}
private:
Token::Value op_;
Expression* left_;
Expression* right_;
int pos_;
// The short-circuit logical operations have an AST ID for their
// right-hand subexpression.
int right_id_;
};
class CountOperation: public Expression {
public:
DECLARE_NODE_TYPE(CountOperation)
bool is_prefix() const { return is_prefix_; }
bool is_postfix() const { return !is_prefix_; }
Token::Value op() const { return op_; }
Token::Value binary_op() {
return (op() == Token::INC) ? Token::ADD : Token::SUB;
}
Expression* expression() const { return expression_; }
virtual int position() const { return pos_; }
virtual void MarkAsStatement() { is_prefix_ = true; }
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
virtual bool IsMonomorphic() { return is_monomorphic_; }
virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
// Bailout support.
int AssignmentId() const { return assignment_id_; }
int CountId() const { return count_id_; }
protected:
template<class> friend class AstNodeFactory;
CountOperation(Isolate* isolate,
Token::Value op,
bool is_prefix,
Expression* expr,
int pos)
: Expression(isolate),
op_(op),
is_prefix_(is_prefix),
expression_(expr),
pos_(pos),
assignment_id_(GetNextId(isolate)),
count_id_(GetNextId(isolate)) {}
private:
Token::Value op_;
bool is_prefix_;
bool is_monomorphic_;
Expression* expression_;
int pos_;
int assignment_id_;
int count_id_;
SmallMapList receiver_types_;
};
class CompareOperation: public Expression {
public:
DECLARE_NODE_TYPE(CompareOperation)
Token::Value op() const { return op_; }
Expression* left() const { return left_; }
Expression* right() const { return right_; }
virtual int position() const { return pos_; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsSmiCompare() { return compare_type_ == SMI_ONLY; }
bool IsObjectCompare() { return compare_type_ == OBJECT_ONLY; }
// Match special cases.
bool IsLiteralCompareTypeof(Expression** expr, Handle<String>* check);
bool IsLiteralCompareUndefined(Expression** expr);
bool IsLiteralCompareNull(Expression** expr);
protected:
template<class> friend class AstNodeFactory;
CompareOperation(Isolate* isolate,
Token::Value op,
Expression* left,
Expression* right,
int pos)
: Expression(isolate),
op_(op),
left_(left),
right_(right),
pos_(pos),
compare_type_(NONE) {
ASSERT(Token::IsCompareOp(op));
}
private:
Token::Value op_;
Expression* left_;
Expression* right_;
int pos_;
enum CompareTypeFeedback { NONE, SMI_ONLY, OBJECT_ONLY };
CompareTypeFeedback compare_type_;
};
class Conditional: public Expression {
public:
DECLARE_NODE_TYPE(Conditional)
Expression* condition() const { return condition_; }
Expression* then_expression() const { return then_expression_; }
Expression* else_expression() const { return else_expression_; }
int then_expression_position() const { return then_expression_position_; }
int else_expression_position() const { return else_expression_position_; }
int ThenId() const { return then_id_; }
int ElseId() const { return else_id_; }
protected:
template<class> friend class AstNodeFactory;
Conditional(Isolate* isolate,
Expression* condition,
Expression* then_expression,
Expression* else_expression,
int then_expression_position,
int else_expression_position)
: Expression(isolate),
condition_(condition),
then_expression_(then_expression),
else_expression_(else_expression),
then_expression_position_(then_expression_position),
else_expression_position_(else_expression_position),
then_id_(GetNextId(isolate)),
else_id_(GetNextId(isolate)) { }
private:
Expression* condition_;
Expression* then_expression_;
Expression* else_expression_;
int then_expression_position_;
int else_expression_position_;
int then_id_;
int else_id_;
};
class Assignment: public Expression {
public:
DECLARE_NODE_TYPE(Assignment)
Assignment* AsSimpleAssignment() { return !is_compound() ? this : NULL; }
Token::Value binary_op() const;
Token::Value op() const { return op_; }
Expression* target() const { return target_; }
Expression* value() const { return value_; }
virtual int position() const { return pos_; }
BinaryOperation* binary_operation() const { return binary_operation_; }
// This check relies on the definition order of token in token.h.
bool is_compound() const { return op() > Token::ASSIGN; }
// An initialization block is a series of statments of the form
// x.y.z.a = ...; x.y.z.b = ...; etc. The parser marks the beginning and
// ending of these blocks to allow for optimizations of initialization
// blocks.
bool starts_initialization_block() { return block_start_; }
bool ends_initialization_block() { return block_end_; }
void mark_block_start() { block_start_ = true; }
void mark_block_end() { block_end_ = true; }
// Type feedback information.
void RecordTypeFeedback(TypeFeedbackOracle* oracle);
virtual bool IsMonomorphic() { return is_monomorphic_; }
virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
// Bailout support.
int CompoundLoadId() const { return compound_load_id_; }
int AssignmentId() const { return assignment_id_; }
protected:
template<class> friend class AstNodeFactory;
Assignment(Isolate* isolate,
Token::Value op,
Expression* target,
Expression* value,
int pos);
template<class Visitor>
void Init(Isolate* isolate, AstNodeFactory<Visitor>* factory) {
ASSERT(Token::IsAssignmentOp(op_));
if (is_compound()) {
binary_operation_ =
factory->NewBinaryOperation(binary_op(), target_, value_, pos_ + 1);
compound_load_id_ = GetNextId(isolate);
}
}
private:
Token::Value op_;
Expression* target_;
Expression* value_;
int pos_;
BinaryOperation* binary_operation_;
int compound_load_id_;
int assignment_id_;
bool block_start_;
bool block_end_;
bool is_monomorphic_;
SmallMapList receiver_types_;
};
class Throw: public Expression {
public:
DECLARE_NODE_TYPE(Throw)
Expression* exception() const { return exception_; }
virtual int position() const { return pos_; }
protected:
template<class> friend class AstNodeFactory;
Throw(Isolate* isolate, Expression* exception, int pos)
: Expression(isolate), exception_(exception), pos_(pos) {}
private:
Expression* exception_;
int pos_;
};
class FunctionLiteral: public Expression {
public:
enum Type {
ANONYMOUS_EXPRESSION,
NAMED_EXPRESSION,
DECLARATION
};
enum ParameterFlag {
kNoDuplicateParameters = 0,
kHasDuplicateParameters = 1
};
enum IsFunctionFlag {
kGlobalOrEval,
kIsFunction
};
DECLARE_NODE_TYPE(FunctionLiteral)
Handle<String> name() const { return name_; }
Scope* scope() const { return scope_; }
ZoneList<Statement*>* body() const { return body_; }
void set_function_token_position(int pos) { function_token_position_ = pos; }
int function_token_position() const { return function_token_position_; }
int start_position() const;
int end_position() const;
int SourceSize() const { return end_position() - start_position(); }
bool is_expression() const { return IsExpression::decode(bitfield_); }
bool is_anonymous() const { return IsAnonymous::decode(bitfield_); }
bool is_classic_mode() const { return language_mode() == CLASSIC_MODE; }
LanguageMode language_mode() const;
int materialized_literal_count() { return materialized_literal_count_; }
int expected_property_count() { return expected_property_count_; }
int handler_count() { return handler_count_; }
bool has_only_simple_this_property_assignments() {
return HasOnlySimpleThisPropertyAssignments::decode(bitfield_);
}
Handle<FixedArray> this_property_assignments() {
return this_property_assignments_;
}
int parameter_count() { return parameter_count_; }
bool AllowsLazyCompilation();
Handle<String> debug_name() const {
if (name_->length() > 0) return name_;
return inferred_name();
}
Handle<String> inferred_name() const { return inferred_name_; }
void set_inferred_name(Handle<String> inferred_name) {
inferred_name_ = inferred_name;
}
bool pretenure() { return Pretenure::decode(bitfield_); }
void set_pretenure() { bitfield_ |= Pretenure::encode(true); }
bool has_duplicate_parameters() {
return HasDuplicateParameters::decode(bitfield_);
}
bool is_function() { return IsFunction::decode(bitfield_) == kIsFunction; }
int ast_node_count() { return ast_properties_.node_count(); }
AstProperties::Flags* flags() { return ast_properties_.flags(); }
void set_ast_properties(AstProperties* ast_properties) {
ast_properties_ = *ast_properties;
}
protected:
template<class> friend class AstNodeFactory;
FunctionLiteral(Isolate* isolate,
Handle<String> name,
Scope* scope,
ZoneList<Statement*>* body,
int materialized_literal_count,
int expected_property_count,
int handler_count,
bool has_only_simple_this_property_assignments,
Handle<FixedArray> this_property_assignments,
int parameter_count,
Type type,
ParameterFlag has_duplicate_parameters,
IsFunctionFlag is_function)
: Expression(isolate),
name_(name),
scope_(scope),
body_(body),
this_property_assignments_(this_property_assignments),
inferred_name_(isolate->factory()->empty_string()),
materialized_literal_count_(materialized_literal_count),
expected_property_count_(expected_property_count),
handler_count_(handler_count),
parameter_count_(parameter_count),
function_token_position_(RelocInfo::kNoPosition) {
bitfield_ =
HasOnlySimpleThisPropertyAssignments::encode(
has_only_simple_this_property_assignments) |
IsExpression::encode(type != DECLARATION) |
IsAnonymous::encode(type == ANONYMOUS_EXPRESSION) |
Pretenure::encode(false) |
HasDuplicateParameters::encode(has_duplicate_parameters) |
IsFunction::encode(is_function);
}
private:
Handle<String> name_;
Scope* scope_;
ZoneList<Statement*>* body_;
Handle<FixedArray> this_property_assignments_;
Handle<String> inferred_name_;
AstProperties ast_properties_;
int materialized_literal_count_;
int expected_property_count_;
int handler_count_;
int parameter_count_;
int function_token_position_;
unsigned bitfield_;
class HasOnlySimpleThisPropertyAssignments: public BitField<bool, 0, 1> {};
class IsExpression: public BitField<bool, 1, 1> {};
class IsAnonymous: public BitField<bool, 2, 1> {};
class Pretenure: public BitField<bool, 3, 1> {};
class HasDuplicateParameters: public BitField<ParameterFlag, 4, 1> {};
class IsFunction: public BitField<IsFunctionFlag, 5, 1> {};
};
class SharedFunctionInfoLiteral: public Expression {
public:
DECLARE_NODE_TYPE(SharedFunctionInfoLiteral)
Handle<SharedFunctionInfo> shared_function_info() const {
return shared_function_info_;
}
protected:
template<class> friend class AstNodeFactory;
SharedFunctionInfoLiteral(
Isolate* isolate,
Handle<SharedFunctionInfo> shared_function_info)
: Expression(isolate),
shared_function_info_(shared_function_info) { }
private:
Handle<SharedFunctionInfo> shared_function_info_;
};
class ThisFunction: public Expression {
public:
DECLARE_NODE_TYPE(ThisFunction)
protected:
template<class> friend class AstNodeFactory;
explicit ThisFunction(Isolate* isolate): Expression(isolate) {}
};
#undef DECLARE_NODE_TYPE
// ----------------------------------------------------------------------------
// Regular expressions
class RegExpVisitor BASE_EMBEDDED {
public:
virtual ~RegExpVisitor() { }
#define MAKE_CASE(Name) \
virtual void* Visit##Name(RegExp##Name*, void* data) = 0;
FOR_EACH_REG_EXP_TREE_TYPE(MAKE_CASE)
#undef MAKE_CASE
};
class RegExpTree: public ZoneObject {
public:
static const int kInfinity = kMaxInt;
virtual ~RegExpTree() { }
virtual void* Accept(RegExpVisitor* visitor, void* data) = 0;
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success) = 0;
virtual bool IsTextElement() { return false; }
virtual bool IsAnchoredAtStart() { return false; }
virtual bool IsAnchoredAtEnd() { return false; }
virtual int min_match() = 0;
virtual int max_match() = 0;
// Returns the interval of registers used for captures within this
// expression.
virtual Interval CaptureRegisters() { return Interval::Empty(); }
virtual void AppendToText(RegExpText* text);
SmartArrayPointer<const char> ToString();
#define MAKE_ASTYPE(Name) \
virtual RegExp##Name* As##Name(); \
virtual bool Is##Name();
FOR_EACH_REG_EXP_TREE_TYPE(MAKE_ASTYPE)
#undef MAKE_ASTYPE
};
class RegExpDisjunction: public RegExpTree {
public:
explicit RegExpDisjunction(ZoneList<RegExpTree*>* alternatives);
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpDisjunction* AsDisjunction();
virtual Interval CaptureRegisters();
virtual bool IsDisjunction();
virtual bool IsAnchoredAtStart();
virtual bool IsAnchoredAtEnd();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
private:
ZoneList<RegExpTree*>* alternatives_;
int min_match_;
int max_match_;
};
class RegExpAlternative: public RegExpTree {
public:
explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes);
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpAlternative* AsAlternative();
virtual Interval CaptureRegisters();
virtual bool IsAlternative();
virtual bool IsAnchoredAtStart();
virtual bool IsAnchoredAtEnd();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
ZoneList<RegExpTree*>* nodes() { return nodes_; }
private:
ZoneList<RegExpTree*>* nodes_;
int min_match_;
int max_match_;
};
class RegExpAssertion: public RegExpTree {
public:
enum Type {
START_OF_LINE,
START_OF_INPUT,
END_OF_LINE,
END_OF_INPUT,
BOUNDARY,
NON_BOUNDARY
};
explicit RegExpAssertion(Type type) : type_(type) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpAssertion* AsAssertion();
virtual bool IsAssertion();
virtual bool IsAnchoredAtStart();
virtual bool IsAnchoredAtEnd();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
Type type() { return type_; }
private:
Type type_;
};
class CharacterSet BASE_EMBEDDED {
public:
explicit CharacterSet(uc16 standard_set_type)
: ranges_(NULL),
standard_set_type_(standard_set_type) {}
explicit CharacterSet(ZoneList<CharacterRange>* ranges)
: ranges_(ranges),
standard_set_type_(0) {}
ZoneList<CharacterRange>* ranges();
uc16 standard_set_type() { return standard_set_type_; }
void set_standard_set_type(uc16 special_set_type) {
standard_set_type_ = special_set_type;
}
bool is_standard() { return standard_set_type_ != 0; }
void Canonicalize();
private:
ZoneList<CharacterRange>* ranges_;
// If non-zero, the value represents a standard set (e.g., all whitespace
// characters) without having to expand the ranges.
uc16 standard_set_type_;
};
class RegExpCharacterClass: public RegExpTree {
public:
RegExpCharacterClass(ZoneList<CharacterRange>* ranges, bool is_negated)
: set_(ranges),
is_negated_(is_negated) { }
explicit RegExpCharacterClass(uc16 type)
: set_(type),
is_negated_(false) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpCharacterClass* AsCharacterClass();
virtual bool IsCharacterClass();
virtual bool IsTextElement() { return true; }
virtual int min_match() { return 1; }
virtual int max_match() { return 1; }
virtual void AppendToText(RegExpText* text);
CharacterSet character_set() { return set_; }
// TODO(lrn): Remove need for complex version if is_standard that
// recognizes a mangled standard set and just do { return set_.is_special(); }
bool is_standard();
// Returns a value representing the standard character set if is_standard()
// returns true.
// Currently used values are:
// s : unicode whitespace
// S : unicode non-whitespace
// w : ASCII word character (digit, letter, underscore)
// W : non-ASCII word character
// d : ASCII digit
// D : non-ASCII digit
// . : non-unicode non-newline
// * : All characters
uc16 standard_type() { return set_.standard_set_type(); }
ZoneList<CharacterRange>* ranges() { return set_.ranges(); }
bool is_negated() { return is_negated_; }
private:
CharacterSet set_;
bool is_negated_;
};
class RegExpAtom: public RegExpTree {
public:
explicit RegExpAtom(Vector<const uc16> data) : data_(data) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpAtom* AsAtom();
virtual bool IsAtom();
virtual bool IsTextElement() { return true; }
virtual int min_match() { return data_.length(); }
virtual int max_match() { return data_.length(); }
virtual void AppendToText(RegExpText* text);
Vector<const uc16> data() { return data_; }
int length() { return data_.length(); }
private:
Vector<const uc16> data_;
};
class RegExpText: public RegExpTree {
public:
RegExpText() : elements_(2), length_(0) {}
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpText* AsText();
virtual bool IsText();
virtual bool IsTextElement() { return true; }
virtual int min_match() { return length_; }
virtual int max_match() { return length_; }
virtual void AppendToText(RegExpText* text);
void AddElement(TextElement elm) {
elements_.Add(elm);
length_ += elm.length();
}
ZoneList<TextElement>* elements() { return &elements_; }
private:
ZoneList<TextElement> elements_;
int length_;
};
class RegExpQuantifier: public RegExpTree {
public:
enum Type { GREEDY, NON_GREEDY, POSSESSIVE };
RegExpQuantifier(int min, int max, Type type, RegExpTree* body)
: body_(body),
min_(min),
max_(max),
min_match_(min * body->min_match()),
type_(type) {
if (max > 0 && body->max_match() > kInfinity / max) {
max_match_ = kInfinity;
} else {
max_match_ = max * body->max_match();
}
}
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
static RegExpNode* ToNode(int min,
int max,
bool is_greedy,
RegExpTree* body,
RegExpCompiler* compiler,
RegExpNode* on_success,
bool not_at_start = false);
virtual RegExpQuantifier* AsQuantifier();
virtual Interval CaptureRegisters();
virtual bool IsQuantifier();
virtual int min_match() { return min_match_; }
virtual int max_match() { return max_match_; }
int min() { return min_; }
int max() { return max_; }
bool is_possessive() { return type_ == POSSESSIVE; }
bool is_non_greedy() { return type_ == NON_GREEDY; }
bool is_greedy() { return type_ == GREEDY; }
RegExpTree* body() { return body_; }
private:
RegExpTree* body_;
int min_;
int max_;
int min_match_;
int max_match_;
Type type_;
};
class RegExpCapture: public RegExpTree {
public:
explicit RegExpCapture(RegExpTree* body, int index)
: body_(body), index_(index) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
static RegExpNode* ToNode(RegExpTree* body,
int index,
RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpCapture* AsCapture();
virtual bool IsAnchoredAtStart();
virtual bool IsAnchoredAtEnd();
virtual Interval CaptureRegisters();
virtual bool IsCapture();
virtual int min_match() { return body_->min_match(); }
virtual int max_match() { return body_->max_match(); }
RegExpTree* body() { return body_; }
int index() { return index_; }
static int StartRegister(int index) { return index * 2; }
static int EndRegister(int index) { return index * 2 + 1; }
private:
RegExpTree* body_;
int index_;
};
class RegExpLookahead: public RegExpTree {
public:
RegExpLookahead(RegExpTree* body,
bool is_positive,
int capture_count,
int capture_from)
: body_(body),
is_positive_(is_positive),
capture_count_(capture_count),
capture_from_(capture_from) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpLookahead* AsLookahead();
virtual Interval CaptureRegisters();
virtual bool IsLookahead();
virtual bool IsAnchoredAtStart();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
RegExpTree* body() { return body_; }
bool is_positive() { return is_positive_; }
int capture_count() { return capture_count_; }
int capture_from() { return capture_from_; }
private:
RegExpTree* body_;
bool is_positive_;
int capture_count_;
int capture_from_;
};
class RegExpBackReference: public RegExpTree {
public:
explicit RegExpBackReference(RegExpCapture* capture)
: capture_(capture) { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpBackReference* AsBackReference();
virtual bool IsBackReference();
virtual int min_match() { return 0; }
virtual int max_match() { return capture_->max_match(); }
int index() { return capture_->index(); }
RegExpCapture* capture() { return capture_; }
private:
RegExpCapture* capture_;
};
class RegExpEmpty: public RegExpTree {
public:
RegExpEmpty() { }
virtual void* Accept(RegExpVisitor* visitor, void* data);
virtual RegExpNode* ToNode(RegExpCompiler* compiler,
RegExpNode* on_success);
virtual RegExpEmpty* AsEmpty();
virtual bool IsEmpty();
virtual int min_match() { return 0; }
virtual int max_match() { return 0; }
static RegExpEmpty* GetInstance() {
static RegExpEmpty* instance = ::new RegExpEmpty();
return instance;
}
};
// ----------------------------------------------------------------------------
// Out-of-line inline constructors (to side-step cyclic dependencies).
inline ModuleVariable::ModuleVariable(VariableProxy* proxy)
: Module(proxy->interface()),
proxy_(proxy) {
}
// ----------------------------------------------------------------------------
// Basic visitor
// - leaf node visitors are abstract.
class AstVisitor BASE_EMBEDDED {
public:
AstVisitor() : isolate_(Isolate::Current()), stack_overflow_(false) { }
virtual ~AstVisitor() { }
// Stack overflow check and dynamic dispatch.
void Visit(AstNode* node) { if (!CheckStackOverflow()) node->Accept(this); }
// Iteration left-to-right.
virtual void VisitDeclarations(ZoneList<Declaration*>* declarations);
virtual void VisitStatements(ZoneList<Statement*>* statements);
virtual void VisitExpressions(ZoneList<Expression*>* expressions);
// Stack overflow tracking support.
bool HasStackOverflow() const { return stack_overflow_; }
bool CheckStackOverflow();
// If a stack-overflow exception is encountered when visiting a
// node, calling SetStackOverflow will make sure that the visitor
// bails out without visiting more nodes.
void SetStackOverflow() { stack_overflow_ = true; }
void ClearStackOverflow() { stack_overflow_ = false; }
// Individual AST nodes.
#define DEF_VISIT(type) \
virtual void Visit##type(type* node) = 0;
AST_NODE_LIST(DEF_VISIT)
#undef DEF_VISIT
protected:
Isolate* isolate() { return isolate_; }
private:
Isolate* isolate_;
bool stack_overflow_;
};
// ----------------------------------------------------------------------------
// Construction time visitor.
class AstConstructionVisitor BASE_EMBEDDED {
public:
AstConstructionVisitor() { }
AstProperties* ast_properties() { return &properties_; }
private:
template<class> friend class AstNodeFactory;
// Node visitors.
#define DEF_VISIT(type) \
void Visit##type(type* node);
AST_NODE_LIST(DEF_VISIT)
#undef DEF_VISIT
void increase_node_count() { properties_.add_node_count(1); }
void add_flag(AstPropertiesFlag flag) { properties_.flags()->Add(flag); }
AstProperties properties_;
};
class AstNullVisitor BASE_EMBEDDED {
public:
// Node visitors.
#define DEF_VISIT(type) \
void Visit##type(type* node) {}
AST_NODE_LIST(DEF_VISIT)
#undef DEF_VISIT
};
// ----------------------------------------------------------------------------
// AstNode factory
template<class Visitor>
class AstNodeFactory BASE_EMBEDDED {
public:
explicit AstNodeFactory(Isolate* isolate)
: isolate_(isolate),
zone_(isolate_->zone()) { }
Visitor* visitor() { return &visitor_; }
#define VISIT_AND_RETURN(NodeType, node) \
visitor_.Visit##NodeType((node)); \
return node;
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
VariableMode mode,
Scope* scope) {
VariableDeclaration* decl =
new(zone_) VariableDeclaration(proxy, mode, scope);
VISIT_AND_RETURN(VariableDeclaration, decl)
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
VariableMode mode,
FunctionLiteral* fun,
Scope* scope) {
FunctionDeclaration* decl =
new(zone_) FunctionDeclaration(proxy, mode, fun, scope);
VISIT_AND_RETURN(FunctionDeclaration, decl)
}
ModuleDeclaration* NewModuleDeclaration(VariableProxy* proxy,
Module* module,
Scope* scope) {
ModuleDeclaration* decl =
new(zone_) ModuleDeclaration(proxy, module, scope);
VISIT_AND_RETURN(ModuleDeclaration, decl)
}
ImportDeclaration* NewImportDeclaration(VariableProxy* proxy,
Module* module,
Scope* scope) {
ImportDeclaration* decl =
new(zone_) ImportDeclaration(proxy, module, scope);
VISIT_AND_RETURN(ImportDeclaration, decl)
}
ExportDeclaration* NewExportDeclaration(VariableProxy* proxy,
Scope* scope) {
ExportDeclaration* decl =
new(zone_) ExportDeclaration(proxy, scope);
VISIT_AND_RETURN(ExportDeclaration, decl)
}
ModuleLiteral* NewModuleLiteral(Block* body, Interface* interface) {
ModuleLiteral* module = new(zone_) ModuleLiteral(body, interface);
VISIT_AND_RETURN(ModuleLiteral, module)
}
ModuleVariable* NewModuleVariable(VariableProxy* proxy) {
ModuleVariable* module = new(zone_) ModuleVariable(proxy);
VISIT_AND_RETURN(ModuleVariable, module)
}
ModulePath* NewModulePath(Module* origin, Handle<String> name) {
ModulePath* module = new(zone_) ModulePath(origin, name);
VISIT_AND_RETURN(ModulePath, module)
}
ModuleUrl* NewModuleUrl(Handle<String> url) {
ModuleUrl* module = new(zone_) ModuleUrl(url);
VISIT_AND_RETURN(ModuleUrl, module)
}
Block* NewBlock(ZoneStringList* labels,
int capacity,
bool is_initializer_block) {
Block* block = new(zone_) Block(
isolate_, labels, capacity, is_initializer_block);
VISIT_AND_RETURN(Block, block)
}
#define STATEMENT_WITH_LABELS(NodeType) \
NodeType* New##NodeType(ZoneStringList* labels) { \
NodeType* stmt = new(zone_) NodeType(isolate_, labels); \
VISIT_AND_RETURN(NodeType, stmt); \
}
STATEMENT_WITH_LABELS(DoWhileStatement)
STATEMENT_WITH_LABELS(WhileStatement)
STATEMENT_WITH_LABELS(ForStatement)
STATEMENT_WITH_LABELS(ForInStatement)
STATEMENT_WITH_LABELS(SwitchStatement)
#undef STATEMENT_WITH_LABELS
ExpressionStatement* NewExpressionStatement(Expression* expression) {
ExpressionStatement* stmt = new(zone_) ExpressionStatement(expression);
VISIT_AND_RETURN(ExpressionStatement, stmt)
}
ContinueStatement* NewContinueStatement(IterationStatement* target) {
ContinueStatement* stmt = new(zone_) ContinueStatement(target);
VISIT_AND_RETURN(ContinueStatement, stmt)
}
BreakStatement* NewBreakStatement(BreakableStatement* target) {
BreakStatement* stmt = new(zone_) BreakStatement(target);
VISIT_AND_RETURN(BreakStatement, stmt)
}
ReturnStatement* NewReturnStatement(Expression* expression) {
ReturnStatement* stmt = new(zone_) ReturnStatement(expression);
VISIT_AND_RETURN(ReturnStatement, stmt)
}
WithStatement* NewWithStatement(Expression* expression,
Statement* statement) {
WithStatement* stmt = new(zone_) WithStatement(expression, statement);
VISIT_AND_RETURN(WithStatement, stmt)
}
IfStatement* NewIfStatement(Expression* condition,
Statement* then_statement,
Statement* else_statement) {
IfStatement* stmt = new(zone_) IfStatement(
isolate_, condition, then_statement, else_statement);
VISIT_AND_RETURN(IfStatement, stmt)
}
TryCatchStatement* NewTryCatchStatement(int index,
Block* try_block,
Scope* scope,
Variable* variable,
Block* catch_block) {
TryCatchStatement* stmt = new(zone_) TryCatchStatement(
index, try_block, scope, variable, catch_block);
VISIT_AND_RETURN(TryCatchStatement, stmt)
}
TryFinallyStatement* NewTryFinallyStatement(int index,
Block* try_block,
Block* finally_block) {
TryFinallyStatement* stmt =
new(zone_) TryFinallyStatement(index, try_block, finally_block);
VISIT_AND_RETURN(TryFinallyStatement, stmt)
}
DebuggerStatement* NewDebuggerStatement() {
DebuggerStatement* stmt = new(zone_) DebuggerStatement();
VISIT_AND_RETURN(DebuggerStatement, stmt)
}
EmptyStatement* NewEmptyStatement() {
return new(zone_) EmptyStatement();
}
Literal* NewLiteral(Handle<Object> handle) {
Literal* lit = new(zone_) Literal(isolate_, handle);
VISIT_AND_RETURN(Literal, lit)
}
Literal* NewNumberLiteral(double number) {
return NewLiteral(isolate_->factory()->NewNumber(number, TENURED));
}
ObjectLiteral* NewObjectLiteral(
Handle<FixedArray> constant_properties,
ZoneList<ObjectLiteral::Property*>* properties,
int literal_index,
bool is_simple,
bool fast_elements,
int depth,
bool has_function) {
ObjectLiteral* lit = new(zone_) ObjectLiteral(
isolate_, constant_properties, properties, literal_index,
is_simple, fast_elements, depth, has_function);
VISIT_AND_RETURN(ObjectLiteral, lit)
}
ObjectLiteral::Property* NewObjectLiteralProperty(bool is_getter,
FunctionLiteral* value) {
ObjectLiteral::Property* prop =
new(zone_) ObjectLiteral::Property(is_getter, value);
prop->set_key(NewLiteral(value->name()));
return prop; // Not an AST node, will not be visited.
}
RegExpLiteral* NewRegExpLiteral(Handle<String> pattern,
Handle<String> flags,
int literal_index) {
RegExpLiteral* lit =
new(zone_) RegExpLiteral(isolate_, pattern, flags, literal_index);
VISIT_AND_RETURN(RegExpLiteral, lit);
}
ArrayLiteral* NewArrayLiteral(Handle<FixedArray> constant_elements,
ZoneList<Expression*>* values,
int literal_index,
bool is_simple,
int depth) {
ArrayLiteral* lit = new(zone_) ArrayLiteral(
isolate_, constant_elements, values, literal_index, is_simple, depth);
VISIT_AND_RETURN(ArrayLiteral, lit)
}
VariableProxy* NewVariableProxy(Variable* var) {
VariableProxy* proxy = new(zone_) VariableProxy(isolate_, var);
VISIT_AND_RETURN(VariableProxy, proxy)
}
VariableProxy* NewVariableProxy(Handle<String> name,
bool is_this,
int position = RelocInfo::kNoPosition,
Interface* interface =
Interface::NewValue()) {
VariableProxy* proxy =
new(zone_) VariableProxy(isolate_, name, is_this, position, interface);
VISIT_AND_RETURN(VariableProxy, proxy)
}
Property* NewProperty(Expression* obj, Expression* key, int pos) {
Property* prop = new(zone_) Property(isolate_, obj, key, pos);
VISIT_AND_RETURN(Property, prop)
}
Call* NewCall(Expression* expression,
ZoneList<Expression*>* arguments,
int pos) {
Call* call = new(zone_) Call(isolate_, expression, arguments, pos);
VISIT_AND_RETURN(Call, call)
}
CallNew* NewCallNew(Expression* expression,
ZoneList<Expression*>* arguments,
int pos) {
CallNew* call = new(zone_) CallNew(isolate_, expression, arguments, pos);
VISIT_AND_RETURN(CallNew, call)
}
CallRuntime* NewCallRuntime(Handle<String> name,
const Runtime::Function* function,
ZoneList<Expression*>* arguments) {
CallRuntime* call =
new(zone_) CallRuntime(isolate_, name, function, arguments);
VISIT_AND_RETURN(CallRuntime, call)
}
UnaryOperation* NewUnaryOperation(Token::Value op,
Expression* expression,
int pos) {
UnaryOperation* node =
new(zone_) UnaryOperation(isolate_, op, expression, pos);
VISIT_AND_RETURN(UnaryOperation, node)
}
BinaryOperation* NewBinaryOperation(Token::Value op,
Expression* left,
Expression* right,
int pos) {
BinaryOperation* node =
new(zone_) BinaryOperation(isolate_, op, left, right, pos);
VISIT_AND_RETURN(BinaryOperation, node)
}
CountOperation* NewCountOperation(Token::Value op,
bool is_prefix,
Expression* expr,
int pos) {
CountOperation* node =
new(zone_) CountOperation(isolate_, op, is_prefix, expr, pos);
VISIT_AND_RETURN(CountOperation, node)
}
CompareOperation* NewCompareOperation(Token::Value op,
Expression* left,
Expression* right,
int pos) {
CompareOperation* node =
new(zone_) CompareOperation(isolate_, op, left, right, pos);
VISIT_AND_RETURN(CompareOperation, node)
}
Conditional* NewConditional(Expression* condition,
Expression* then_expression,
Expression* else_expression,
int then_expression_position,
int else_expression_position) {
Conditional* cond = new(zone_) Conditional(
isolate_, condition, then_expression, else_expression,
then_expression_position, else_expression_position);
VISIT_AND_RETURN(Conditional, cond)
}
Assignment* NewAssignment(Token::Value op,
Expression* target,
Expression* value,
int pos) {
Assignment* assign =
new(zone_) Assignment(isolate_, op, target, value, pos);
assign->Init(isolate_, this);
VISIT_AND_RETURN(Assignment, assign)
}
Throw* NewThrow(Expression* exception, int pos) {
Throw* t = new(zone_) Throw(isolate_, exception, pos);
VISIT_AND_RETURN(Throw, t)
}
FunctionLiteral* NewFunctionLiteral(
Handle<String> name,
Scope* scope,
ZoneList<Statement*>* body,
int materialized_literal_count,
int expected_property_count,
int handler_count,
bool has_only_simple_this_property_assignments,
Handle<FixedArray> this_property_assignments,
int parameter_count,
FunctionLiteral::ParameterFlag has_duplicate_parameters,
FunctionLiteral::Type type,
FunctionLiteral::IsFunctionFlag is_function) {
FunctionLiteral* lit = new(zone_) FunctionLiteral(
isolate_, name, scope, body,
materialized_literal_count, expected_property_count, handler_count,
has_only_simple_this_property_assignments, this_property_assignments,
parameter_count, type, has_duplicate_parameters, is_function);
// Top-level literal doesn't count for the AST's properties.
if (is_function == FunctionLiteral::kIsFunction) {
visitor_.VisitFunctionLiteral(lit);
}
return lit;
}
SharedFunctionInfoLiteral* NewSharedFunctionInfoLiteral(
Handle<SharedFunctionInfo> shared_function_info) {
SharedFunctionInfoLiteral* lit =
new(zone_) SharedFunctionInfoLiteral(isolate_, shared_function_info);
VISIT_AND_RETURN(SharedFunctionInfoLiteral, lit)
}
ThisFunction* NewThisFunction() {
ThisFunction* fun = new(zone_) ThisFunction(isolate_);
VISIT_AND_RETURN(ThisFunction, fun)
}
#undef VISIT_AND_RETURN
private:
Isolate* isolate_;
Zone* zone_;
Visitor visitor_;
};
} } // namespace v8::internal
#endif // V8_AST_H_
| mogoweb/webkit_for_android5.1 | v8/src/ast.h | C | apache-2.0 | 87,732 |
//
// MyScrollView.h
// MITMObjectSample
//
// Created by Георгий Малюков on 23.08.15.
// Copyright (c) 2015 Georgiy Malyukov. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MyScrollView : UIScrollView {
}
@end
| NRGRepo/MITMObject | Samples/MITMObjectSample/MITMObjectSample/Classes/View/MyScrollView.h | C | apache-2.0 | 250 |
/**
* Appcelerator Kroll - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved.
*/
#ifndef _APPLICATION_BINDING_H_
#define _APPLICATION_BINDING_H_
#include <kroll/kroll.h>
#include <map>
#include <vector>
#include <string>
namespace kroll
{
class ApplicationBinding : public KAccessorObject
{
public:
ApplicationBinding(SharedApplication application, bool current = false);
private:
SharedApplication application;
bool current;
void _GetID(const ValueList& args, KValueRef value);
void _GetGUID(const ValueList& args, KValueRef value);
void _GetName(const ValueList& args, KValueRef result);
void _GetVersion(const ValueList& args, KValueRef value);
void _GetPath(const ValueList& args, KValueRef value);
void _GetExecutablePath(const ValueList& args, KValueRef value);
void _GetResourcesPath(const ValueList& args, KValueRef value);
void _GetDataPath(const ValueList& args, KValueRef value);
void _GetManifestPath(const ValueList& args, KValueRef value);
void _GetManifest(const ValueList& args, KValueRef value);
void _GetProperties(const ValueList& args, KValueRef value);
void _IsCurrent(const ValueList& args, KValueRef value);
void _GetPID(const ValueList& args, KValueRef value);
void _GetArguments(const ValueList& args, KValueRef value);
void _HasArgument(const ValueList& args, KValueRef value);
void _GetArgumentValue(const ValueList& args, KValueRef value);
void _GetDependencies(const ValueList& args, KValueRef value);
void _ResolveDependencies(const ValueList& args, KValueRef value);
void _GetComponents(const ValueList& args, KValueRef value);
void _GetModules(const ValueList& args, KValueRef value);
void _GetRuntime(const ValueList& args, KValueRef value);
void _GetAvailableComponents(const ValueList& args, KValueRef value);
void _GetAvailableModules(const ValueList& args, KValueRef value);
void _GetAvailableRuntimes(const ValueList& args, KValueRef value);
void _GetBundledComponents(const ValueList& args, KValueRef value);
void _GetBundledModules(const ValueList& args, KValueRef value);
void _GetBundledRuntimes(const ValueList& args, KValueRef value);
};
}
#endif
| mital/kroll | modules/api/application_binding.h | C | apache-2.0 | 2,282 |
--TEST--
swoole_server: max_request
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
use Swoole\Coroutine\Client;
use Swoole\Timer;
use Swoole\Event;
use Swoole\Server;
$pm = new SwooleTest\ProcessManager;
$counter = new swoole_atomic();
$pm->parentFunc = function ($pid) use ($pm) {
go(function () use ($pm) {
$client = new Client(SWOOLE_SOCK_TCP);
$client->set([
"open_eof_check" => true,
"open_eof_split" => true,
"package_eof" => "\r\n\r\n",
]);
$r = $client->connect('127.0.0.1', $pm->getFreePort(), -1);
if ($r === false) {
echo "ERROR";
exit;
}
for ($i = 0; $i < 4000; $i++) {
$data = "PKG-$i" . str_repeat('A', rand(100, 20000)) . "\r\n\r\n";
if ($client->send($data) === false) {
echo "send error\n";
break;
}
$ret = $client->recv();
Assert::same(strlen($ret), strlen($data) + 8);
}
$client->close();
});
Event::wait();
global $counter;
Assert::assert($counter->get() > 10);
swoole_process::kill($pid);
};
$pm->childFunc = function () use ($pm)
{
$serv = new Server('127.0.0.1', $pm->getFreePort());
$serv->set([
"worker_num" => 4,
'dispatch_mode' => 1,
"open_eof_split" => true,
"package_eof" => "\r\n\r\n",
'max_request' => 200,
'log_file' => '/dev/null',
]);
$serv->on("WorkerStart", function (Server $serv) use ($pm)
{
global $counter;
$counter->add(1);
$pm->wakeup();
});
$serv->on("Receive", function (Server $serv, $fd, $reactorId, $data)
{
$serv->send($fd, "Server: $data");
});
$serv->start();
};
$pm->childFirst();
$pm->run();
?>
--EXPECT--
| eaglewu/swoole | tests/swoole_server/max_request.phpt | PHP | apache-2.0 | 1,914 |
package fm.http.server
import scala.concurrent.{ExecutionContext, Future}
final class FilteredRequestRouterAndHandler(routerAndHandler: RequestRouterAndHandler, filter: RequestFilter) extends RequestRouterAndHandler {
final override def lookup(request: Request): Option[RequestHandler] = {
routerAndHandler.lookup(request).map{ _.withFilter(filter) }
}
final override def apply(request: Request)(implicit executor: ExecutionContext): Future[Response] = {
filter.handle(request, routerAndHandler)
}
override def beforeStartup(): Unit = routerAndHandler.beforeStartup()
override def afterStartup(): Unit = routerAndHandler.afterStartup()
override def beforeShutdown(): Unit = routerAndHandler.beforeShutdown()
override def afterShutdown(): Unit = routerAndHandler.afterShutdown()
}
| frugalmechanic/fm-http | src/main/scala/fm/http/server/FilteredRequestRouterAndHandler.scala | Scala | apache-2.0 | 809 |
/**
* Copyright 2016 StreamSets Inc.
*
* Licensed under 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 com.streamsets.pipeline.stage.destination.rabbitmq;
import com.streamsets.pipeline.api.Label;
public enum Priority implements Label{
ZERO("0", 0),
ONE("1", 1),
TWO("2", 2),
THREE("3", 3),
FOUR("4", 4),
FIVE("5", 5),
SIX("6", 6),
SEVEN("7", 7),
EIGHT("8", 8),
NINE("9", 9)
;
private String label;
private int priority;
Priority(String label, int priority) {
this.label = label;
this.priority = priority;
}
@Override
public String getLabel() {
return this.label;
}
public int getPriority() {
return this.priority;
}
}
| studanshu/datacollector | rabbitmq-lib/src/main/java/com/streamsets/pipeline/stage/destination/rabbitmq/Priority.java | Java | apache-2.0 | 1,434 |
/*
* Copyright (C) 2015 Square, 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 keywhiz.service.daos;
import com.google.common.collect.ImmutableSet;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import javax.inject.Inject;
import keywhiz.api.model.Client;
import keywhiz.api.model.Group;
import keywhiz.api.model.SanitizedSecret;
import keywhiz.api.model.Secret;
import keywhiz.api.model.SecretContent;
import keywhiz.api.model.SecretSeries;
import keywhiz.api.model.SecretSeriesAndContent;
import keywhiz.jooq.tables.records.SecretsRecord;
import keywhiz.service.config.Readonly;
import keywhiz.service.daos.ClientDAO.ClientDAOFactory;
import keywhiz.service.daos.GroupDAO.GroupDAOFactory;
import keywhiz.service.daos.SecretContentDAO.SecretContentDAOFactory;
import keywhiz.service.daos.SecretSeriesDAO.SecretSeriesDAOFactory;
import org.jooq.Configuration;
import org.jooq.DSLContext;
import org.jooq.impl.DSL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.lang.String.format;
import static keywhiz.jooq.tables.Accessgrants.ACCESSGRANTS;
import static keywhiz.jooq.tables.Clients.CLIENTS;
import static keywhiz.jooq.tables.Groups.GROUPS;
import static keywhiz.jooq.tables.Memberships.MEMBERSHIPS;
import static keywhiz.jooq.tables.Secrets.SECRETS;
import static keywhiz.jooq.tables.SecretsContent.SECRETS_CONTENT;
public class AclDAO {
private static final Logger logger = LoggerFactory.getLogger(AclDAO.class);
private final DSLContext dslContext;
private final ClientDAOFactory clientDAOFactory;
private final GroupDAOFactory groupDAOFactory;
private final SecretContentDAOFactory secretContentDAOFactory;
private final SecretSeriesDAOFactory secretSeriesDAOFactory;
private final ClientMapper clientMapper;
private final GroupMapper groupMapper;
private final SecretSeriesMapper secretSeriesMapper;
private AclDAO(DSLContext dslContext, ClientDAOFactory clientDAOFactory,
GroupDAOFactory groupDAOFactory, SecretContentDAOFactory secretContentDAOFactory,
SecretSeriesDAOFactory secretSeriesDAOFactory, ClientMapper clientMapper,
GroupMapper groupMapper, SecretSeriesMapper secretSeriesMapper) {
this.dslContext = dslContext;
this.clientDAOFactory = clientDAOFactory;
this.groupDAOFactory = groupDAOFactory;
this.secretContentDAOFactory = secretContentDAOFactory;
this.secretSeriesDAOFactory = secretSeriesDAOFactory;
this.clientMapper = clientMapper;
this.groupMapper = groupMapper;
this.secretSeriesMapper = secretSeriesMapper;
}
public void findAndAllowAccess(long secretId, long groupId) {
dslContext.transaction(configuration -> {
GroupDAO groupDAO = groupDAOFactory.using(configuration);
SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(configuration);
Optional<Group> group = groupDAO.getGroupById(groupId);
if (!group.isPresent()) {
logger.info("Failure to allow access groupId {}, secretId {}: groupId not found.", groupId,
secretId);
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
}
Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);
if (!secret.isPresent()) {
logger.info("Failure to allow access groupId {}, secretId {}: secretId not found.", groupId,
secretId);
throw new IllegalStateException(format("SecretId %d doesn't exist.", secretId));
}
allowAccess(configuration, secretId, groupId);
});
}
public void findAndRevokeAccess(long secretId, long groupId) {
dslContext.transaction(configuration -> {
GroupDAO groupDAO = groupDAOFactory.using(configuration);
SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(configuration);
Optional<Group> group = groupDAO.getGroupById(groupId);
if (!group.isPresent()) {
logger.info("Failure to revoke access groupId {}, secretId {}: groupId not found.", groupId,
secretId);
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
}
Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);
if (!secret.isPresent()) {
logger.info("Failure to revoke access groupId {}, secretId {}: secretId not found.",
groupId, secretId);
throw new IllegalStateException(format("SecretId %d doesn't exist.", secretId));
}
revokeAccess(configuration, secretId, groupId);
});
}
public void findAndEnrollClient(long clientId, long groupId) {
dslContext.transaction(configuration -> {
ClientDAO clientDAO = clientDAOFactory.using(configuration);
GroupDAO groupDAO = groupDAOFactory.using(configuration);
Optional<Client> client = clientDAO.getClientById(clientId);
if (!client.isPresent()) {
logger.info("Failure to enroll membership clientId {}, groupId {}: clientId not found.",
clientId, groupId);
throw new IllegalStateException(format("ClientId %d doesn't exist.", clientId));
}
Optional<Group> group = groupDAO.getGroupById(groupId);
if (!group.isPresent()) {
logger.info("Failure to enroll membership clientId {}, groupId {}: groupId not found.",
clientId, groupId);
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
}
enrollClient(configuration, clientId, groupId);
});
}
public void findAndEvictClient(long clientId, long groupId) {
dslContext.transaction(configuration -> {
ClientDAO clientDAO = clientDAOFactory.using(configuration);
GroupDAO groupDAO = groupDAOFactory.using(configuration);
Optional<Client> client = clientDAO.getClientById(clientId);
if (!client.isPresent()) {
logger.info("Failure to evict membership clientId {}, groupId {}: clientId not found.",
clientId, groupId);
throw new IllegalStateException(format("ClientId %d doesn't exist.", clientId));
}
Optional<Group> group = groupDAO.getGroupById(groupId);
if (!group.isPresent()) {
logger.info("Failure to evict membership clientId {}, groupId {}: groupId not found.",
clientId, groupId);
throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));
}
evictClient(configuration, clientId, groupId);
});
}
public ImmutableSet<SanitizedSecret> getSanitizedSecretsFor(Group group) {
checkNotNull(group);
ImmutableSet.Builder<SanitizedSecret> set = ImmutableSet.builder();
return dslContext.transactionResult(configuration -> {
SecretContentDAO secretContentDAO = secretContentDAOFactory.using(configuration);
for (SecretSeries series : getSecretSeriesFor(configuration, group)) {
for (SecretContent content : secretContentDAO.getSecretContentsBySecretId(series.id())) {
SecretSeriesAndContent seriesAndContent = SecretSeriesAndContent.of(series, content);
set.add(SanitizedSecret.fromSecretSeriesAndContent(seriesAndContent));
}
}
return set.build();
});
}
public Set<Group> getGroupsFor(Secret secret) {
List<Group> r = dslContext
.select(GROUPS.fields())
.from(GROUPS)
.join(ACCESSGRANTS).on(GROUPS.ID.eq(ACCESSGRANTS.GROUPID))
.join(SECRETS).on(ACCESSGRANTS.SECRETID.eq(SECRETS.ID))
.where(SECRETS.NAME.eq(secret.getName()))
.fetchInto(GROUPS)
.map(groupMapper);
return new HashSet<>(r);
}
public Set<Group> getGroupsFor(Client client) {
List<Group> r = dslContext
.select(GROUPS.fields())
.from(GROUPS)
.join(MEMBERSHIPS).on(GROUPS.ID.eq(MEMBERSHIPS.GROUPID))
.join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.where(CLIENTS.NAME.eq(client.getName()))
.fetchInto(GROUPS)
.map(groupMapper);
return new HashSet<>(r);
}
public Set<Client> getClientsFor(Group group) {
List<Client> r = dslContext
.select(CLIENTS.fields())
.from(CLIENTS)
.join(MEMBERSHIPS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.join(GROUPS).on(GROUPS.ID.eq(MEMBERSHIPS.GROUPID))
.where(GROUPS.NAME.eq(group.getName()))
.fetchInto(CLIENTS)
.map(clientMapper);
return new HashSet<>(r);
}
public ImmutableSet<SanitizedSecret> getSanitizedSecretsFor(Client client) {
checkNotNull(client);
// In the past, the two data fetches below were wrapped in a transaction. The transaction was
// removed because jOOQ transactions doesn't play well with MySQL readonly connections
// (see https://github.com/jOOQ/jOOQ/issues/3955).
//
// A possible work around is to write a transaction manager (see http://git.io/vkuFM)
//
// Removing the transaction however seems to be simpler and safe. The first data fetch's
// secret.id is used for the second data fetch.
//
// A third way to work around this issue is to write a SQL join. Jooq makes it relatively easy,
// but such joins hurt code re-use.
SecretContentDAO secretContentDAO = secretContentDAOFactory.using(dslContext.configuration());
ImmutableSet.Builder<SanitizedSecret> sanitizedSet = ImmutableSet.builder();
for (SecretSeries series : getSecretSeriesFor(dslContext.configuration(), client)) {
for (SecretContent content : secretContentDAO.getSecretContentsBySecretId(series.id())) {
SecretSeriesAndContent seriesAndContent = SecretSeriesAndContent.of(series, content);
sanitizedSet.add(SanitizedSecret.fromSecretSeriesAndContent(seriesAndContent));
}
}
return sanitizedSet.build();
}
public Set<Client> getClientsFor(Secret secret) {
List<Client> r = dslContext
.select(CLIENTS.fields())
.from(CLIENTS)
.join(MEMBERSHIPS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.join(ACCESSGRANTS).on(MEMBERSHIPS.GROUPID.eq(ACCESSGRANTS.GROUPID))
.join(SECRETS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID))
.where(SECRETS.NAME.eq(secret.getName()))
.fetchInto(CLIENTS)
.map(clientMapper);
return new HashSet<>(r);
}
public Optional<SanitizedSecret> getSanitizedSecretFor(Client client, String name, String version) {
checkNotNull(client);
checkArgument(!name.isEmpty());
checkNotNull(version);
// In the past, the two data fetches below were wrapped in a transaction. The transaction was
// removed because jOOQ transactions doesn't play well with MySQL readonly connections
// (see https://github.com/jOOQ/jOOQ/issues/3955).
//
// A possible work around is to write a transaction manager (see http://git.io/vkuFM)
//
// Removing the transaction however seems to be simpler and safe. The first data fetch's
// secret.id is used for the second data fetch.
//
// A third way to work around this issue is to write a SQL join. Jooq makes it relatively easy,
// but such joins hurt code re-use.
SecretContentDAO secretContentDAO = secretContentDAOFactory.using(dslContext.configuration());
Optional<SecretSeries> secretSeries = getSecretSeriesFor(dslContext.configuration(), client, name);
if (!secretSeries.isPresent()) {
return Optional.empty();
}
Optional<SecretContent> secretContent =
secretContentDAO.getSecretContentBySecretIdAndVersion(secretSeries.get().id(), version);
if (!secretContent.isPresent()) {
return Optional.empty();
}
SecretSeriesAndContent seriesAndContent =
SecretSeriesAndContent.of(secretSeries.get(), secretContent.get());
return Optional.of(SanitizedSecret.fromSecretSeriesAndContent(seriesAndContent));
}
protected void allowAccess(Configuration configuration, long secretId, long groupId) {
OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
int secretIdInt = Math.toIntExact(secretId);
int groupIdInt = Math.toIntExact(groupId);
boolean assigned = 0 < DSL.using(configuration)
.fetchCount(ACCESSGRANTS,
ACCESSGRANTS.SECRETID.eq(secretIdInt).and(
ACCESSGRANTS.GROUPID.eq(groupIdInt)));
if (assigned) {
return;
}
DSL.using(configuration)
.insertInto(ACCESSGRANTS)
.set(ACCESSGRANTS.SECRETID, secretIdInt)
.set(ACCESSGRANTS.GROUPID, groupIdInt)
.set(ACCESSGRANTS.CREATEDAT, now)
.set(ACCESSGRANTS.UPDATEDAT, now)
.execute();
}
protected void revokeAccess(Configuration configuration, long secretId, long groupId) {
DSL.using(configuration)
.delete(ACCESSGRANTS)
.where(ACCESSGRANTS.SECRETID.eq(Math.toIntExact(secretId))
.and(ACCESSGRANTS.GROUPID.eq(Math.toIntExact(groupId))))
.execute();
}
protected void enrollClient(Configuration configuration, long clientId, long groupId) {
OffsetDateTime now = OffsetDateTime.now(ZoneOffset.UTC);
int groupIdInt = Math.toIntExact(groupId);
int clientIdInt = Math.toIntExact(clientId);
boolean enrolled = 0 < DSL.using(configuration)
.fetchCount(MEMBERSHIPS,
MEMBERSHIPS.GROUPID.eq(groupIdInt).and(
MEMBERSHIPS.CLIENTID.eq(clientIdInt)));
if (enrolled) {
return;
}
DSL.using(configuration)
.insertInto(MEMBERSHIPS)
.set(MEMBERSHIPS.GROUPID, groupIdInt)
.set(MEMBERSHIPS.CLIENTID, clientIdInt)
.set(MEMBERSHIPS.CREATEDAT, now)
.set(MEMBERSHIPS.UPDATEDAT, now)
.execute();
}
protected void evictClient(Configuration configuration, long clientId, long groupId) {
DSL.using(configuration)
.delete(MEMBERSHIPS)
.where(MEMBERSHIPS.CLIENTID.eq(Math.toIntExact(clientId))
.and(MEMBERSHIPS.GROUPID.eq(Math.toIntExact(groupId))))
.execute();
}
protected ImmutableSet<SecretSeries> getSecretSeriesFor(Configuration configuration, Group group) {
List<SecretSeries> r = DSL.using(configuration)
.select(SECRETS.fields())
.from(SECRETS)
.join(ACCESSGRANTS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID))
.join(GROUPS).on(GROUPS.ID.eq(ACCESSGRANTS.GROUPID))
.where(GROUPS.NAME.eq(group.getName()))
.fetchInto(SECRETS)
.map(secretSeriesMapper);
return ImmutableSet.copyOf(r);
}
protected ImmutableSet<SecretSeries> getSecretSeriesFor(Configuration configuration, Client client) {
List<SecretSeries> r = DSL.using(configuration)
.select(SECRETS.fields())
.from(SECRETS)
.join(ACCESSGRANTS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID))
.join(MEMBERSHIPS).on(ACCESSGRANTS.GROUPID.eq(MEMBERSHIPS.GROUPID))
.join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.where(CLIENTS.NAME.eq(client.getName()))
.fetchInto(SECRETS)
.map(secretSeriesMapper);
return ImmutableSet.copyOf(r);
}
/**
* @param client client to access secrets
* @param name name of SecretSeries
* @return Optional.absent() when secret unauthorized or not found.
* The query doesn't distinguish between these cases. If result absent, a followup call on clients
* table should be used to determine the exception.
*/
protected Optional<SecretSeries> getSecretSeriesFor(Configuration configuration, Client client, String name) {
SecretsRecord r = DSL.using(configuration)
.select(SECRETS.fields())
.from(SECRETS)
.join(SECRETS_CONTENT).on(SECRETS.ID.eq(SECRETS_CONTENT.SECRETID))
.join(ACCESSGRANTS).on(SECRETS.ID.eq(ACCESSGRANTS.SECRETID))
.join(MEMBERSHIPS).on(ACCESSGRANTS.GROUPID.eq(MEMBERSHIPS.GROUPID))
.join(CLIENTS).on(CLIENTS.ID.eq(MEMBERSHIPS.CLIENTID))
.where(SECRETS.NAME.eq(name).and(CLIENTS.NAME.eq(client.getName())))
.limit(1)
.fetchOneInto(SECRETS);
return Optional.ofNullable(r).map(secretSeriesMapper::map);
}
public static class AclDAOFactory implements DAOFactory<AclDAO> {
private final DSLContext jooq;
private final DSLContext readonlyJooq;
private final ClientDAOFactory clientDAOFactory;
private final GroupDAOFactory groupDAOFactory;
private final SecretContentDAOFactory secretContentDAOFactory;
private final SecretSeriesDAOFactory secretSeriesDAOFactory;
private final ClientMapper clientMapper;
private final GroupMapper groupMapper;
private final SecretSeriesMapper secretSeriesMapper;
@Inject public AclDAOFactory(DSLContext jooq, @Readonly DSLContext readonlyJooq,
ClientDAOFactory clientDAOFactory, GroupDAOFactory groupDAOFactory,
SecretContentDAOFactory secretContentDAOFactory,
SecretSeriesDAOFactory secretSeriesDAOFactory, ClientMapper clientMapper,
GroupMapper groupMapper, SecretSeriesMapper secretSeriesMapper) {
this.jooq = jooq;
this.readonlyJooq = readonlyJooq;
this.clientDAOFactory = clientDAOFactory;
this.groupDAOFactory = groupDAOFactory;
this.secretContentDAOFactory = secretContentDAOFactory;
this.secretSeriesDAOFactory = secretSeriesDAOFactory;
this.clientMapper = clientMapper;
this.groupMapper = groupMapper;
this.secretSeriesMapper = secretSeriesMapper;
}
@Override public AclDAO readwrite() {
return new AclDAO(jooq, clientDAOFactory, groupDAOFactory, secretContentDAOFactory,
secretSeriesDAOFactory, clientMapper, groupMapper, secretSeriesMapper);
}
@Override public AclDAO readonly() {
return new AclDAO(readonlyJooq, clientDAOFactory, groupDAOFactory, secretContentDAOFactory,
secretSeriesDAOFactory, clientMapper, groupMapper, secretSeriesMapper);
}
@Override public AclDAO using(Configuration configuration) {
DSLContext dslContext = DSL.using(checkNotNull(configuration));
return new AclDAO(dslContext, clientDAOFactory, groupDAOFactory, secretContentDAOFactory,
secretSeriesDAOFactory, clientMapper, groupMapper, secretSeriesMapper);
}
}
}
| akshatknsl/keywhiz | server/src/main/java/keywhiz/service/daos/AclDAO.java | Java | apache-2.0 | 18,789 |
"""
(c) 2020 Kirk Byers <ktbyers@twb-tech.com>
(c) 2016 Elisa Jasinska <elisa@bigwaveit.org>
This file is part of Ansible
Ansible 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 3 of the License, or
(at your option) any later version.
Ansible 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 Ansible. If not, see <http://www.gnu.org/licenses/>.
"""
from __future__ import unicode_literals, print_function
from ansible.module_utils.basic import AnsibleModule
# FIX for Ansible 2.8 moving this function and making it private
# greatly simplified for napalm-ansible's use
def return_values(obj):
"""Return native stringified values from datastructures.
For use with removing sensitive values pre-jsonification."""
yield str(obj)
DOCUMENTATION = """
---
module: napalm_get_facts
author: "Elisa Jasinska (@fooelisa)"
version_added: "2.1"
short_description: "Gathers facts from a network device via napalm"
description:
- "Gathers facts from a network device via the Python module napalm"
requirements:
- napalm
options:
hostname:
description:
- IP or FQDN of the device you want to connect to
required: False
username:
description:
- Username
required: False
password:
description:
- Password
required: False
dev_os:
description:
- OS of the device
required: False
provider:
description:
- Dictionary which acts as a collection of arguments used to define the characteristics
of how to connect to the device.
Note - hostname, username, password and dev_os must be defined in either provider
or local param
Note - local param takes precedence, e.g. hostname is preferred to provider['hostname']
required: False
timeout:
description:
- Time in seconds to wait for the device to respond
required: False
default: 60
optional_args:
description:
- Dictionary of additional arguments passed to underlying driver
required: False
default: None
ignore_notimplemented:
description:
- "Ignores NotImplementedError for filters which aren't supported by the driver. Returns
invalid filters in a list called: not_implemented"
required: False
default: False
choices: [True, False]
filter:
description:
- "A list of facts to retreive from a device and provided though C(ansible_facts)
The list of facts available are maintained at:
http://napalm.readthedocs.io/en/latest/support/
Note- not all getters are implemented on all supported device types"
required: False
default: ['facts']
args:
description:
- dictionary of kwargs arguments to pass to the filter. The outer key is the name of
the getter (same as the filter)
required: False
default: None
"""
EXAMPLES = """
- name: get facts from device
napalm_get_facts:
hostname: '{{ inventory_hostname }}'
username: '{{ user }}'
dev_os: '{{ os }}'
password: '{{ passwd }}'
filter: ['facts']
register: result
- name: print data
debug:
var: result
- name: Getters
napalm_get_facts:
provider: "{{ ios_provider }}"
filter:
- "lldp_neighbors_detail"
- "interfaces"
- name: get facts from device
napalm_get_facts:
hostname: "{{ host }}"
username: "{{ user }}"
dev_os: "{{ os }}"
password: "{{ password }}"
optional_args:
port: "{{ port }}"
filter: ['facts', 'route_to', 'interfaces']
args:
route_to:
protocol: static
destination: 8.8.8.8
"""
RETURN = """
changed:
description: "whether the command has been executed on the device"
returned: always
type: bool
sample: True
ansible_facts:
description: "Facts gathered on the device provided via C(ansible_facts)"
returned: certain keys are returned depending on filter
type: dict
"""
napalm_found = False
try:
from napalm import get_network_driver
from napalm.base import ModuleImportError
napalm_found = True
except ImportError:
pass
def main():
module = AnsibleModule(
argument_spec=dict(
hostname=dict(type="str", required=False, aliases=["host"]),
username=dict(type="str", required=False),
password=dict(type="str", required=False, no_log=True),
provider=dict(type="dict", required=False),
dev_os=dict(type="str", required=False),
timeout=dict(type="int", required=False, default=60),
ignore_notimplemented=dict(type="bool", required=False, default=False),
args=dict(type="dict", required=False, default=None),
optional_args=dict(type="dict", required=False, default=None),
filter=dict(type="list", required=False, default=["facts"]),
),
supports_check_mode=True,
)
if not napalm_found:
module.fail_json(msg="the python module napalm is required")
provider = module.params["provider"] or {}
no_log = ["password", "secret"]
for param in no_log:
if provider.get(param):
module.no_log_values.update(return_values(provider[param]))
if provider.get("optional_args") and provider["optional_args"].get(param):
module.no_log_values.update(
return_values(provider["optional_args"].get(param))
)
if module.params.get("optional_args") and module.params["optional_args"].get(
param
):
module.no_log_values.update(
return_values(module.params["optional_args"].get(param))
)
# allow host or hostname
provider["hostname"] = provider.get("hostname", None) or provider.get("host", None)
# allow local params to override provider
for param, pvalue in provider.items():
if module.params.get(param) is not False:
module.params[param] = module.params.get(param) or pvalue
hostname = module.params["hostname"]
username = module.params["username"]
dev_os = module.params["dev_os"]
password = module.params["password"]
timeout = module.params["timeout"]
filter_list = module.params["filter"]
args = module.params["args"] or {}
ignore_notimplemented = module.params["ignore_notimplemented"]
implementation_errors = []
argument_check = {"hostname": hostname, "username": username, "dev_os": dev_os}
for key, val in argument_check.items():
if val is None:
module.fail_json(msg=str(key) + " is required")
if module.params["optional_args"] is None:
optional_args = {}
else:
optional_args = module.params["optional_args"]
try:
network_driver = get_network_driver(dev_os)
except ModuleImportError as e:
module.fail_json(msg="Failed to import napalm driver: " + str(e))
try:
device = network_driver(
hostname=hostname,
username=username,
password=password,
timeout=timeout,
optional_args=optional_args,
)
device.open()
except Exception as e:
module.fail_json(msg="cannot connect to device: " + str(e))
# retreive data from device
facts = {}
NAPALM_GETTERS = [
getter for getter in dir(network_driver) if getter.startswith("get_")
]
# Allow NX-OS checkpoint file to be retrieved via Ansible for use with replace config
NAPALM_GETTERS.append("get_checkpoint_file")
for getter in filter_list:
getter_function = "get_{}".format(getter)
if getter_function not in NAPALM_GETTERS:
module.fail_json(msg="filter not recognized: " + getter)
try:
if getter_function == "get_checkpoint_file":
getter_function = "_get_checkpoint_file"
get_func = getattr(device, getter_function)
result = get_func(**args.get(getter, {}))
facts[getter] = result
except NotImplementedError:
if ignore_notimplemented:
implementation_errors.append(getter)
else:
module.fail_json(
msg="The filter {} is not supported in napalm-{} [get_{}()]".format(
getter, dev_os, getter
)
)
except Exception as e:
module.fail_json(
msg="[{}] cannot retrieve device data: ".format(getter) + str(e)
)
# close device connection
try:
device.close()
except Exception as e:
module.fail_json(msg="cannot close device connection: " + str(e))
new_facts = {}
# Prepend all facts with napalm_ for unique namespace
for filter_name, filter_value in facts.items():
# Make napalm get_facts to be directly accessible as variables
if filter_name == "facts":
for fact_name, fact_value in filter_value.items():
napalm_fact_name = "napalm_" + fact_name
new_facts[napalm_fact_name] = fact_value
new_filter_name = "napalm_" + filter_name
new_facts[new_filter_name] = filter_value
results = {"ansible_facts": new_facts}
if ignore_notimplemented:
results["not_implemented"] = sorted(implementation_errors)
module.exit_json(**results)
if __name__ == "__main__":
main()
| napalm-automation/napalm-ansible | napalm_ansible/modules/napalm_get_facts.py | Python | apache-2.0 | 9,930 |
package config
import (
"log"
"os"
"os/user"
"path/filepath"
"koding/klient/storage"
"koding/tools/util"
"github.com/boltdb/bolt"
)
// CurrentUser represents current user that owns the KD process.
//
// If the process was started with sudo, the CurrentUser represents
// the user that invoked sudo.
var CurrentUser = currentUser()
// CacheOptions are used to configure Cache behavior for New method.
type CacheOptions struct {
File string
BoltDB *bolt.Options
Bucket []byte
Owner *User
}
func (o *CacheOptions) owner() *User {
if o.Owner != nil {
return o.Owner
}
return CurrentUser
}
// Cache is a file-based cached used to persist values between
// different runs of kd tool.
type Cache struct {
*storage.EncodingStorage
}
// NewCache returns new cache value.
//
// If it was not possible to create or open BoltDB database,
// an in-memory cache is created.
func NewCache(options *CacheOptions) *Cache {
db, err := newBoltDB(options)
if err != nil {
log.Println(err)
}
return &Cache{
EncodingStorage: storage.NewEncodingStorage(db, options.Bucket),
}
}
// NewCache returns new cache value backed by BoltDB.
func NewBoltCache(options *CacheOptions) (*Cache, error) {
db, err := newBoltDB(options)
if err != nil {
return nil, err
}
bolt, err := storage.NewBoltStorageBucket(db, options.Bucket)
if err != nil {
return nil, err
}
return &Cache{
EncodingStorage: &storage.EncodingStorage{
Interface: bolt,
},
}, nil
}
func newBoltDB(o *CacheOptions) (*bolt.DB, error) {
dir := filepath.Dir(o.File)
// Best-effort attempts, ignore errors.
_ = os.MkdirAll(dir, 0755)
_ = util.Chown(dir, o.owner().User)
return bolt.Open(o.File, 0644, o.BoltDB)
}
func KodingHome() string {
home := os.Getenv("KODING_HOME")
if _, err := os.Stat(home); err != nil {
home = filepath.Join(CurrentUser.HomeDir, ".config", "koding")
}
return home
}
type User struct {
*user.User
Groups []*user.Group
}
func currentUser() *User {
u := &User{
User: currentStdUser(),
}
ids, err := u.GroupIds()
if err != nil {
return u
}
for _, id := range ids {
if g, err := user.LookupGroupId(id); err == nil {
u.Groups = append(u.Groups, g)
}
}
return u
}
func currentStdUser() *user.User {
u, err := user.Current()
if err != nil {
panic(err)
}
if u.Uid != "0" {
return u
}
if sudoU, err := user.Lookup(os.Getenv("SUDO_USER")); err == nil {
return sudoU
}
if rootU, err := user.Lookup(os.Getenv("USERNAME")); err == nil {
return rootU
}
return u
}
| usirin/koding | go/src/koding/kites/config/cache.go | GO | apache-2.0 | 2,530 |
#!/bin/bash
# This file is sourced by build_crowbar.sh when you want to build Crowbar
# using Ubuntu 11.04 as the base OS. It includes all Ubuntu 11.04 specific
# build routines.
# OS information for the OS we are building crowbar on to.
OS=ubuntu
OS_VERSION=11.04
OS_TOKEN="$OS-$OS_VERSION"
OS_CODENAME=natty
. "$CROWBAR_DIR/ubuntu-common/build_lib.sh" | rhafer/crowbar | ubuntu-11.04-extra/build_lib.sh | Shell | apache-2.0 | 357 |
/*
Copyright 2016 Mozilla
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 * as ActionTypes from '../constants/action-types';
import * as PagesSelectors from '../selectors/pages';
export function createPage(id, location, options) {
return {
type: ActionTypes.CREATE_PAGE,
id,
location,
options,
};
}
export function removePage(pageId) {
return {
type: ActionTypes.REMOVE_PAGE,
pageId,
};
}
export function setSelectedPage(pageId) {
return {
type: ActionTypes.SET_SELECTED_PAGE,
pageId,
};
}
export function setSelectedPageIndex(pageIndex) {
return (dispatch, getState) => {
dispatch(setSelectedPage(PagesSelectors.getPageIdByIndex(getState(), pageIndex)));
};
}
export function setSelectedPagePrevious() {
return (dispatch, getState) => {
const selectedIndex = PagesSelectors.getSelectedPageIndex(getState());
// Immutable handles looping for us via negative indexes.
const prevIndex = selectedIndex - 1;
dispatch(setSelectedPageIndex(prevIndex));
};
}
export function setSelectedPageNext() {
return (dispatch, getState) => {
const selectedIndex = PagesSelectors.getSelectedPageIndex(getState());
const pageCount = PagesSelectors.getPageCount(getState());
// Manually handle looping when going out of bounds rightward.
const nextIndex = selectedIndex === pageCount - 1 ? 0 : selectedIndex + 1;
dispatch(setSelectedPageIndex(nextIndex));
};
}
export function resetPageData(pageId) {
return {
type: ActionTypes.RESET_PAGE_DATA,
pageId,
};
}
export function setPageIndex(pageId, pageIndex) {
return {
type: ActionTypes.SET_PAGE_INDEX,
pageId,
pageIndex,
};
}
export function setPageDetails(pageId, pageDetails) {
return {
type: ActionTypes.SET_PAGE_DETAILS,
pageId,
pageDetails,
};
}
export function setPageMeta(pageId, pageMeta) {
return {
type: ActionTypes.SET_PAGE_META,
pageId,
pageMeta,
};
}
export function setPageState(pageId, pageState) {
return {
type: ActionTypes.SET_PAGE_STATE,
pageId,
pageState,
};
}
export function setPageUIState(pageId, pageUIState) {
return {
type: ActionTypes.SET_PAGE_UI_STATE,
pageId,
pageUIState,
};
}
export function preventInteractionForPage(pageId) {
return setPageUIState(pageId, { preventInteraction: true });
}
export function allowInteractionForPage(pageId) {
return setPageUIState(pageId, { preventInteraction: false });
}
export function setPagePinned(pageId) {
return (dispatch, getState) => {
// When there's no pinned pages, the "last pinned page index" will be -1.
const lastIndex = PagesSelectors.getLastPinnedPageIndex(getState());
dispatch(setPageIndex(pageId, lastIndex + 1));
// Set the `pinned` state *last*, so that the above selector
// actually does what we want.
dispatch(setPageUIState(pageId, { pinned: true }));
};
}
export function setPageUnpinned(pageId) {
return (dispatch, getState) => {
// When there's no pinned pages, the "last pinned page index" will be -1.
const lastIndex = PagesSelectors.getLastPinnedPageIndex(getState());
dispatch(setPageIndex(pageId, lastIndex));
// Set the `pinned` state *last*, so that the above selector
// actually does what we want.
dispatch(setPageUIState(pageId, { pinned: false }));
};
}
export function showPageSearch(pageId) {
return dispatch => {
dispatch(setPageUIState(pageId, { searchVisible: true }));
dispatch(setPageUIState(pageId, { searchFocused: true }));
};
}
export function hidePageSearch(pageId) {
return dispatch => {
dispatch(setPageUIState(pageId, { searchVisible: false }));
dispatch(setPageUIState(pageId, { searchFocused: false }));
};
}
export function showCurrentPageSearch() {
return (dispatch, getState) => {
dispatch(showPageSearch(PagesSelectors.getSelectedPageId(getState())));
};
}
export function hideCurrentPageSearch() {
return (dispatch, getState) => {
dispatch(hidePageSearch(PagesSelectors.getSelectedPageId(getState())));
};
}
export function setLocalPageHistory(pageId, history, historyIndex) {
return {
type: ActionTypes.SET_LOCAL_PAGE_HISTORY,
pageId,
history,
historyIndex,
};
}
export function popRecentlyClosedPage() {
return {
type: ActionTypes.POP_RECENTLY_CLOSED_PAGE,
};
}
export function saveRestorablePage(pageId, sessionId) {
return {
type: ActionTypes.SAVE_RESTORABLE_PAGE,
pageId,
sessionId,
};
}
| mozilla/tofino | app/ui/browser-modern/actions/page-actions.js | JavaScript | apache-2.0 | 4,988 |
package code
package model
import net.liftweb.mapper._
import net.liftweb.common._
import net.liftweb.sitemap.Loc._
import net.liftmodules.fobobs.mapper._
/**
* The singleton that has methods for accessing the database
*/
object User
extends User
with MetaMegaProtoUser[User]
with BootstrapMegaMetaProtoUser[User] {
override def dbTableName = "users" // define the DB table name
override def screenWrap = Full(<lift:surround with="default" at="content">
<lift:bind /></lift:surround>)
// define the order fields will appear in forms and output
override def fieldOrder =
List(id, firstName, lastName, email, locale, timezone, password, textArea)
// comment this line out to require email validations
override def skipEmailValidation = true
//add a loc group to the user menu
override def globalUserLocParams: List[LocParam[Unit]] =
List(LocGroup("user"))
override def resetPasswordMenuLoc: Box[net.liftweb.sitemap.Menu] = Box(Empty)
override def validateUserMenuLoc: Box[net.liftweb.sitemap.Menu] = Box(Empty)
}
/**
* An O-R mapped "User" class that includes first name, last name, password and we add a "Personal Essay" to it
*/
class User extends MegaProtoUser[User] {
def getSingleton = User // what's the "meta" server
// define an additional field for a personal essay
object textArea extends MappedTextarea(this, 2048) {
override def textareaRows = 10
override def textareaCols = 50
override def displayName = "Personal Essay"
}
}
| karma4u101/FoBo-Demo | pimping-lift-advanced-bs3/src/main/scala/code/model/User.scala | Scala | apache-2.0 | 1,521 |
package org.springframework.security.oauth.consumer;
import java.util.HashMap;
import org.junit.Test;
import org.springframework.security.oauth.common.signature.HMAC_SHA1SignatureMethod;
import org.springframework.security.oauth.common.signature.SharedConsumerSecret;
import org.springframework.security.oauth.consumer.client.CoreOAuthConsumerSupport;
import org.springframework.security.oauth.consumer.net.DefaultOAuthURLStreamHandlerFactory;
/**
* @author Ryan Heaton
*/
public class TestGoogleOAuth {
/**
* tests getting a request token.
*/
@Test
public void testGetRequestToken() throws Exception {
CoreOAuthConsumerSupport support = new CoreOAuthConsumerSupport();
support.setStreamHandlerFactory(new DefaultOAuthURLStreamHandlerFactory());
InMemoryProtectedResourceDetailsService service = new InMemoryProtectedResourceDetailsService();
HashMap<String, ProtectedResourceDetails> detailsStore = new HashMap<String, ProtectedResourceDetails>();
BaseProtectedResourceDetails googleDetails = new BaseProtectedResourceDetails();
googleDetails.setRequestTokenURL("https://www.google.com/accounts/OAuthGetRequestToken");
googleDetails.setAccessTokenURL("https://www.google.com/accounts/OAuthAuthorizeToken");
googleDetails.setConsumerKey("anonymous");
googleDetails.setSharedSecret(new SharedConsumerSecret("anonymous"));
googleDetails.setId("google");
googleDetails.setUse10a(true);
googleDetails.setSignatureMethod(HMAC_SHA1SignatureMethod.SIGNATURE_NAME);
googleDetails.setRequestTokenHttpMethod("GET");
HashMap<String, String> additional = new HashMap<String, String>();
additional.put("scope", "http://picasaweb.google.com/data");
googleDetails.setAdditionalParameters(additional);
detailsStore.put(googleDetails.getId(), googleDetails);
service.setResourceDetailsStore(detailsStore);
support.setProtectedResourceDetailsService(service);
// uncomment to see a request to google.
// see http://code.google.com/apis/accounts/docs/OAuth_ref.html
// and http://jira.codehaus.org/browse/OAUTHSS-37
// OAuthConsumerToken token = support.getUnauthorizedRequestToken("google", "urn:mycallback");
// System.out.println(token.getValue());
// System.out.println(token.getSecret());
}
}
| semantico/spring-security-oauth | spring-security-oauth/src/test/java/org/springframework/security/oauth/consumer/TestGoogleOAuth.java | Java | apache-2.0 | 2,243 |
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { settings } from 'carbon-components';
const { prefix } = settings;
export default class TagSkeleton extends React.Component {
render() {
return <span className={`${prefix}--tag ${prefix}--skeleton`} />;
}
}
| carbon-design-system/carbon-components-react | src/components/Tag/Tag.Skeleton.js | JavaScript | apache-2.0 | 431 |
/*
* CalendarService.java, Jun 30, 2014, izein
*
* Copyright (c) 2014 1&1 Internet AG, Karlsruhe. All rights reserved.
*/
/**
*
*/
package org.unitedinternet.cosmo.service;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.fortuna.ical4j.model.Calendar;
import net.fortuna.ical4j.model.Date;
import org.unitedinternet.cosmo.model.CollectionItem;
import org.unitedinternet.cosmo.model.ContentItem;
import org.unitedinternet.cosmo.model.ICalendarItem;
import org.unitedinternet.cosmo.model.Item;
import org.unitedinternet.cosmo.model.NoteItem;
import org.unitedinternet.cosmo.model.User;
/**
* @author izein
*
*/
public interface CalendarService extends Service {
/**
* Find calendar events by time range.
*
* @param collection collection to search
* @param rangeStart time range start
* @param rangeEnd time range end
* @param timeZoneId id for timezone; null if not used.
* @param expandRecurringEvents if true, recurring events will be expanded
* and each occurrence will be returned as a NoteItemOccurrence.
* @return Set<ContentItem> set ContentItem objects that contain EventStamps that occur
* int the given timeRange
*/
Set<ContentItem> findEvents(CollectionItem collection, Date rangeStart,
Date rangeEnd, String timeZoneId, boolean expandRecurringEvents);
/**
* Find calendar event with a specified icalendar uid. The icalendar format
* requires that an event's uid is unique within a calendar.
*
* @param uid
* icalendar uid of calendar event
* @param collection
* collection to search
* @return calendar event represented by uid and calendar
*/
ContentItem findEventByIcalUid(String uid, CollectionItem collection);
/**
* Find events by ical uid.
* @param collection Calendar.
* @param uid The event's uid.
*/
Map<String, List<NoteItem>> findNoteItemsByIcalUid(Item collection, List<String> uid);
/**
* splits the Calendar Object received into different calendar Components>
*
* @param calendar Calendar
* @param User cosmoUser
* @return Set<ContentItem>
*/
public Set<ICalendarItem> splitCalendarItems(Calendar calendar, User cosmoUser);
}
| Eisler/cosmo | cosmo-api/src/main/java/org/unitedinternet/cosmo/service/CalendarService.java | Java | apache-2.0 | 2,346 |
/* TODO: CLEAN THIS SHIT UP
*
**/
function setupVoteClickHandlers() {
/**
* Assign click handlers to all voting buttons.
*/
$('.vote').click(function() {
var quote_id = $(this).data('quote_id');
var direction = '';
if($(this).attr('class').indexOf('down') >= 0) {
direction = 'down';
} else {
direction = 'up';
}
if($(this).attr('class').indexOf('voted') >= 0) {
annulVote(quote_id, direction, this);
} else {
castVote(quote_id, direction, this);
}
});
}
function castVote(quote_id, direction, button) {
$.ajax({
url: '/api/v1/quotes/'+quote_id+'/vote/'+direction,
type: 'POST',
success: function(data, status, jqXHR){
$(button).addClass(data['status'] + ' voted');
changeScoreCount(button, direction, false);
}
});
}
function annulVote(quote_id, direction, button) {
$.ajax({
url: '/api/v1/quotes/'+quote_id+'/vote/'+direction,
type: 'DELETE',
success: function(data, status, jqXHR){
$(button).removeClass('success error voted');
changeScoreCount(button, direction, true);
}
});
}
function changeScoreCount(button, direction, cancelVote) {
if(direction == 'up') {
var scorefield = $(button).next();
var score = parseInt(scorefield.html());
if(cancelVote === true) {
scorefield.html(score - 1);
var upvotes = parseInt($(button).attr('title')) - 1 + ' upvote';
} else {
if($(button).next().next().attr('class').indexOf('voted') > -1) {
// quote has already been downvoted, remove that downvote
$(button).next().next().removeClass('voted success error');
scorefield.html(score + 2);
} else {
scorefield.html(score + 1);
}
var upvotes = parseInt($(button).attr('title')) + 1 + ' upvote';
}
if(parseInt(upvotes) !== 1) {
upvotes += 's';
}
$(button).attr('title', upvotes);
} else {
var scorefield = $(button).prev();
var score = parseInt(scorefield.html());
if(cancelVote === true) {
scorefield.html(score + 1);
var downvotes = parseInt($(button).attr('title')) - 1 + ' downvote';
} else {
if($(button).prev().prev().attr('class').indexOf('voted') > -1) {
// quote has already been upvoted, remove that upvote
$(button).prev().prev().removeClass('voted success error');
scorefield.html(score - 2);
} else {
scorefield.html(score - 1);
}
var downvotes = parseInt($(button).attr('title')) + 1 + ' downvote';
}
if(parseInt(downvotes) !== 1) {
downvotes += 's';
}
$(button).attr('title', downvotes);
}
}
| stesh/porick-flask | porick/static/js/voting.js | JavaScript | apache-2.0 | 3,009 |
// Copyright 2016 The Cockroach 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.
//
// Author: Matt Jibson (mjibson@cockroachlabs.com)
package sql
import "github.com/cockroachdb/cockroach/sql/parser"
// returningNode accumulates the results for a RETURNING clause. If the rows are empty, we just
// keep track of the count.
type returningNode struct {
valuesNode
rowCount int
}
// returningHelper implements the logic used for statements with RETURNING clauses. It accumulates
// result rows, one for each call to append().
type returningHelper struct {
p *planner
results *returningNode
// Processed copies of expressions from ReturningExprs.
exprs parser.Exprs
qvals qvalMap
}
func makeReturningHelper(p *planner, r parser.ReturningExprs,
alias string, tablecols []ColumnDescriptor) (returningHelper, error) {
rh := returningHelper{p: p, results: &returningNode{}}
if len(r) == 0 {
return rh, nil
}
rh.results.columns = make([]ResultColumn, 0, len(r))
table := tableInfo{
columns: makeResultColumns(tablecols, 0),
alias: alias,
}
rh.qvals = make(qvalMap)
rh.exprs = make([]parser.Expr, 0, len(r))
for _, target := range r {
if isStar, cols, exprs, err := checkRenderStar(target, &table, rh.qvals); err != nil {
return returningHelper{}, err
} else if isStar {
rh.exprs = append(rh.exprs, exprs...)
rh.results.columns = append(rh.results.columns, cols...)
continue
}
// When generating an output column name it should exactly match the original
// expression, so determine the output column name before we perform any
// manipulations to the expression.
outputName := getRenderColName(target)
expr, err := resolveQNames(&table, rh.qvals, target.Expr)
if err != nil {
return returningHelper{}, err
}
typ, err := expr.TypeCheck(rh.p.evalCtx.Args)
if err != nil {
return returningHelper{}, err
}
rh.exprs = append(rh.exprs, expr)
rh.results.columns = append(rh.results.columns, ResultColumn{Name: outputName, Typ: typ})
}
return rh, nil
}
// append adds a result row. The row is computed according to the ReturningExprs, with input values
// from rowVals.
func (rh *returningHelper) append(rowVals parser.DTuple) error {
if rh.exprs == nil {
rh.results.rowCount++
return nil
}
rh.qvals.populateQVals(rowVals)
resrow := make(parser.DTuple, len(rh.exprs))
for i, e := range rh.exprs {
d, err := e.Eval(rh.p.evalCtx)
if err != nil {
return err
}
resrow[i] = d
}
rh.results.rows = append(rh.results.rows, resrow)
return nil
}
// getResults returns the results as a returningNode.
func (rh *returningHelper) getResults() *returningNode {
return rh.results
}
| cuongdo/cockroach | sql/returning.go | GO | apache-2.0 | 3,184 |
/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets 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 io.druid.segment;
import io.druid.query.monomorphicprocessing.RuntimeShapeInspector;
public final class ZeroLongColumnSelector implements LongColumnSelector
{
private static final ZeroLongColumnSelector INSTANCE = new ZeroLongColumnSelector();
private ZeroLongColumnSelector()
{
// No instantiation.
}
public static ZeroLongColumnSelector instance()
{
return INSTANCE;
}
@Override
public long get()
{
return 0;
}
@Override
public void inspectRuntimeShape(RuntimeShapeInspector inspector)
{
// nothing to inspect
}
}
| lizhanhui/data_druid | processing/src/main/java/io/druid/segment/ZeroLongColumnSelector.java | Java | apache-2.0 | 1,383 |
package com.siberiadante.utilsample.adapter.widget;
import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;
import com.siberiadante.androidutil.adapter.recycleradapter.SDBaseViewHolder;
import com.siberiadante.androidutil.adapter.recycleradapter.SDRecyclerViewAdapter;
import com.siberiadante.utilsample.R;
import com.siberiadante.utilsample.bean.document.DocumentList;
/**
* create date: 2018/11/3
*/
public class SDRVAdapter extends SDRecyclerViewAdapter<DocumentList> {
public SDRVAdapter(Context context) {
super(context);
}
@Override
public SDBaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
return new DocViewHolder(parent);
}
private class DocViewHolder extends SDBaseViewHolder<DocumentList> {
TextView tvDocument;
private DocViewHolder(ViewGroup parent) {
super(parent, R.layout.list_document_item);
tvDocument = $(R.id.tv_document);
}
@Override
public void setData(DocumentList data) {
super.setData(data);
tvDocument.setText(data.getTitle());
}
}
}
| SibreiaDante/SiberiaDanteLib | utilsample/src/main/java/com/siberiadante/utilsample/adapter/widget/SDRVAdapter.java | Java | apache-2.0 | 1,168 |
package cgeo.geocaching.utils;
import org.eclipse.jdt.annotation.NonNull;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.StringRes;
import java.io.File;
public class ShareUtils {
private ShareUtils() {
// utility class
}
public static void share(final Context context, final @NonNull File file, final @NonNull String mimeType, @StringRes final int titleResourceId) {
final Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
shareIntent.setType(mimeType);
context.startActivity(Intent.createChooser(shareIntent, context.getString(titleResourceId)));
}
public static void share(final Context context, final @NonNull File file, @StringRes final int titleResourceId) {
share(context, file, "*/*", titleResourceId);
}
}
| SammysHP/cgeo | main/src/cgeo/geocaching/utils/ShareUtils.java | Java | apache-2.0 | 965 |
/*
* Copyright 2014 Open Networking Laboratory
*
* 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.onosproject.store.trivial;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Service;
import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.net.Annotations;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.DefaultHost;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Host;
import org.onosproject.net.HostId;
import org.onosproject.net.HostLocation;
import org.onosproject.net.host.HostDescription;
import org.onosproject.net.host.HostEvent;
import org.onosproject.net.host.HostStore;
import org.onosproject.net.host.HostStoreDelegate;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.store.AbstractStore;
import org.slf4j.Logger;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import static org.onosproject.net.DefaultAnnotations.merge;
import static org.onosproject.net.host.HostEvent.Type.HOST_ADDED;
import static org.onosproject.net.host.HostEvent.Type.HOST_MOVED;
import static org.onosproject.net.host.HostEvent.Type.HOST_REMOVED;
import static org.onosproject.net.host.HostEvent.Type.HOST_UPDATED;
import static org.slf4j.LoggerFactory.getLogger;
// TODO: multi-provider, annotation not supported.
/**
* Manages inventory of end-station hosts using trivial in-memory
* implementation.
*/
@Component(immediate = true)
@Service
public class SimpleHostStore
extends AbstractStore<HostEvent, HostStoreDelegate>
implements HostStore {
private final Logger log = getLogger(getClass());
// Host inventory
private final Map<HostId, StoredHost> hosts = new ConcurrentHashMap<>(2000000, 0.75f, 16);
// Hosts tracked by their location
private final Multimap<ConnectPoint, Host> locations = HashMultimap.create();
@Activate
public void activate() {
log.info("Started");
}
@Deactivate
public void deactivate() {
log.info("Stopped");
}
@Override
public HostEvent createOrUpdateHost(ProviderId providerId, HostId hostId,
HostDescription hostDescription,
boolean replaceIps) {
//TODO We need a way to detect conflicting changes and abort update.
StoredHost host = hosts.get(hostId);
HostEvent hostEvent;
if (host == null) {
hostEvent = createHost(providerId, hostId, hostDescription);
} else {
hostEvent = updateHost(providerId, host, hostDescription, replaceIps);
}
notifyDelegate(hostEvent);
return hostEvent;
}
// creates a new host and sends HOST_ADDED
private HostEvent createHost(ProviderId providerId, HostId hostId,
HostDescription descr) {
StoredHost newhost = new StoredHost(providerId, hostId,
descr.hwAddress(),
descr.vlan(),
descr.location(),
ImmutableSet.copyOf(descr.ipAddress()),
descr.annotations());
synchronized (this) {
hosts.put(hostId, newhost);
locations.put(descr.location(), newhost);
}
return new HostEvent(HOST_ADDED, newhost);
}
// checks for type of update to host, sends appropriate event
private HostEvent updateHost(ProviderId providerId, StoredHost host,
HostDescription descr, boolean replaceIps) {
HostEvent event;
if (!host.location().equals(descr.location())) {
host.setLocation(descr.location());
return new HostEvent(HOST_MOVED, host);
}
if (host.ipAddresses().containsAll(descr.ipAddress()) &&
descr.annotations().keys().isEmpty()) {
return null;
}
final Set<IpAddress> addresses;
if (replaceIps) {
addresses = ImmutableSet.copyOf(descr.ipAddress());
} else {
addresses = new HashSet<>(host.ipAddresses());
addresses.addAll(descr.ipAddress());
}
Annotations annotations = merge((DefaultAnnotations) host.annotations(),
descr.annotations());
StoredHost updated = new StoredHost(providerId, host.id(),
host.mac(), host.vlan(),
descr.location(), addresses,
annotations);
event = new HostEvent(HOST_UPDATED, updated);
synchronized (this) {
hosts.put(host.id(), updated);
locations.remove(host.location(), host);
locations.put(updated.location(), updated);
}
return event;
}
@Override
public HostEvent removeHost(HostId hostId) {
synchronized (this) {
Host host = hosts.remove(hostId);
if (host != null) {
locations.remove((host.location()), host);
HostEvent hostEvent = new HostEvent(HOST_REMOVED, host);
notifyDelegate(hostEvent);
return hostEvent;
}
return null;
}
}
@Override
public HostEvent removeIp(HostId hostId, IpAddress ipAddress) {
return null;
}
@Override
public int getHostCount() {
return hosts.size();
}
@Override
public Iterable<Host> getHosts() {
return ImmutableSet.<Host>copyOf(hosts.values());
}
@Override
public Host getHost(HostId hostId) {
return hosts.get(hostId);
}
@Override
public Set<Host> getHosts(VlanId vlanId) {
Set<Host> vlanset = new HashSet<>();
for (Host h : hosts.values()) {
if (h.vlan().equals(vlanId)) {
vlanset.add(h);
}
}
return vlanset;
}
@Override
public Set<Host> getHosts(MacAddress mac) {
Set<Host> macset = new HashSet<>();
for (Host h : hosts.values()) {
if (h.mac().equals(mac)) {
macset.add(h);
}
}
return macset;
}
@Override
public Set<Host> getHosts(IpAddress ip) {
Set<Host> ipset = new HashSet<>();
for (Host h : hosts.values()) {
if (h.ipAddresses().contains(ip)) {
ipset.add(h);
}
}
return ipset;
}
@Override
public Set<Host> getConnectedHosts(ConnectPoint connectPoint) {
return ImmutableSet.copyOf(locations.get(connectPoint));
}
@Override
public Set<Host> getConnectedHosts(DeviceId deviceId) {
Set<Host> hostset = new HashSet<>();
for (ConnectPoint p : locations.keySet()) {
if (p.deviceId().equals(deviceId)) {
hostset.addAll(locations.get(p));
}
}
return hostset;
}
// Auxiliary extension to allow location to mutate.
private static final class StoredHost extends DefaultHost {
private HostLocation location;
/**
* Creates an end-station host using the supplied information.
*
* @param providerId provider identity
* @param id host identifier
* @param mac host MAC address
* @param vlan host VLAN identifier
* @param location host location
* @param ips host IP addresses
* @param annotations optional key/value annotations
*/
public StoredHost(ProviderId providerId, HostId id,
MacAddress mac, VlanId vlan, HostLocation location,
Set<IpAddress> ips, Annotations... annotations) {
super(providerId, id, mac, vlan, location, ips, annotations);
this.location = location;
}
void setLocation(HostLocation location) {
this.location = location;
}
@Override
public HostLocation location() {
return location;
}
}
}
| sonu283304/onos | core/common/src/test/java/org/onosproject/store/trivial/SimpleHostStore.java | Java | apache-2.0 | 9,200 |
/*
* 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/health/model/DescribeEventTypesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Health::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DescribeEventTypesRequest::DescribeEventTypesRequest() :
m_filterHasBeenSet(false),
m_localeHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String DescribeEventTypesRequest::SerializePayload() const
{
JsonValue payload;
if(m_filterHasBeenSet)
{
payload.WithObject("filter", m_filter.Jsonize());
}
if(m_localeHasBeenSet)
{
payload.WithString("locale", m_locale);
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("nextToken", m_nextToken);
}
if(m_maxResultsHasBeenSet)
{
payload.WithInteger("maxResults", m_maxResults);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DescribeEventTypesRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSHealth_20160804.DescribeEventTypes"));
return headers;
}
| cedral/aws-sdk-cpp | aws-cpp-sdk-health/source/model/DescribeEventTypesRequest.cpp | C++ | apache-2.0 | 1,758 |
var echarts = require("../echarts");
var zrUtil = require("zrender/lib/core/util");
var axisPointerModelHelper = require("./axisPointer/modelHelper");
var axisTrigger = require("./axisPointer/axisTrigger");
require("./axisPointer/AxisPointerModel");
require("./axisPointer/AxisPointerView");
require("./axisPointer/CartesianAxisPointer");
// CartesianAxisPointer is not supposed to be required here. But consider
// echarts.simple.js and online build tooltip, which only require gridSimple,
// CartesianAxisPointer should be able to required somewhere.
echarts.registerPreprocessor(function (option) {
// Always has a global axisPointerModel for default setting.
if (option) {
(!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});
var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link
// is not set, remain null/undefined, otherwise it will
// override existent link setting.
if (link && !zrUtil.isArray(link)) {
option.axisPointer.link = [link];
}
}
}); // This process should proformed after coordinate systems created
// and series data processed. So put it on statistic processing stage.
echarts.registerProcessor(echarts.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {
// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
// allAxesInfo should be updated when setOption performed.
ecModel.getComponent('axisPointer').coordSysAxesInfo = axisPointerModelHelper.collect(ecModel, api);
}); // Broadcast to all views.
echarts.registerAction({
type: 'updateAxisPointer',
event: 'updateAxisPointer',
update: ':updateAxisPointer'
}, axisTrigger); | falost/falost.github.io | static/libs/echarts/lib/component/axisPointer.js | JavaScript | apache-2.0 | 1,704 |
package sangria.starWars
import sangria.execution.Executor
import sangria.marshalling.InputUnmarshaller
import sangria.schema._
import sangria.macros._
import sangria.starWars.TestSchema.{PrivacyError, StarWarsSchema}
import sangria.starWars.TestData.{CharacterRepo, FriendsResolver}
import sangria.util.FutureResultSupport
import InputUnmarshaller.mapVars
import sangria.validation.QueryValidator
import scala.concurrent.ExecutionContext.Implicits.global
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class StarWarsQuerySpec extends AnyWordSpec with Matchers with FutureResultSupport {
"Basic Queries" should {
"Correctly identifies R2-D2 as the hero of the Star Wars Saga" in {
val query = graphql"""
query HeroNameQuery {
hero {
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(Map("data" -> Map("hero" -> Map("name" -> "R2-D2"))))
}
"Allows us to query for the ID and friends of R2-D2" in {
val query = graphql"""
query HeroNameAndFriendsQuery {
hero {
id
name
friends {
name
}
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"hero" -> Map(
"id" -> "2001",
"name" -> "R2-D2",
"friends" -> List(
Map("name" -> "Luke Skywalker"),
Map("name" -> "Han Solo"),
Map("name" -> "Leia Organa")
)))))
}
"Hero query should succeed even if not all types are referenced indirectly" in {
val query = graphql"""
query HeroNameAndFriendsQuery {
hero {
id
name
friends {
name
}
}
}
"""
val HeroOnlyQuery = ObjectType[CharacterRepo, Unit](
"HeroOnlyQuery",
fields[CharacterRepo, Unit](
Field(
"hero",
TestSchema.Character,
arguments = TestSchema.EpisodeArg :: Nil,
resolve = ctx => ctx.ctx.getHero(ctx.arg(TestSchema.EpisodeArg)))
)
)
val heroOnlySchema =
Schema(HeroOnlyQuery, additionalTypes = TestSchema.Human :: TestSchema.Droid :: Nil)
Executor
.execute(heroOnlySchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"hero" -> Map(
"id" -> "2001",
"name" -> "R2-D2",
"friends" -> List(
Map("name" -> "Luke Skywalker"),
Map("name" -> "Han Solo"),
Map("name" -> "Leia Organa")
)))))
}
}
"Nested Queries" should {
"Allows us to query for the friends of friends of R2-D2" in {
val query = graphql"""
query NestedQuery {
hero {
name
friends {
name
appearsIn
friends {
name
}
}
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"hero" -> Map(
"name" -> "R2-D2",
"friends" -> List(
Map(
"name" -> "Luke Skywalker",
"appearsIn" -> List("NEWHOPE", "EMPIRE", "JEDI"),
"friends" -> List(
Map("name" -> "Han Solo"),
Map("name" -> "Leia Organa"),
Map("name" -> "C-3PO"),
Map("name" -> "R2-D2")
)
),
Map(
"name" -> "Han Solo",
"appearsIn" -> List("NEWHOPE", "EMPIRE", "JEDI"),
"friends" -> List(
Map("name" -> "Luke Skywalker"),
Map("name" -> "Leia Organa"),
Map("name" -> "R2-D2")
)
),
Map(
"name" -> "Leia Organa",
"appearsIn" -> List("NEWHOPE", "EMPIRE", "JEDI"),
"friends" -> List(
Map("name" -> "Luke Skywalker"),
Map("name" -> "Han Solo"),
Map("name" -> "C-3PO"),
Map("name" -> "R2-D2")
)
)
)
)
)
)
)
}
}
"Using IDs and query parameters to refetch objects" should {
"Allows us to query for Luke Skywalker directly, using his ID" in {
val query = graphql"""
query FetchLukeQuery {
human(id: "1000") {
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"human" -> Map(
"name" -> "Luke Skywalker"
)
)
))
}
"Allows us to create a generic query, then use it to fetch Luke Skywalker using his ID" in {
val query = graphql"""
query FetchSomeIDQuery($$someId: String!) {
human(id: $$someId) {
name
}
}
"""
val args = mapVars("someId" -> "1000")
Executor
.execute(
StarWarsSchema,
query,
new CharacterRepo,
variables = args,
deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"human" -> Map(
"name" -> "Luke Skywalker"
)
)
))
}
"Allows us to create a generic query, then use it to fetch Han Solo using his ID" in {
val query = graphql"""
query FetchSomeIDQuery($$someId: String!) {
human(id: $$someId) {
name
}
}
"""
val args = mapVars("someId" -> "1002")
Executor
.execute(
StarWarsSchema,
query,
new CharacterRepo,
variables = args,
deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"human" -> Map(
"name" -> "Han Solo"
)
)
))
}
"Allows us to create a generic query, then pass an invalid ID to get null back" in {
val query = graphql"""
query humanQuery($$id: String!) {
human(id: $$id) {
name
}
}
"""
val args = mapVars("id" -> "not a valid id")
Executor
.execute(
StarWarsSchema,
query,
new CharacterRepo,
variables = args,
deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"human" -> null
)
))
}
}
"Using aliases to change the key in the response" should {
"Allows us to query for Luke, changing his key with an alias" in {
val query =
graphql"""
query FetchLukeAliased {
luke: human(id: "1000") {
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"luke" -> Map("name" -> "Luke Skywalker")
)
))
}
"Allows us to query for both Luke and Leia, using two root fields and an alias" in {
val query =
graphql"""
query FetchLukeAndLeiaAliased {
luke: human(id: "1000") {
name
}
leia: human(id: "1003") {
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"luke" -> Map("name" -> "Luke Skywalker"),
"leia" -> Map("name" -> "Leia Organa")
)
))
}
}
"Uses fragments to express more complex queries" should {
"Allows us to query using duplicated content" in {
val query = graphql"""
query DuplicateFields {
luke: human(id: "1000") {
name
homePlanet
}
leia: human(id: "1003") {
name
homePlanet
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"luke" -> Map("name" -> "Luke Skywalker", "homePlanet" -> "Tatooine"),
"leia" -> Map("name" -> "Leia Organa", "homePlanet" -> "Alderaan")
)
))
}
"Allows us to use a fragment to avoid duplicating content" in {
val query = graphql"""
query UseFragment {
luke: human(id: "1000") {
...HumanFragment
}
leia: human(id: "1003") {
...HumanFragment
}
}
fragment HumanFragment on Human {
name
homePlanet
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"luke" -> Map("name" -> "Luke Skywalker", "homePlanet" -> "Tatooine"),
"leia" -> Map("name" -> "Leia Organa", "homePlanet" -> "Alderaan")
)
))
}
}
"Using __typename to find the type of an object" should {
"Allows us to verify that R2-D2 is a droid" in {
val query = graphql"""
query CheckTypeOfR2 {
hero {
__typename
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"hero" -> Map("__typename" -> "Droid", "name" -> "R2-D2")
)
))
}
"Allows us to verify that Luke is a human" in {
val query = graphql"""
query CheckTypeOfLuke {
hero(episode: EMPIRE) {
__typename
name
}
}
"""
Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await should be(
Map(
"data" -> Map(
"hero" -> Map("__typename" -> "Human", "name" -> "Luke Skywalker")
)
))
}
}
"Reporting errors raised in resolvers" should {
"Correctly reports error on accessing secretBackstory" in {
val query = graphql"""
query HeroNameQuery {
hero {
name
secretBackstory
}
}
"""
val res = Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await
.asInstanceOf[Map[String, Any]]
res("data") should be(Map("hero" -> Map("name" -> "R2-D2", "secretBackstory" -> null)))
val errors = res("errors").asInstanceOf[Seq[Any]]
errors should (have(size(1)).and(
contain(
Map(
"message" -> "secretBackstory is secret.",
"path" -> List("hero", "secretBackstory"),
"locations" -> Vector(Map("line" -> 5, "column" -> 13))))))
}
"Correctly reports error on accessing secretBackstory in a list" in {
val query = graphql"""
query HeroNameQuery {
hero {
name
friends {
name
secretBackstory
}
}
}
"""
val res = Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await
.asInstanceOf[Map[String, Any]]
res("data") should be(
Map(
"hero" ->
Map(
"name" -> "R2-D2",
"friends" -> Vector(
Map("name" -> "Luke Skywalker", "secretBackstory" -> null),
Map("name" -> "Han Solo", "secretBackstory" -> null),
Map("name" -> "Leia Organa", "secretBackstory" -> null)
)
)))
val errors = res("errors").asInstanceOf[Seq[Any]]
errors should (have(size(3))
.and(
contain(
Map(
"message" -> "secretBackstory is secret.",
"path" -> Vector("hero", "friends", 0, "secretBackstory"),
"locations" -> Vector(Map("line" -> 7, "column" -> 15)))))
.and(
contain(
Map(
"message" -> "secretBackstory is secret.",
"path" -> Vector("hero", "friends", 1, "secretBackstory"),
"locations" -> Vector(Map("line" -> 7, "column" -> 15)))))
.and(
contain(
Map(
"message" -> "secretBackstory is secret.",
"path" -> Vector("hero", "friends", 2, "secretBackstory"),
"locations" -> Vector(Map("line" -> 7, "column" -> 15))))))
}
"Correctly reports error on accessing through an alias" in {
val query = graphql"""
query HeroNameQuery {
mainHero: hero {
name
story: secretBackstory
}
}
"""
val res = Executor
.execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver)
.await
.asInstanceOf[Map[String, Any]]
res("data") should be(Map("mainHero" -> Map("name" -> "R2-D2", "story" -> null)))
val errors = res("errors").asInstanceOf[Seq[Any]]
errors should (have(size(1)).and(
contain(
Map(
"message" -> "secretBackstory is secret.",
"path" -> List("mainHero", "story"),
"locations" -> Vector(Map("line" -> 5, "column" -> 13))))))
}
"Full response path is included when fields are non-nullable" in {
lazy val A: ObjectType[Unit, Any] = ObjectType(
"A",
() =>
fields(
Field("nullableA", OptionType(A), resolve = _ => ""),
Field("nonNullA", A, resolve = _ => ""),
Field("throws", A, resolve = _ => throw PrivacyError("Catch me if you can"))
)
)
val Query = ObjectType(
"Query",
fields[Unit, Unit](Field("nullableA", OptionType(A), resolve = _ => "")))
val schema = Schema(Query)
val query = graphql"""
query {
nullableA {
nullableA {
nonNullA {
nonNullA {
throws
}
}
}
}
}
"""
val res = Executor
.execute(schema, query, queryValidator = QueryValidator.empty)
.await
.asInstanceOf[Map[String, Any]]
res("data") should be(Map("nullableA" -> Map("nullableA" -> null)))
val errors = res("errors").asInstanceOf[Seq[Any]]
errors should (have(size(1)).and(
contain(
Map(
"message" -> "Catch me if you can",
"path" -> List("nullableA", "nullableA", "nonNullA", "nonNullA", "throws"),
"locations" -> List(Map("line" -> 7, "column" -> 19))))))
}
}
}
| sangria-graphql/sangria | modules/core/src/test/scala/sangria/starWars/StarWarsQuerySpec.scala | Scala | apache-2.0 | 15,929 |
package net.stickycode.stereotype.primitive;
import net.stickycode.exception.PermanentException;
@SuppressWarnings("serial")
public class DataVolumesMustBeNaturalNumbersException
extends PermanentException {
public DataVolumesMustBeNaturalNumbersException(String value) {
super("Found '', but Data volumes must be natural numbers with units e.g. 1g, 125m, 1032k, 125M, 123mB, 1234mb, 100KB, 100kb", value);
}
}
| tectronics/stickycode | net.stickycode.stereotype/sticky-stereotype-primitive/src/main/java/net/stickycode/stereotype/primitive/DataVolumesMustBeNaturalNumbersException.java | Java | apache-2.0 | 427 |
/*
* Copyright 2000-2015 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 com.intellij.util.lang;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.io.UnsyncByteArrayInputStream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
class MemoryResource extends Resource {
private final URL myUrl;
private final byte[] myContent;
private final Map<Resource.Attribute, String> myAttributes;
private MemoryResource(URL url, byte[] content, Map<Resource.Attribute, String> attributes) {
myUrl = url;
myContent = content;
myAttributes = attributes;
}
@Override
public URL getURL() {
return myUrl;
}
@Override
public InputStream getInputStream() throws IOException {
return new UnsyncByteArrayInputStream(myContent);
}
@Override
public byte[] getBytes() throws IOException {
return myContent;
}
@Override
public String getValue(Attribute key) {
return myAttributes != null ? myAttributes.get(key) : null;
}
@NotNull
static MemoryResource load(URL baseUrl,
@NotNull ZipFile zipFile,
@NotNull ZipEntry entry,
@Nullable Map<Attribute, String> attributes) throws IOException {
String name = entry.getName();
URL url = new URL(baseUrl, name);
byte[] content = ArrayUtil.EMPTY_BYTE_ARRAY;
InputStream stream = zipFile.getInputStream(entry);
if (stream != null) {
try {
content = FileUtil.loadBytes(stream, (int)entry.getSize());
}
finally {
stream.close();
}
}
return new MemoryResource(url, content, attributes);
}
}
| msebire/intellij-community | platform/util/src/com/intellij/util/lang/MemoryResource.java | Java | apache-2.0 | 2,445 |
---
layout: vakit_dashboard
title: LOUISIANA, ABD için iftar, namaz vakitleri ve hava durumu - ilçe/eyalet seç
permalink: /ABD/LOUISIANA/BATON_ROUGE
---
<script type="text/javascript">
var GLOBAL_COUNTRY = 'ABD';
var GLOBAL_CITY = 'LOUISIANA';
var GLOBAL_STATE = 'BATON_ROUGE';
var lat = 72;
var lon = 21;
</script>
| hakanu/iftar | _posts_/vakit/ABD/LOUISIANA/BATON_ROUGE/2017-02-01-BATON_ROUGE.markdown | Markdown | apache-2.0 | 330 |
/*
* 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/apigateway/model/UpdateIntegrationResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::APIGateway::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
UpdateIntegrationResult::UpdateIntegrationResult() :
m_type(IntegrationType::NOT_SET),
m_contentHandling(ContentHandlingStrategy::NOT_SET)
{
}
UpdateIntegrationResult::UpdateIntegrationResult(const AmazonWebServiceResult<JsonValue>& result) :
m_type(IntegrationType::NOT_SET),
m_contentHandling(ContentHandlingStrategy::NOT_SET)
{
*this = result;
}
UpdateIntegrationResult& UpdateIntegrationResult::operator =(const AmazonWebServiceResult<JsonValue>& result)
{
const JsonValue& jsonValue = result.GetPayload();
if(jsonValue.ValueExists("type"))
{
m_type = IntegrationTypeMapper::GetIntegrationTypeForName(jsonValue.GetString("type"));
}
if(jsonValue.ValueExists("httpMethod"))
{
m_httpMethod = jsonValue.GetString("httpMethod");
}
if(jsonValue.ValueExists("uri"))
{
m_uri = jsonValue.GetString("uri");
}
if(jsonValue.ValueExists("credentials"))
{
m_credentials = jsonValue.GetString("credentials");
}
if(jsonValue.ValueExists("requestParameters"))
{
Aws::Map<Aws::String, JsonValue> requestParametersJsonMap = jsonValue.GetObject("requestParameters").GetAllObjects();
for(auto& requestParametersItem : requestParametersJsonMap)
{
m_requestParameters[requestParametersItem.first] = requestParametersItem.second.AsString();
}
}
if(jsonValue.ValueExists("requestTemplates"))
{
Aws::Map<Aws::String, JsonValue> requestTemplatesJsonMap = jsonValue.GetObject("requestTemplates").GetAllObjects();
for(auto& requestTemplatesItem : requestTemplatesJsonMap)
{
m_requestTemplates[requestTemplatesItem.first] = requestTemplatesItem.second.AsString();
}
}
if(jsonValue.ValueExists("passthroughBehavior"))
{
m_passthroughBehavior = jsonValue.GetString("passthroughBehavior");
}
if(jsonValue.ValueExists("contentHandling"))
{
m_contentHandling = ContentHandlingStrategyMapper::GetContentHandlingStrategyForName(jsonValue.GetString("contentHandling"));
}
if(jsonValue.ValueExists("cacheNamespace"))
{
m_cacheNamespace = jsonValue.GetString("cacheNamespace");
}
if(jsonValue.ValueExists("cacheKeyParameters"))
{
Array<JsonValue> cacheKeyParametersJsonList = jsonValue.GetArray("cacheKeyParameters");
for(unsigned cacheKeyParametersIndex = 0; cacheKeyParametersIndex < cacheKeyParametersJsonList.GetLength(); ++cacheKeyParametersIndex)
{
m_cacheKeyParameters.push_back(cacheKeyParametersJsonList[cacheKeyParametersIndex].AsString());
}
}
if(jsonValue.ValueExists("integrationResponses"))
{
Aws::Map<Aws::String, JsonValue> integrationResponsesJsonMap = jsonValue.GetObject("integrationResponses").GetAllObjects();
for(auto& integrationResponsesItem : integrationResponsesJsonMap)
{
m_integrationResponses[integrationResponsesItem.first] = integrationResponsesItem.second.AsObject();
}
}
return *this;
}
| chiaming0914/awe-cpp-sdk | aws-cpp-sdk-apigateway/source/model/UpdateIntegrationResult.cpp | C++ | apache-2.0 | 3,871 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Fri Oct 11 15:55:39 PDT 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.datasketches.pig.hll.DataToSketch (datasketches-pig 1.1.0-incubating-SNAPSHOT API)</title>
<meta name="date" content="2019-10-11">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.datasketches.pig.hll.DataToSketch (datasketches-pig 1.1.0-incubating-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/datasketches/pig/hll/DataToSketch.html" title="class in org.apache.datasketches.pig.hll">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/datasketches/pig/hll/class-use/DataToSketch.html" target="_top">Frames</a></li>
<li><a href="DataToSketch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.datasketches.pig.hll.DataToSketch" class="title">Uses of Class<br>org.apache.datasketches.pig.hll.DataToSketch</h2>
</div>
<div class="classUseContainer">No usage of org.apache.datasketches.pig.hll.DataToSketch</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/datasketches/pig/hll/DataToSketch.html" title="class in org.apache.datasketches.pig.hll">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/datasketches/pig/hll/class-use/DataToSketch.html" target="_top">Frames</a></li>
<li><a href="DataToSketch.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| DataSketches/DataSketches.github.io | api/pig/snapshot/apidocs/org/apache/datasketches/pig/hll/class-use/DataToSketch.html | HTML | apache-2.0 | 4,824 |
/*
* Copyright (C) 2015 Willi Ye
*
* 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.grarak.kerneladiutor.fragments;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewTreeObserver;
import com.grarak.kerneladiutor.MainActivity;
/**
* Created by willi on 14.04.15.
*/
public abstract class BaseFragment extends Fragment implements MainActivity.OnBackButtonListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
public ActionBar getActionBar() {
return ((AppCompatActivity) getActivity()).getSupportActionBar();
}
public void onViewCreated(View view, Bundle saved) {
super.onViewCreated(view, saved);
final ViewTreeObserver observer = view.getViewTreeObserver();
observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
public void onGlobalLayout() {
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
observer.removeOnGlobalLayoutListener(this);
} else {
observer.removeGlobalOnLayoutListener(this);
}
onViewCreated();
} catch (Exception ignored) {}
}
});
}
public void onViewCreated() {
}
}
| spezi77/KernelAdiutor-Mod | app/src/main/java/com/grarak/kerneladiutor/fragments/BaseFragment.java | Java | apache-2.0 | 2,105 |
<?php
/**
* This example gets custom targeting values for the given predefined custom
* targeting key. The statement retrieves up to the maximum page size limit of
* 500. To create custom targeting values, run
* CreateCustomTargetingKeysAndValuesExample.php. To determine which custom
* targeting keys exist, run GetAllCustomTargetingKeysAndValuesExample.php.
*
* Tags: CustomTargetingService.getCustomTargetingValuesByStatement
*
* PHP version 5
*
* Copyright 2013, Google Inc. 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 GoogleApiAdsDfp
* @subpackage v201403
* @category WebServices
* @copyright 2013, Google Inc. All Rights Reserved.
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License,
* Version 2.0
* @author Adam Rogal
* @author Eric Koleda
*/
error_reporting(E_STRICT | E_ALL);
// You can set the include path to src directory or reference
// DfpUser.php directly via require_once.
// $path = '/path/to/dfp_api_php_lib/src';
$path = dirname(__FILE__) . '/../../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'Google/Api/Ads/Dfp/Lib/DfpUser.php';
require_once dirname(__FILE__) . '/../../../Common/ExampleUtils.php';
require_once 'Google/Api/Ads/Common/Util/MapUtils.php';
try {
// Get DfpUser from credentials in "../auth.ini"
// relative to the DfpUser.php file's directory.
$user = new DfpUser();
// Log SOAP XML request and response.
$user->LogDefaults();
// Get the CustomTargetingService.
$customTargetingService =
$user->GetService('CustomTargetingService', 'v201403');
// Set the ID of the custom targeting key to get custom targeting values for.
$keyId = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE';
// Create a statement to only select custom targeting values for a given key.
$filterStatement = new Statement(
'WHERE customTargetingKeyId = :keyId LIMIT 500',
MapUtils::GetMapEntries(array('keyId' => new NumberValue($keyId))));
// Get custom targeting keys by statement.
$page = $customTargetingService->getCustomTargetingValuesByStatement(
$filterStatement);
// Display results.
if (isset($page->results)) {
$i = $page->startIndex;
foreach ($page->results as $key) {
printf("%d) Custom targeting value with ID '%s', name '%s', and " .
"display name '%s' was found.\n", $i, $key->id, $key->name,
$key->displayName);
$i++;
}
}
printf("Number of results found: %d\n", sizeof($page->results));
} catch (OAuth2Exception $e) {
ExampleUtils::CheckForOAuth2Errors($e);
} catch (ValidationException $e) {
ExampleUtils::CheckForOAuth2Errors($e);
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
| classano/googleads | examples/Dfp/v201403/CustomTargetingService/GetCustomTargetingValuesByStatementExample.php | PHP | apache-2.0 | 3,281 |
var searchData=
[
['num_5fof_5fetalon',['NUM_OF_ETALON',['../analizer_8h.html#a39d05713f9a15de04077b8bea7b13f44',1,'analizer.h']]],
['num_5fof_5fled',['NUM_OF_LED',['../analizer_8h.html#a2bdaf37b88fc3b0920fffa2b6166be22',1,'analizer.h']]],
['num_5fof_5fpoints',['NUM_OF_POINTS',['../analizer_8h.html#a864b43588aed04ef9d694ec60ef7a9f1',1,'analizer.h']]]
];
| zvebabi/Analizer_LED_ms_HT | doxygen/html/search/defines_8.js | JavaScript | apache-2.0 | 362 |
function Node(id,_2,_3,_4,_5,_6,_7,_8,_9){
this.id=id;
this.pid=_2;
this.name=_3;
this.url=_4;
this.title=_5;
this.target=_6;
this.icon=_7;
this.iconOpen=_8;
this._io=_9||false;
this._is=false;
this._ls=false;
this._hc=false;
this._ai=0;
this._p;
}
function dTree(_a,_b){
this.config={target:null,folderLinks:true,useSelection:true,useCookies:true,useLines:true,useIcons:true,useStatusText:false,closeSameLevel:false,inOrder:false};
this.icon={root:_b+"img/base.gif",folder:_b+"img/folder.gif",folderOpen:_b+"img/folderopen.gif",node:_b+"img/page.gif",empty:_b+"img/empty.gif",line:_b+"img/line.gif",join:_b+"img/join.gif",joinBottom:_b+"img/joinbottom.gif",plus:_b+"img/plus.gif",plusBottom:_b+"img/plusbottom.gif",minus:_b+"img/minus.gif",minusBottom:_b+"img/minusbottom.gif",nlPlus:_b+"img/nolines_plus.gif",nlMinus:_b+"img/nolines_minus.gif"};
this.obj=_a;
this.aNodes=[];
this.aIndent=[];
this.root=new Node(-1);
this.selectedNode=null;
this.selectedFound=false;
this.completed=false;
}
dTree.prototype.add=function(id,_d,_e,_f,_10,_11,_12,_13,_14){
this.aNodes[this.aNodes.length]=new Node(id,_d,_e,_f,_10,_11,_12,_13,_14);
};
dTree.prototype.openAll=function(){
this.oAll(true);
};
dTree.prototype.closeAll=function(){
this.oAll(false);
};
dTree.prototype.toString=function(){
this.setCS_All();
var str="<div class=\"dtree\">\n";
if(document.getElementById){
if(this.config.useCookies){
this.selectedNode=this.getSelected();
}
str+=this.addNode(this.root);
}else{
str+="Browser not supported.";
}
str+="</div>";
if(!this.selectedFound){
this.selectedNode=null;
}
this.completed=true;
return str;
};
dTree.prototype.addNode=function(_16){
var str="";
var n=0;
if(this.config.inOrder){
n=_16._ai;
}
for(n;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_16.id){
var cn=this.aNodes[n];
cn._p=_16;
cn._ai=n;
if(!cn.target&&this.config.target){
cn.target=this.config.target;
}
if(cn._hc&&!cn._io&&this.config.useCookies){
cn._io=this.isOpen(cn.id);
}
if(!this.config.folderLinks&&cn._hc){
cn.url=null;
}
if(this.config.useSelection&&cn.id==this.selectedNode&&!this.selectedFound){
cn._is=true;
this.selectedNode=n;
this.selectedFound=true;
}
str+=this.node(cn,n);
if(cn._ls){
break;
}
}
}
return str;
};
dTree.prototype.node=function(_1a,_1b){
var str="<div class=\"dTreeNode\">"+this.indent(_1a,_1b);
if(this.config.useIcons){
if(!_1a.icon){
_1a.icon=(this.root.id==_1a.pid)?this.icon.root:((_1a._hc)?this.icon.folder:this.icon.node);
}
if(!_1a.iconOpen){
_1a.iconOpen=(_1a._hc)?this.icon.folderOpen:this.icon.node;
}
if(this.root.id==_1a.pid){
_1a.icon=this.icon.root;
_1a.iconOpen=this.icon.root;
}
str+="<img id=\"i"+this.obj+_1b+"\" src=\""+((_1a._io)?_1a.iconOpen:_1a.icon)+"\" alt=\"\" />";
}
if(_1a.url){
str+="<a id=\"s"+this.obj+_1b+"\" class=\""+((this.config.useSelection)?((_1a._is?"nodeSel":"node")):"node")+"\" href=\""+_1a.url+"\"";
if(_1a.title){
str+=" title=\""+_1a.title+"\"";
}
if(_1a.target){
str+=" target=\""+_1a.target+"\"";
}
if(this.config.useStatusText){
str+=" onmouseover=\"window.status='"+_1a.name+"';return true;\" onmouseout=\"window.status='';return true;\" ";
}
if(this.config.useSelection&&((_1a._hc&&this.config.folderLinks)||!_1a._hc)){
str+=" onclick=\"javascript: "+this.obj+".s("+_1b+");\"";
}
str+=">";
}else{
if((!this.config.folderLinks||!_1a.url)&&_1a._hc&&_1a.pid!=this.root.id){
str+="<a href=\"javascript: "+this.obj+".o("+_1b+");\" class=\"node\">";
}
}
str+=_1a.name;
if(_1a.url||((!this.config.folderLinks||!_1a.url)&&_1a._hc)){
str+="</a>";
}
str+="</div>";
if(_1a._hc){
str+="<div id=\"d"+this.obj+_1b+"\" class=\"clip\" style=\"display:"+((this.root.id==_1a.pid||_1a._io)?"block":"none")+";\">";
str+=this.addNode(_1a);
str+="</div>";
}
this.aIndent.pop();
return str;
};
dTree.prototype.indent=function(_1d,_1e){
var str="";
if(this.root.id!=_1d.pid){
for(var n=0;n<this.aIndent.length;n++){
str+="<img src=\""+((this.aIndent[n]==1&&this.config.useLines)?this.icon.line:this.icon.empty)+"\" alt=\"\" />";
}
(_1d._ls)?this.aIndent.push(0):this.aIndent.push(1);
if(_1d._hc){
str+="<a href=\"javascript: "+this.obj+".o("+_1e+");\"><img id=\"j"+this.obj+_1e+"\" src=\"";
if(!this.config.useLines){
str+=(_1d._io)?this.icon.nlMinus:this.icon.nlPlus;
}else{
str+=((_1d._io)?((_1d._ls&&this.config.useLines)?this.icon.minusBottom:this.icon.minus):((_1d._ls&&this.config.useLines)?this.icon.plusBottom:this.icon.plus));
}
str+="\" alt=\"\" /></a>";
}else{
str+="<img src=\""+((this.config.useLines)?((_1d._ls)?this.icon.joinBottom:this.icon.join):this.icon.empty)+"\" alt=\"\" />";
}
}
return str;
};
dTree.prototype.setCS=function(_21){
var _22;
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_21.id){
_21._hc=true;
}
if(this.aNodes[n].pid==_21.pid){
_22=this.aNodes[n].id;
}
}
if(_22==_21.id){
_21._ls=true;
}
};
dTree.prototype.setCS_All=function(){
var ids={};
for(var n=0;n<this.aNodes.length;n++){
var _26=this.aNodes[n];
if(!ids[_26.pid]){
ids[_26.pid]={_hc:true,_ls_is:_26.id};
}else{
ids[_26.pid]._hc=true;
ids[_26.pid]._ls_is=_26.id;
}
if(!ids[_26.id]){
ids[_26.id]={_hc:false,_ls_is:null};
}
}
for(var n=0;n<this.aNodes.length;n++){
var _26=this.aNodes[n];
_26._ls=ids[_26.pid]._ls_is==_26.id?true:false;
_26._hc=ids[_26.id]._hc;
}
};
dTree.prototype.getSelected=function(){
var sn=this.getCookie("cs"+this.obj);
return (sn)?sn:null;
};
dTree.prototype.s=function(id){
if(!this.config.useSelection){
return;
}
var cn=this.aNodes[id];
if(cn._hc&&!this.config.folderLinks){
return;
}
if(this.selectedNode!=id){
if(this.selectedNode||this.selectedNode==0){
eOld=document.getElementById("s"+this.obj+this.selectedNode);
eOld.className="node";
}
eNew=document.getElementById("s"+this.obj+id);
eNew.className="nodeSel";
this.selectedNode=id;
if(this.config.useCookies){
this.setCookie("cs"+this.obj,cn.id);
}
}
};
dTree.prototype.o=function(id){
var cn=this.aNodes[id];
this.nodeStatus(!cn._io,id,cn._ls);
cn._io=!cn._io;
if(this.config.closeSameLevel){
this.closeLevel(cn);
}
if(this.config.useCookies){
this.updateCookie();
}
};
dTree.prototype.oAll=function(_2c){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n]._hc&&this.aNodes[n].pid!=this.root.id){
this.nodeStatus(_2c,n,this.aNodes[n]._ls);
this.aNodes[n]._io=_2c;
}
}
if(this.config.useCookies){
this.updateCookie();
}
};
dTree.prototype.openTo=function(nId,_2f,_30){
if(!_30){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].id==nId){
nId=n;
break;
}
}
}
var cn=this.aNodes[nId];
if(cn.pid==this.root.id||!cn._p){
return;
}
cn._io=true;
cn._is=_2f;
if(this.completed&&cn._hc){
this.nodeStatus(true,cn._ai,cn._ls);
}
if(this.completed&&_2f){
this.s(cn._ai);
}else{
if(_2f){
this._sn=cn._ai;
}
}
this.openTo(cn._p._ai,false,true);
};
dTree.prototype.closeLevel=function(_33){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_33.pid&&this.aNodes[n].id!=_33.id&&this.aNodes[n]._hc){
this.nodeStatus(false,n,this.aNodes[n]._ls);
this.aNodes[n]._io=false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
dTree.prototype.closeAllChildren=function(_35){
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n].pid==_35.id&&this.aNodes[n]._hc){
if(this.aNodes[n]._io){
this.nodeStatus(false,n,this.aNodes[n]._ls);
}
this.aNodes[n]._io=false;
this.closeAllChildren(this.aNodes[n]);
}
}
};
dTree.prototype.nodeStatus=function(_37,id,_39){
eDiv=document.getElementById("d"+this.obj+id);
eJoin=document.getElementById("j"+this.obj+id);
if(this.config.useIcons){
eIcon=document.getElementById("i"+this.obj+id);
eIcon.src=(_37)?this.aNodes[id].iconOpen:this.aNodes[id].icon;
}
eJoin.src=(this.config.useLines)?((_37)?((_39)?this.icon.minusBottom:this.icon.minus):((_39)?this.icon.plusBottom:this.icon.plus)):((_37)?this.icon.nlMinus:this.icon.nlPlus);
eDiv.style.display=(_37)?"block":"none";
};
dTree.prototype.clearCookie=function(){
var now=new Date();
var _3b=new Date(now.getTime()-1000*60*60*24);
this.setCookie("co"+this.obj,"cookieValue",_3b);
this.setCookie("cs"+this.obj,"cookieValue",_3b);
};
dTree.prototype.setCookie=function(_3c,_3d,_3e,_3f,_40,_41){
document.cookie=escape(_3c)+"="+escape(_3d)+(_3e?"; expires="+_3e.toGMTString():"")+(_3f?"; path="+_3f:"")+(_40?"; domain="+_40:"")+(_41?"; secure":"");
};
dTree.prototype.getCookie=function(_42){
var _43="";
var _44=document.cookie.indexOf(escape(_42)+"=");
if(_44!=-1){
var _45=_44+(escape(_42)+"=").length;
var _46=document.cookie.indexOf(";",_45);
if(_46!=-1){
_43=unescape(document.cookie.substring(_45,_46));
}else{
_43=unescape(document.cookie.substring(_45));
}
}
return (_43);
};
dTree.prototype.updateCookie=function(){
var str="";
for(var n=0;n<this.aNodes.length;n++){
if(this.aNodes[n]._io&&this.aNodes[n].pid!=this.root.id){
if(str){
str+=".";
}
str+=this.aNodes[n].id;
}
}
this.setCookie("co"+this.obj,str);
};
dTree.prototype.isOpen=function(id){
var _4a=this.getCookie("co"+this.obj).split(".");
for(var n=0;n<_4a.length;n++){
if(_4a[n]==id){
return true;
}
}
return false;
};
if(!Array.prototype.push){
Array.prototype.push=function array_push(){
for(var i=0;i<arguments.length;i++){
this[this.length]=arguments[i];
}
return this.length;
};
}
if(!Array.prototype.pop){
Array.prototype.pop=function array_pop(){
lastElement=this[this.length-1];
this.length=Math.max(this.length-1,0);
return lastElement;
};
}
| apache/cocoon | blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/xinha/plugins/Linker/dTree/dtree.js | JavaScript | apache-2.0 | 9,239 |
/* The following code was generated by JFlex 1.4.3 on 04/03/12 16:02 */
/**
* 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.jena.iri.impl;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
* on 04/03/12 16:02 from the specification file
* <tt>tmp.jflex</tt>
*/
class LexerXHost extends AbsLexer implements org.apache.jena.iri.ViolationCodes, org.apache.jena.iri.IRIComponents, Lexer {
/** This character denotes the end of file */
private static final int YYEOF = -1;
/** initial size of the lookahead buffer */
private static final int ZZ_BUFFERSIZE = 2048;
/** lexical states */
public static final int YYINITIAL = 0;
/**
* ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
* ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
* at the beginning of a line
* l is of the form l = 2*k, k a non negative integer
*/
private static final int ZZ_LEXSTATE[] = {
0, 1
};
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\11\14\1\13\1\13\2\14\1\13\22\14\1\12\1\3\1\17\1\0"+
"\1\3\1\4\7\3\2\2\1\0\1\6\1\10\1\5\7\10\1\0"+
"\1\3\1\17\1\3\1\17\2\0\6\7\24\1\1\0\1\17\1\0"+
"\1\17\1\2\1\17\1\11\5\11\24\2\3\17\1\2\6\16\1\15"+
"\32\16\ud760\22\u0400\20\u0400\21\u2000\22";
/**
* Translates characters to character classes
*/
private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
/**
* Translates DFA states to action switch labels.
*/
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\2\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7"+
"\1\10\1\11\1\12\1\13\2\14\1\15\1\16\3\0"+
"\1\17\1\20\1\21\1\22\1\23";
private static int [] zzUnpackAction() {
int [] result = new int[25];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAction(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/**
* Translates a state to a row index in the transition table
*/
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\23\0\46\0\46\0\46\0\46\0\71\0\114"+
"\0\46\0\46\0\46\0\46\0\46\0\137\0\46\0\46"+
"\0\114\0\162\0\205\0\230\0\46\0\46\0\46\0\46"+
"\0\46";
private static int [] zzUnpackRowMap() {
int [] result = new int[25];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackRowMap(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int high = packed.charAt(i++) << 16;
result[j++] = high | packed.charAt(i++);
}
return j;
}
/**
* The transition table of the DFA
*/
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\3\1\4\1\5\1\6\1\7\2\5\1\4\2\5"+
"\1\10\1\11\1\12\1\13\1\14\1\15\1\16\1\17"+
"\1\20\1\3\1\4\1\5\1\6\1\7\2\5\1\4"+
"\2\5\1\21\1\11\1\12\1\13\1\14\1\15\1\16"+
"\1\17\1\20\30\0\1\22\3\23\1\24\23\0\1\25"+
"\31\0\1\26\6\0\1\27\1\30\2\27\1\31\16\0"+
"\4\27\1\31\16\0\5\31\11\0";
private static int [] zzUnpackTrans() {
int [] result = new int[171];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackTrans(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
value--;
do result[j++] = value; while (--count > 0);
}
return j;
}
/* error codes */
private static final int ZZ_UNKNOWN_ERROR = 0;
private static final int ZZ_NO_MATCH = 1;
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String ZZ_ERROR_MSG[] = {
"Unkown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/**
* ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
*/
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\2\0\4\11\2\1\5\11\1\1\2\11\1\1\3\0"+
"\5\11";
private static int [] zzUnpackAttribute() {
int [] result = new int[25];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
}
private static int zzUnpackAttribute(String packed, int offset, int [] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value; while (--count > 0);
}
return j;
}
/** the input device */
private java.io.Reader zzReader;
/** the current state of the DFA */
private int zzState;
/** the current lexical state */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
private int zzMarkedPos;
/** the current text position in the buffer */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
*/
private int yycolumn;
/**
* zzAtBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/* user code: */
private int lastChar;
@Override
char[] zzBuffer() {
yyreset(null);
this.zzAtEOF = true;
int length = parser.end(range)-parser.start(range);
lastChar = length - 1;
zzEndRead = length;
while (length > zzBuffer.length)
zzBuffer = new char[zzBuffer.length*2];
return zzBuffer;
}
@Override
protected void error(int e) {
switch(e) {
case PERCENT:
case PERCENT_20:
parser.recordError(HOST,USE_PUNYCODE_NOT_PERCENTS);
break;
}
parser.recordError(range,e);
}
/**
* Creates a new scanner
* There is also a java.io.InputStream version of this constructor.
*
* @param in the java.io.Reader to read input from.
*/
LexerXHost(java.io.Reader in) {
this.zzReader = in;
}
/**
* Creates a new scanner.
* There is also java.io.Reader version of this constructor.
*
* @param in the java.io.Inputstream to read input from.
*/
LexerXHost(java.io.InputStream in) {
this(new java.io.InputStreamReader(in));
}
/**
* Unpacks the compressed character translation table.
*
* @param packed the packed character translation table
* @return the unpacked character translation table
*/
private static char [] zzUnpackCMap(String packed) {
char [] map = new char[0x10000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 90) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; while (--count > 0);
}
return map;
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzStartRead = 0;
}
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length) {
/* if not: blow it up */
char newBuffer[] = new char[zzCurrentPos*2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
}
/* finally: fill the buffer with new input */
int numRead = zzReader.read(zzBuffer, zzEndRead,
zzBuffer.length-zzEndRead);
if (numRead > 0) {
zzEndRead+= numRead;
return false;
}
// unlikely but not impossible: read 0 characters, but not at end of stream
if (numRead == 0) {
int c = zzReader.read();
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char) c;
return false;
}
}
// numRead < 0
return true;
}
/**
* Closes the input stream.
*/
private final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <tt>ZZ_INITIAL</tt>.
*
* @param reader the new input stream
*/
private final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
yyline = yychar = yycolumn = 0;
zzLexicalState = YYINITIAL;
}
/**
* Returns the current lexical state.
*/
private final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
private final void yybegin(int newState) {
zzLexicalState = newState;
}
/**
* Returns the text matched by the current regular expression.
*/
@Override final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
}
/**
* Returns the character at position <tt>pos</tt> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
*
* @return the character at position pos
*/
private final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
}
/**
* Returns the length of the matched text region.
*/
private final int yylength() {
return zzMarkedPos-zzStartRead;
}
/**
* Reports an error that occurred while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
*
* @param errorCode the code of the errormessage to display
*/
private void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
*/
public void yypushback(int number) {
if ( number > yylength() )
zzScanError(ZZ_PUSHBACK_2BIG);
zzMarkedPos -= number;
}
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/
@Override
public int yylex() throws java.io.IOException {
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
int [] zzTransL = ZZ_TRANS;
int [] zzRowMapL = ZZ_ROWMAP;
int [] zzAttrL = ZZ_ATTRIBUTE;
while (true) {
zzMarkedPosL = zzMarkedPos;
yychar+= zzMarkedPosL-zzStartRead;
if (zzMarkedPosL > zzStartRead) {
switch (zzBufferL[zzMarkedPosL-1]) {
case '\n':
case '\u000B':
case '\u000C':
case '\u0085':
case '\u2028':
case '\u2029':
zzAtBOL = true;
break;
case '\r':
if (zzMarkedPosL < zzEndReadL)
zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
else if (zzAtEOF)
zzAtBOL = false;
else {
boolean eof = zzRefill();
zzMarkedPosL = zzMarkedPos;
zzEndReadL = zzEndRead;
zzBufferL = zzBuffer;
if (eof)
zzAtBOL = false;
else
zzAtBOL = zzBufferL[zzMarkedPosL] != '\n';
}
break;
default:
zzAtBOL = false;
}
}
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
if (zzAtBOL)
zzState = ZZ_LEXSTATE[zzLexicalState+1];
else
zzState = ZZ_LEXSTATE[zzLexicalState];
zzForAction: {
while (true) {
if (zzCurrentPosL < zzEndReadL)
zzInput = zzBufferL[zzCurrentPosL++];
else if (zzAtEOF) {
zzInput = YYEOF;
break zzForAction;
}
else {
// store back cached positions
zzCurrentPos = zzCurrentPosL;
zzMarkedPos = zzMarkedPosL;
boolean eof = zzRefill();
// get translated positions and possibly new buffer
zzCurrentPosL = zzCurrentPos;
zzMarkedPosL = zzMarkedPos;
zzBufferL = zzBuffer;
zzEndReadL = zzEndRead;
if (eof) {
zzInput = YYEOF;
break zzForAction;
}
else {
zzInput = zzBufferL[zzCurrentPosL++];
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
int zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
if ( (zzAttributes & 8) == 8 ) break zzForAction;
}
}
}
// store back cached position
zzMarkedPos = zzMarkedPosL;
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
case 15:
{ rule(-70);
error(DOUBLE_WHITESPACE);
}
case 20: break;
case 10:
{ rule(-115);
error(DISCOURAGED_XML_CHARACTER);
error(CONTROL_CHARACTER);
}
case 21: break;
case 13:
{ /*
xxxx,xxxx,xxxx,xxxx xxxx,xxxx,xxxx,xxxx
000u,uuuu,xxxx,xxxx,xxxx,xxxx 110110wwww,xxxx,xx 110111xx,xxxx,xxxx
wwww = uuuuu - 1.
*/
rule(-150);
difficultChar();
}
case 22: break;
case 16:
{ rule(-130);
surrogatePair();
}
case 23: break;
case 2:
{ rule(1);
error(LOWERCASE_PREFERRED);
}
case 24: break;
case 17:
{ rule(-40);
error(PERCENT);
}
case 25: break;
case 12:
{ rule(-140);
error(LONE_SURROGATE);
difficultChar();
}
case 26: break;
case 14:
{ rule(-80);
error(DOUBLE_WHITESPACE);
}
case 27: break;
case 19:
{ rule(-50);
error(PERCENT);
error(PERCENT_ENCODING_SHOULD_BE_UPPERCASE);
}
case 28: break;
case 6:
{ rule(-90);
if (yychar==lastChar)
error(DOUBLE_WHITESPACE);
else
error(WHITESPACE);
}
case 29: break;
case 11:
{ rule(-120);
error(UNWISE_CHARACTER);
}
case 30: break;
case 9:
{ rule(-113);
error(CONTROL_CHARACTER);
}
case 31: break;
case 3:
{ rule(-10);
}
case 32: break;
case 18:
{ rule(-30);
error(PERCENT_20);
}
case 33: break;
case 5:
{ rule(-60);
error(ILLEGAL_PERCENT_ENCODING);
}
case 34: break;
case 4:
{ rule(-20);
}
case 35: break;
case 7:
{ rule(-100);
error(CONTROL_CHARACTER);
error(NOT_XML_SCHEMA_WHITESPACE);
}
case 36: break;
case 1:
{ rule(-160);
error(ILLEGAL_CHARACTER);
}
case 37: break;
case 8:
{ rule(-110);
error(NON_XML_CHARACTER);
error(CONTROL_CHARACTER);
}
case 38: break;
default:
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
return YYEOF;
}
else {
zzScanError(ZZ_NO_MATCH);
}
}
}
}
}
| apache/jena | jena-iri/src/main/java/org/apache/jena/iri/impl/LexerXHost.java | Java | apache-2.0 | 19,596 |
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/compilation-info.h"
#include "src/compiler.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/linkage.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node.h"
#include "src/compiler/operator.h"
#include "src/compiler/pipeline.h"
#include "src/compiler/schedule.h"
#include "src/parsing/parse-info.h"
#include "src/zone/zone.h"
#include "test/cctest/cctest.h"
namespace v8 {
namespace internal {
namespace compiler {
static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite,
"dummy", 0, 0, 0, 0, 0, 0);
// So we can get a real JS function.
static Handle<JSFunction> Compile(const char* source) {
Isolate* isolate = CcTest::i_isolate();
Handle<String> source_code = isolate->factory()
->NewStringFromUtf8(CStrVector(source))
.ToHandleChecked();
Handle<SharedFunctionInfo> shared = Compiler::GetSharedFunctionInfoForScript(
source_code, Handle<String>(), 0, 0, v8::ScriptOriginOptions(),
Handle<Object>(), Handle<Context>(isolate->native_context()), NULL, NULL,
v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE, false);
return isolate->factory()->NewFunctionFromSharedFunctionInfo(
shared, isolate->native_context());
}
TEST(TestLinkageCreate) {
HandleAndZoneScope handles;
Handle<JSFunction> function = Compile("a + b");
ParseInfo parse_info(handles.main_zone(), handle(function->shared()));
CompilationInfo info(&parse_info, function);
CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(descriptor);
}
TEST(TestLinkageJSFunctionIncoming) {
const char* sources[] = {"(function() { })", "(function(a) { })",
"(function(a,b) { })", "(function(a,b,c) { })"};
for (int i = 0; i < 3; i++) {
HandleAndZoneScope handles;
Handle<JSFunction> function =
Handle<JSFunction>::cast(v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(CompileRun(sources[i]))));
ParseInfo parse_info(handles.main_zone(), handle(function->shared()));
CompilationInfo info(&parse_info, function);
CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
CHECK(descriptor);
CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount()));
CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
CHECK_EQ(Operator::kNoProperties, descriptor->properties());
CHECK_EQ(true, descriptor->IsJSFunctionCall());
}
}
TEST(TestLinkageJSCall) {
HandleAndZoneScope handles;
Handle<JSFunction> function = Compile("a + c");
ParseInfo parse_info(handles.main_zone(), handle(function->shared()));
CompilationInfo info(&parse_info, function);
for (int i = 0; i < 32; i++) {
CallDescriptor* descriptor = Linkage::GetJSCallDescriptor(
info.zone(), false, i, CallDescriptor::kNoFlags);
CHECK(descriptor);
CHECK_EQ(i, static_cast<int>(descriptor->JSParameterCount()));
CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
CHECK_EQ(Operator::kNoProperties, descriptor->properties());
CHECK_EQ(true, descriptor->IsJSFunctionCall());
}
}
TEST(TestLinkageRuntimeCall) {
// TODO(titzer): test linkage creation for outgoing runtime calls.
}
TEST(TestLinkageStubCall) {
Isolate* isolate = CcTest::InitIsolateOnce();
Zone zone(isolate->allocator(), ZONE_NAME);
Callable callable = CodeFactory::ToNumber(isolate);
CompilationInfo info(ArrayVector("test"), isolate, &zone,
Code::ComputeFlags(Code::STUB));
CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
isolate, &zone, callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kNoProperties);
CHECK(descriptor);
CHECK_EQ(0, static_cast<int>(descriptor->StackParameterCount()));
CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
CHECK_EQ(Operator::kNoProperties, descriptor->properties());
CHECK_EQ(false, descriptor->IsJSFunctionCall());
// TODO(titzer): test linkage creation for outgoing stub calls.
}
} // namespace compiler
} // namespace internal
} // namespace v8
| hkernbach/arangodb | 3rdParty/V8/v5.7.492.77/test/cctest/compiler/test-linkage.cc | C++ | apache-2.0 | 4,430 |
/**
* Copyright (C) 2016 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.market.curve.interpolator;
import static com.opengamma.strata.collect.TestHelper.assertSerialization;
import static org.testng.Assert.assertEquals;
import org.testng.annotations.Test;
import com.opengamma.strata.collect.array.DoubleArray;
/**
* Test {@link NaturalSplineCurveInterpolator}.
*/
@Test
public class NaturalSplineCurveInterpolatorTest {
private static final CurveInterpolator NATURAL_SPLINE_INTERPOLATOR = NaturalSplineCurveInterpolator.INSTANCE;
private static final CurveExtrapolator FLAT_EXTRAPOLATOR = CurveExtrapolators.FLAT;
private static final DoubleArray X_DATA = DoubleArray.of(0.0, 0.4, 1.0, 1.8, 2.8, 5.0);
private static final DoubleArray Y_DATA = DoubleArray.of(3.0, 4.0, 3.1, 2.0, 7.0, 2.0);
private static final DoubleArray X_TEST = DoubleArray.of(0.2, 1.1, 2.3);
private static final DoubleArray Y_TEST = DoubleArray.of(3.616894743727217, 2.8102203061222415, 4.223324003010826);
private static final double TOL = 1.e-12;
public void test_basics() {
assertEquals(NATURAL_SPLINE_INTERPOLATOR.getName(), NaturalSplineCurveInterpolator.NAME);
assertEquals(NATURAL_SPLINE_INTERPOLATOR.toString(), NaturalSplineCurveInterpolator.NAME);
}
//-------------------------------------------------------------------------
public void test_interpolation() {
BoundCurveInterpolator bci = NATURAL_SPLINE_INTERPOLATOR.bind(X_DATA, Y_DATA, FLAT_EXTRAPOLATOR, FLAT_EXTRAPOLATOR);
for (int i = 0; i < X_DATA.size(); i++) {
assertEquals(bci.interpolate(X_DATA.get(i)), Y_DATA.get(i), TOL);
}
for (int i = 0; i < X_TEST.size(); i++) {
assertEquals(bci.interpolate(X_TEST.get(i)), Y_TEST.get(i), TOL);
}
}
public void test_firstDerivative() {
BoundCurveInterpolator bci = NATURAL_SPLINE_INTERPOLATOR.bind(X_DATA, Y_DATA, FLAT_EXTRAPOLATOR, FLAT_EXTRAPOLATOR);
double eps = 1e-8;
double lo = bci.interpolate(0.2);
double hi = bci.interpolate(0.2 + eps);
double deriv = (hi - lo) / eps;
assertEquals(bci.firstDerivative(0.2), deriv, 1e-6);
}
//-------------------------------------------------------------------------
public void test_firstNode() {
BoundCurveInterpolator bci = NATURAL_SPLINE_INTERPOLATOR.bind(X_DATA, Y_DATA, FLAT_EXTRAPOLATOR, FLAT_EXTRAPOLATOR);
assertEquals(bci.interpolate(0.0), 3.0, TOL);
assertEquals(bci.parameterSensitivity(0.0).get(0), 1d, TOL);
assertEquals(bci.parameterSensitivity(0.0).get(1), 0d, TOL);
}
public void test_allNodes() {
BoundCurveInterpolator bci = NATURAL_SPLINE_INTERPOLATOR.bind(X_DATA, Y_DATA, FLAT_EXTRAPOLATOR, FLAT_EXTRAPOLATOR);
for (int i = 0; i < X_DATA.size(); i++) {
assertEquals(bci.interpolate(X_DATA.get(i)), Y_DATA.get(i), TOL);
}
}
public void test_lastNode() {
BoundCurveInterpolator bci = NATURAL_SPLINE_INTERPOLATOR.bind(X_DATA, Y_DATA, FLAT_EXTRAPOLATOR, FLAT_EXTRAPOLATOR);
assertEquals(bci.interpolate(5.0), 2.0, TOL);
assertEquals(bci.parameterSensitivity(5.0).get(X_DATA.size() - 2), 0d, TOL);
assertEquals(bci.parameterSensitivity(5.0).get(X_DATA.size() - 1), 1d, TOL);
}
//-------------------------------------------------------------------------
public void test_serialization() {
assertSerialization(NATURAL_SPLINE_INTERPOLATOR);
}
}
| jmptrader/Strata | modules/market/src/test/java/com/opengamma/strata/market/curve/interpolator/NaturalSplineCurveInterpolatorTest.java | Java | apache-2.0 | 3,461 |
"""Tests for the nut integration."""
import json
from unittest.mock import MagicMock, patch
from homeassistant.components.nut.const import DOMAIN
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_RESOURCES
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, load_fixture
def _get_mock_pynutclient(list_vars=None, list_ups=None):
pynutclient = MagicMock()
type(pynutclient).list_ups = MagicMock(return_value=list_ups)
type(pynutclient).list_vars = MagicMock(return_value=list_vars)
return pynutclient
async def async_init_integration(
hass: HomeAssistant, ups_fixture: str, resources: list, add_options: bool = False
) -> MockConfigEntry:
"""Set up the nexia integration in Home Assistant."""
ups_fixture = f"nut/{ups_fixture}.json"
list_vars = json.loads(load_fixture(ups_fixture))
mock_pynut = _get_mock_pynutclient(list_ups={"ups1": "UPS 1"}, list_vars=list_vars)
with patch(
"homeassistant.components.nut.PyNUTClient",
return_value=mock_pynut,
):
entry = MockConfigEntry(
domain=DOMAIN,
data={CONF_HOST: "mock", CONF_PORT: "mock", CONF_RESOURCES: resources},
options={CONF_RESOURCES: resources} if add_options else {},
)
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
return entry
| aronsky/home-assistant | tests/components/nut/util.py | Python | apache-2.0 | 1,446 |
/**
* easyXDM
* http://easyxdm.net/
* Copyright(c) 2009-2011, Øyvind Sean Kinsey, oyvind@kinsey.no.
*
* 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.
*/
(function (N, d, p, K, k, H) {
var b = this;
var n = Math.floor(Math.random() * 10000);
var q = Function.prototype;
var Q = /^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/;
var R = /[\-\w]+\/\.\.\//;
var F = /([^:])\/\//g;
var I = "";
var o = {};
var M = N.easyXDM;
var U = "easyXDM_";
var E;
var y = false;
var i;
var h;
function C(X, Z) {
var Y = typeof X[Z];
return Y == "function" || (!!(Y == "object" && X[Z])) || Y == "unknown"
}
function u(X, Y) {
return !!(typeof(X[Y]) == "object" && X[Y])
}
function r(X) {
return Object.prototype.toString.call(X) === "[object Array]"
}
function c() {
var Z = "Shockwave Flash", ad = "application/x-shockwave-flash";
if (!t(navigator.plugins) && typeof navigator.plugins[Z] == "object") {
var ab = navigator.plugins[Z].description;
if (ab && !t(navigator.mimeTypes) && navigator.mimeTypes[ad] && navigator.mimeTypes[ad].enabledPlugin) {
i = ab.match(/\d+/g)
}
}
if (!i) {
var Y;
try {
Y = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
i = Array.prototype.slice.call(Y.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/), 1);
Y = null
} catch (ac) {
}
}
if (!i) {
return false
}
var X = parseInt(i[0], 10), aa = parseInt(i[1], 10);
h = X > 9 && aa > 0;
return true
}
var v, x;
if (C(N, "addEventListener")) {
v = function (Z, X, Y) {
Z.addEventListener(X, Y, false)
};
x = function (Z, X, Y) {
Z.removeEventListener(X, Y, false)
}
} else {
if (C(N, "attachEvent")) {
v = function (X, Z, Y) {
X.attachEvent("on" + Z, Y)
};
x = function (X, Z, Y) {
X.detachEvent("on" + Z, Y)
}
} else {
throw new Error("Browser not supported")
}
}
var W = false, J = [], L;
if ("readyState" in d) {
L = d.readyState;
W = L == "complete" || (~navigator.userAgent.indexOf("AppleWebKit/") && (L == "loaded" || L == "interactive"))
} else {
W = !!d.body
}
function s() {
if (W) {
return
}
W = true;
for (var X = 0; X < J.length; X++) {
J[X]()
}
J.length = 0
}
if (!W) {
if (C(N, "addEventListener")) {
v(d, "DOMContentLoaded", s)
} else {
v(d, "readystatechange", function () {
if (d.readyState == "complete") {
s()
}
});
if (d.documentElement.doScroll && N === top) {
var g = function () {
if (W) {
return
}
try {
d.documentElement.doScroll("left")
} catch (X) {
K(g, 1);
return
}
s()
};
g()
}
}
v(N, "load", s)
}
function G(Y, X) {
if (W) {
Y.call(X);
return
}
J.push(function () {
Y.call(X)
})
}
function m() {
var Z = parent;
if (I !== "") {
for (var X = 0, Y = I.split("."); X < Y.length; X++) {
Z = Z[Y[X]]
}
}
return Z.easyXDM
}
function e(X) {
N.easyXDM = M;
I = X;
if (I) {
U = "easyXDM_" + I.replace(".", "_") + "_"
}
return o
}
function z(X) {
return X.match(Q)[3]
}
function f(X) {
return X.match(Q)[4] || ""
}
function j(Z) {
var X = Z.toLowerCase().match(Q);
var aa = X[2], ab = X[3], Y = X[4] || "";
if ((aa == "http:" && Y == ":80") || (aa == "https:" && Y == ":443")) {
Y = ""
}
return aa + "//" + ab + Y
}
function B(X) {
X = X.replace(F, "$1/");
if (!X.match(/^(http||https):\/\//)) {
var Y = (X.substring(0, 1) === "/") ? "" : p.pathname;
if (Y.substring(Y.length - 1) !== "/") {
Y = Y.substring(0, Y.lastIndexOf("/") + 1)
}
X = p.protocol + "//" + p.host + Y + X
}
while (R.test(X)) {
X = X.replace(R, "")
}
return X
}
function P(X, aa) {
var ac = "", Z = X.indexOf("#");
if (Z !== -1) {
ac = X.substring(Z);
X = X.substring(0, Z)
}
var ab = [];
for (var Y in aa) {
if (aa.hasOwnProperty(Y)) {
ab.push(Y + "=" + H(aa[Y]))
}
}
return X + (y ? "#" : (X.indexOf("?") == -1 ? "?" : "&")) + ab.join("&") + ac
}
var S = (function (X) {
X = X.substring(1).split("&");
var Z = {}, aa, Y = X.length;
while (Y--) {
aa = X[Y].split("=");
Z[aa[0]] = k(aa[1])
}
return Z
}(/xdm_e=/.test(p.search) ? p.search : p.hash));
function t(X) {
return typeof X === "undefined"
}
var O = function () {
var Y = {};
var Z = {a: [1, 2, 3]}, X = '{"a":[1,2,3]}';
if (typeof JSON != "undefined" && typeof JSON.stringify === "function" && JSON.stringify(Z).replace((/\s/g), "") === X) {
return JSON
}
if (Object.toJSON) {
if (Object.toJSON(Z).replace((/\s/g), "") === X) {
Y.stringify = Object.toJSON
}
}
if (typeof String.prototype.evalJSON === "function") {
Z = X.evalJSON();
if (Z.a && Z.a.length === 3 && Z.a[2] === 3) {
Y.parse = function (aa) {
return aa.evalJSON()
}
}
}
if (Y.stringify && Y.parse) {
O = function () {
return Y
};
return Y
}
return null
};
function T(X, Y, Z) {
var ab;
for (var aa in Y) {
if (Y.hasOwnProperty(aa)) {
if (aa in X) {
ab = Y[aa];
if (typeof ab === "object") {
T(X[aa], ab, Z)
} else {
if (!Z) {
X[aa] = Y[aa]
}
}
} else {
X[aa] = Y[aa]
}
}
}
return X
}
function a() {
var Y = d.body.appendChild(d.createElement("form")), X = Y.appendChild(d.createElement("input"));
X.name = U + "TEST" + n;
E = X !== Y.elements[X.name];
d.body.removeChild(Y)
}
function A(Y) {
if (t(E)) {
a()
}
var ac;
if (E) {
ac = d.createElement('<iframe name="' + Y.props.name + '"/>')
} else {
ac = d.createElement("IFRAME");
ac.name = Y.props.name
}
ac.id = ac.name = Y.props.name;
delete Y.props.name;
if (typeof Y.container == "string") {
Y.container = d.getElementById(Y.container)
}
if (!Y.container) {
T(ac.style, {position: "absolute", top: "-2000px", left: "0px"});
Y.container = d.body
}
var ab = Y.props.src;
Y.props.src = "javascript:false";
T(ac, Y.props);
ac.border = ac.frameBorder = 0;
ac.allowTransparency = true;
Y.container.appendChild(ac);
if (Y.onLoad) {
v(ac, "load", Y.onLoad)
}
if (Y.usePost) {
var aa = Y.container.appendChild(d.createElement("form")), X;
aa.target = ac.name;
aa.action = ab;
aa.method = "POST";
if (typeof(Y.usePost) === "object") {
for (var Z in Y.usePost) {
if (Y.usePost.hasOwnProperty(Z)) {
if (E) {
X = d.createElement('<input name="' + Z + '"/>')
} else {
X = d.createElement("INPUT");
X.name = Z
}
X.value = Y.usePost[Z];
aa.appendChild(X)
}
}
}
aa.submit();
aa.parentNode.removeChild(aa)
} else {
ac.src = ab
}
Y.props.src = ab;
return ac
}
function V(aa, Z) {
if (typeof aa == "string") {
aa = [aa]
}
var Y, X = aa.length;
while (X--) {
Y = aa[X];
Y = new RegExp(Y.substr(0, 1) == "^" ? Y : ("^" + Y.replace(/(\*)/g, ".$1").replace(/\?/g, ".") + "$"));
if (Y.test(Z)) {
return true
}
}
return false
}
function l(Z) {
var ae = Z.protocol, Y;
Z.isHost = Z.isHost || t(S.xdm_p);
y = Z.hash || false;
if (!Z.props) {
Z.props = {}
}
if (!Z.isHost) {
Z.channel = S.xdm_c.replace(/["'<>\\]/g, "");
Z.secret = S.xdm_s;
Z.remote = S.xdm_e.replace(/["'<>\\]/g, "");
ae = S.xdm_p;
if (Z.acl && !V(Z.acl, Z.remote)) {
throw new Error("Access denied for " + Z.remote)
}
} else {
Z.remote = B(Z.remote);
Z.channel = Z.channel || "default" + n++;
Z.secret = Math.random().toString(16).substring(2);
if (t(ae)) {
if (j(p.href) == j(Z.remote)) {
ae = "4"
} else {
if (C(N, "postMessage") || C(d, "postMessage")) {
ae = "1"
} else {
if (Z.swf && C(N, "ActiveXObject") && c()) {
ae = "6"
} else {
if (navigator.product === "Gecko" && "frameElement" in N && navigator.userAgent.indexOf("WebKit") == -1) {
ae = "5"
} else {
if (Z.remoteHelper) {
ae = "2"
} else {
ae = "0"
}
}
}
}
}
}
}
Z.protocol = ae;
switch (ae) {
case"0":
T(Z, {interval: 100, delay: 2000, useResize: true, useParent: false, usePolling: false}, true);
if (Z.isHost) {
if (!Z.local) {
var ac = p.protocol + "//" + p.host, X = d.body.getElementsByTagName("img"), ad;
var aa = X.length;
while (aa--) {
ad = X[aa];
if (ad.src.substring(0, ac.length) === ac) {
Z.local = ad.src;
break
}
}
if (!Z.local) {
Z.local = N
}
}
var ab = {xdm_c: Z.channel, xdm_p: 0};
if (Z.local === N) {
Z.usePolling = true;
Z.useParent = true;
Z.local = p.protocol + "//" + p.host + p.pathname + p.search;
ab.xdm_e = Z.local;
ab.xdm_pa = 1
} else {
ab.xdm_e = B(Z.local)
}
if (Z.container) {
Z.useResize = false;
ab.xdm_po = 1
}
Z.remote = P(Z.remote, ab)
} else {
T(Z, {
channel: S.xdm_c,
remote: S.xdm_e,
useParent: !t(S.xdm_pa),
usePolling: !t(S.xdm_po),
useResize: Z.useParent ? false : Z.useResize
})
}
Y = [new o.stack.HashTransport(Z), new o.stack.ReliableBehavior({}), new o.stack.QueueBehavior({
encode: true,
maxLength: 4000 - Z.remote.length
}), new o.stack.VerifyBehavior({initiate: Z.isHost})];
break;
case"1":
Y = [new o.stack.PostMessageTransport(Z)];
break;
case"2":
if (Z.isHost) {
Z.remoteHelper = B(Z.remoteHelper)
}
Y = [new o.stack.NameTransport(Z), new o.stack.QueueBehavior(), new o.stack.VerifyBehavior({initiate: Z.isHost})];
break;
case"3":
Y = [new o.stack.NixTransport(Z)];
break;
case"4":
Y = [new o.stack.SameOriginTransport(Z)];
break;
case"5":
Y = [new o.stack.FrameElementTransport(Z)];
break;
case"6":
if (!i) {
c()
}
Y = [new o.stack.FlashTransport(Z)];
break
}
Y.push(new o.stack.QueueBehavior({lazy: Z.lazy, remove: true}));
return Y
}
function D(aa) {
var ab, Z = {
incoming: function (ad, ac) {
this.up.incoming(ad, ac)
}, outgoing: function (ac, ad) {
this.down.outgoing(ac, ad)
}, callback: function (ac) {
this.up.callback(ac)
}, init: function () {
this.down.init()
}, destroy: function () {
this.down.destroy()
}
};
for (var Y = 0, X = aa.length; Y < X; Y++) {
ab = aa[Y];
T(ab, Z, true);
if (Y !== 0) {
ab.down = aa[Y - 1]
}
if (Y !== X - 1) {
ab.up = aa[Y + 1]
}
}
return ab
}
function w(X) {
X.up.down = X.down;
X.down.up = X.up;
X.up = X.down = null
}
T(o, {version: "2.4.19.3", query: S, stack: {}, apply: T, getJSONObject: O, whenReady: G, noConflict: e});
o.DomHelper = {
on: v, un: x, requiresJSON: function (X) {
if (!u(N, "JSON")) {
d.write('<script type="text/javascript" src="' + X + '"><\/script>')
}
}
};
(function () {
var X = {};
o.Fn = {
set: function (Y, Z) {
X[Y] = Z
}, get: function (Z, Y) {
if (!X.hasOwnProperty(Z)) {
return
}
var aa = X[Z];
if (Y) {
delete X[Z]
}
return aa
}
}
}());
o.Socket = function (Y) {
var X = D(l(Y).concat([{
incoming: function (ab, aa) {
Y.onMessage(ab, aa)
}, callback: function (aa) {
if (Y.onReady) {
Y.onReady(aa)
}
}
}])), Z = j(Y.remote);
this.origin = j(Y.remote);
this.destroy = function () {
X.destroy()
};
this.postMessage = function (aa) {
X.outgoing(aa, Z)
};
X.init()
};
o.Rpc = function (Z, Y) {
if (Y.local) {
for (var ab in Y.local) {
if (Y.local.hasOwnProperty(ab)) {
var aa = Y.local[ab];
if (typeof aa === "function") {
Y.local[ab] = {method: aa}
}
}
}
}
var X = D(l(Z).concat([new o.stack.RpcBehavior(this, Y), {
callback: function (ac) {
if (Z.onReady) {
Z.onReady(ac)
}
}
}]));
this.origin = j(Z.remote);
this.destroy = function () {
X.destroy()
};
X.init()
};
o.stack.SameOriginTransport = function (Y) {
var Z, ab, aa, X;
return (Z = {
outgoing: function (ad, ae, ac) {
aa(ad);
if (ac) {
ac()
}
}, destroy: function () {
if (ab) {
ab.parentNode.removeChild(ab);
ab = null
}
}, onDOMReady: function () {
X = j(Y.remote);
if (Y.isHost) {
T(Y.props, {
src: P(Y.remote, {
xdm_e: p.protocol + "//" + p.host + p.pathname,
xdm_c: Y.channel,
xdm_p: 4
}), name: U + Y.channel + "_provider"
});
ab = A(Y);
o.Fn.set(Y.channel, function (ac) {
aa = ac;
K(function () {
Z.up.callback(true)
}, 0);
return function (ad) {
Z.up.incoming(ad, X)
}
})
} else {
aa = m().Fn.get(Y.channel, true)(function (ac) {
Z.up.incoming(ac, X)
});
K(function () {
Z.up.callback(true)
}, 0)
}
}, init: function () {
G(Z.onDOMReady, Z)
}
})
};
o.stack.FlashTransport = function (aa) {
var ac, X, ab, ad, Y, ae;
function af(ah, ag) {
K(function () {
ac.up.incoming(ah, ad)
}, 0)
}
function Z(ah) {
var ag = aa.swf + "?host=" + aa.isHost;
var aj = "easyXDM_swf_" + Math.floor(Math.random() * 10000);
o.Fn.set("flash_loaded" + ah.replace(/[\-.]/g, "_"), function () {
o.stack.FlashTransport[ah].swf = Y = ae.firstChild;
var ak = o.stack.FlashTransport[ah].queue;
for (var al = 0; al < ak.length; al++) {
ak[al]()
}
ak.length = 0
});
if (aa.swfContainer) {
ae = (typeof aa.swfContainer == "string") ? d.getElementById(aa.swfContainer) : aa.swfContainer
} else {
ae = d.createElement("div");
T(ae.style, h && aa.swfNoThrottle ? {
height: "20px",
width: "20px",
position: "fixed",
right: 0,
top: 0
} : {height: "1px", width: "1px", position: "absolute", overflow: "hidden", right: 0, top: 0});
d.body.appendChild(ae)
}
var ai = "callback=flash_loaded" + H(ah.replace(/[\-.]/g, "_")) + "&proto=" + b.location.protocol + "&domain=" + H(z(b.location.href)) + "&port=" + H(f(b.location.href)) + "&ns=" + H(I);
ae.innerHTML = "<object height='20' width='20' type='application/x-shockwave-flash' id='" + aj + "' data='" + ag + "'><param name='allowScriptAccess' value='always'></param><param name='wmode' value='transparent'><param name='movie' value='" + ag + "'></param><param name='flashvars' value='" + ai + "'></param><embed type='application/x-shockwave-flash' FlashVars='" + ai + "' allowScriptAccess='always' wmode='transparent' src='" + ag + "' height='1' width='1'></embed></object>"
}
return (ac = {
outgoing: function (ah, ai, ag) {
Y.postMessage(aa.channel, ah.toString());
if (ag) {
ag()
}
}, destroy: function () {
try {
Y.destroyChannel(aa.channel)
} catch (ag) {
}
Y = null;
if (X) {
X.parentNode.removeChild(X);
X = null
}
}, onDOMReady: function () {
ad = aa.remote;
o.Fn.set("flash_" + aa.channel + "_init", function () {
K(function () {
ac.up.callback(true)
})
});
o.Fn.set("flash_" + aa.channel + "_onMessage", af);
aa.swf = B(aa.swf);
var ah = z(aa.swf);
var ag = function () {
o.stack.FlashTransport[ah].init = true;
Y = o.stack.FlashTransport[ah].swf;
Y.createChannel(aa.channel, aa.secret, j(aa.remote), aa.isHost);
if (aa.isHost) {
if (h && aa.swfNoThrottle) {
T(aa.props, {position: "fixed", right: 0, top: 0, height: "20px", width: "20px"})
}
T(aa.props, {
src: P(aa.remote, {xdm_e: j(p.href), xdm_c: aa.channel, xdm_p: 6, xdm_s: aa.secret}),
name: U + aa.channel + "_provider"
});
X = A(aa)
}
};
if (o.stack.FlashTransport[ah] && o.stack.FlashTransport[ah].init) {
ag()
} else {
if (!o.stack.FlashTransport[ah]) {
o.stack.FlashTransport[ah] = {queue: [ag]};
Z(ah)
} else {
o.stack.FlashTransport[ah].queue.push(ag)
}
}
}, init: function () {
G(ac.onDOMReady, ac)
}
})
};
o.stack.PostMessageTransport = function (aa) {
var ac, ad, Y, Z;
function X(ae) {
if (ae.origin) {
return j(ae.origin)
}
if (ae.uri) {
return j(ae.uri)
}
if (ae.domain) {
return p.protocol + "//" + ae.domain
}
throw"Unable to retrieve the origin of the event"
}
function ab(af) {
var ae = X(af);
if (ae == Z && af.data.substring(0, aa.channel.length + 1) == aa.channel + " ") {
ac.up.incoming(af.data.substring(aa.channel.length + 1), ae)
}
}
return (ac = {
outgoing: function (af, ag, ae) {
Y.postMessage(aa.channel + " " + af, ag || Z);
if (ae) {
ae()
}
}, destroy: function () {
x(N, "message", ab);
if (ad) {
Y = null;
ad.parentNode.removeChild(ad);
ad = null
}
}, onDOMReady: function () {
Z = j(aa.remote);
if (aa.isHost) {
var ae = function (af) {
if (af.data == aa.channel + "-ready") {
Y = ("postMessage" in ad.contentWindow) ? ad.contentWindow : ad.contentWindow.document;
x(N, "message", ae);
v(N, "message", ab);
K(function () {
ac.up.callback(true)
}, 0)
}
};
v(N, "message", ae);
T(aa.props, {
src: P(aa.remote, {xdm_e: j(p.href), xdm_c: aa.channel, xdm_p: 1}),
name: U + aa.channel + "_provider"
});
ad = A(aa)
} else {
v(N, "message", ab);
Y = ("postMessage" in N.parent) ? N.parent : N.parent.document;
Y.postMessage(aa.channel + "-ready", Z);
K(function () {
ac.up.callback(true)
}, 0)
}
}, init: function () {
G(ac.onDOMReady, ac)
}
})
};
o.stack.FrameElementTransport = function (Y) {
var Z, ab, aa, X;
return (Z = {
outgoing: function (ad, ae, ac) {
aa.call(this, ad);
if (ac) {
ac()
}
}, destroy: function () {
if (ab) {
ab.parentNode.removeChild(ab);
ab = null
}
}, onDOMReady: function () {
X = j(Y.remote);
if (Y.isHost) {
T(Y.props, {
src: P(Y.remote, {xdm_e: j(p.href), xdm_c: Y.channel, xdm_p: 5}),
name: U + Y.channel + "_provider"
});
ab = A(Y);
ab.fn = function (ac) {
delete ab.fn;
aa = ac;
K(function () {
Z.up.callback(true)
}, 0);
return function (ad) {
Z.up.incoming(ad, X)
}
}
} else {
if (d.referrer && j(d.referrer) != S.xdm_e) {
N.top.location = S.xdm_e
}
aa = N.frameElement.fn(function (ac) {
Z.up.incoming(ac, X)
});
Z.up.callback(true)
}
}, init: function () {
G(Z.onDOMReady, Z)
}
})
};
o.stack.NameTransport = function (ab) {
var ac;
var ae, ai, aa, ag, ah, Y, X;
function af(al) {
var ak = ab.remoteHelper + (ae ? "#_3" : "#_2") + ab.channel;
ai.contentWindow.sendMessage(al, ak)
}
function ad() {
if (ae) {
if (++ag === 2 || !ae) {
ac.up.callback(true)
}
} else {
af("ready");
ac.up.callback(true)
}
}
function aj(ak) {
ac.up.incoming(ak, Y)
}
function Z() {
if (ah) {
K(function () {
ah(true)
}, 0)
}
}
return (ac = {
outgoing: function (al, am, ak) {
ah = ak;
af(al)
}, destroy: function () {
ai.parentNode.removeChild(ai);
ai = null;
if (ae) {
aa.parentNode.removeChild(aa);
aa = null
}
}, onDOMReady: function () {
ae = ab.isHost;
ag = 0;
Y = j(ab.remote);
ab.local = B(ab.local);
if (ae) {
o.Fn.set(ab.channel, function (al) {
if (ae && al === "ready") {
o.Fn.set(ab.channel, aj);
ad()
}
});
X = P(ab.remote, {xdm_e: ab.local, xdm_c: ab.channel, xdm_p: 2});
T(ab.props, {src: X + "#" + ab.channel, name: U + ab.channel + "_provider"});
aa = A(ab)
} else {
ab.remoteHelper = ab.remote;
o.Fn.set(ab.channel, aj)
}
var ak = function () {
var al = ai || this;
x(al, "load", ak);
o.Fn.set(ab.channel + "_load", Z);
(function am() {
if (typeof al.contentWindow.sendMessage == "function") {
ad()
} else {
K(am, 50)
}
}())
};
ai = A({props: {src: ab.local + "#_4" + ab.channel}, onLoad: ak})
}, init: function () {
G(ac.onDOMReady, ac)
}
})
};
o.stack.HashTransport = function (Z) {
var ac;
var ah = this, af, aa, X, ad, am, ab, al;
var ag, Y;
function ak(ao) {
if (!al) {
return
}
var an = Z.remote + "#" + (am++) + "_" + ao;
((af || !ag) ? al.contentWindow : al).location = an
}
function ae(an) {
ad = an;
ac.up.incoming(ad.substring(ad.indexOf("_") + 1), Y)
}
function aj() {
if (!ab) {
return
}
var an = ab.location.href, ap = "", ao = an.indexOf("#");
if (ao != -1) {
ap = an.substring(ao)
}
if (ap && ap != ad) {
ae(ap)
}
}
function ai() {
aa = setInterval(aj, X)
}
return (ac = {
outgoing: function (an, ao) {
ak(an)
}, destroy: function () {
N.clearInterval(aa);
if (af || !ag) {
al.parentNode.removeChild(al)
}
al = null
}, onDOMReady: function () {
af = Z.isHost;
X = Z.interval;
ad = "#" + Z.channel;
am = 0;
ag = Z.useParent;
Y = j(Z.remote);
if (af) {
T(Z.props, {src: Z.remote, name: U + Z.channel + "_provider"});
if (ag) {
Z.onLoad = function () {
ab = N;
ai();
ac.up.callback(true)
}
} else {
var ap = 0, an = Z.delay / 50;
(function ao() {
if (++ap > an) {
throw new Error("Unable to reference listenerwindow")
}
try {
ab = al.contentWindow.frames[U + Z.channel + "_consumer"]
} catch (aq) {
}
if (ab) {
ai();
ac.up.callback(true)
} else {
K(ao, 50)
}
}())
}
al = A(Z)
} else {
ab = N;
ai();
if (ag) {
al = parent;
ac.up.callback(true)
} else {
T(Z, {
props: {src: Z.remote + "#" + Z.channel + new Date(), name: U + Z.channel + "_consumer"},
onLoad: function () {
ac.up.callback(true)
}
});
al = A(Z)
}
}
}, init: function () {
G(ac.onDOMReady, ac)
}
})
};
o.stack.ReliableBehavior = function (Y) {
var aa, ac;
var ab = 0, X = 0, Z = "";
return (aa = {
incoming: function (af, ad) {
var ae = af.indexOf("_"), ag = af.substring(0, ae).split(",");
af = af.substring(ae + 1);
if (ag[0] == ab) {
Z = "";
if (ac) {
ac(true)
}
}
if (af.length > 0) {
aa.down.outgoing(ag[1] + "," + ab + "_" + Z, ad);
if (X != ag[1]) {
X = ag[1];
aa.up.incoming(af, ad)
}
}
}, outgoing: function (af, ad, ae) {
Z = af;
ac = ae;
aa.down.outgoing(X + "," + (++ab) + "_" + af, ad)
}
})
};
o.stack.QueueBehavior = function (Z) {
var ac, ad = [], ag = true, aa = "", af, X = 0, Y = false, ab = false;
function ae() {
if (Z.remove && ad.length === 0) {
w(ac);
return
}
if (ag || ad.length === 0 || af) {
return
}
ag = true;
var ah = ad.shift();
ac.down.outgoing(ah.data, ah.origin, function (ai) {
ag = false;
if (ah.callback) {
K(function () {
ah.callback(ai)
}, 0)
}
ae()
})
}
return (ac = {
init: function () {
if (t(Z)) {
Z = {}
}
if (Z.maxLength) {
X = Z.maxLength;
ab = true
}
if (Z.lazy) {
Y = true
} else {
ac.down.init()
}
}, callback: function (ai) {
ag = false;
var ah = ac.up;
ae();
ah.callback(ai)
}, incoming: function (ak, ai) {
if (ab) {
var aj = ak.indexOf("_"), ah = parseInt(ak.substring(0, aj), 10);
aa += ak.substring(aj + 1);
if (ah === 0) {
if (Z.encode) {
aa = k(aa)
}
ac.up.incoming(aa, ai);
aa = ""
}
} else {
ac.up.incoming(ak, ai)
}
}, outgoing: function (al, ai, ak) {
if (Z.encode) {
al = H(al)
}
var ah = [], aj;
if (ab) {
while (al.length !== 0) {
aj = al.substring(0, X);
al = al.substring(aj.length);
ah.push(aj)
}
while ((aj = ah.shift())) {
ad.push({data: ah.length + "_" + aj, origin: ai, callback: ah.length === 0 ? ak : null})
}
} else {
ad.push({data: al, origin: ai, callback: ak})
}
if (Y) {
ac.down.init()
} else {
ae()
}
}, destroy: function () {
af = true;
ac.down.destroy()
}
})
};
o.stack.VerifyBehavior = function (ab) {
var ac, aa, Y, Z = false;
function X() {
aa = Math.random().toString(16).substring(2);
ac.down.outgoing(aa)
}
return (ac = {
incoming: function (af, ad) {
var ae = af.indexOf("_");
if (ae === -1) {
if (af === aa) {
ac.up.callback(true)
} else {
if (!Y) {
Y = af;
if (!ab.initiate) {
X()
}
ac.down.outgoing(af)
}
}
} else {
if (af.substring(0, ae) === Y) {
ac.up.incoming(af.substring(ae + 1), ad)
}
}
}, outgoing: function (af, ad, ae) {
ac.down.outgoing(aa + "_" + af, ad, ae)
}, callback: function (ad) {
if (ab.initiate) {
X()
}
}
})
};
o.stack.RpcBehavior = function (ad, Y) {
var aa, af = Y.serializer || O();
var ae = 0, ac = {};
function X(ag) {
ag.jsonrpc = "2.0";
aa.down.outgoing(af.stringify(ag))
}
function ab(ag, ai) {
var ah = Array.prototype.slice;
return function () {
var aj = arguments.length, al, ak = {method: ai};
if (aj > 0 && typeof arguments[aj - 1] === "function") {
if (aj > 1 && typeof arguments[aj - 2] === "function") {
al = {success: arguments[aj - 2], error: arguments[aj - 1]};
ak.params = ah.call(arguments, 0, aj - 2)
} else {
al = {success: arguments[aj - 1]};
ak.params = ah.call(arguments, 0, aj - 1)
}
ac["" + (++ae)] = al;
ak.id = ae
} else {
ak.params = ah.call(arguments, 0)
}
if (ag.namedParams && ak.params.length === 1) {
ak.params = ak.params[0]
}
X(ak)
}
}
function Z(an, am, ai, al) {
if (!ai) {
if (am) {
X({id: am, error: {code: -32601, message: "Procedure not found."}})
}
return
}
var ak, ah;
if (am) {
ak = function (ao) {
ak = q;
X({id: am, result: ao})
};
ah = function (ao, ap) {
ah = q;
var aq = {id: am, error: {code: -32099, message: ao}};
if (ap) {
aq.error.data = ap
}
X(aq)
}
} else {
ak = ah = q
}
if (!r(al)) {
al = [al]
}
try {
var ag = ai.method.apply(ai.scope, al.concat([ak, ah]));
if (!t(ag)) {
ak(ag)
}
} catch (aj) {
ah(aj.message)
}
}
return (aa = {
incoming: function (ah, ag) {
var ai = af.parse(ah);
if (ai.method) {
if (Y.handle) {
Y.handle(ai, X)
} else {
Z(ai.method, ai.id, Y.local[ai.method], ai.params)
}
} else {
var aj = ac[ai.id];
if (ai.error) {
if (aj.error) {
aj.error(ai.error)
}
} else {
if (aj.success) {
aj.success(ai.result)
}
}
delete ac[ai.id]
}
}, init: function () {
if (Y.remote) {
for (var ag in Y.remote) {
if (Y.remote.hasOwnProperty(ag)) {
ad[ag] = ab(Y.remote[ag], ag)
}
}
}
aa.down.init()
}, destroy: function () {
for (var ag in Y.remote) {
if (Y.remote.hasOwnProperty(ag) && ad.hasOwnProperty(ag)) {
delete ad[ag]
}
}
aa.down.destroy()
}
})
};
b.easyXDM = o
})(window, document, location, window.setTimeout, decodeURIComponent, encodeURIComponent);
| stori-es/stori_es | dashboard/src/main/webapp/cors/easyXDM.min.js | JavaScript | apache-2.0 | 42,231 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-06 05:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_hackathon_name'),
]
operations = [
migrations.AlterField(
model_name='hackathon',
name='name',
field=models.CharField(max_length=100, unique=True),
),
]
| andrewsosa/hackfsu_com | api/api/migrations/0003_auto_20161206_0538.py | Python | apache-2.0 | 458 |
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* 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
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <string>
#include <memory>
#include "modsecurity/actions/action.h"
#ifndef SRC_ACTIONS_NO_AUDIT_LOG_H_
#define SRC_ACTIONS_NO_AUDIT_LOG_H_
#ifdef __cplusplus
class Transaction;
namespace modsecurity {
class Transaction;
namespace actions {
class NoAuditLog : public Action {
public:
explicit NoAuditLog(const std::string &action)
: Action(action, RunTimeOnlyIfMatchKind) { }
bool evaluate(RuleWithActions *rule, Transaction *transaction,
std::shared_ptr<RuleMessage> rm) override;
};
} // namespace actions
} // namespace modsecurity
#endif
#endif // SRC_ACTIONS_NO_AUDIT_LOG_H_
| SpiderLabs/ModSecurity | src/actions/no_audit_log.h | C | apache-2.0 | 1,152 |
/*
* 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.shardingsphere.dbtest.cases.assertion.dml;
import lombok.Getter;
import org.apache.shardingsphere.dbtest.cases.assertion.root.IntegrateTestCase;
import javax.xml.bind.annotation.XmlElement;
import java.util.LinkedList;
import java.util.List;
/**
* JAXB definition of DML integrate test case.
*/
@Getter
public final class DMLIntegrateTestCase extends IntegrateTestCase {
@XmlElement(name = "assertion")
private List<DMLIntegrateTestCaseAssertion> integrateTestCaseAssertions = new LinkedList<>();
}
| shardingjdbc/sharding-jdbc | sharding-integration-test/sharding-jdbc-test/src/test/java/org/apache/shardingsphere/dbtest/cases/assertion/dml/DMLIntegrateTestCase.java | Java | apache-2.0 | 1,339 |
# 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.
from . import ObjectCreationParameters
__author__ = 'Shamal Faily'
class ResponseParameters(ObjectCreationParameters.ObjectCreationParameters):
def __init__(self,respName,respRisk,tags,cProps,rType):
ObjectCreationParameters.ObjectCreationParameters.__init__(self)
self.theName = respName
self.theTags = tags
self.theRisk = respRisk
self.theEnvironmentProperties = cProps
self.theResponseType = rType
def name(self): return self.theName
def tags(self): return self.theTags
def risk(self): return self.theRisk
def environmentProperties(self): return self.theEnvironmentProperties
def responseType(self): return self.theResponseType
| nathanbjenx/cairis | cairis/core/ResponseParameters.py | Python | apache-2.0 | 1,469 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_45) on Tue Jul 28 07:43:47 CEST 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.togglz.core.metadata (Togglz 2.2.0.Final API)</title>
<meta name="date" content="2015-07-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../../../../org/togglz/core/metadata/package-summary.html" target="classFrame">org.togglz.core.metadata</a></h1>
<div class="indexContainer">
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
<li><a href="FeatureGroup.html" title="interface in org.togglz.core.metadata" target="classFrame"><span class="interfaceName">FeatureGroup</span></a></li>
<li><a href="FeatureMetaData.html" title="interface in org.togglz.core.metadata" target="classFrame"><span class="interfaceName">FeatureMetaData</span></a></li>
</ul>
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="EmptyFeatureMetaData.html" title="class in org.togglz.core.metadata" target="classFrame">EmptyFeatureMetaData</a></li>
<li><a href="SimpleFeatureGroup.html" title="class in org.togglz.core.metadata" target="classFrame">SimpleFeatureGroup</a></li>
</ul>
</div>
</body>
</html>
| togglz/togglz-site | apidocs/2.2.0.Final/org/togglz/core/metadata/package-frame.html | HTML | apache-2.0 | 1,458 |
using Ploeh.AutoFixture;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Mendham.Testing.Builder.Test.TestObjects
{
[DefaultBuilder]
public class DerivedConstrainedInputObjectBuilder : Builder<DerivedConstrainedInputObject>
{
private string value;
private int derivedValue;
public DerivedConstrainedInputObjectBuilder()
{
this.value = ObjectCreationContext.Create<string>()
.Substring(0, 3);
this.derivedValue = ObjectCreationContext.Create<int>();
}
public DerivedConstrainedInputObjectBuilder WithValue(string value)
{
this.value = value;
return this;
}
public DerivedConstrainedInputObjectBuilder WithDerivedValue(int derivedValue)
{
this.derivedValue = derivedValue;
return this;
}
protected override DerivedConstrainedInputObject BuildObject()
{
return new DerivedConstrainedInputObject(value, derivedValue);
}
}
} | Mendham/Mendham | test/Mendham.Testing.Builder.Test/TestObjects/DerivedConstrainedInputObjectBuilder.cs | C# | apache-2.0 | 1,114 |
//========================================================================
//
//File: $RCSfile: ShapeElement.java,v $
//Version: $Revision: 1.3 $
//Modified: $Date: 2013/01/10 22:43:53 $
//
//Copyright 2005-2014 Mentor Graphics Corporation. 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.mentor.nucleus.bp.ui.canvas.test.model;
import java.util.UUID;
import com.mentor.nucleus.bp.core.Justification_c;
import com.mentor.nucleus.bp.core.Style_c;
public class ShapeElement {
private UUID id = UUID.randomUUID();
public String Get_compartment_text(int at, int comp_num, int ent_num) {
if(at == Justification_c.Center_in_X && comp_num == 1) {
return "Test Shape Element";
}
return "";
}
public int Get_compartments() {
return 1;
}
public int Get_entries(int comp_num) {
return 1;
}
public UUID Get_ooa_id() {
return id ;
}
public int Get_style() {
return Style_c.Box;
}
public int Get_text_style(int at, int comp_num, int ent_num) {
return Style_c.None;
}
}
| HebaKhaled/bposs | src/com.mentor.nucleus.bp.ui.canvas.test/src/com/mentor/nucleus/bp/ui/canvas/test/model/ShapeElement.java | Java | apache-2.0 | 1,777 |
/* Copyright (C) 1996,1997,1998, 1999, 2000, 2001, 2002 UPM-CLIP */
#include "threads.h"
#include "datadefs.h"
#include "support.h"
#include "predtyp.h"
#include "task_areas.h"
#include "profile_defs.h"
#include <assert.h>
/* declarations for global functions accessed here */
#include "builtin_defs.h"
#include "wam_defs.h"
#include "inout_defs.h"
/* local declarations */
#if defined(DBG) || defined(DEBUG)
static TAGGED safe_deref(TAGGED t);
#endif
BOOL set_predtrace(Arg)
Argdecl;
{
TAGGED x;
DEREF(x,X(0));
if (!TagIsSmall(x))
return FALSE;
predtrace = (BOOL)GetSmall(x);
#if defined(PROFILE)
if (profile||predtrace) stop_on_pred_calls = TRUE;
#else
if (predtrace) stop_on_pred_calls = TRUE;
#endif
return TRUE;
}
/* run_determ_c(goal) runs the goal and returns returns TRUE
if goal is defined as a c predicate, even if that predicate fails.
Otherwise it returns false.
*/
extern INSN *bootcode; /* Shared */
#if defined(INTERNAL_CALLING)
extern INSN *internal_calling; /* Shared */
#endif
extern INSN *startgoalcode; /* Shared */
extern INSN *startgoalcode_cont; /* Shared */
/*
myDEREF(Xderef,X)
TAGGED Xderef, X;
{
REGISTER TAGGED m_i, m_j;
TAGGED aux1, aux2, aux3;
TAGGED *aux4;
m_i = X;
if (IsVar(m_i))
do {
aux1 = (TAGGED)(m_i) & POINTERMASK;
aux2 = aux1 + MallocBase;
aux4 = (TAGGED *)aux2;
aux3 = *aux4;
m_i = aux3;
if (m_i == m_j)
break;
}
while (IsVar(m_i=m_j));
Xderef = m_i;
}
*/
BOOL run_determ_c(Arg,goal)
Argdecl;
TAGGED goal;
{
struct definition *func;
REGISTER int i;
REGISTER TAGGED *s;
/*
prolog_display(Arg);
printf("\n");
*/
DEREF(goal,goal);
/*myDEREF(goal,goal);*//* Was for debugging */
/*func = find_definition(&prolog_predicates,goal,&w->structure,FALSE);*/
func = find_definition(predicates_location,goal,&w->structure,FALSE);
if (func==NULL) return FALSE;
if (func->enter_instr == ENTER_C){
for (i=func->arity, s=w->structure; --i>=0;)
RefHeap(w->term[i],HeapOffset(s,i));
#if 0 /* was GAUGE */
return (*func->code.cinfo->procedure)(Arg);
#else
return (*func->code.cinfo)(Arg);
#endif
} else
if (func->enter_instr == BUILTIN_CALL){
w->next_insn = bootcode; /* Should have been initialized */
wam(w, NULL);
return TRUE;
}
return FALSE;
}
/* CALLQ|call/1|goal=X(0)|exit_toplevel */
#if defined(DBG) || defined(DEBUG)
static TAGGED safe_deref(t)
TAGGED t;
{
REGISTER TAGGED aux;
DerefSwitch(t,aux,;);
return (t & ~3);
}
void wr_tagged(Arg,t)
Argdecl;
TAGGED t;
{
wr_tagged_rec(Arg,t);
putchar('\n');
}
void wr_tagged_rec(Arg,t)
Argdecl;
TAGGED t;
{
REGISTER TAGGED temp;
int arity,i;
t = safe_deref(t);
switch(TagOf(t)) {
case LST:
putchar('[');
RefCar(temp,t);
wr_tagged_rec(Arg,temp);
RefCdr(temp,t);
t = safe_deref(temp);
while(TagIsLST(t)) {
putchar(',');
RefCar(temp,t);
wr_tagged_rec(Arg,temp);
RefCdr(temp,t);
t = safe_deref(temp);
}
if(t!=atom_nil) {
putchar('|');
wr_tagged_rec(Arg,t);
}
putchar(']');
break;
case STR:
if (STRIsLarge(t))
goto number;
wr_tagged_rec(Arg,TagToHeadfunctor(t));
putchar('(');
arity = Arity(TagToHeadfunctor(t));
for(i=1; i<=arity; i++){
if(i>1) putchar(',');
RefArg(temp,t,i);
wr_tagged_rec(Arg,temp);
}
putchar(')');
break;
case UBV:
case SVA:
case HVA:
case CVA:
print_variable(Arg,stream_user_output,t);
break;
case ATM:
print_atom(Arg,stream_user_output,t);
break;
case NUM:
number:
print_number(Arg, stream_user_output,t);
break;
}
}
#endif
static ENG_FLT fzero = 0.0; /* Shared, no locked */
static unsigned long *zeros = (unsigned long *)(&fzero); /* Shared */
void checkasserts()
{
assert((sizeof(ENG_INT) == 4));
assert((sizeof(TAGGED *) == 4));
assert((sizeof(ENG_FLT) == 8));
assert((zeros[0]==0 && zeros[1]==0));
}
void wr_functor(s,func)
char *s;
struct definition *func;
{
printf("%s: ",s);
wr_functor_1(func);
putchar('\n');
}
/* unused */
/*
static struct definition *which_parent(func)
struct definition *func;
{
REGISTER struct definition *func1;
do
func1 = func,
func = (struct definition *)TagToPointer(func1->printname);
while (!(func1->printname & 2));
return func;
}
*/
/* unused */
/*
static which_child(func)
struct definition *func;
{
REGISTER int i;
struct definition *f1;
for (i=1, f1 = which_parent(func)->code.incoreinfo->subdefs;
f1 != func;
i++, f1 = (struct definition *)TagToPointer(f1->printname))
;
return i;
printf("Out of order!!\n");
}
*/
void wr_functor_1(func)
struct definition *func;
{
if (!(func->printname & 1))
printf("%s/%d", GetString(func->printname), func->arity);
else
printf("(?)");
/*
{
putchar('(');
wr_functor_1(which_parent(func));
printf("-%d)/%d", which_child(func), func->arity);
}
*/
}
void display_term(Argdecl, TAGGED term, struct stream_node *stream, BOOL quoted);
void wr_call(Arg,s,func)
Argdecl;
char *s;
struct definition *func;
{
short i;
printf("%s: ",s);
if (!(func->printname & 1))
{
printf(GetString(func->printname));
if (func->arity > 0) {
putchar('(');
DEREF(X(0),X(0));
display_term(Arg,X(0),Output_Stream_Ptr, TRUE);
for (i = 1; i < func->arity; i++) printf(",_");
putchar(')');
}
}
else
printf("(?)");
putchar('\n');
}
#if defined(DBG) || defined(DEBUG)
void wr_functor_spec(Arg,t)
Argdecl;
TAGGED t;
{
wr_tagged(Arg,t);
printf("/%ld\n",Arity(t));
}
void wr_x(Arg,i)
Argdecl;
int i;
{
wr_tagged(Arg,X(i));
}
void wr_y(Arg,i)
Argdecl;
int i;
{
REGISTER struct frame *E = w->frame;
wr_tagged(Arg,Y(i));
}
#endif
| leuschel/ecce | www/CiaoDE/ciao/engine/builtin.c | C | apache-2.0 | 6,235 |
/*
* 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.jmeter.samplers.gui;
import java.util.Arrays;
import java.util.Collection;
import javax.swing.JPopupMenu;
import org.apache.jmeter.gui.AbstractJMeterGuiComponent;
import org.apache.jmeter.gui.util.MenuFactory;
/**
* This is the base class for JMeter GUI components which manage samplers.
*
*/
public abstract class AbstractSamplerGui extends AbstractJMeterGuiComponent {
private static final long serialVersionUID = 240L;
/**
* When a user right-clicks on the component in the test tree, or selects
* the edit menu when the component is selected, the component will be asked
* to return a JPopupMenu that provides all the options available to the
* user from this component.
* <p>
* This implementation returns menu items appropriate for most sampler
* components.
*
* @return a JPopupMenu appropriate for the component.
*/
@Override
public JPopupMenu createPopupMenu() {
return MenuFactory.getDefaultSamplerMenu();
}
/**
* This is the list of menu categories this gui component will be available
* under. This implementation returns
* {@link org.apache.jmeter.gui.util.MenuFactory#SAMPLERS}, which is
* appropriate for most sampler components.
*
* @return a Collection of Strings, where each element is one of the
* constants defined in MenuFactory
*/
@Override
public Collection<String> getMenuCategories() {
return Arrays.asList(new String[] { MenuFactory.SAMPLERS });
}
}
| saketh7/Jmeter | src/core/org/apache/jmeter/samplers/gui/AbstractSamplerGui.java | Java | apache-2.0 | 2,423 |
#ifndef __XN_PRIME_CLIENT_PROPS_H__
#define __XN_PRIME_CLIENT_PROPS_H__
#include <PrimeSense.h>
enum
{
/**** Device properties ****/
/* XnDetailedVersion, get only */
LINK_PROP_FW_VERSION = 0x12000001, // "FWVersion"
/* Int, get only */
LINK_PROP_VERSIONS_INFO_COUNT = 0x12000002, // "VersionsInfoCount"
/* General - array - XnComponentVersion * count elements, get only */
LINK_PROP_VERSIONS_INFO = 0x12000003, // "VersionsInfo"
/* Int - 0 means off, 1 means on. */
LINK_PROP_EMITTER_ACTIVE = 0x12000008, // "EmitterActive"
/* String. Set only */
LINK_PROP_PRESET_FILE = 0x1200000a, // "PresetFile"
/* Get only */
LINK_PROP_BOOT_STATUS = 0x1200000b,
/* Int - system specific units */
LINK_PROP_PROJECTOR_POWER = 0x1200000c,
/**** Device commands ****/
/* XnCommandGetFwStreams */
LINK_COMMAND_GET_FW_STREAM_LIST = 0x1200F001,
/* XnCommandCreateStream */
LINK_COMMAND_CREATE_FW_STREAM = 0x1200F002,
/* XnCommandDestroyStream */
LINK_COMMAND_DESTROY_FW_STREAM = 0x1200F003,
/* XnCommandStartStream */
LINK_COMMAND_START_FW_STREAM = 0x1200F004,
/* XnCommandStopStream */
LINK_COMMAND_STOP_FW_STREAM = 0x1200F005,
/* XnCommandGetFwStreamVideoModeList */
LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE_LIST = 0x1200F006,
/* XnCommandSetFwStreamVideoMode */
LINK_COMMAND_SET_FW_STREAM_VIDEO_MODE = 0x1200F007,
/* XnCommandGetFwStreamVideoMode */
LINK_COMMAND_GET_FW_STREAM_VIDEO_MODE = 0x1200F008,
/* XnCommandSetProjectorPulse */
LINK_COMMAND_SET_PROJECTOR_PULSE = 0x1200F009,
/* No args */
LINK_COMMAND_DISABLE_PROJECTOR_PULSE = 0x1200F00a,
/**** Stream properties ****/
/* Int. 1 - Shifts 9.3, 2 - Grayscale16, 3 - YUV422, 4 - Bayer8 */
LINK_PROP_PIXEL_FORMAT = 0x12001001, // "PixelFormat"
/* Int. 0 - None, 1 - 8z, 2 - 16z, 3 - 24z, 4 - 6-bit, 5 - 10-bit, 6 - 11-bit, 7 - 12-bit */
LINK_PROP_COMPRESSION = 0x12001002, // "Compression"
/**** Depth Stream properties ****/
/* Real, get only */
LINK_PROP_DEPTH_SCALE = 0x1200000b, // "DepthScale"
/* Int, get only */
LINK_PROP_MAX_SHIFT = 0x12002001, // "MaxShift"
/* Int, get only */
LINK_PROP_ZERO_PLANE_DISTANCE = 0x12002002, // "ZPD"
/* Int, get only */
LINK_PROP_CONST_SHIFT = 0x12002003, // "ConstShift"
/* Int, get only */
LINK_PROP_PARAM_COEFF = 0x12002004, // "ParamCoeff"
/* Int, get only */
LINK_PROP_SHIFT_SCALE = 0x12002005, // "ShiftScale"
/* Real, get only */
LINK_PROP_ZERO_PLANE_PIXEL_SIZE = 0x12002006, // "ZPPS"
/* Real, get only */
LINK_PROP_ZERO_PLANE_OUTPUT_PIXEL_SIZE = 0x12002007, // "ZPOPS"
/* Real, get only */
LINK_PROP_EMITTER_DEPTH_CMOS_DISTANCE = 0x12002008, // "LDDIS"
/* General - array - MaxShift * XnDepthPixel elements, get only */
LINK_PROP_SHIFT_TO_DEPTH_TABLE = 0x12002009, // "S2D"
/* General - array - MaxDepth * uint16_t elements, get only */
LINK_PROP_DEPTH_TO_SHIFT_TABLE = 0x1200200a, // "D2S"
};
typedef enum XnFileZone
{
XN_ZONE_FACTORY = 0x0000,
XN_ZONE_UPDATE = 0x0001,
} XnFileZone;
typedef enum XnBootErrorCode
{
XN_BOOT_OK = 0x0000,
XN_BOOT_BAD_CRC = 0x0001,
XN_BOOT_UPLOAD_IN_PROGRESS = 0x0002,
XN_BOOT_FW_LOAD_FAILED = 0x0003,
} XnBootErrorCode;
typedef enum XnFwStreamType
{
XN_FW_STREAM_TYPE_COLOR = 0x0001,
XN_FW_STREAM_TYPE_IR = 0x0002,
XN_FW_STREAM_TYPE_SHIFTS = 0x0003,
XN_FW_STREAM_TYPE_AUDIO = 0x0004,
XN_FW_STREAM_TYPE_DY = 0x0005,
XN_FW_STREAM_TYPE_LOG = 0x0008,
} XnFwStreamType;
typedef enum XnFwPixelFormat
{
XN_FW_PIXEL_FORMAT_NONE = 0x0000,
XN_FW_PIXEL_FORMAT_SHIFTS_9_3 = 0x0001,
XN_FW_PIXEL_FORMAT_GRAYSCALE16 = 0x0002,
XN_FW_PIXEL_FORMAT_YUV422 = 0x0003,
XN_FW_PIXEL_FORMAT_BAYER8 = 0x0004,
} XnFwPixelFormat;
typedef enum XnFwCompressionType
{
XN_FW_COMPRESSION_NONE = 0x0000,
XN_FW_COMPRESSION_8Z = 0x0001,
XN_FW_COMPRESSION_16Z = 0x0002,
XN_FW_COMPRESSION_24Z = 0x0003,
XN_FW_COMPRESSION_6_BIT_PACKED = 0x0004,
XN_FW_COMPRESSION_10_BIT_PACKED = 0x0005,
XN_FW_COMPRESSION_11_BIT_PACKED = 0x0006,
XN_FW_COMPRESSION_12_BIT_PACKED = 0x0007,
} XnFwCompressionType;
#pragma pack (push, 1)
#define XN_MAX_VERSION_MODIFIER_LENGTH 16
typedef struct XnDetailedVersion
{
uint8_t m_nMajor;
uint8_t m_nMinor;
uint16_t m_nMaintenance;
uint32_t m_nBuild;
char m_strModifier[XN_MAX_VERSION_MODIFIER_LENGTH];
} XnDetailedVersion;
typedef struct XnBootStatus
{
XnFileZone zone;
XnBootErrorCode errorCode;
} XnBootStatus;
typedef struct XnFwStreamInfo
{
XnFwStreamType type;
char creationInfo[80];
} XnFwStreamInfo;
typedef struct XnFwStreamVideoMode
{
uint32_t m_nXRes;
uint32_t m_nYRes;
uint32_t m_nFPS;
XnFwPixelFormat m_nPixelFormat;
XnFwCompressionType m_nCompression;
} XnFwStreamVideoMode;
typedef struct XnCommandGetFwStreamList
{
uint32_t count; // in: number of allocated elements in streams array. out: number of written elements in the array
XnFwStreamInfo* streams;
} XnCommandGetFwStreamList;
typedef struct XnCommandCreateStream
{
XnFwStreamType type;
const char* creationInfo;
uint32_t id; // out
} XnCommandCreateStream;
typedef struct XnCommandDestroyStream
{
uint32_t id;
} XnCommandDestroyStream;
typedef struct XnCommandStartStream
{
uint32_t id;
} XnCommandStartStream;
typedef struct XnCommandStopStream
{
uint32_t id;
} XnCommandStopStream;
typedef struct XnCommandGetFwStreamVideoModeList
{
int streamId;
uint32_t count; // in: number of allocated elements in videoModes array. out: number of written elements in the array
XnFwStreamVideoMode* videoModes;
} XnCommandGetFwStreamVideoModeList;
typedef struct XnCommandSetFwStreamVideoMode
{
int streamId;
XnFwStreamVideoMode videoMode;
} XnCommandSetFwStreamVideoMode;
typedef struct XnCommandGetFwStreamVideoMode
{
int streamId;
XnFwStreamVideoMode videoMode; // out
} XnCommandGetFwStreamVideoMode;
typedef struct XnCommandSetProjectorPulse
{
int delay;
int width;
int frames;
} XnCommandSetProjectorPulse;
#pragma pack (pop)
#endif //__XN_PRIME_CLIENT_PROPS_H__
| gaborpapp/Cinder-NI-nolibs | include/PSLink.h | C | apache-2.0 | 5,988 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.