Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
              to
              {'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
============================= TractConverter (deprecated) ============================= **The TractConverter is now deprecated, please use Nibabel streamlines API instead (e.g. `nibabel.streamlines.load()`).** TractConverter is a python toolbox to convert tractogram files. TractConverter is for research only; please do not use results from TractConverter on clinical data. Installation ============ ``sudo pip install http://github.com/MarcCote/tractconverter/archive/master.zip`` Code ==== [![Build Status](https://travis-ci.org/MarcCote/tractconverter.png)](https://travis-ci.org/MarcCote/tractconverter) You can find our sources: * [Main repository](https://github.com/MarcCote/tractconverter) on Github. * Download as a tar/zip file the [current trunk](https://github.com/MarcCote/tractconverter/archive/master.zip). * Download [latest release](https://github.com/MarcCote/tractconverter/releases/tag/v0.8). License ======= TractConverter is licensed under the terms of the BSD license. Some code included with TractConverter is also licensed under the BSD license. Please see the LICENSE file in the TractConverter distribution.
{ "content_hash": "ddd8fdf5fb39901db37d28a870d2aae5", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 121, "avg_line_length": 34.81818181818182, "alnum_prop": 0.7328111401218451, "repo_name": "jchoude/tractconverter", "id": "976c362347b69919c7b210779f1a033175d31371", "size": "1149", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "81105" }, { "name": "Shell", "bytes": "27" } ] }
static int gCounter; @implementation Fraction @synthesize numerator, denominator, addCounter; +(Fraction *) allocF{ extern int gCounter; ++gCounter; return [Fraction alloc]; } +(int) count{ extern int gCounter; return gCounter; } -(instancetype) initWith:(int) n over:(int) d{ self = [super init]; if (self) [self setTo:n over:d]; return self; } -(instancetype) init{ return [self initWith:0 over:0]; } -(void) print{ NSLog(@"%i/%i", numerator, denominator); } -(double) convertToNum{ if (denominator != 0) return (double)numerator / denominator; else return NAN; } -(void) setTo: (int) n over: (int) d{ numerator = n; denominator = d; } -(id) addId: (id) f{ id result = [[Fraction alloc]init]; if ([f isMemberOfClass:[Fraction class]]) { [result setNumerator:(self.numerator + [f numerator] + self.denominator + [f denominator])]; [result setDenominator:self.denominator * [f denominator]]; } return result; } -(void) reduce{ int u = numerator; int v = denominator; int temp; while (v != 0) { temp = u % v; u = v; v = temp; } numerator /= u; denominator /= u; } @end
{ "content_hash": "3563ca20531acd1dfb698c14fd4f3693", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 100, "avg_line_length": 18.28985507246377, "alnum_prop": 0.5792393026941363, "repo_name": "midalist/PiOC6th", "id": "99bee20023ab429e445291f71d9b2926d1023ba4", "size": "1375", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Chapter 11/Exercise 11.1/Exercise 11.1/Fraction.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "480543" } ] }
module ApplicationHelper def show_edit_actions(object) true if @current_user.id = object.user.id end end
{ "content_hash": "533cba8c5355efb957ab7f381df36c57", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 22.6, "alnum_prop": 0.7433628318584071, "repo_name": "ChristineSchatz/Rails_Blog", "id": "7d90e8a2dd7dc3ae7337fceb8af061c1e76f1fb4", "size": "113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rails_blog/app/helpers/application_helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1571" }, { "name": "CoffeeScript", "bytes": "1055" }, { "name": "HTML", "bytes": "8556" }, { "name": "JavaScript", "bytes": "667" }, { "name": "Ruby", "bytes": "29016" } ] }
<?php namespace Phive\TaskQueue; use Phive\Queue\Queue; use Psr\Log\LoggerInterface as Logger; class ExecutionContext { /** * @var Queue */ private $queue; /** * @var Logger */ private $logger; public function __construct(Queue $queue, Logger $logger) { $this->queue = $queue; $this->logger = $logger; } /** * @return Queue */ public function getQueue() { return $this->queue; } /** * @return Logger */ public function getLogger() { return $this->logger; } }
{ "content_hash": "3e09d8e0d294a9c1c649c83277638f98", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 61, "avg_line_length": 14.585365853658537, "alnum_prop": 0.5234113712374582, "repo_name": "rybakit/phive-task-queue", "id": "8647ef655a2356504d577279ecee946309b1bea5", "size": "598", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ExecutionContext.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "19758" } ] }
{% extends "./head-signedin.html" %} <!-- page title --> {% block page_title %} Licence serial number {{ pData.LicenceNumber }} - GOV.UK {% endblock %} {% block content %} <main id="content" role="main"> {% from "custom_inc/waterdata.html" import permits %} {% for pNumber, pData in permits %} {% if pNumber==chosenPermitID %} <!-- internal beta banner block --> {% include "../partials/feedback-banner.html" %} <!-- navigation block --> {% include "../partials/nav-eo-view.html" %} <!-- page title --> <div class="grid-row"> <div class="column-two-thirds"> <!-- code alert --> {% if pData.SecCode %} <!-- internal code block --> {% include "../partials/admin-code-sent.html" %} {% endif %} </div> </div> <!-- page heading --> {% if pData.LicenceName %} <!-- licence with a name --> <div class="grid-row"> <div class="column-two-thirds"> <h1 class="heading-large"> <span class="heading-secondary"> Licence number {{pData.LicenceSerialNo}} </span> {{ pData.LicenceName }} </h1> </div> </div> {% else %} <!-- licence with no name --> <h1 class="heading-large">Licence number {{ pData.LicenceSerialNo }}</h1> {% endif %} <!-- Licence holder --> <div class="datatable datahead"> <label>Licence holder</label> <div class="licenceAnswerv7"> {{ pData.HolderFirstName }} {{ pData.HolderSurname }}</br> <a href="/v21/br/contact_details?wid={{ pNumber }}">View licence contact details</a> </div> </div> <div class="datatable"> <label>Start date</label> <div class="dataText"> {{ pData.EffectiveDateStart }} </div> </div> <div class="datatable"> <label>End date</label> <div class="dataText"> {{ pData.EffectiveDateEnd }} </div> </div> <div class="datatable"> <label>Source of supply</label> <div class="licenceAnswerv7">{{ pData.Source}}</div> </div> <div class="datatable"> <label>Purpose of abstraction</label> <div class="licenceAnswerv7"> {{ pData.Purpose1 }}</br> </div> </div> <div class="datatable"> <label>Period of abstraction</label> <div class="licenceAnswerv7">{{ pData.PeriodofAbstraction }}</div> </div> <div class="datatable"> {% if pData.Point2 %} <label>Points of abstraction</label> <div class="licenceAnswerv7"> {{ pData.Point1 }}<br> {{ pData.Point2 }}<br> {% if pData.Point3 %} {{ pData.Point3 }}<br> {% endif %} {% if pData.Point4 %} {{ pData.Point4 }}<br> {% endif %} {% if pData.Point5 %} {{ pData.Point5 }}<br> {% endif %} <a href="points/points?wid={{ query.wid }}">View details of abstraction points</a> </div> {% else %} <label>Point of abstraction</label> <div class="licenceAnswerv7"> {{ pData.Point1 }}<br> <a href="points/points?wid={{ query.wid }}">View details of abstraction point</a> {% endif %} </div> <div class="datatable"> <label>Abstraction conditions</label> <div class="licenceAnswerv7"> {{ pData.Condition1 }}</br> {% if pData.Condition2 %} {{ pData.Condition2 }}</br> {% endif %} {% if pData.Condition3 %} {{ pData.Condition3 }}</br> {% endif %} {% if pData.Condition4 %} {{ pData.Condition4 }}</br> {% endif %} {% if pData.Condition5 %} {{ pData.Condition5 }}</br> {% endif %} <a href="conditions/conditions?wid={{ query.wid }}">View details of abstraction conditions</a> </div> </div> <div class="datatable"> <label>Abstraction amounts</label> <div class="licenceAnswerv7"> {{ pData.Amount1 }}</br> {% if pData.Amount2 %} {{ pData.Amount2 }}</br> {% endif %} {% if pData.Amount3 %} {{ pData.Amount3 }}</br> {% endif %} {% if pData.Amount4 %} {{ pData.Amount4 }}</br> {% endif %} {% if pData.Amount5 %} {{ pData.Amount5 }}</br> {% endif %} </div> </div> <div class="datatable big-space"> <label>Returns for this licence</label> <div class="licenceAnswerv7"> {% if pData.Purpose1Due %} {{ pData.Purpose1 }}</br> {% endif %} {% if pData.Purpose2 %} {{ pData.Purpose2 }}</br> {% endif %} {% if pData.Purpose3 %} {{ pData.Purpose3 }}</br> {% endif %} {% if pData.Purpose4 %} {{ pData.Purpose4 }}</br> {% endif %} {% if pData.Purpose5 %} {{ pData.Purpose5 }}</br> {% endif %} <a href="returns/returns?wid={{ query.wid }}">View returns</a> </div> </div> <!-- bad data block --> {% include "../partials/version-current.html" %} </div> {% endif %} {% endfor %} </main> {% endblock %}
{ "content_hash": "3fee3c54ef2425058d047a1a9087fc40", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 102, "avg_line_length": 22.7, "alnum_prop": 0.5296355626752103, "repo_name": "christinagyles-ea/water", "id": "c4397a4bae9cae7dacf5fea4fa2f0672f0a77d66", "size": "4994", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/v6/views/v21/eo/online-licence.html", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "7565" }, { "name": "HTML", "bytes": "291991" }, { "name": "JavaScript", "bytes": "39109" }, { "name": "Shell", "bytes": "1495" } ] }
import React from 'react' import PropTypes from 'prop-types' import { connect } from 'dva' import { Row, Col } from 'antd' import LoginForm from '../../components/LoginForm' import ChangeLanguage from '../../components/ChangeLanguage' import { noticeSuccess, noticeError } from '../../utils/notice' import styles from './login.less' class Login extends React.Component { getChildContext() { return { currentLanguage: this.props.currentLanguage } } get loginFormProps() { return { email: this.props.email, rememberMe: this.props.rememberMe, loading: this.props.loading, onLogin: this.props.onLogin, onChange: this.props.onChange } } get changeLanguageProps() { return { currentLanguage: this.props.currentLanguage, supportLanguages: this.props.supportLanguages, onMenuClick: this.props.onMenuClick } } render() { return ( <Row type="flex" justify="center" align="middle" className={styles.normal}> <ChangeLanguage {...this.changeLanguageProps} /> <Col xs={22} sm={12} md={8} lg={6} xl={4}> <LoginForm {...this.loginFormProps} /> </Col> </Row> ) } } Login.childContextTypes = { currentLanguage: PropTypes.string } Login.defaultProps = { loading: false } Login.propTypes = { email: PropTypes.string.isRequired, rememberMe: PropTypes.bool.isRequired, loading: PropTypes.bool, currentLanguage: PropTypes.string.isRequired, supportLanguages: PropTypes.array.isRequired, onChange: PropTypes.func.isRequired, onMenuClick: PropTypes.func.isRequired, onLogin: PropTypes.func.isRequired } const mapStateToProps = state => ({ email: state.login.email, rememberMe: state.login.rememberMe, loading: state.loading.models.login, currentLanguage: state.app.currentLanguage, supportLanguages: state.app.supportLanguages }) const mapDispatchToProps = dispatch => ({ onChange: values => dispatch({ type: 'login/triggerCheckBox', payload: { rememberMe: values } }), onMenuClick: language => dispatch({ type: 'app/changeLanguage', currentLanguage: language }), onLogin: (email, password) => dispatch({ type: 'login/login', payload: { email, password }, onSuccess: msg => noticeSuccess(msg), onError: (code, msg) => noticeError(code, msg) }) }) export default connect(mapStateToProps, mapDispatchToProps)(Login)
{ "content_hash": "3b18fc205c0930c39c47f523c5cce7ab", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 99, "avg_line_length": 27.168539325842698, "alnum_prop": 0.6869313482216708, "repo_name": "Mesamo/dva-admin", "id": "9e6db7e2ae7bd728178d06a971e42c501dd06294", "size": "2418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/routes/Login/login.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5715" }, { "name": "HTML", "bytes": "451" }, { "name": "JavaScript", "bytes": "74970" } ] }
package com.thanosfisherman.wifiutils.sample; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
{ "content_hash": "813820636ab30086806e7281ee719f7d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 24.352941176470587, "alnum_prop": 0.7004830917874396, "repo_name": "ThanosFisherman/WifiUtils", "id": "22a33cbc988f6fb43eaebafb2774ced67361670f", "size": "414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sample/src/test/java/com/thanosfisherman/wifiutils/sample/ExampleUnitTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "114920" }, { "name": "Kotlin", "bytes": "20877" } ] }
package com.hurence.logisland.logging; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Stubs out the functionality of a ComponentLog so that it can * be used during initialization of a component. * */ public class MockComponentLogger implements ComponentLog { private static final Logger logger = LoggerFactory .getLogger(MockComponentLogger.class); @Override public void warn(String msg, Throwable t) { logger.warn(msg, t); } @Override public void warn(String msg, Object[] os) { logger.warn(msg, os); } @Override public void warn(String msg, Object[] os, Throwable t) { logger.warn(msg, os); logger.warn("", t); } @Override public void warn(String msg) { logger.warn(msg); } @Override public void trace(String msg, Throwable t) { logger.trace(msg, t); } @Override public void trace(String msg, Object[] os) { logger.trace(msg, os); } @Override public void trace(String msg) { logger.trace(msg); } @Override public void trace(String msg, Object[] os, Throwable t) { logger.trace(msg, os); logger.trace("", t); } @Override public boolean isWarnEnabled() { return logger.isWarnEnabled(); } @Override public boolean isTraceEnabled() { return logger.isTraceEnabled(); } @Override public boolean isInfoEnabled() { return logger.isInfoEnabled(); } @Override public boolean isErrorEnabled() { return logger.isErrorEnabled(); } @Override public boolean isDebugEnabled() { return logger.isDebugEnabled(); } @Override public void info(String msg, Throwable t) { logger.info(msg, t); } @Override public void info(String msg, Object[] os) { logger.info(msg, os); } @Override public void info(String msg) { logger.info(msg); } @Override public void info(String msg, Object[] os, Throwable t) { logger.trace(msg, os); logger.trace("", t); } @Override public String getName() { return logger.getName(); } @Override public void error(String msg, Throwable t) { logger.error(msg, t); } @Override public void error(String msg, Object[] os) { logger.error(msg, os); } @Override public void error(String msg) { logger.error(msg); } @Override public void error(String msg, Object[] os, Throwable t) { logger.error(msg, os); logger.error("", t); } @Override public void debug(String msg, Throwable t) { logger.debug(msg, t); } @Override public void debug(String msg, Object[] os) { logger.debug(msg, os); } @Override public void debug(String msg, Object[] os, Throwable t) { logger.debug(msg, os); logger.debug("", t); } @Override public void debug(String msg) { logger.debug(msg); } @Override public void log(LogLevel level, String msg, Throwable t) { switch (level) { case DEBUG: debug(msg, t); break; case ERROR: case FATAL: error(msg, t); break; case INFO: info(msg, t); break; case TRACE: trace(msg, t); break; case WARN: warn(msg, t); break; } } @Override public void log(LogLevel level, String msg, Object[] os) { switch (level) { case DEBUG: debug(msg, os); break; case ERROR: case FATAL: error(msg, os); break; case INFO: info(msg, os); break; case TRACE: trace(msg, os); break; case WARN: warn(msg, os); break; } } @Override public void log(LogLevel level, String msg) { switch (level) { case DEBUG: debug(msg); break; case ERROR: case FATAL: error(msg); break; case INFO: info(msg); break; case TRACE: trace(msg); break; case WARN: warn(msg); break; } } @Override public void log(LogLevel level, String msg, Object[] os, Throwable t) { switch (level) { case DEBUG: debug(msg, os, t); break; case ERROR: case FATAL: error(msg, os, t); break; case INFO: info(msg, os, t); break; case TRACE: trace(msg, os, t); break; case WARN: warn(msg, os, t); break; } } }
{ "content_hash": "16d963ccaa83508957738bdad96f9768", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 75, "avg_line_length": 21.56611570247934, "alnum_prop": 0.48936577888484384, "repo_name": "MiniPlayer/log-island", "id": "45ab266162747f684633ee02882c0f58da5de112", "size": "5844", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "logisland-api/src/main/java/com/hurence/logisland/logging/MockComponentLogger.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3163" }, { "name": "HTML", "bytes": "32441" }, { "name": "Java", "bytes": "2489666" }, { "name": "JavaScript", "bytes": "32790" }, { "name": "Makefile", "bytes": "6774" }, { "name": "Python", "bytes": "4205508" }, { "name": "Roff", "bytes": "3242333" }, { "name": "Scala", "bytes": "274678" }, { "name": "Shell", "bytes": "31034" } ] }
class Nonce < ApplicationRecord def self.valid?(nonce) create!(nonce: nonce) true rescue Rails.logger.warn("Failed to create nonce: #{nonce}") false end # Remove old nonces from db. Run this from a background task to # clean the db of extraneous data. def self.clean delete_all(["created_at < ?", Time.now - 6.hours]) end end
{ "content_hash": "9057b458d0e658f15e65052ea20974ee", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 21.352941176470587, "alnum_prop": 0.6639118457300276, "repo_name": "atomicjolt/lti_starter_app", "id": "6a4ba76ce81efa2ac8b895371298856b48c3f932", "size": "363", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/models/nonce.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "212242" }, { "name": "Dockerfile", "bytes": "1971" }, { "name": "HTML", "bytes": "54268" }, { "name": "JavaScript", "bytes": "306904" }, { "name": "Procfile", "bytes": "39" }, { "name": "Ruby", "bytes": "665685" }, { "name": "SCSS", "bytes": "71837" }, { "name": "Shell", "bytes": "9415" } ] }
<scalastyle> <name>Scalastyle standard configuration</name> <check level="warning" class="org.scalastyle.file.FileTabChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true"> <parameters> <parameter name="maxFileLength"><![CDATA[800]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true"> <parameters> <parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author or authors. // See the LICENCE.txt file distributed with this work for additional // information regarding copyright ownership. // // 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.]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"> <parameters> <parameter name="ignoreWhitespaceLines"><![CDATA[false]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.file.FileLineLengthChecker" enabled="true"> <parameters> <parameter name="maxLineLength"><![CDATA[160]]></parameter> <parameter name="tabSize"><![CDATA[4]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.PackageNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true"> <parameters> <parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true"> <parameters> <parameter name="maxParameters"><![CDATA[8]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true"> <parameters> <parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeRightBracketChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.NullChecker" enabled="true"> <parameters> <parameter name="allowNullChecks"><![CDATA[true]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.file.RegexChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[println]]></parameter> <parameter name="line"><![CDATA[false]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true"> <parameters> <parameter name="maxTypes"><![CDATA[30]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true"> <parameters> <parameter name="maximum"><![CDATA[10]]></parameter> <parameter name="countCases"><![CDATA[true]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check> <check level="warning" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true"> <parameters> <parameter name="singleLineAllowed"><![CDATA[true]]></parameter> <parameter name="doubleLineAllowed"><![CDATA[false]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true"> <parameters> <parameter name="maxLength"><![CDATA[50]]></parameter> <parameter name="ignoreComments"><![CDATA[false]]></parameter> <parameter name="ignoreEmpty"><![CDATA[false]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*(_=)?$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.MethodArgumentNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true"> <parameters> <parameter name="maxMethods"><![CDATA[30]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"/> <check level="warning" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"/> <check level="warning" class="org.scalastyle.scalariform.NotImplementedErrorUsage" enabled="true" /> <check level="warning" class="org.scalastyle.scalariform.BlockImportChecker" enabled="false"/> <check level="warning" class="org.scalastyle.scalariform.ProcedureDeclarationChecker" enabled="true"/> <check level="warning" class="org.scalastyle.scalariform.ForBraceChecker" enabled="true"/> <check level="warning" class="org.scalastyle.scalariform.ForLoopChecker" enabled="true"/> <check level="warning" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" enabled="true"/> <check level="warning" class="org.scalastyle.scalariform.FieldNamesChecker" enabled="true"> <parameters> <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter> <parameter name="objectFieldRegex"><![CDATA[^[A-Z][A-Za-z]*$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.TodoCommentChecker" enabled="true"> <parameters> <parameter name="words"><![CDATA[TODO|FIXME]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NamedArgumentChecker" enabled="true"> <parameters> <parameter name="checkString"><![CDATA[false]]></parameter> <parameter name="ignoreMethod"><![CDATA[^set.+$]]></parameter> </parameters> </check> </scalastyle>
{ "content_hash": "feeef70306f5c40c03faf36331bc5435", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 120, "avg_line_length": 50.574074074074076, "alnum_prop": 0.7331868668375442, "repo_name": "scalastyle/scalastyle", "id": "83b6bf75a7b3e4336be2c9fa282bec0b2abd43e0", "size": "8193", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/resources/default_config.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "417092" } ] }
package main import ( "fmt" "github.com/dbferreira/go-bat/go-bat" ) func main() { gobat.HandleTask() fmt.Println("Complete, stopping app...") }
{ "content_hash": "e76e434ae73f431e32d324ebd9394e2e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 41, "avg_line_length": 11.692307692307692, "alnum_prop": 0.6644736842105263, "repo_name": "dbferreira/go-bat", "id": "818da855ac4375b08a0a212005c3a474114b4f0e", "size": "152", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "5438" } ] }
package com.netflix.curator.framework.state; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.netflix.curator.framework.CuratorFramework; import com.netflix.curator.framework.listen.ListenerContainer; import com.netflix.curator.utils.ThreadUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Closeable; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicReference; /** * Used internally to manage connection state */ public class ConnectionStateManager implements Closeable { private static final int QUEUE_SIZE; static { int size = 25; String property = System.getProperty("ConnectionStateManagerSize", null); if ( property != null ) { try { size = Integer.parseInt(property); } catch ( NumberFormatException ignore ) { // ignore } } QUEUE_SIZE = size; } private final Logger log = LoggerFactory.getLogger(getClass()); private final BlockingQueue<ConnectionState> eventQueue = new ArrayBlockingQueue<ConnectionState>(QUEUE_SIZE); private final CuratorFramework client; private final ListenerContainer<ConnectionStateListener> listeners = new ListenerContainer<ConnectionStateListener>(); private final AtomicReference<ConnectionState> currentState = new AtomicReference<ConnectionState>(); private final ExecutorService service; private final AtomicReference<State> state = new AtomicReference<State>(State.LATENT); private enum State { LATENT, STARTED, CLOSED } /** * @param client the client * @param threadFactory thread factory to use or null for a default */ public ConnectionStateManager(CuratorFramework client, ThreadFactory threadFactory) { this.client = client; if ( threadFactory == null ) { threadFactory = ThreadUtils.newThreadFactory("ConnectionStateManager"); } service = Executors.newSingleThreadExecutor(threadFactory); } /** * Start the manager */ public void start() { Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once"); service.submit ( new Callable<Object>() { @Override public Object call() throws Exception { processEvents(); return null; } } ); } @Override public void close() { if ( state.compareAndSet(State.STARTED, State.CLOSED) ) { service.shutdownNow(); listeners.clear(); } } /** * Return the listenable * * @return listenable */ public ListenerContainer<ConnectionStateListener> getListenable() { return listeners; } /** * Post a state change. If the manager is already in that state the change * is ignored. Otherwise the change is queued for listeners. * * @param newState new state */ public void addStateChange(ConnectionState newState) { if ( state.get() != State.STARTED ) { return; } ConnectionState previousState = currentState.getAndSet(newState); if ( previousState == newState ) { return; } ConnectionState localState = (previousState == null) ? ConnectionState.CONNECTED : newState; log.info("State change: " + localState); while ( !eventQueue.offer(localState) ) { eventQueue.poll(); log.warn("ConnectionStateManager queue full - dropping events to make room"); } } private void processEvents() { try { while ( !Thread.currentThread().isInterrupted() ) { final ConnectionState newState = eventQueue.take(); if ( listeners.size() == 0 ) { log.warn("There are no ConnectionStateListeners registered."); } listeners.forEach ( new Function<ConnectionStateListener, Void>() { @Override public Void apply(ConnectionStateListener listener) { listener.stateChanged(client, newState); return null; } } ); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); } } }
{ "content_hash": "8e4a12bd0832ac9e96c9876541edd913", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 129, "avg_line_length": 30.068571428571428, "alnum_prop": 0.5655644241733181, "repo_name": "box/curator", "id": "06e348d7601cc8ea5a5a7d034b2749e58fac8c34", "size": "5901", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "curator-framework/src/main/java/com/netflix/curator/framework/state/ConnectionStateManager.java", "mode": "33188", "license": "apache-2.0", "language": [] }
package com.devspark.robototextview.widget; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Typeface; import android.util.AttributeSet; import android.widget.DigitalClock; import com.devspark.robototextview.R; import com.devspark.robototextview.RobotoTypefaceManager; /** * Implementation of a {@link DigitalClock} with native support for all the Roboto fonts. * * @author Evgeny Shishkin */ public class RobotoDigitalClock extends DigitalClock { /** * Simple constructor to use when creating a widget from code. * * @param context The Context the widget is running in, through which it can * access the current theme, resources, etc. */ public RobotoDigitalClock(Context context) { super(context); onInitTypeface(context, null); } /** * Constructor that is called when inflating a widget from XML. This is called * when a widget is being constructed from an XML file, supplying attributes * that were specified in the XML file. This version uses a default style of * 0, so the only attribute values applied are those in the Context's Theme * and the given AttributeSet. * <p/> * <p/> * The method onFinishInflate() will be called after all children have been * added. * * @param context The Context the widget is running in, through which it can * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the widget. */ public RobotoDigitalClock(Context context, AttributeSet attrs) { super(context, attrs); onInitTypeface(context, attrs); } /** * Setup Roboto typeface. * * @param context The Context the widget is running in, through which it can * access the current theme, resources, etc. * @param attrs The attributes of the XML tag that is inflating the widget. */ private void onInitTypeface(Context context, AttributeSet attrs) { // Typeface.createFromAsset doesn't work in the layout editor, so skipping. if (isInEditMode()) { return; } int typefaceValue = RobotoTypefaceManager.ROBOTO_REGULAR; if (attrs != null) { TypedArray values = context.obtainStyledAttributes(attrs, R.styleable.RobotoTextView); if (values != null) { typefaceValue = values.getInt(R.styleable.RobotoTextView_typeface, typefaceValue); values.recycle(); } } Typeface robotoTypeface = RobotoTypefaceManager.obtainTypeface(context, typefaceValue); setTypeface(robotoTypeface); } }
{ "content_hash": "d8963e7800029e974bf2ef82ad276eb2", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 98, "avg_line_length": 35.34615384615385, "alnum_prop": 0.667392092854552, "repo_name": "0359xiaodong/Android-RobotoTextView", "id": "71561b6c7f9ec6cd7662473e7dd9fd952e85450e", "size": "3360", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "robototextview/src/main/java/com/devspark/robototextview/widget/RobotoDigitalClock.java", "mode": "33188", "license": "apache-2.0", "language": [] }
function shadowSelector(v) { return 'body /shadow-deep/ ' + selector(v); } function selector(v) { return '[touch-action="' + v + '"]'; } function rule(v) { return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; touch-action-delay: none; }'; } var attrib2css = [ 'none', 'auto', 'pan-x', 'pan-y', { rule: 'pan-x pan-y', selectors: [ 'pan-x pan-y', 'pan-y pan-x' ] } ]; var styles = ''; // only install stylesheet if the browser has touch action support var hasNativePE = window.PointerEvent || window.MSPointerEvent; // only add shadow selectors if shadowdom is supported var hasShadowRoot = !window.ShadowDOMPolyfill && document.head.createShadowRoot; export function applyAttributeStyles() { if (hasNativePE) { attrib2css.forEach(function(r) { if (String(r) === r) { styles += selector(r) + rule(r) + '\n'; if (hasShadowRoot) { styles += shadowSelector(r) + rule(r) + '\n'; } } else { styles += r.selectors.map(selector) + rule(r.rule) + '\n'; if (hasShadowRoot) { styles += r.selectors.map(shadowSelector) + rule(r.rule) + '\n'; } } }); var el = document.createElement('style'); el.textContent = styles; document.head.appendChild(el); } }
{ "content_hash": "6e317b270cc09a1f9bd38517b1801151", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 95, "avg_line_length": 25.607843137254903, "alnum_prop": 0.5849923430321593, "repo_name": "fercamp09/int20171T", "id": "15c50023dbc0185ac3ac08d804d9859d83ecd9c0", "size": "1306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/components/userinterface1/thirdPartyCode/bower_components/pepjs/src/touch-action.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "209587" }, { "name": "CSS", "bytes": "388771" }, { "name": "HTML", "bytes": "249977" }, { "name": "Java", "bytes": "36862" }, { "name": "JavaScript", "bytes": "5716559" }, { "name": "Objective-C", "bytes": "54450" }, { "name": "Objective-C++", "bytes": "83085" }, { "name": "Ruby", "bytes": "2111" }, { "name": "TypeScript", "bytes": "258000" } ] }
package com.io.bio.file; import java.io.*; import java.nio.file.NoSuchFileException; /** * Author Mr.Pro * Date 9/10/17 = 4:01 PM */ public class FileUtils { public static String readFile(String filePath) throws IOException { File file = new File(filePath); if(!file.exists()){ throw new NoSuchFileException("Can not find "+filePath); } FileReader fileReader = new FileReader(filePath); int c; StringBuffer text = new StringBuffer(); while ((c=fileReader.read())!=-1){ char cc = (char)c; text.append(cc); } return text.toString(); } public static void write(String path, String fileName, String data) throws IOException { File dir = new File(path); if(!dir.exists()){ dir.mkdirs(); } File writeFile = new File(path+"/"+fileName); writeFile.createNewFile(); OutputStream outputStream = new FileOutputStream(writeFile); outputStream.write(data.getBytes()); outputStream.flush(); outputStream.close(); } public static void main(String[] arg) throws IOException { String temp = readFile("test.txt"); String[] t = temp.split("\n"); for (String line : t){ System.out.println(line.split(" ")[2].split(";")[0].trim()+","); } } }
{ "content_hash": "4c5f8426934d09d8614be5b6f1089f3a", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 92, "avg_line_length": 29.595744680851062, "alnum_prop": 0.578001437814522, "repo_name": "caoyj1991/Core-Java", "id": "ccd1cf2afd41b37abbdf33ea4d9948178aa03df5", "size": "1391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jdklib/src/main/java/com/io/bio/file/FileUtils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "95768" }, { "name": "Shell", "bytes": "435" } ] }
using EPiServer.Core; using EPiServer.DataAbstraction; using EPiServer.DataAnnotations; using System.ComponentModel.DataAnnotations; namespace AlloySampleAzure.Models.Pages { /// <summary> /// Used for the pages mainly consisting of manually created content such as text, images, and blocks /// </summary> [SiteContentType(GUID = "9CCC8A41-5C8C-4BE0-8E73-520FF3DE8267")] [SiteImageUrl(Global.StaticGraphicsFolderPath + "page-type-thumbnail-standard.png")] public class StandardPage : SitePageData { [Display( GroupName = SystemTabNames.Content, Order = 310)] [CultureSpecific] public virtual XhtmlString MainBody { get; set; } [Display( GroupName = SystemTabNames.Content, Order = 320)] public virtual ContentArea MainContentArea { get; set; } } }
{ "content_hash": "efa0825b442e1de6ca17155c7762e5f3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 105, "avg_line_length": 33.46153846153846, "alnum_prop": 0.6781609195402298, "repo_name": "vnbaaij/ImageProcessor.Web.Episerver", "id": "cf9fc806d444f9ad0823f1f8eb62885df239b90b", "size": "870", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/AlloySampleAzure/Models/Pages/StandardPage.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "195720" }, { "name": "CSS", "bytes": "9286" }, { "name": "HTML", "bytes": "1209" }, { "name": "JavaScript", "bytes": "25843" }, { "name": "PowerShell", "bytes": "1321" } ] }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3ed30bb73ad3523be05fd5c8bc532e9e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "0ccf56719b1d2daaedd9bbb6b4f737e49d811acc", "size": "178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Ancylobothrys/Ancylobothrys mammosa/README.md", "mode": "33188", "license": "apache-2.0", "language": [] }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>JOGL Graph UI-Scene Demo 01 Auto-AA (NApplet)</title> </head> <body BGCOLOR="#ffffff"> <P> JOGL Graph UI-Scene Demo 01 Auto-AA (VBAA for < 200 dpi) </P> <P> <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="800" height="400"> <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"> <param name="archive" value="jar/gluegen-rt.jar, jar/joal.jar, jar/jogl-all.jar, jar/jogl-test.jar"> <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener04> <param name="gl_profile" value="GL2ES2"> <param name="gl_swap_interval" value="1"> <param name="gl_alpha" value="4"> <param name="gl_multisamplebuffer" value="0"> <param name="gl_debug" value="false"> <param name="gl_trace" value="false"> <comment> <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run" width="800" height="400" type="application/x-java-applet;version=1.6" pluginspage="http://java.sun.com/javase/downloads/ea.jsp" archive="jar/gluegen-rt.jar, jar/joal.jar, jar/jogl-all.jar, jar/jogl-test.jar" gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener04" gl_profile="GL2ES2" gl_swap_interval="1" gl_alpha="4" gl_multisamplebuffer="0" gl_debug="false" gl_trace="false"> <noembed>Sorry, no Java support detected.</noembed> </embed> </comment> </object> </P> <P> Graph UI-Scene Demo Keys:<br> <ul> <li> none - use mouse </li> </ul> </P> <P> JOGL NEWT JNLP Applet Runner Special Keys:<br> <ul> <li> d - toggle decoration </li> <li> f - toggle fullscreen </li> <li> r - in/out browser window </li> <li> a - on/off always-on-top </li> <li> c - change mouse pointer </li> <li> i - invisible mouse pointer </li> <li> w - warp mouse pointer to center </li> </ul> </P> </body> </html>
{ "content_hash": "5d91b34d8578aac2094d6902cd54d4a0", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 112, "avg_line_length": 31.4, "alnum_prop": 0.5928116469517744, "repo_name": "duke-compsci344-spring2015/jogl_jars", "id": "db4be720cebdd30b98172891af0b4b8eee41fe97", "size": "2198", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo04-napplet.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "94948" }, { "name": "Java", "bytes": "56715" }, { "name": "Shell", "bytes": "10406" } ] }
<div class="theseus-error-dialog template modal hide"> <div class="modal-header"> <a href="#" class="close">&times;</a> <h1 class="dialog-title">{{Strings.NODE_THESEUS_VERSION_ERROR_HEADER}}</h1> </div> <div class="modal-body"> <div class="dialog-image"></div> <p class="dialog-message">{{Strings.NODE_THESEUS_VERSION_ERROR_TEXT_1}}</p> </div> <div class="modal-footer"> <a href="#" class="dialog-button btn primary" data-button-id="ok">{{Strings.NODE_THESEUS_VERSION_ERROR_CONFIRM}}</a> </div> </div>
{ "content_hash": "ed4b77aec9d3b4c1313b1dabb3bdf09a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 124, "avg_line_length": 43.53846153846154, "alnum_prop": 0.6148409893992933, "repo_name": "mcanthony/theseus", "id": "98bc77af12a6233def35b02953bb1c988af82b4b", "size": "566", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/InvalidVersion.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9500" }, { "name": "HTML", "bytes": "3050" }, { "name": "JavaScript", "bytes": "280294" }, { "name": "Shell", "bytes": "461" } ] }
using System.Collections.Generic; namespace CompatibleSoftware.Poker.Domain { public interface ICommunityCards { void AddCard(ICard card); IList<ICard> GetCards(); } }
{ "content_hash": "7c4f795c1b91f1a8ee94e6e48518bbbc", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 41, "avg_line_length": 18.90909090909091, "alnum_prop": 0.6490384615384616, "repo_name": "KevMain/Poker", "id": "7151023a49a6417e6676f1542b694b18bb66c47d", "size": "210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/CompatibleSoftware.Poker.Domain/ICommunityCards.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "28659" } ] }
namespace Microsoft.Azure.Management.Network { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; /// <summary> /// ExpressRouteCircuitsOperations operations. /// </summary> internal partial class ExpressRouteCircuitsOperations : IServiceOperations<NetworkManagementClient>, IExpressRouteCircuitsOperations { /// <summary> /// Initializes a new instance of the ExpressRouteCircuitsOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } Client = client; } /// <summary> /// Gets a reference to the NetworkManagementClient /// </summary> public NetworkManagementClient Client { get; private set; } /// <summary> /// Deletes the specified express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Gets information about the specified express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of express route circuit. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuit>> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuit>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuit>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Creates or updates an express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the circuit. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update express route circuit /// operation. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<ExpressRouteCircuit>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse<ExpressRouteCircuit> _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Updates an express route circuit tags. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the circuit. /// </param> /// <param name='parameters'> /// Parameters supplied to update express route circuit tags. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<ExpressRouteCircuit>> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse<ExpressRouteCircuit> _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Gets the currently advertised ARP table associated with the express route /// circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<ExpressRouteCircuitsArpTableListResult>> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse<ExpressRouteCircuitsArpTableListResult> _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Gets the currently advertised routes table associated with the express /// route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<ExpressRouteCircuitsRoutesTableListResult>> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse<ExpressRouteCircuitsRoutesTableListResult> _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Gets the currently advertised routes table summary associated with the /// express route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<ExpressRouteCircuitsRoutesTableSummaryListResult>> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse<ExpressRouteCircuitsRoutesTableSummaryListResult> _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// Gets all the stats from an express route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuitStats>> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuitStats>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuitStats>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all stats from an express route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuitStats>> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuitStats>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuitStats>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all the express route circuits in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<ExpressRouteCircuit>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<ExpressRouteCircuit>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ExpressRouteCircuit>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all the express route circuits in a subscription. /// </summary> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<ExpressRouteCircuit>>> ListAllWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<ExpressRouteCircuit>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ExpressRouteCircuit>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Deletes the specified express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Creates or updates an express route circuit. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the circuit. /// </param> /// <param name='parameters'> /// Parameters supplied to the create or update express route circuit /// operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuit>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuit>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuit>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuit>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Updates an express route circuit tags. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the circuit. /// </param> /// <param name='parameters'> /// Parameters supplied to update express route circuit tags. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuit>> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string circuitName, TagsObject parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuit>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuit>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets the currently advertised ARP table associated with the express route /// circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuitsArpTableListResult>> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuitsArpTableListResult>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuitsArpTableListResult>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets the currently advertised routes table associated with the express /// route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuitsRoutesTableListResult>> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuitsRoutesTableListResult>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuitsRoutesTableListResult>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets the currently advertised routes table summary associated with the /// express route circuit in a resource group. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='circuitName'> /// The name of the express route circuit. /// </param> /// <param name='peeringName'> /// The name of the peering. /// </param> /// <param name='devicePath'> /// The path of the device. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ExpressRouteCircuitsRoutesTableSummaryListResult>> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (circuitName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } if (peeringName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } if (devicePath == null) { throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2018-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ExpressRouteCircuitsRoutesTableSummaryListResult>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ExpressRouteCircuitsRoutesTableSummaryListResult>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all the express route circuits in a resource group. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<ExpressRouteCircuit>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<ExpressRouteCircuit>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ExpressRouteCircuit>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets all the express route circuits in a subscription. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<ExpressRouteCircuit>>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<ExpressRouteCircuit>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ExpressRouteCircuit>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
{ "content_hash": "e6e8c9979546d21f6565f333d9559719", "timestamp": "", "source": "github", "line_count": 2749, "max_line_length": 354, "avg_line_length": 47.2921062204438, "alnum_prop": 0.5587819023737366, "repo_name": "pilor/azure-sdk-for-net", "id": "4b95aec25d34e277e9f0605df9e8c9c6af921e3e", "size": "130359", "binary": false, "copies": "1", "ref": "refs/heads/psSdkJson6", "path": "src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "18102" }, { "name": "C#", "bytes": "117130489" }, { "name": "JavaScript", "bytes": "7875" }, { "name": "PowerShell", "bytes": "105037" }, { "name": "Shell", "bytes": "31578" }, { "name": "XSLT", "bytes": "6114" } ] }
var inverseAuthMW = require('../middleware/authentication/inverseAuth'); var checkUsernameMW = require('../middleware/registration/checkUsername'); var checkEmailMW = require('../middleware/registration/checkEmail'); var checkPasswordMW = require('../middleware/registration/checkPassword'); var saveUserMW = require('../middleware/registration/saveUser'); var renderMW = require('../middleware/general/render'); var models = require('../models'); module.exports = function (app) { var objectRepository = { userModel: models.User, spendingModel: models.Spending }; app.post('/registration', inverseAuthMW(objectRepository), checkUsernameMW(objectRepository), checkEmailMW(objectRepository), checkPasswordMW(objectRepository), saveUserMW(objectRepository), renderMW(objectRepository, 'login') ); };
{ "content_hash": "18b57a1837505ffb4fb8f51df6787589", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 74, "avg_line_length": 35.28, "alnum_prop": 0.7108843537414966, "repo_name": "kocsob/spending-monitor", "id": "6b8517390c01abb3b49d1c0c0116dd05ab320d4d", "size": "896", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/registration.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "680" }, { "name": "HTML", "bytes": "20589" }, { "name": "JavaScript", "bytes": "32490" } ] }
End of preview.

No dataset card yet

Downloads last month
5