text:
<?php
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/**
 * Service definition for Resourceviews (v1beta2).
 *
 *

 * The Resource View API allows users to create and manage logical sets of
 * Google Compute Engine instances.

 *
 *

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

 *
 * @author Google, Inc.
 */
class Google_Service_Resourceviews extends Google_Service
{
  /** View and manage your data across Google Cloud Platform services. */
  const CLOUD_PLATFORM =
      "https://www.googleapis.com/auth/cloud-platform";
  /** View your data across Google Cloud Platform services. */
  const CLOUD_PLATFORM_READ_ONLY =
      "https://www.googleapis.com/auth/cloud-platform.read-only";
  /** View and manage your Google Compute Engine resources. */
  const COMPUTE =
      "https://www.googleapis.com/auth/compute";
  /** View your Google Compute Engine resources. */
  const COMPUTE_READONLY =
      "https://www.googleapis.com/auth/compute.readonly";
  /** View and manage your Google Cloud Platform management resources and deployment status information. */
  const NDEV_CLOUDMAN =
      "https://www.googleapis.com/auth/ndev.cloudman";
  /** View your Google Cloud Platform management resources and deployment status information. */
  const NDEV_CLOUDMAN_READONLY =
      "https://www.googleapis.com/auth/ndev.cloudman.readonly";

  public $zoneOperations;
  public $zoneViews;

  /**
   * Constructs the internal representation of the Resourceviews service.
   *
   * @param Google_Client $client
   */
  public function __construct(Google_Client $client)
  {
    parent::__construct($client);
    $this->rootUrl = 'https://www.googleapis.com/';
    $this->servicePath = 'resourceviews/v1beta2/projects/';
    $this->version = 'v1beta2';
    $this->serviceName = 'resourceviews';

    $this->zoneOperations = new Google_Service_Resourceviews_ZoneOperations_Resource(
        $this,
        $this->serviceName,
        'zoneOperations',
        array(
          'methods' => array(
            'get' => array(
              'path' => '{project}/zones/{zone}/operations/{operation}',
              'httpMethod' => 'GET',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'operation' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'list' => array(
              'path' => '{project}/zones/{zone}/operations',
              'httpMethod' => 'GET',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'filter' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
                'maxResults' => array(
                  'location' => 'query',
                  'type' => 'integer',
                ),
                'pageToken' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
              ),
            ),
          )
        )
    );
    $this->zoneViews = new Google_Service_Resourceviews_ZoneViews_Resource(
        $this,
        $this->serviceName,
        'zoneViews',
        array(
          'methods' => array(
            'addResources' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}/addResources',
              'httpMethod' => 'POST',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'delete' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}',
              'httpMethod' => 'DELETE',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'get' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}',
              'httpMethod' => 'GET',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'getService' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}/getService',
              'httpMethod' => 'POST',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceName' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
              ),
            ),'insert' => array(
              'path' => '{project}/zones/{zone}/resourceViews',
              'httpMethod' => 'POST',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'list' => array(
              'path' => '{project}/zones/{zone}/resourceViews',
              'httpMethod' => 'GET',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'maxResults' => array(
                  'location' => 'query',
                  'type' => 'integer',
                ),
                'pageToken' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
              ),
            ),'listResources' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}/resources',
              'httpMethod' => 'GET',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'format' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
                'listState' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
                'maxResults' => array(
                  'location' => 'query',
                  'type' => 'integer',
                ),
                'pageToken' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
                'serviceName' => array(
                  'location' => 'query',
                  'type' => 'string',
                ),
              ),
            ),'removeResources' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}/removeResources',
              'httpMethod' => 'POST',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),'setService' => array(
              'path' => '{project}/zones/{zone}/resourceViews/{resourceView}/setService',
              'httpMethod' => 'POST',
              'parameters' => array(
                'project' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'zone' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
                'resourceView' => array(
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ),
              ),
            ),
          )
        )
    );
  }
}

/**
 * The "zoneOperations" collection of methods.
 * Typical usage is:
 *
 *   $resourceviewsService = new Google_Service_Resourceviews(...);
 *   $zoneOperations = $resourceviewsService->zoneOperations;
 *
 */
class Google_Service_Resourceviews_ZoneOperations_Resource extends Google_Service_Resource
{

  /**
   * Retrieves the specified zone-specific operation resource.
   * (zoneOperations.get)
   *
   * @param string $project Name of the project scoping this request.
   * @param string $zone Name of the zone scoping this request.
   * @param string $operation Name of the operation resource to return.
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function get($project, $zone, $operation, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);
    $params = array_merge($params, $optParams);
    return $this->call('get', array($params), "Google_Service_Resourceviews_Operation");
  }

  /**
   * Retrieves the list of operation resources contained within the specified
   * zone. (zoneOperations.listZoneOperations)
   *
   * @param string $project Name of the project scoping this request.
   * @param string $zone Name of the zone scoping this request.
   * @param array $optParams Optional parameters.
   *
   * @opt_param string filter Optional. Filter expression for filtering listed
   * resources.
   * @opt_param string maxResults Optional. Maximum count of results to be
   * returned. Maximum value is 500 and default value is 500.
   * @opt_param string pageToken Optional. Tag returned by a previous list request
   * truncated by maxResults. Used to continue a previous list request.
   * @return Google_Service_Resourceviews_OperationList
   */
  public function listZoneOperations($project, $zone, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_Resourceviews_OperationList");
  }
}

/**
 * The "zoneViews" collection of methods.
 * Typical usage is:
 *
 *   $resourceviewsService = new Google_Service_Resourceviews(...);
 *   $zoneViews = $resourceviewsService->zoneViews;
 *
 */
class Google_Service_Resourceviews_ZoneViews_Resource extends Google_Service_Resource
{

  /**
   * Add resources to the view. (zoneViews.addResources)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param Google_ZoneViewsAddResourcesRequest $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function addResources($project, $zone, $resourceView, Google_Service_Resourceviews_ZoneViewsAddResourcesRequest $postBody, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('addResources', array($params), "Google_Service_Resourceviews_Operation");
  }

  /**
   * Delete a resource view. (zoneViews.delete)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function delete($project, $zone, $resourceView, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params), "Google_Service_Resourceviews_Operation");
  }

  /**
   * Get the information of a zonal resource view. (zoneViews.get)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_ResourceView
   */
  public function get($project, $zone, $resourceView, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView);
    $params = array_merge($params, $optParams);
    return $this->call('get', array($params), "Google_Service_Resourceviews_ResourceView");
  }

  /**
   * Get the service information of a resource view or a resource.
   * (zoneViews.getService)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param array $optParams Optional parameters.
   *
   * @opt_param string resourceName The name of the resource if user wants to get
   * the service information of the resource.
   * @return Google_Service_Resourceviews_ZoneViewsGetServiceResponse
   */
  public function getService($project, $zone, $resourceView, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView);
    $params = array_merge($params, $optParams);
    return $this->call('getService', array($params), "Google_Service_Resourceviews_ZoneViewsGetServiceResponse");
  }

  /**
   * Create a resource view. (zoneViews.insert)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param Google_ResourceView $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function insert($project, $zone, Google_Service_Resourceviews_ResourceView $postBody, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('insert', array($params), "Google_Service_Resourceviews_Operation");
  }

  /**
   * List resource views. (zoneViews.listZoneViews)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param array $optParams Optional parameters.
   *
   * @opt_param int maxResults Maximum count of results to be returned. Acceptable
   * values are 0 to 5000, inclusive. (Default: 5000)
   * @opt_param string pageToken Specifies a nextPageToken returned by a previous
   * list request. This token can be used to request the next page of results from
   * a previous list request.
   * @return Google_Service_Resourceviews_ZoneViewsList
   */
  public function listZoneViews($project, $zone, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_Resourceviews_ZoneViewsList");
  }

  /**
   * List the resources of the resource view. (zoneViews.listResources)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param array $optParams Optional parameters.
   *
   * @opt_param string format The requested format of the return value. It can be
   * URL or URL_PORT. A JSON object will be included in the response based on the
   * format. The default format is NONE, which results in no JSON in the response.
   * @opt_param string listState The state of the instance to list. By default, it
   * lists all instances.
   * @opt_param int maxResults Maximum count of results to be returned. Acceptable
   * values are 0 to 5000, inclusive. (Default: 5000)
   * @opt_param string pageToken Specifies a nextPageToken returned by a previous
   * list request. This token can be used to request the next page of results from
   * a previous list request.
   * @opt_param string serviceName The service name to return in the response. It
   * is optional and if it is not set, all the service end points will be
   * returned.
   * @return Google_Service_Resourceviews_ZoneViewsListResourcesResponse
   */
  public function listResources($project, $zone, $resourceView, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView);
    $params = array_merge($params, $optParams);
    return $this->call('listResources', array($params), "Google_Service_Resourceviews_ZoneViewsListResourcesResponse");
  }

  /**
   * Remove resources from the view. (zoneViews.removeResources)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param Google_ZoneViewsRemoveResourcesRequest $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function removeResources($project, $zone, $resourceView, Google_Service_Resourceviews_ZoneViewsRemoveResourcesRequest $postBody, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('removeResources', array($params), "Google_Service_Resourceviews_Operation");
  }

  /**
   * Update the service information of a resource view or a resource.
   * (zoneViews.setService)
   *
   * @param string $project The project name of the resource view.
   * @param string $zone The zone name of the resource view.
   * @param string $resourceView The name of the resource view.
   * @param Google_ZoneViewsSetServiceRequest $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_Resourceviews_Operation
   */
  public function setService($project, $zone, $resourceView, Google_Service_Resourceviews_ZoneViewsSetServiceRequest $postBody, $optParams = array())
  {
    $params = array('project' => $project, 'zone' => $zone, 'resourceView' => $resourceView, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('setService', array($params), "Google_Service_Resourceviews_Operation");
  }
}

class Google_Service_Resourceviews_Label extends Google_Model
{
  protected $internal_gapi_mappings = array(
  );
  public $key;
  public $value;

  public function setKey($key)
  {
    $this->key = $key;
  }
  public function getKey()
  {
    return $this->key;
  }
  public function setValue($value)
  {
    $this->value = $value;
  }
  public function getValue()
  {
    return $this->value;
  }
}

class Google_Service_Resourceviews_ListResourceResponseItem extends Google_Model
{
  protected $internal_gapi_mappings = array(
  );
  public $endpoints;
  public $resource;

  public function setEndpoints($endpoints)
  {
    $this->endpoints = $endpoints;
  }
  public function getEndpoints()
  {
    return $this->endpoints;
  }
  public function setResource($resource)
  {
    $this->resource = $resource;
  }
  public function getResource()
  {
    return $this->resource;
  }
}

class Google_Service_Resourceviews_Operation extends Google_Collection
{
  protected $collection_key = 'warnings';
  protected $internal_gapi_mappings = array(
  );
  public $clientOperationId;
  public $creationTimestamp;
  public $endTime;
  protected $errorType = 'Google_Service_Resourceviews_OperationError';
  protected $errorDataType = '';
  public $httpErrorMessage;
  public $httpErrorStatusCode;
  public $id;
  public $insertTime;
  public $kind;
  public $name;
  public $operationType;
  public $progress;
  public $region;
  public $selfLink;
  public $startTime;
  public $status;
  public $statusMessage;
  public $targetId;
  public $targetLink;
  public $user;
  protected $warningsType = 'Google_Service_Resourceviews_OperationWarnings';
  protected $warningsDataType = 'array';
  public $zone;

  public function setClientOperationId($clientOperationId)
  {
    $this->clientOperationId = $clientOperationId;
  }
  public function getClientOperationId()
  {
    return $this->clientOperationId;
  }
  public function setCreationTimestamp($creationTimestamp)
  {
    $this->creationTimestamp = $creationTimestamp;
  }
  public function getCreationTimestamp()
  {
    return $this->creationTimestamp;
  }
  public function setEndTime($endTime)
  {
    $this->endTime = $endTime;
  }
  public function getEndTime()
  {
    return $this->endTime;
  }
  public function setError(Google_Service_Resourceviews_OperationError $error)
  {
    $this->error = $error;
  }
  public function getError()
  {
    return $this->error;
  }
  public function setHttpErrorMessage($httpErrorMessage)
  {
    $this->httpErrorMessage = $httpErrorMessage;
  }
  public function getHttpErrorMessage()
  {
    return $this->httpErrorMessage;
  }
  public function setHttpErrorStatusCode($httpErrorStatusCode)
  {
    $this->httpErrorStatusCode = $httpErrorStatusCode;
  }
  public function getHttpErrorStatusCode()
  {
    return $this->httpErrorStatusCode;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setInsertTime($insertTime)
  {
    $this->insertTime = $insertTime;
  }
  public function getInsertTime()
  {
    return $this->insertTime;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setOperationType($operationType)
  {
    $this->operationType = $operationType;
  }
  public function getOperationType()
  {
    return $this->operationType;
  }
  public function setProgress($progress)
  {
    $this->progress = $progress;
  }
  public function getProgress()
  {
    return $this->progress;
  }
  public function setRegion($region)
  {
    $this->region = $region;
  }
  public function getRegion()
  {
    return $this->region;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
  public function setStartTime($startTime)
  {
    $this->startTime = $startTime;
  }
  public function getStartTime()
  {
    return $this->startTime;
  }
  public function setStatus($status)
  {
    $this->status = $status;
  }
  public function getStatus()
  {
    return $this->status;
  }
  public function setStatusMessage($statusMessage)
  {
    $this->statusMessage = $statusMessage;
  }
  public function getStatusMessage()
  {
    return $this->statusMessage;
  }
  public function setTargetId($targetId)
  {
    $this->targetId = $targetId;
  }
  public function getTargetId()
  {
    return $this->targetId;
  }
  public function setTargetLink($targetLink)
  {
    $this->targetLink = $targetLink;
  }
  public function getTargetLink()
  {
    return $this->targetLink;
  }
  public function setUser($user)
  {
    $this->user = $user;
  }
  public function getUser()
  {
    return $this->user;
  }
  public function setWarnings($warnings)
  {
    $this->warnings = $warnings;
  }
  public function getWarnings()
  {
    return $this->warnings;
  }
  public function setZone($zone)
  {
    $this->zone = $zone;
  }
  public function getZone()
  {
    return $this->zone;
  }
}

class Google_Service_Resourceviews_OperationError extends Google_Collection
{
  protected $collection_key = 'errors';
  protected $internal_gapi_mappings = array(
  );
  protected $errorsType = 'Google_Service_Resourceviews_OperationErrorErrors';
  protected $errorsDataType = 'array';

  public function setErrors($errors)
  {
    $this->errors = $errors;
  }
  public function getErrors()
  {
    return $this->errors;
  }
}

class Google_Service_Resourceviews_OperationErrorErrors extends Google_Model
{
  protected $internal_gapi_mappings = array(
  );
  public $code;
  public $location;
  public $message;

  public function setCode($code)
  {
    $this->code = $code;
  }
  public function getCode()
  {
    return $this->code;
  }
  public function setLocation($location)
  {
    $this->location = $location;
  }
  public function getLocation()
  {
    return $this->location;
  }
  public function setMessage($message)
  {
    $this->message = $message;
  }
  public function getMessage()
  {
    return $this->message;
  }
}

class Google_Service_Resourceviews_OperationList extends Google_Collection
{
  protected $collection_key = 'items';
  protected $internal_gapi_mappings = array(
  );
  public $id;
  protected $itemsType = 'Google_Service_Resourceviews_Operation';
  protected $itemsDataType = 'array';
  public $kind;
  public $nextPageToken;
  public $selfLink;

  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setItems($items)
  {
    $this->items = $items;
  }
  public function getItems()
  {
    return $this->items;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
}

class Google_Service_Resourceviews_OperationWarnings extends Google_Collection
{
  protected $collection_key = 'data';
  protected $internal_gapi_mappings = array(
  );
  public $code;
  protected $dataType = 'Google_Service_Resourceviews_OperationWarningsData';
  protected $dataDataType = 'array';
  public $message;

  public function setCode($code)
  {
    $this->code = $code;
  }
  public function getCode()
  {
    return $this->code;
  }
  public function setData($data)
  {
    $this->data = $data;
  }
  public function getData()
  {
    return $this->data;
  }
  public function setMessage($message)
  {
    $this->message = $message;
  }
  public function getMessage()
  {
    return $this->message;
  }
}

class Google_Service_Resourceviews_OperationWarningsData extends Google_Model
{
  protected $internal_gapi_mappings = array(
  );
  public $key;
  public $value;

  public function setKey($key)
  {
    $this->key = $key;
  }
  public function getKey()
  {
    return $this->key;
  }
  public function setValue($value)
  {
    $this->value = $value;
  }
  public function getValue()
  {
    return $this->value;
  }
}

class Google_Service_Resourceviews_ResourceView extends Google_Collection
{
  protected $collection_key = 'resources';
  protected $internal_gapi_mappings = array(
  );
  public $creationTimestamp;
  public $description;
  protected $endpointsType = 'Google_Service_Resourceviews_ServiceEndpoint';
  protected $endpointsDataType = 'array';
  public $fingerprint;
  public $id;
  public $kind;
  protected $labelsType = 'Google_Service_Resourceviews_Label';
  protected $labelsDataType = 'array';
  public $name;
  public $network;
  public $resources;
  public $selfLink;
  public $size;

  public function setCreationTimestamp($creationTimestamp)
  {
    $this->creationTimestamp = $creationTimestamp;
  }
  public function getCreationTimestamp()
  {
    return $this->creationTimestamp;
  }
  public function setDescription($description)
  {
    $this->description = $description;
  }
  public function getDescription()
  {
    return $this->description;
  }
  public function setEndpoints($endpoints)
  {
    $this->endpoints = $endpoints;
  }
  public function getEndpoints()
  {
    return $this->endpoints;
  }
  public function setFingerprint($fingerprint)
  {
    $this->fingerprint = $fingerprint;
  }
  public function getFingerprint()
  {
    return $this->fingerprint;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setLabels($labels)
  {
    $this->labels = $labels;
  }
  public function getLabels()
  {
    return $this->labels;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setNetwork($network)
  {
    $this->network = $network;
  }
  public function getNetwork()
  {
    return $this->network;
  }
  public function setResources($resources)
  {
    $this->resources = $resources;
  }
  public function getResources()
  {
    return $this->resources;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
  public function setSize($size)
  {
    $this->size = $size;
  }
  public function getSize()
  {
    return $this->size;
  }
}

class Google_Service_Resourceviews_ServiceEndpoint extends Google_Model
{
  protected $internal_gapi_mappings = array(
  );
  public $name;
  public $port;

  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setPort($port)
  {
    $this->port = $port;
  }
  public function getPort()
  {
    return $this->port;
  }
}

class Google_Service_Resourceviews_ZoneViewsAddResourcesRequest extends Google_Collection
{
  protected $collection_key = 'resources';
  protected $internal_gapi_mappings = array(
  );
  public $resources;

  public function setResources($resources)
  {
    $this->resources = $resources;
  }
  public function getResources()
  {
    return $this->resources;
  }
}

class Google_Service_Resourceviews_ZoneViewsGetServiceResponse extends Google_Collection
{
  protected $collection_key = 'endpoints';
  protected $internal_gapi_mappings = array(
  );
  protected $endpointsType = 'Google_Service_Resourceviews_ServiceEndpoint';
  protected $endpointsDataType = 'array';
  public $fingerprint;

  public function setEndpoints($endpoints)
  {
    $this->endpoints = $endpoints;
  }
  public function getEndpoints()
  {
    return $this->endpoints;
  }
  public function setFingerprint($fingerprint)
  {
    $this->fingerprint = $fingerprint;
  }
  public function getFingerprint()
  {
    return $this->fingerprint;
  }
}

class Google_Service_Resourceviews_ZoneViewsList extends Google_Collection
{
  protected $collection_key = 'items';
  protected $internal_gapi_mappings = array(
  );
  protected $itemsType = 'Google_Service_Resourceviews_ResourceView';
  protected $itemsDataType = 'array';
  public $kind;
  public $nextPageToken;
  public $selfLink;

  public function setItems($items)
  {
    $this->items = $items;
  }
  public function getItems()
  {
    return $this->items;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
}

class Google_Service_Resourceviews_ZoneViewsListResourcesResponse extends Google_Collection
{
  protected $collection_key = 'items';
  protected $internal_gapi_mappings = array(
  );
  protected $itemsType = 'Google_Service_Resourceviews_ListResourceResponseItem';
  protected $itemsDataType = 'array';
  public $network;
  public $nextPageToken;

  public function setItems($items)
  {
    $this->items = $items;
  }
  public function getItems()
  {
    return $this->items;
  }
  public function setNetwork($network)
  {
    $this->network = $network;
  }
  public function getNetwork()
  {
    return $this->network;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
}

class Google_Service_Resourceviews_ZoneViewsRemoveResourcesRequest extends Google_Collection
{
  protected $collection_key = 'resources';
  protected $internal_gapi_mappings = array(
  );
  public $resources;

  public function setResources($resources)
  {
    $this->resources = $resources;
  }
  public function getResources()
  {
    return $this->resources;
  }
}

class Google_Service_Resourceviews_ZoneViewsSetServiceRequest extends Google_Collection
{
  protected $collection_key = 'endpoints';
  protected $internal_gapi_mappings = array(
  );
  protected $endpointsType = 'Google_Service_Resourceviews_ServiceEndpoint';
  protected $endpointsDataType = 'array';
  public $fingerprint;
  public $resourceName;

  public function setEndpoints($endpoints)
  {
    $this->endpoints = $endpoints;
  }
  public function getEndpoints()
  {
    return $this->endpoints;
  }
  public function setFingerprint($fingerprint)
  {
    $this->fingerprint = $fingerprint;
  }
  public function getFingerprint()
  {
    return $this->fingerprint;
  }
  public function setResourceName($resourceName)
  {
    $this->resourceName = $resourceName;
  }
  public function getResourceName()
  {
    return $this->resourceName;
  }
}


text:
EZ-PROGRESS-SLIDER
==================

Angular directive that lets you slide a bootstrap progress bar.

###Installation

```
$ bower install ez-progress-slider
```

```html
<link href="bower_components/ez-progress-slider/dist/ez-progress-slider.min.js" rel="stylesheet"/>
<script src="bower_components/ez-progress-slider/dist/ez-progress-slider.min.js"/>
```

```js
angular.module('yourApp', ['ez.progressSlider'])
```

###Usage

```html
 <ez-progress-slider data-progress="data.progress1" data-target="data.target1"></ez-progress-slider>
```

###Demo

View DEMO.

redpajama_set_name: RedPajamaGithub


text:
package org.nd4j.autodiff.samediff.config;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import org.nd4j.autodiff.listeners.records.History;
import org.nd4j.autodiff.listeners.Listener;
import org.nd4j.autodiff.samediff.SameDiff;
import org.nd4j.autodiff.samediff.TrainingConfig;
import org.nd4j.common.base.Preconditions;
import org.nd4j.linalg.dataset.adapter.MultiDataSetIteratorAdapter;
import org.nd4j.linalg.dataset.api.iterator.DataSetIterator;
import org.nd4j.linalg.dataset.api.iterator.MultiDataSetIterator;

@Getter
@Setter
public class FitConfig {

    @Setter(AccessLevel.NONE)
    private SameDiff sd;

    private MultiDataSetIterator trainingData;

    private MultiDataSetIterator validationData = null;

    private int epochs = -1;

    private int validationFrequency = 1;

    @NonNull
    private List<Listener> listeners = new ArrayList<>();

    public FitConfig(@NonNull SameDiff sd) {
        this.sd = sd;
    }

    /**
     * Set the number of epochs to train for
     */
    public FitConfig epochs(int epochs) {
        this.epochs = epochs;
        return this;
    }

    /**
     * Set the training data
     */
    public FitConfig train(@NonNull MultiDataSetIterator trainingData) {
        this.trainingData = trainingData;
        return this;
    }

    /**
     * Set the training data
     */
    public FitConfig train(@NonNull DataSetIterator trainingData) {
        return train(new MultiDataSetIteratorAdapter(trainingData));
    }

    /**
     * Set the training data and number of epochs
     */
    public FitConfig train(@NonNull MultiDataSetIterator trainingData, int epochs) {
        return train(trainingData).epochs(epochs);
    }

    /**
     * Set the training data and number of epochs
     */
    public FitConfig train(@NonNull DataSetIterator trainingData, int epochs) {
        return train(trainingData).epochs(epochs);
    }

    /**
     * Set the validation data
     */
    public FitConfig validate(MultiDataSetIterator validationData) {
        this.validationData = validationData;
        return this;
    }

    /**
     * Set the validation data
     */
    public FitConfig validate(DataSetIterator validationData) {
        if (validationData == null) {
            return validate((MultiDataSetIterator) null);
        } else {
            return validate(new MultiDataSetIteratorAdapter(validationData));
        }
    }

    /**
     * Set the validation frequency.  Validation will be preformed once every so many epochs.
     *

     * Specifically, validation will be preformed when i % validationFrequency == 0
     */
    public FitConfig validationFrequency(int validationFrequency) {
        this.validationFrequency = validationFrequency;
        return this;
    }

    /**
     * Set the validation data and frequency
     *

     * Specifically, validation will be preformed when i % validationFrequency == 0
     */
    public FitConfig validate(MultiDataSetIterator validationData, int validationFrequency) {
        return validate(validationData).validationFrequency(validationFrequency);
    }

    /**
     * Set the validation data and frequency
     *

     * Specifically, validation will be preformed when i % validationFrequency == 0
     */
    public FitConfig validate(DataSetIterator validationData, int validationFrequency) {
        return validate(validationData).validationFrequency(validationFrequency);
    }

    /**
     * Add listeners for this operation
     */
    public FitConfig listeners(@NonNull Listener... listeners) {
        this.listeners.addAll(Arrays.asList(listeners));
        return this;
    }

    private void validateConfig() {
        Preconditions.checkNotNull(trainingData, "Training data must not be null");
        Preconditions.checkState(epochs > 0, "Epochs must be > 0, got %s", epochs);

        if (validationData != null)
            Preconditions.checkState(validationFrequency > 0, "Validation Frequency must be > 0 if validation data is given, got %s", validationFrequency);
    }

    /**
     * Do the training.
     *
     * @return a {@link History} object containing the history information for this training operation
     * (evaluations specified in the {@link TrainingConfig}, loss values, and timing information).
     */
    public History exec() {
        validateConfig();

        return sd.fit(trainingData, epochs, validationData, validationFrequency, listeners.toArray(new Listener[0]));
    }

}


text:
package com.ormma.OrmmaTestBed;

import org.ormma.view.OrmmaView;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.google.android.maps.MapActivity;

public class AdPrototype extends MapActivity {
    private OrmmaView mAdView;
    private Button mButton;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mAdView = (OrmmaView) findViewById(R.id.ad);

   	    mButton = (Button) findViewById(R.id.load);
	    mButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
//				Uri uri = Uri.parse("http://v.imwx.com/v/mobile-3gp/special/15_gwc_sears_friday_pr6136.3gp");
//			    videoOptions_480x270.html
//		        http://demo.goldspotmedia.com/agencytest/test1.html
//		        file:///android_asset/320x50Expand_480wTransparency.html
				mAdView.loadUrl("http://demo.goldspotmedia.com/agencytest/test1.html");
			}
		});
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
    	super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
    	super.onRestoreInstanceState(savedInstanceState);
    }

	protected boolean isRouteDisplayed() {
		return false;
	}
}


text:
/**
 */
package CIM15.IEC61970.Wires;

import CIM15.Element;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

/**
 *
 * A representation of the model object 'Phase Impedance Data'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getR R}

 *
{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getX X}

 *
{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getPhaseImpedance Phase Impedance}

 *
{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getB B}

 *
{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getSequenceNumber Sequence Number}

 *

 *

 *
 * @generated
 */
public class PhaseImpedanceData extends Element {
	/**
	 * The default value of the '{@link #getR() R}' attribute.
	 *
	 *
	 * @see #getR()
	 * @generated
	 * @ordered
	 */
	protected static final float R_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getR() R}' attribute.
	 *
	 *
	 * @see #getR()
	 * @generated
	 * @ordered
	 */
	protected float r = R_EDEFAULT;

	/**
	 * This is true if the R attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean rESet;

	/**
	 * The default value of the '{@link #getX() X}' attribute.
	 *
	 *
	 * @see #getX()
	 * @generated
	 * @ordered
	 */
	protected static final float X_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getX() X}' attribute.
	 *
	 *
	 * @see #getX()
	 * @generated
	 * @ordered
	 */
	protected float x = X_EDEFAULT;

	/**
	 * This is true if the X attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean xESet;

	/**
	 * The cached value of the '{@link #getPhaseImpedance() Phase Impedance}' reference.
	 *
	 *
	 * @see #getPhaseImpedance()
	 * @generated
	 * @ordered
	 */
	protected PerLengthPhaseImpedance phaseImpedance;

	/**
	 * The default value of the '{@link #getB() B}' attribute.
	 *
	 *
	 * @see #getB()
	 * @generated
	 * @ordered
	 */
	protected static final float B_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getB() B}' attribute.
	 *
	 *
	 * @see #getB()
	 * @generated
	 * @ordered
	 */
	protected float b = B_EDEFAULT;

	/**
	 * This is true if the B attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean bESet;

	/**
	 * The default value of the '{@link #getSequenceNumber() Sequence Number}' attribute.
	 *
	 *
	 * @see #getSequenceNumber()
	 * @generated
	 * @ordered
	 */
	protected static final int SEQUENCE_NUMBER_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getSequenceNumber() Sequence Number}' attribute.
	 *
	 *
	 * @see #getSequenceNumber()
	 * @generated
	 * @ordered
	 */
	protected int sequenceNumber = SEQUENCE_NUMBER_EDEFAULT;

	/**
	 * This is true if the Sequence Number attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean sequenceNumberESet;

	/**
	 *
	 *
	 * @generated
	 */
	protected PhaseImpedanceData() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.PHASE_IMPEDANCE_DATA;
	}

	/**
	 * Returns the value of the 'R' attribute.
	 *
	 *

	 * If the meaning of the 'R' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'R' attribute.
	 * @see #isSetR()
	 * @see #unsetR()
	 * @see #setR(float)
	 * @generated
	 */
	public float getR() {
		return r;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getR R}' attribute.
	 *
	 *
	 * @param value the new value of the 'R' attribute.
	 * @see #isSetR()
	 * @see #unsetR()
	 * @see #getR()
	 * @generated
	 */
	public void setR(float newR) {
		r = newR;
		rESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getR R}' attribute.
	 *
	 *
	 * @see #isSetR()
	 * @see #getR()
	 * @see #setR(float)
	 * @generated
	 */
	public void unsetR() {
		r = R_EDEFAULT;
		rESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getR R}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'R' attribute is set.
	 * @see #unsetR()
	 * @see #getR()
	 * @see #setR(float)
	 * @generated
	 */
	public boolean isSetR() {
		return rESet;
	}

	/**
	 * Returns the value of the 'X' attribute.
	 *
	 *

	 * If the meaning of the 'X' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'X' attribute.
	 * @see #isSetX()
	 * @see #unsetX()
	 * @see #setX(float)
	 * @generated
	 */
	public float getX() {
		return x;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getX X}' attribute.
	 *
	 *
	 * @param value the new value of the 'X' attribute.
	 * @see #isSetX()
	 * @see #unsetX()
	 * @see #getX()
	 * @generated
	 */
	public void setX(float newX) {
		x = newX;
		xESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getX X}' attribute.
	 *
	 *
	 * @see #isSetX()
	 * @see #getX()
	 * @see #setX(float)
	 * @generated
	 */
	public void unsetX() {
		x = X_EDEFAULT;
		xESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getX X}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'X' attribute is set.
	 * @see #unsetX()
	 * @see #getX()
	 * @see #setX(float)
	 * @generated
	 */
	public boolean isSetX() {
		return xESet;
	}

	/**
	 * Returns the value of the 'Phase Impedance' reference.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61970.Wires.PerLengthPhaseImpedance#getPhaseImpedanceData Phase Impedance Data}'.
	 *
	 *

	 * If the meaning of the 'Phase Impedance' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Phase Impedance' reference.
	 * @see #setPhaseImpedance(PerLengthPhaseImpedance)
	 * @see CIM15.IEC61970.Wires.PerLengthPhaseImpedance#getPhaseImpedanceData
	 * @generated
	 */
	public PerLengthPhaseImpedance getPhaseImpedance() {
		if (phaseImpedance != null && phaseImpedance.eIsProxy()) {
			InternalEObject oldPhaseImpedance = (InternalEObject)phaseImpedance;
			phaseImpedance = (PerLengthPhaseImpedance)eResolveProxy(oldPhaseImpedance);
			if (phaseImpedance != oldPhaseImpedance) {
			}
		}
		return phaseImpedance;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public PerLengthPhaseImpedance basicGetPhaseImpedance() {
		return phaseImpedance;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetPhaseImpedance(PerLengthPhaseImpedance newPhaseImpedance, NotificationChain msgs) {
		PerLengthPhaseImpedance oldPhaseImpedance = phaseImpedance;
		phaseImpedance = newPhaseImpedance;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getPhaseImpedance Phase Impedance}' reference.
	 *
	 *
	 * @param value the new value of the 'Phase Impedance' reference.
	 * @see #getPhaseImpedance()
	 * @generated
	 */
	public void setPhaseImpedance(PerLengthPhaseImpedance newPhaseImpedance) {
		if (newPhaseImpedance != phaseImpedance) {
			NotificationChain msgs = null;
			if (phaseImpedance != null)
				msgs = ((InternalEObject)phaseImpedance).eInverseRemove(this, WiresPackage.PER_LENGTH_PHASE_IMPEDANCE__PHASE_IMPEDANCE_DATA, PerLengthPhaseImpedance.class, msgs);
			if (newPhaseImpedance != null)
				msgs = ((InternalEObject)newPhaseImpedance).eInverseAdd(this, WiresPackage.PER_LENGTH_PHASE_IMPEDANCE__PHASE_IMPEDANCE_DATA, PerLengthPhaseImpedance.class, msgs);
			msgs = basicSetPhaseImpedance(newPhaseImpedance, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 * Returns the value of the 'B' attribute.
	 *
	 *

	 * If the meaning of the 'B' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'B' attribute.
	 * @see #isSetB()
	 * @see #unsetB()
	 * @see #setB(float)
	 * @generated
	 */
	public float getB() {
		return b;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getB B}' attribute.
	 *
	 *
	 * @param value the new value of the 'B' attribute.
	 * @see #isSetB()
	 * @see #unsetB()
	 * @see #getB()
	 * @generated
	 */
	public void setB(float newB) {
		b = newB;
		bESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getB B}' attribute.
	 *
	 *
	 * @see #isSetB()
	 * @see #getB()
	 * @see #setB(float)
	 * @generated
	 */
	public void unsetB() {
		b = B_EDEFAULT;
		bESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getB B}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'B' attribute is set.
	 * @see #unsetB()
	 * @see #getB()
	 * @see #setB(float)
	 * @generated
	 */
	public boolean isSetB() {
		return bESet;
	}

	/**
	 * Returns the value of the 'Sequence Number' attribute.
	 *
	 *

	 * If the meaning of the 'Sequence Number' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Sequence Number' attribute.
	 * @see #isSetSequenceNumber()
	 * @see #unsetSequenceNumber()
	 * @see #setSequenceNumber(int)
	 * @generated
	 */
	public int getSequenceNumber() {
		return sequenceNumber;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getSequenceNumber Sequence Number}' attribute.
	 *
	 *
	 * @param value the new value of the 'Sequence Number' attribute.
	 * @see #isSetSequenceNumber()
	 * @see #unsetSequenceNumber()
	 * @see #getSequenceNumber()
	 * @generated
	 */
	public void setSequenceNumber(int newSequenceNumber) {
		sequenceNumber = newSequenceNumber;
		sequenceNumberESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getSequenceNumber Sequence Number}' attribute.
	 *
	 *
	 * @see #isSetSequenceNumber()
	 * @see #getSequenceNumber()
	 * @see #setSequenceNumber(int)
	 * @generated
	 */
	public void unsetSequenceNumber() {
		sequenceNumber = SEQUENCE_NUMBER_EDEFAULT;
		sequenceNumberESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61970.Wires.PhaseImpedanceData#getSequenceNumber Sequence Number}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Sequence Number' attribute is set.
	 * @see #unsetSequenceNumber()
	 * @see #getSequenceNumber()
	 * @see #setSequenceNumber(int)
	 * @generated
	 */
	public boolean isSetSequenceNumber() {
		return sequenceNumberESet;
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				if (phaseImpedance != null)
					msgs = ((InternalEObject)phaseImpedance).eInverseRemove(this, WiresPackage.PER_LENGTH_PHASE_IMPEDANCE__PHASE_IMPEDANCE_DATA, PerLengthPhaseImpedance.class, msgs);
				return basicSetPhaseImpedance((PerLengthPhaseImpedance)otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				return basicSetPhaseImpedance(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__R:
				return getR();
			case WiresPackage.PHASE_IMPEDANCE_DATA__X:
				return getX();
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				if (resolve) return getPhaseImpedance();
				return basicGetPhaseImpedance();
			case WiresPackage.PHASE_IMPEDANCE_DATA__B:
				return getB();
			case WiresPackage.PHASE_IMPEDANCE_DATA__SEQUENCE_NUMBER:
				return getSequenceNumber();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__R:
				setR((Float)newValue);
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__X:
				setX((Float)newValue);
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				setPhaseImpedance((PerLengthPhaseImpedance)newValue);
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__B:
				setB((Float)newValue);
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__SEQUENCE_NUMBER:
				setSequenceNumber((Integer)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__R:
				unsetR();
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__X:
				unsetX();
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				setPhaseImpedance((PerLengthPhaseImpedance)null);
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__B:
				unsetB();
				return;
			case WiresPackage.PHASE_IMPEDANCE_DATA__SEQUENCE_NUMBER:
				unsetSequenceNumber();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.PHASE_IMPEDANCE_DATA__R:
				return isSetR();
			case WiresPackage.PHASE_IMPEDANCE_DATA__X:
				return isSetX();
			case WiresPackage.PHASE_IMPEDANCE_DATA__PHASE_IMPEDANCE:
				return phaseImpedance != null;
			case WiresPackage.PHASE_IMPEDANCE_DATA__B:
				return isSetB();
			case WiresPackage.PHASE_IMPEDANCE_DATA__SEQUENCE_NUMBER:
				return isSetSequenceNumber();
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (r: ");
		if (rESet) result.append(r); else result.append("<unset>");
		result.append(", x: ");
		if (xESet) result.append(x); else result.append("<unset>");
		result.append(", b: ");
		if (bESet) result.append(b); else result.append("<unset>");
		result.append(", sequenceNumber: ");
		if (sequenceNumberESet) result.append(sequenceNumber); else result.append("<unset>");
		result.append(')');
		return result.toString();
	}

} // PhaseImpedanceData


text:
all: clean coverage

release: tag
	git push origin --tags

tag:
	chag tag --sign --debug CHANGELOG.rst

test:
	vendor/bin/phpunit

coverage:
	vendor/bin/phpunit --coverage-html=artifacts/coverage

view-coverage:
	open artifacts/coverage/index.html

clean:
	rm -rf artifacts/*


text:
using System.Collections.Generic;
using System.Linq;
using Microsoft.IdentityModel.Logging;
using Microsoft.IdentityModel.Tokens;

namespace System.IdentityModel.Tokens.Jwt
{
    /// <summary>
    /// Initializes a new instance of <see cref="JwtHeader"/> which contains JSON objects representing the cryptographic operations applied to the JWT and optionally any additional properties of the JWT.
    /// The member names within the JWT Header are referred to as Header Parameter Names.
    /// <para>These names MUST be unique and the values must be <see cref="string"/>(s). The corresponding values are referred to as Header Parameter Values.</para>
    /// </summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable"), System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Serialize not really supported.")]
    public class JwtHeader : Dictionary<string, object>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="JwtHeader"/> class. Default string comparer <see cref="StringComparer.Ordinal"/>.
        /// </summary>
        public JwtHeader()
            : base(StringComparer.Ordinal)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="signingCredentials"><see cref="SigningCredentials"/> used creating a JWS Compact JSON.</param>
        public JwtHeader(SigningCredentials signingCredentials)
            : this(signingCredentials, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, EncryptingCredentials.Alg }, { enc, EncryptingCredentials.Enc } }</para>
        /// </summary>
        /// <param name="encryptingCredentials"><see cref="EncryptingCredentials"/> used creating a JWE Compact JSON.</param>
        /// <exception cref="ArgumentNullException">If 'encryptingCredentials' is null.</exception>
        public JwtHeader(EncryptingCredentials encryptingCredentials)
            : this(encryptingCredentials, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="signingCredentials"><see cref="SigningCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        public JwtHeader(SigningCredentials signingCredentials, IDictionary<string,string> outboundAlgorithmMap)
            : this(signingCredentials, outboundAlgorithmMap, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="signingCredentials"><see cref="SigningCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        /// <param name="tokenType"> will be added as the value for the 'typ' claim in the header. If it is null or empty <see cref="JwtConstants.HeaderType"/> will be used as token type</param>
        public JwtHeader(SigningCredentials signingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType)
            : this(signingCredentials, outboundAlgorithmMap, tokenType, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, SigningCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="signingCredentials"><see cref="SigningCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        /// <param name="tokenType"> will be added as the value for the 'typ' claim in the header. If it is null or empty <see cref="JwtConstants.HeaderType"/> will be used as token type</param>
        /// <param name="additionalInnerHeaderClaims">Defines the dictionary containing any custom header claims that need to be added to the inner JWT token header.</param>
        public JwtHeader(SigningCredentials signingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType, IDictionary<string, object> additionalInnerHeaderClaims)
            : base(StringComparer.Ordinal)
        {
            if (signingCredentials == null)
                this[JwtHeaderParameterNames.Alg] = SecurityAlgorithms.None;

            else
            {
                if (outboundAlgorithmMap != null && outboundAlgorithmMap.TryGetValue(signingCredentials.Algorithm, out string outboundAlg))
                    Alg = outboundAlg;
                else
                    Alg = signingCredentials.Algorithm;

                if (!string.IsNullOrEmpty(signingCredentials.Key.KeyId))
                    Kid = signingCredentials.Key.KeyId;

                if (signingCredentials is X509SigningCredentials x509SigningCredentials)
                    this[JwtHeaderParameterNames.X5t] = Base64UrlEncoder.Encode(x509SigningCredentials.Certificate.GetCertHash());
            }

            if (string.IsNullOrEmpty(tokenType))
                Typ = JwtConstants.HeaderType;
            else
                Typ = tokenType;

            AddAdditionalClaims(additionalInnerHeaderClaims, false);
            SigningCredentials = signingCredentials;
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="encryptingCredentials"><see cref="EncryptingCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        /// <exception cref="ArgumentNullException">If 'encryptingCredentials' is null.</exception>
        public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap)
            : this(encryptingCredentials, outboundAlgorithmMap, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="encryptingCredentials"><see cref="EncryptingCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        /// <param name="tokenType"> provides the token type</param>
        /// <exception cref="ArgumentNullException">If 'encryptingCredentials' is null.</exception>
        public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType)
            : this(encryptingCredentials, outboundAlgorithmMap, tokenType, null)
        {
        }

        /// <summary>
        /// Initializes a new instance of <see cref="JwtHeader"/>.
        /// With the Header Parameters:
        /// <para>{ { typ, JWT }, { alg, EncryptingCredentials.Algorithm } }</para>
        /// </summary>
        /// <param name="encryptingCredentials"><see cref="EncryptingCredentials"/> used when creating a JWS Compact JSON.</param>
        /// <param name="outboundAlgorithmMap">provides a mapping for the 'alg' value so that values are within the JWT namespace.</param>
        /// <param name="tokenType"> provides the token type</param>
        /// <param name="additionalHeaderClaims">Defines the dictionary containing any custom header claims that need to be added to the outer JWT token header.</param>
        /// <exception cref="ArgumentNullException">If 'encryptingCredentials' is null.</exception>
        public JwtHeader(EncryptingCredentials encryptingCredentials, IDictionary<string, string> outboundAlgorithmMap, string tokenType, IDictionary<string, object> additionalHeaderClaims)
            : base(StringComparer.Ordinal)
        {
            if (encryptingCredentials == null)
                throw LogHelper.LogArgumentNullException(nameof(encryptingCredentials));

            string outboundAlg;
            if (outboundAlgorithmMap != null && outboundAlgorithmMap.TryGetValue(encryptingCredentials.Alg, out outboundAlg))
                Alg = outboundAlg;
            else
                Alg = encryptingCredentials.Alg;

            if (outboundAlgorithmMap != null && outboundAlgorithmMap.TryGetValue(encryptingCredentials.Enc, out outboundAlg))
                Enc = outboundAlg;
            else
                Enc = encryptingCredentials.Enc;

            if (!string.IsNullOrEmpty(encryptingCredentials.Key.KeyId))
                Kid = encryptingCredentials.Key.KeyId;

            if (string.IsNullOrEmpty(tokenType))
                Typ = JwtConstants.HeaderType;
            else
                Typ = tokenType;

            AddAdditionalClaims(additionalHeaderClaims, encryptingCredentials.SetDefaultCtyClaim);
            EncryptingCredentials = encryptingCredentials;
        }

        /// <summary>
        /// Gets the signature algorithm that was used to create the signature.
        /// </summary>
        /// <remarks>If the signature algorithm is not found, null is returned.</remarks>
        public string Alg
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.Alg);
            }

            private set
            {
                this[JwtHeaderParameterNames.Alg] = value;
            }
        }

        /// <summary>
        /// Gets the content mime type (Cty) of the token.
        /// </summary>
        /// <remarks>If the content mime type is not found, null is returned.</remarks>
        public string Cty
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.Cty);
            }

            private set
            {
                this[JwtHeaderParameterNames.Cty] = value;
            }
        }

        /// <summary>
        /// Gets the encryption algorithm (Enc) of the token.
        /// </summary>
        /// <remarks>If the content mime type is not found, null is returned.</remarks>
        public string Enc
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.Enc);
            }

            private set
            {
                this[JwtHeaderParameterNames.Enc] = value;
            }
        }

        /// <summary>
        /// Gets the <see cref="EncryptingCredentials"/> passed in the constructor.
        /// </summary>
        /// <remarks>This value may be null.</remarks>
        public EncryptingCredentials EncryptingCredentials { get; private set; }

        /// <summary>
        /// Gets the iv of symmetric key wrap.
        /// </summary>
        public string IV
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.IV);
            }
        }

        /// <summary>
        /// Gets the key identifier for the security key used to sign the token
        /// </summary>
        public string Kid
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.Kid);
            }

            private set
            {
                this[JwtHeaderParameterNames.Kid] = value;
            }
        }

        /// <summary>
        /// Gets the <see cref="SigningCredentials"/> passed in the constructor.
        /// </summary>
        /// <remarks>This value may be null.</remarks>
        public SigningCredentials SigningCredentials
        {
            get; private set;
        }

        /// <summary>
        /// Gets the mime type (Typ) of the token.
        /// </summary>
        /// <remarks>If the mime type is not found, null is returned.</remarks>
        public string Typ
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.Typ);
            }

            private set
            {
                this[JwtHeaderParameterNames.Typ] = value;
            }
        }

        /// <summary>
        /// Gets the thumbprint of the certificate used to sign the token
        /// </summary>
        public string X5t
        {
            get
            {
                return GetStandardClaim(JwtHeaderParameterNames.X5t);
            }
        }

        /// <summary>
        /// Gets the certificate used to sign the token
        /// </summary>
        /// <remarks>If the 'x5c' claim is not found, null is returned.</remarks>
        public string X5c => GetStandardClaim(JwtHeaderParameterNames.X5c);

        /// <summary>
        /// Gets the 'value' of the 'zip' claim { zip, 'value' }.
        /// </summary>
        /// <remarks>If the 'zip' claim is not found, null is returned.</remarks>
        public string Zip => GetStandardClaim(JwtHeaderParameterNames.Zip);

        /// <summary>
        /// Deserializes Base64UrlEncoded JSON into a <see cref="JwtHeader"/> instance.
        /// </summary>
        /// <param name="base64UrlEncodedJsonString">Base64url encoded JSON to deserialize.</param>
        /// <returns>An instance of <see cref="JwtHeader"/>.</returns>
        /// <remarks>Use <see cref="JsonExtensions.Deserializer"/> to customize JSON serialization.</remarks>
        public static JwtHeader Base64UrlDeserialize(string base64UrlEncodedJsonString)
        {
            return JsonExtensions.DeserializeJwtHeader(Base64UrlEncoder.Decode(base64UrlEncodedJsonString));
        }

        /// <summary>
        /// Encodes this instance as Base64UrlEncoded JSON.
        /// </summary>
        /// <returns>Base64UrlEncoded JSON.</returns>
        /// <remarks>Use <see cref="JsonExtensions.Serializer"/> to customize JSON serialization.</remarks>
        public virtual string Base64UrlEncode()
        {
            return Base64UrlEncoder.Encode(SerializeToJson());
        }

        /// <summary>
        /// Deserialzes JSON into a <see cref="JwtHeader"/> instance.
        /// </summary>
        /// <param name="jsonString"> The JSON to deserialize.</param>
        /// <returns>An instance of <see cref="JwtHeader"/>.</returns>
        /// <remarks>Use <see cref="JsonExtensions.Deserializer"/> to customize JSON serialization.</remarks>
        public static JwtHeader Deserialize(string jsonString)
        {
            return JsonExtensions.DeserializeJwtHeader(jsonString);
        }
        /// <summary>
        /// Gets a standard claim from the header.
        /// A standard claim is either a string or a value of another type serialized in JSON format.
        /// </summary>
        /// <param name="claimType">The key of the claim.</param>
        /// <returns>The standard claim string; or null if not found.</returns>
        internal string GetStandardClaim(string claimType)
        {
            if (TryGetValue(claimType, out object value))
            {
                if (value == null)
                    return null;

                if (value is string str)
                    return str;

                return JsonExtensions.SerializeToJson(value);
            }

            return null;
        }

        internal void AddAdditionalClaims(IDictionary<string, object> additionalHeaderClaims, bool setDefaultCtyClaim)
        {
            if (additionalHeaderClaims?.Count > 0 && additionalHeaderClaims.Keys.Intersect(DefaultHeaderParameters, StringComparer.OrdinalIgnoreCase).Any())
                throw LogHelper.LogExceptionMessage(new SecurityTokenException(LogHelper.FormatInvariant(LogMessages.IDX12742, nameof(additionalHeaderClaims), string.Join(", ", DefaultHeaderParameters))));

            if (additionalHeaderClaims != null)
            {
                if (!additionalHeaderClaims.TryGetValue(JwtHeaderParameterNames.Cty, out _) && setDefaultCtyClaim)
                    Cty = JwtConstants.HeaderType;

                foreach (string claim in additionalHeaderClaims.Keys)
                    this[claim] = additionalHeaderClaims[claim];
            }
            else if (setDefaultCtyClaim)
                Cty = JwtConstants.HeaderType;
        }

        internal static IList<string> DefaultHeaderParameters = new List<string>()
        {
            JwtHeaderParameterNames.Alg,
            JwtHeaderParameterNames.Kid,
            JwtHeaderParameterNames.X5t,
            JwtHeaderParameterNames.Enc,
            JwtHeaderParameterNames.Zip
        };

        /// <summary>
        /// Serializes this instance to JSON.
        /// </summary>
        /// <returns>This instance as JSON.</returns>
        /// <remarks>Use <see cref="JsonExtensions.Serializer"/> to customize JSON serialization.</remarks>
        public virtual string SerializeToJson()
        {
            return JsonExtensions.SerializeToJson(this as IDictionary<string, object>);
        }
    }
}


text:
 Inhalt

 Installieren Sie Tools und klonen Sie das Repository

 Entwickeln Sie mit VsCode

 Entwickeln Sie mit Visual Studio

 Entwickeln Sie auf anderen Plattformen

 Datenbank

 Google Cloud Platform

 Google API-Schlüssel

 Installieren Sie Tools und klonen Sie das Repository

 [Inhalt]

 Git installieren. Git für Windows , Git für Mac

 Installieren Sie Node.js.

 Installieren Sie das .Net Core SDK.

 Klonen oder laden Sie das Projekt von Github herunter . Verzweigen Sie das Projekt am besten und klonen Sie Ihre Gabel.

 Überprüfen Sie die Installation:

 cd FrontEnd / ClientApp

 npm installieren; npm starten

 [Öffnen Sie einen Browser für "localhost: 4200"]

 Entwickeln Sie mit VsCode

 [Inhalt]

 Installieren Sie VsCode

 Installieren Sie Visual Studio Code und starten Sie es.

 Installieren Sie diese Erweiterungen über das Erweiterungsfenster links:

 "Debugger for Chrome" von Microsoft

 "C
# für Visual Studio Code" von Microsoft

 "SQL Server (mssql)" von Microsoft

 "Todo Tree" von Gruntfuggly - zeigt TODO-Zeilen im Code (optional)

 "Powershell" von Microsoft - zum Debuggen von Powershell-Build-Skripten (optional)

 Führen Sie ClientApp eigenständig aus

 Öffnen Sie den Projektordner in VsCode

 Installieren Sie NPM-Pakete:

 Öffnen Sie einen Terminalbereich in VsCode

 cd FrontEnd / ClientApp

 npm installieren

 Schließen Sie ClientApp ab und führen Sie es aus

 npm starten

 Legen Sie im Debug-Bereich die Startkonfiguration auf "ClientApp Standalone" fest.

 Drücken Sie F5 (Debug) oder Strg-F5 (ohne Debugging ausführen).

 ODER öffnen Sie einen Browser für localhost: 4200

 Standardmäßig ruft ClientApp Stub-Services auf, anstatt die WebApp-API aufzurufen.

 Führen Sie ClientApp & WebApp aus

 Laden Sie die Testdaten von Google Drive herunter . Legen Sie sie in einem Geschwisterordner für das Projekt "TESTDATA" ab. Dies sind Mediendateien, die nicht an Github übergeben werden sollten. Sie können sie auch von OneDrive herunterladen .

 Ändern Sie in FrontEnd / ClientApp / app.module.ts "isAspServerRunning" von false in true.

 Projekte erstellen:

 Strg-Umschalt-P

 Wählen Sie "Aufgaben: Aufgabe ausführen"

 Wählen Sie "build-webapp" oder "Build All"

 Starten Sie ClientApp (falls noch nicht ausgeführt)

 cd FrontEnd / ClientApp

 npm starten

 Legen Sie im Debug-Bereich die Startkonfiguration "WebApp & ClientApp" fest.

 Drücken Sie F5 (Debug) oder Strg-F5 (ohne Debugging ausführen).

 Der Chrome-Browser wird geöffnet. Ignorieren Sie die temporäre Meldung "Site kann nicht erreicht werden" und warten Sie, bis ClientApp angezeigt wird.

 Anmerkungen

 "build-webapp" erstellt WebApp.

 "Alle erstellen" erstellt alle Projekte. Wie bei build-webapp werden NuGet-Pakete nach Bedarf installiert. Überprüfen Sie jedes Terminalfenster auf Fehler und führen Sie es bei Bedarf erneut aus. Es gibt einen bekannten Fehler bei der Race-Bedingung beim aysnchronen Wiederherstellen mehrerer NuGet-Pakete.

 Wenn Sie "isAspServerRunning" auf "true" setzen, wird ClientApp angewiesen, die WebApp-API anstelle der Stub-Services aufzurufen.

 Die Unterordner auf Google Drive dienen zum Testen von WebApp. Die Dateien dienen zum Testen von WorkflowApp.

 ClientApp wird vom Webpack-Dev-Server bereitgestellt. WebApp verwendet den Kestrel-Server. Kestrel überträgt ClientApp-Anforderungen jedoch an den Webpack-Dev-Server.

 Führen Sie WorkflowApp aus

 Installieren Sie FFmpeg. . Dies dient zur Verarbeitung von Audio- und Videodateien.

 Laden Sie die Testdateien von Google Drive herunter .

 Legen Sie im Debug-Bereich die Startkonfiguration auf "WorkflowApp" fest.

 Drücken Sie F5 (Debug) oder Strg-F5 (ohne Debugging ausführen).

 Anmerkungen

 Beim ersten Start von WorkflowApp wird ein Ordner "DATAFILES" und darin die folgenden 3 Unterordner erstellt:

 EMPFANGEN - Alle Dateien in diesem Ordner werden automatisch verarbeitet.

 VERARBEITUNG - Enthält Arbeitsordner zur Verarbeitung.

 ABGESCHLOSSEN - Abgeschlossene Dateien werden hier abgelegt.

 Die folgende Einstellung in appsettings.json weist es an, Testdateien nach DATAFILES / RECEIVED zu kopieren. Die Testdateien enthalten ein PDF-Transkript und eine MP4-Aufzeichnung von Beispielmeetings.

  "InitializeWithTestData": true,

 WorkflowApp verarbeitet das Transkript vor und erstellt eine JSON-Datei mit den extrahierten Daten. Wenn Sie ein Google Cloud-Konto eingerichtet haben, wird die MP4-Aufzeichnung transkribiert. Sie finden die Ergebnisse von beiden im Ordner DATAFILES \ PROCESSING.

 Sie werden feststellen, dass das anfängliche MP4-Transkript und seine Transkription in 3-Minuten-Arbeitssegmente aufgeteilt werden. Auf diese Weise können mehrere Freiwillige gleichzeitig am Korrekturlesen der Transkription arbeiten.

 Neue Aufnahmen verarbeiten

 Neben den Testdateien auf Google Drive können Sie Ihre eigenen Aufzeichnungen von Besprechungen verarbeiten:

 Erhalten Sie eine Aufzeichnung einer Regierungssitzung im MP4-Format.

 Benennen Sie die Datei wie folgt: "country_state_county_municipality_agency_language-code_date.mp4".

 Zum Beispiel: "USA_ME_LincolnCounty_BoothbayHarbor_Selectmen_en_2017-01-09.mp4".

 Legen Sie die Datei in "DATAFILES / RECEIVED"

 Legen Sie in BackEnd / WorkflowApp / appsettings.json die folgenden Eigenschaften fest:

 "InitializeWithTestData": false

 "RequireManagerApproval": false

 Führen Sie WorkflowApp aus.

 Wenn Sie ein Google-Konto eingerichtet haben, wird die Aufzeichnung transkribiert.

 Verarbeiten Sie neue Transkripte

 Das Ziel ist es, Code zu schreiben, der intelligent genug ist, um alle Transkriptformate zu verarbeiten. Im Moment müssen wir jedoch benutzerdefinierten Code für neue Formate hinzufügen. Wenn Ihre Stadt, Ihre Gemeinde usw. Abschriften ihrer Besprechungen erstellt, wäre es eine große Hilfe, wenn Sie den Code zur Bearbeitung dieser Besprechungen beisteuern. Siehe Github-Ausgabe Nr. 93

 Entwickeln Sie mit Visual Studio

 [Inhalt]

 Installieren Sie die kostenlose Visual Studio Community Edition.

 Wählen Sie während der Installation sowohl die Workloads "ASP.NET" als auch ".NET Desktop" aus.

 Erweiterungen installieren: (alle von Mads Kristensen)

 "NPM Task Runner"

 "Command Task Runner"

 "Markdown Editor"

 Öffnen Sie die Lösungsdatei "govmeeting.sln"

 Führen Sie ClientApp & WebApp aus

 Laden Sie die Unterordner von Google Drive herunter . Legen Sie sie in einem Geschwisterordner für das Projekt "TESTDATA" ab.

 Ändern Sie in FrontEnd / ClientApp / app.module.ts "isAspServerRunning" von false in true.

 Im Task Runner Explorer

 Wählen Sie: ClientApp

 Führen Sie "install" aus.

 Führen Sie "Start" aus

 Startprojekt auf "WebApp" setzen

 Drücken Sie F5 (Debug) oder Strg-F5 (ohne Debugging ausführen).

 WebApp wird ausgeführt und ein Browser wird geöffnet, in dem die ClientApp angezeigt wird.

 ANMERKUNG: Beim Festlegen von Haltepunkten in der Angular ClientApp in Visual Studio ist ein Problem aufgetreten. Siehe: Github-Ausgabe Nr. 80

 Führen Sie WorkflowApp aus

 Laden Sie die Testdateien von Google Drive herunter (siehe oben).

 Öffnen Sie das Debug-Panel.

 Startprojekt auf "WorkflowApp" setzen

 Drücken Sie F5 (Debug) oder Strg-F5 (ohne Debugging ausführen).

 Hinweis: Siehe Hinweise zu WorkflowApp unter "Visual Studio Code".

 Entwickeln Sie mit anderen Tools

 [Inhalt]

 Setzen Sie in Ihrem Profil die Umgebungsvariable ASPNETCORE_ENVIRONMENT auf "Entwicklung". Dies wird von WebApp und WorkflowApp verwendet.

 Führen Sie ClientApp aus

 Ausführen:

 CD-Frontend / ClientApp

 npm installieren

 npm starten

 Gehen Sie in Ihrem Browser zu localhost: 4200. Die Client-App wird geladen. Einige Funktionen funktionieren erst, wenn WebApp ausgeführt wird.

 Führen Sie WebApp mit ClientApp aus

 Ausführen:

 (oben ausführen: "ClientApp erstellen und starten")

 cd ../../Backend/WebApp

 dotnet build webapp.csproj

 dotnet run bin / debug / dotnet2.2 / webapp.dll

 Gehen Sie in Ihrem Browser zu localhost: 5000. Die Client-App wird geladen.

 Führen Sie ClientApp eigenständig aus

 Ändern Sie in app.module.ts "isAspServerRunning" von "true" in "false".

 (oben ausführen: "ClientApp erstellen und starten")

 Führen Sie WorkflowApp aus

 Ausführen:

 cd Backend / WorkflowApp

 dotnet build workflowapp.csproj

 dotnet run bin / debug / dotnet2.0 / workflowapp.dll

 Hinweis: Siehe Hinweise zu WorkflowApp unter "Visual Studio Code".

 Datenbank

 [Inhalt]

 Möglicherweise müssen Sie die Datenbank nicht installieren und einrichten, um die Entwicklung durchzuführen. Es gibt Teststubs, die das Aufrufen der Datenbank ersetzen. Siehe "Test Stubs" weiter unten.

 Provider installieren

 Wenn Sie Visual Studio oder Visual Studio Code verwenden, ist der SQL Server Express LocalDb-Anbieter bereits installiert. Andernfalls führen Sie unten "Installation des LocalDb-Anbieters" durch.

 Installation des LocalDb-Providers

 Gehen Sie zu SQL Server Express. Laden Sie für Windows die Spezialversion "Express" von SQL Server herunter. Wählen Sie während der Installation "Benutzerdefiniert" und "Lokale Datenbank".

 LocalDb ist auch für MacOs und Linux verfügbar. Wenn Sie es für eine der beiden Plattformen installieren, aktualisieren Sie dieses Dokument mit den Schritten und führen Sie eine Pull-Anforderung durch.

 Andere Anbieter

 Neben LocalSb unterstützt EF Core andere Anbieter, die Sie für die Entwicklung verwenden können, einschließlich SqlLite. Sie müssen das DbContext-Setup in startup.cs und die Verbindungszeichenfolge in appsettings.json ändern.

 Datenbankschema erstellen

 Die Datenbank wird über die Funktion "Code first" von Entity Framework Core erstellt. Es untersucht die C# -Klassen im Datenmodell und erstellt automatisch alle Tabellen und Beziehungen. Es gibt zwei Schritte: (1) Erstellen Sie den "Migrations" -Code für das Update und (2) führen Sie das Update aus.

 CD-Backend / WebApp

 Bei dotnet ef-Migrationen wird das erste --project .. \ Database \ DatabaseAccess_Lib hinzugefügt

 dotnet ef database update --project .. \ Database \ DatabaseAccess_Lib

 Durchsuchen Sie die erstellte Datenbank

 In VsCode

 Fügen Sie Ihrer Benutzereinstellung.json in VsCode Folgendes hinzu:

  "mssql.connections": [ { "server": "(localdb)\\mssqllocaldb", "database": "Govmeeting", "authenticationType": "Integrated", "profileName": "GMProfile", "password": "" } ],

 Drücken Sie Strg-Alt-D oder das SQL Server-Symbol am linken Rand.

 Öffnen Sie die GMProfile-Verbindung, um Datenbankobjekte anzuzeigen und damit zu arbeiten.

 Öffnen Sie "Tabellen". Sie sollten alle Tabellen sehen, die beim Erstellen des obigen Schemas erstellt wurden. Dies umfasst die AspNetxxxx-Tabellen für die Autorisierung und die Tabellen für das Govmeeting-Datenmodell.

 In Visual Studio

 Gehen Sie zum Menüpunkt: Ansicht -> SQL Server-Objekt-Explorer.

 Erweitern Sie SQL Server -> (localdb) \ MSSQLLocalDb -> Datenbanken -> Govmeeting

 Öffnen Sie "Tabellen". Sie sollten alle Tabellen sehen, die beim Erstellen des obigen Schemas erstellt wurden. Dies umfasst die AspNetxxxx-Tabellen für die Autorisierung und die Tabellen für das Govmeeting-Datenmodell.

 Andere Plattformen

 Es gibt das plattformübergreifende und Open Source SQL Operations Studio, "ein Datenverwaltungstool, das die Arbeit mit SQL Server, Azure SQL DB und SQL DW unter Windows, MacOS und Linux ermöglicht." Sie können SQL Operations Studio hier kostenlos herunterladen .

 Wenn Sie dieses oder ein anderes Tool zum Durchsuchen von SQL Server-Datenbanken verwenden, aktualisieren Sie diese Anweisungen.

 Test Stubs

 Der Code zum Speichern / Abrufen von Transkriptdaten in der Datenbank ist noch nicht geschrieben. Daher verwendet DatabaseRepositories_Lib stattdessen statische Testdaten. In WebApp / appsettings.json wird die Eigenschaft "UseDatabaseStubs" auf "true" gesetzt, um die Stub-Routinen aufzurufen.

 Der Benutzerregistrierungs- und Anmeldecode in WebApp verwendet jedoch die Datenbank. Es greift auf die Asp.Net-Benutzerauthentifizierungstabellen zu. WebApp authentifiziert API-Aufrufe von ClientApp basierend auf dem aktuell angemeldeten Benutzer.

 Sie können den Vorprozessorwert "NOAUTH" in WebApp verwenden, um die Authentifizierung zu umgehen. Verwenden Sie eine der folgenden Methoden:

 Deaktivieren Sie in FixasrController.cs oder AddtagsController.cs die Zeile "#if NOAUTH" oben in der Datei.

 Fügen Sie dies zu WebApp.csproj hinzu, um es für alle Controller zu deaktivieren:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'> <DefineConstants>NOAUTH</DefineConstants> </PropertyGroup>

 Gehen Sie in Visual Studio zu den WebApp-Eigenschaftsseiten -> Erstellen -> und geben Sie NOAUTH in das Feld "Bedingte Kompilierungssymbole" ein.

 Google Cloud Platform

 [Inhalt]

 Um die Google Speech APIs für die Konvertierung von Sprache in Text verwenden zu können, benötigen Sie ein Google Cloud Platform (GCP) -Konto. Für die meisten Entwicklungsarbeiten in Govmeeting können Sie vorhandene Testdaten verwenden. Wenn Sie jedoch neue Aufnahmen transkribieren möchten, erhalten Sie eine GCP. Die Google API kann Aufzeichnungen in mehr als 120 Sprachen und Varianten transkribieren.

 Google bietet Entwicklern ein kostenloses Konto mit einem Guthaben (derzeit 300 US-Dollar). Die aktuellen Kosten für die Verwendung der Sprach-API sind für bis zu 60 Minuten Konvertierung pro Monat kostenlos. Danach betragen die Kosten für das "erweiterte Modell" (was wir brauchen) 0,009 USD pro 15 Sekunden. (2,16 USD pro Stunde)

 Eröffnen Sie ein Konto bei Google Cloud Platform

 Gehen Sie zum Google Cloud Dashboard und erstellen Sie ein Projekt.

 Rufen Sie die Google Developer's Console auf und aktivieren Sie die Sprach- und Cloud-Speicher-APIs

 Generieren Sie einen Berechtigungsnachweis "Dienstkonto" für dieses Projekt. Klicken Sie in der Entwicklerkonsole auf Anmeldeinformationen.

 Geben Sie diesem Konto die Berechtigung "Editor" für das Projekt. Klicken Sie auf das Konto. Klicken Sie auf der nächsten Seite auf Berechtigungen.

 Laden Sie die JSON-Datei mit den Anmeldeinformationen herunter.

 Erstellen Sie einen SECRETS Ordner als Geschwister des geklonten Projektordners

 Fügen Sie die Anmeldeinformationsdatei in SECRETS ein und benennen Sie sie in TranscribeAudio.json .

 Testen Sie die Transkription von Sprache zu Text

 Setzen Sie das Startprojekt in Visual Studio auf Backend/WorkflowApp . Drücken Sie F5.

 Kopieren Sie eine der MP4-Beispieldateien von den Testdaten nach DATAFILES / RECEIVED (verschieben Sie sie nicht).

 Das Programm erkennt nun, dass eine neue Datei angezeigt wurde, und beginnt mit der Verarbeitung. Die MP4-Datei wird nach Abschluss auf "COMPLETED" verschoben. Sie sehen die Ergebnisse in Sufoldern, die im Verzeichnis "DATAFILES" erstellt wurden.

 In appsettings.json gibt es eine Eigenschaft "RecordingSizeForDevelopment". Es ist derzeit auf "180" eingestellt. Dadurch verarbeitet die Transkriptionsroutine in ProcessRecording_Lib nur die ersten 180 Sekunden der Aufzeichnung.

 Google API-Schlüssel

 [Inhalt]

 Sie benötigen diese Schlüssel, wenn Sie bestimmte Funktionen des Registrierungs- und Anmeldevorgangs verwenden oder bearbeiten möchten.

 ReCaptcha-Schlüssel werden benötigt, um ReCaptcha während der Benutzerregistrierung zu verwenden. Sie können bei Google reCaptcha bezogen werden .

 OAuth 2.0-Anmeldeinformationen werden verwendet, um externe Benutzer anzumelden, ohne dass der Benutzer ein persönliches Konto auf der Site erstellen muss. Besuchen Sie die Google API-Konsole , um Anmeldeinformationen wie eine Client-ID und ein Client-Geheimnis abzurufen.

 Erstellen Sie einen SECRETS Ordner als Geschwister des geklonten Projektordners. Erstellen Sie darin eine Datei mit dem Namen "appsettings.Development.json" im folgenden Format.

 { "ExternalAuth": { "Google": { "ClientId": "your-client-Id", "ClientSecret": "your-client-secret" } }, "ReCaptcha:SiteKey": "your-site-key", "ReCaptcha:Secret": "your-secret" }

 Bearbeiten Sie es so, dass es die Schlüssel enthält, die Sie gerade erhalten haben:

 Testen Sie reCaptcha

 Führen Sie das WebApp-Projekt aus.

 Klicken Sie oben rechts auf "Registrieren".

 Die Option reCaptcha sollte angezeigt werden.

 Testen Sie die Google-Authentifizierung

 Führen Sie das WebApp-Projekt aus.

 Klicken Sie oben rechts auf "Login".

 Wählen Sie unter "Verwenden Sie einen anderen Dienst zum Anmelden" die Option "Google".


text:
from django.shortcuts import render, get_object_or_404
import datetime
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse

from .models import Movie

def index(request):
    context = {}
    return render(request, 'movielists/index.html', context)

def movies_by_genre(request, genre):
    movies_of_selected_genre = Movie.objects.all().filter(genre = genre).order_by('title')
    context = {'movies_of_selected_genre': movies_of_selected_genre}
    return render(request, 'movielists/movies_by_genre.html', context)

def movie_details(request, movie_id):
    movie = get_object_or_404(Movie, pk=movie_id)
    total_rating = 0
    if movie.rating_count != 0:
        total_rating = movie.rating_sum/movie.rating_count
    return render(request, 'movielists/movie_details.html', {'movie': movie, 'total_rating': total_rating})

def movie_comments(request, movie_id):
    movie = get_object_or_404(Movie, pk=movie_id)
    comments = movie.comment_set.all().order_by('-comment_pub_date')
    context = {'movie': movie, 'comments': comments}
    return render(request, 'movielists/movie_comments.html', context)

def make_a_comment(request, movie_id):
    movie = get_object_or_404(Movie, pk=movie_id)
    if request.POST['user_name'] == "" or request.POST['comment_body'] == "":
        return render(request, 'movielists/movie_comments.html',
                {'movie':movie, 'error_message': "One or both fields empty.",
                    })
    else:
        new_comment = movie.comment_set.create(person=request.POST['user_name'],
               comment_text=request.POST['comment_body'],
               comment_pub_date = datetime.datetime.now())
        new_comment.save()
        return HttpResponseRedirect(reverse('movielists:movie_comments',
            args=(movie.id,)))

def rate(request, movie_id):
    movie = get_object_or_404(Movie, pk=movie_id)
    movie.rating_count += 1
    movie.rating_sum += int(request.POST['rating'])
    movie.total_rating = movie.rating_sum / movie.rating_count
    movie.save()
    total_rating = movie.rating_sum/movie.rating_count
    return render(request, 'movielists/movie_details.html', {'movie': movie, 'total_rating': total_rating})

def top_rated(request):
    top_rated_movies = Movie.objects.all().order_by('-total_rating')[:10]
    context = {'top_rated_movies': top_rated_movies}
    return render(request, 'movielists/top_10.html', context)