content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Abp.Domain.Entities.Auditing; using Abp.Domain.Entities; namespace Abp.EntityFrameworkCore.Tests.Domain { public class Post : AuditedEntity, ISoftDelete, IMayHaveTenant { [Required] public Blog Blog { get; set; } public string Title { get; set; } public string Body { get; set; } public bool IsDeleted { get; set; } public Guid? TenantId { get; set; } public ICollection<Comment> Comments { get; set; } public Post() { Id = Guid.NewGuid(); Comments = new List<Comment>(); } public Post(Blog blog, string title, string body) : this() { Blog = blog; Title = title; Body = body; Comments = new List<Comment>(); } } }
23.615385
66
0.567861
[ "MIT" ]
tolemac/aspnetboilerplate-guid
test/Abp.EntityFrameworkCore.Tests/Domain/Post.cs
923
C#
using System; namespace RouletteApi.Model { public class RouletteModel { public int Id_roulette { get; set; } public DateTime Create_date { get; set; } public int? Number { get; set; } public string Color { get; set; } public DateTime? Closed_date { get; set; } public string State { get; set; } } }
24.133333
50
0.593923
[ "MIT" ]
alejo688/RouletteApi
RouletteApi/Model/RouletteModel.cs
364
C#
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; namespace Amaranth.Data { /// <summary> /// Represents a named macro that expands to a collection of flags. /// </summary> public class FlagMacro { public string Name; public readonly List<string> Flags; public FlagMacro(string name) { Name = name; Flags = new List<string>(); } public override string ToString() { StringBuilder builder = new StringBuilder(); builder.Append(Name); builder.Append(" = "); builder.Append(String.Join(" ", Flags.ToArray())); return builder.ToString(); } } public class FlagMacroCollection : KeyedCollection<string, FlagMacro> { public IEnumerable<string> Expand(string macro) { List<string> flags = new List<string>(); if (Contains(macro)) { // macro, so recursively expand Expand(macro, flags); } else { // not a macro, so just return itself flags.Add(macro); } return flags; } protected override string GetKeyForItem(FlagMacro item) { return item.Name; } private void Expand(string macro, List<string> flags) { foreach (string flag in this[macro].Flags) { if (!flags.Contains(flag)) { // see if the expanded flag is itself a macro if (Contains(flag)) { // recurse into the macro Expand(flag, flags); } else { // not a macro, just add it flags.Add(flag); } } } } } }
26.679012
74
0.447941
[ "MIT" ]
LambdaSix/Amaranth
Amaranth.Data/Classes/FlagMacro.cs
2,163
C#
namespace PokemonAdventureGame.Enums { public enum TypeEffect { IMMUNE, NOT_VERY_EFFECTIVE, NEUTRAL, SUPER_EFFECTIVE } }
16.6
37
0.60241
[ "MIT" ]
JustAn0therDev/PokemonAdventureGame
PokemonAdventureGame/Enums/TypeEffect.cs
166
C#
using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Rendering; using Nop.Web.Framework.Models; using Nop.Web.Framework.Mvc.ModelBinding; namespace Nop.Web.Areas.Admin.Models.Catalog { /// <summary> /// Represents a stock quantity history search model /// </summary> public partial class StockQuantityHistorySearchModel : BaseSearchModel { #region Ctor public StockQuantityHistorySearchModel() { AvailableWarehouses = new List<SelectListItem>(); } #endregion #region Properties public int ProductId { get; set; } [NopResourceDisplayName("Admin.Catalog.Products.List.SearchWarehouse")] public int WarehouseId { get; set; } public IList<SelectListItem> AvailableWarehouses { get; set; } #endregion } }
25.575758
79
0.670616
[ "MIT" ]
ASP-WAF/FireWall
Samples/NopeCommerce/Presentation/Nop.Web/Areas/Admin/Models/Catalog/StockQuantityHistorySearchModel.cs
846
C#
/* * Copyright (c) Dominick Baier. All rights reserved. * see license.txt */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IdentityModel.Tokens; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Security; using System.ServiceModel.Security.Tokens; using System.Xml; namespace Thinktecture.IdentityModel.WSTrust { public class IssuedTokenWSTrustBinding : WSTrustBinding { private SecurityAlgorithmSuite _algorithmSuite; private Collection<ClaimTypeRequirement> _claimTypeRequirements; private EndpointAddress _issuerAddress; private Binding _issuerBinding; private EndpointAddress _issuerMetadataAddress; private SecurityKeyType _keyType; private string _tokenType; public IssuedTokenWSTrustBinding() : this(null, null) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress) : this(issuerBinding, issuerAddress, SecurityMode.Message, TrustVersion.WSTrust13, null) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress, EndpointAddress issuerMetadataAddress) : this(issuerBinding, issuerAddress, SecurityMode.Message, TrustVersion.WSTrust13, issuerMetadataAddress) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress, string tokenType, IEnumerable<ClaimTypeRequirement> claimTypeRequirements) : this(issuerBinding, issuerAddress, SecurityKeyType.SymmetricKey, SecurityAlgorithmSuite.Basic256, tokenType, claimTypeRequirements) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress, SecurityMode mode, TrustVersion trustVersion, EndpointAddress issuerMetadataAddress) : this(issuerBinding, issuerAddress, mode, trustVersion, SecurityKeyType.SymmetricKey, SecurityAlgorithmSuite.Basic256, null, null, issuerMetadataAddress) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress, SecurityKeyType keyType, SecurityAlgorithmSuite algorithmSuite, string tokenType, IEnumerable<ClaimTypeRequirement> claimTypeRequirements) : this(issuerBinding, issuerAddress, SecurityMode.Message, TrustVersion.WSTrust13, keyType, algorithmSuite, tokenType, claimTypeRequirements, null) { } public IssuedTokenWSTrustBinding(Binding issuerBinding, EndpointAddress issuerAddress, SecurityMode mode, TrustVersion version, SecurityKeyType keyType, SecurityAlgorithmSuite algorithmSuite, string tokenType, IEnumerable<ClaimTypeRequirement> claimTypeRequirements, EndpointAddress issuerMetadataAddress) : base(mode, version) { this._claimTypeRequirements = new Collection<ClaimTypeRequirement>(); if ((SecurityMode.Message != mode) && (SecurityMode.TransportWithMessageCredential != mode)) { throw new InvalidOperationException("ID3226"); } if ((this._keyType == SecurityKeyType.BearerKey) && (version == TrustVersion.WSTrustFeb2005)) { throw new InvalidOperationException("ID3267"); } this._keyType = keyType; this._algorithmSuite = algorithmSuite; this._tokenType = tokenType; this._issuerBinding = issuerBinding; this._issuerAddress = issuerAddress; this._issuerMetadataAddress = issuerMetadataAddress; if (claimTypeRequirements != null) { foreach (ClaimTypeRequirement requirement in claimTypeRequirements) { this._claimTypeRequirements.Add(requirement); } } } private void AddAlgorithmParameters(SecurityAlgorithmSuite algorithmSuite, TrustVersion trustVersion, SecurityKeyType keyType, ref IssuedSecurityTokenParameters issuedParameters) { issuedParameters.AdditionalRequestParameters.Insert(0, this.CreateEncryptionAlgorithmElement(algorithmSuite.DefaultEncryptionAlgorithm)); issuedParameters.AdditionalRequestParameters.Insert(0, this.CreateCanonicalizationAlgorithmElement(algorithmSuite.DefaultCanonicalizationAlgorithm)); string signatureAlgorithm = null; string encryptionAlgorithm = null; switch (keyType) { case SecurityKeyType.SymmetricKey: signatureAlgorithm = algorithmSuite.DefaultSymmetricSignatureAlgorithm; encryptionAlgorithm = algorithmSuite.DefaultEncryptionAlgorithm; break; case SecurityKeyType.AsymmetricKey: signatureAlgorithm = algorithmSuite.DefaultAsymmetricSignatureAlgorithm; encryptionAlgorithm = algorithmSuite.DefaultAsymmetricKeyWrapAlgorithm; break; case SecurityKeyType.BearerKey: return; default: throw new ArgumentOutOfRangeException("keyType"); } issuedParameters.AdditionalRequestParameters.Insert(0, this.CreateSignWithElement(signatureAlgorithm)); issuedParameters.AdditionalRequestParameters.Insert(0, this.CreateEncryptWithElement(encryptionAlgorithm)); if (trustVersion != TrustVersion.WSTrustFeb2005) { issuedParameters.AdditionalRequestParameters.Insert(0, CreateKeyWrapAlgorithmElement(algorithmSuite.DefaultAsymmetricKeyWrapAlgorithm)); } } protected override void ApplyTransportSecurity(HttpTransportBindingElement transport) { throw new NotSupportedException(); } private XmlElement CreateCanonicalizationAlgorithmElement(string canonicalizationAlgorithm) { if (canonicalizationAlgorithm == null) { throw new ArgumentNullException("canonicalizationAlgorithm"); } var document = new XmlDocument(); XmlElement element = null; if (base.TrustVersion == TrustVersion.WSTrust13) { element = document.CreateElement("trust", "CanonicalizationAlgorithm", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"); } else if (base.TrustVersion == TrustVersion.WSTrustFeb2005) { element = document.CreateElement("t", "CanonicalizationAlgorithm", "http://schemas.xmlsoap.org/ws/2005/02/trust"); } if (element != null) { element.AppendChild(document.CreateTextNode(canonicalizationAlgorithm)); } return element; } private XmlElement CreateEncryptionAlgorithmElement(string encryptionAlgorithm) { if (encryptionAlgorithm == null) { throw new ArgumentNullException("encryptionAlgorithm"); } XmlDocument document = new XmlDocument(); XmlElement element = null; if (base.TrustVersion == TrustVersion.WSTrust13) { element = document.CreateElement("trust", "EncryptionAlgorithm", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"); } else if (base.TrustVersion == TrustVersion.WSTrustFeb2005) { element = document.CreateElement("t", "EncryptionAlgorithm", "http://schemas.xmlsoap.org/ws/2005/02/trust"); } if (element != null) { element.AppendChild(document.CreateTextNode(encryptionAlgorithm)); } return element; } private XmlElement CreateEncryptWithElement(string encryptionAlgorithm) { if (encryptionAlgorithm == null) { throw new ArgumentNullException("encryptionAlgorithm"); } XmlDocument document = new XmlDocument(); XmlElement element = null; if (base.TrustVersion == TrustVersion.WSTrust13) { element = document.CreateElement("trust", "EncryptWith", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"); } else if (base.TrustVersion == TrustVersion.WSTrustFeb2005) { element = document.CreateElement("t", "EncryptWith", "http://schemas.xmlsoap.org/ws/2005/02/trust"); } if (element != null) { element.AppendChild(document.CreateTextNode(encryptionAlgorithm)); } return element; } private static XmlElement CreateKeyWrapAlgorithmElement(string keyWrapAlgorithm) { if (keyWrapAlgorithm == null) { throw new ArgumentNullException("keyWrapAlgorithm"); } XmlDocument document = new XmlDocument(); XmlElement element = document.CreateElement("trust", "KeyWrapAlgorithm", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"); element.AppendChild(document.CreateTextNode(keyWrapAlgorithm)); return element; } protected override SecurityBindingElement CreateSecurityBindingElement() { SecurityBindingElement element; IssuedSecurityTokenParameters issuedParameters = new IssuedSecurityTokenParameters(this._tokenType, this._issuerAddress, this._issuerBinding) { KeyType = this._keyType, IssuerMetadataAddress = this._issuerMetadataAddress }; if (this._keyType == SecurityKeyType.SymmetricKey) { issuedParameters.KeySize = this._algorithmSuite.DefaultSymmetricKeyLength; } else { issuedParameters.KeySize = 0; } if (this._claimTypeRequirements != null) { foreach (ClaimTypeRequirement requirement in this._claimTypeRequirements) { issuedParameters.ClaimTypeRequirements.Add(requirement); } } this.AddAlgorithmParameters(this._algorithmSuite, base.TrustVersion, this._keyType, ref issuedParameters); if (SecurityMode.Message == base.SecurityMode) { element = SecurityBindingElement.CreateIssuedTokenForCertificateBindingElement(issuedParameters); } else { if (SecurityMode.TransportWithMessageCredential != base.SecurityMode) { throw new InvalidOperationException("ID3226"); } element = SecurityBindingElement.CreateIssuedTokenOverTransportBindingElement(issuedParameters); } element.DefaultAlgorithmSuite = this._algorithmSuite; element.IncludeTimestamp = true; return element; } private XmlElement CreateSignWithElement(string signatureAlgorithm) { if (signatureAlgorithm == null) { throw new ArgumentNullException("signatureAlgorithm"); } XmlDocument document = new XmlDocument(); XmlElement element = null; if (base.TrustVersion == TrustVersion.WSTrust13) { element = document.CreateElement("trust", "SignatureAlgorithm", "http://docs.oasis-open.org/ws-sx/ws-trust/200512"); } else if (base.TrustVersion == TrustVersion.WSTrustFeb2005) { element = document.CreateElement("t", "SignatureAlgorithm", "http://schemas.xmlsoap.org/ws/2005/02/trust"); } if (element != null) { element.AppendChild(document.CreateTextNode(signatureAlgorithm)); } return element; } public SecurityAlgorithmSuite AlgorithmSuite { get { return this._algorithmSuite; } set { this._algorithmSuite = value; } } public Collection<ClaimTypeRequirement> ClaimTypeRequirement { get { return this._claimTypeRequirements; } } public EndpointAddress IssuerAddress { get { return this._issuerAddress; } set { this._issuerAddress = value; } } public Binding IssuerBinding { get { return this._issuerBinding; } set { this._issuerBinding = value; } } public EndpointAddress IssuerMetadataAddress { get { return this._issuerMetadataAddress; } set { this._issuerMetadataAddress = value; } } public SecurityKeyType KeyType { get { return this._keyType; } set { this._keyType = value; } } public string TokenType { get { return this._tokenType; } set { this._tokenType = value; } } } }
37.924731
313
0.592855
[ "BSD-3-Clause" ]
YouthLab/Thinktecture.IdentityModel.45
IdentityModel/Thinktecture.IdentityModel/WSTrust/IssuedTokenWSTrustBinding.cs
14,110
C#
using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Xml.Schema; using System.Xml.Serialization; namespace Workday.FinancialManagement { [GeneratedCode("System.Xml", "4.6.1590.0"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "urn:com.workday/bsvc")] [Serializable] public class Fund_TypeObjectIDType : INotifyPropertyChanged { private string typeField; private string valueField; [method: CompilerGenerated] [CompilerGenerated] public event PropertyChangedEventHandler PropertyChanged; [XmlAttribute(Form = XmlSchemaForm.Qualified)] public string type { get { return this.typeField; } set { this.typeField = value; this.RaisePropertyChanged("type"); } } [XmlText] public string Value { get { return this.valueField; } set { this.valueField = value; this.RaisePropertyChanged("Value"); } } protected void RaisePropertyChanged(string propertyName) { PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if (propertyChanged != null) { propertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }
20.704918
136
0.727633
[ "MIT" ]
matteofabbri/Workday.WebServices
Workday.FinancialManagement/Fund_TypeObjectIDType.cs
1,263
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Animation; using Windows.UI.Xaml.Navigation; // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=391641 namespace ResourceBitmapCode.WinPhone { /// <summary> /// Provides application-specific behavior to supplement the default Application class. /// </summary> public sealed partial class App : Application { private TransitionCollection transitions; /// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += this.OnSuspending; } /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); // TODO: change this value to a cache size that is appropriate for your application rootFrame.CacheSize = 1; Xamarin.Forms.Forms.Init(e); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // Removes the turnstile navigation for startup. if (rootFrame.ContentTransitions != null) { this.transitions = new TransitionCollection(); foreach (var c in rootFrame.ContentTransitions) { this.transitions.Add(c); } } rootFrame.ContentTransitions = null; rootFrame.Navigated += this.RootFrame_FirstNavigated; // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) { throw new Exception("Failed to create initial page"); } } // Ensure the current window is active Window.Current.Activate(); } /// <summary> /// Restores the content transitions after the app has launched. /// </summary> /// <param name="sender">The object where the handler is attached.</param> /// <param name="e">Details about the navigation event.</param> private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) { var rootFrame = sender as Frame; rootFrame.ContentTransitions = this.transitions ?? new TransitionCollection() { new NavigationThemeTransition() }; rootFrame.Navigated -= this.RootFrame_FirstNavigated; } /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); // TODO: Save application state and stop any background activity deferral.Complete(); } } }
38.887218
126
0.610402
[ "Apache-2.0" ]
aliozgur/xamarin-forms-book-samples
Chapter13/ResourceBitmapCode/ResourceBitmapCode/ResourceBitmapCode.WinPhone/App.xaml.cs
5,172
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. using System; using System.Collections; using System.Linq; using System.Reactive.Linq; using Microsoft.Reactive.Testing; using NUnit.Framework; namespace ReactiveTests.Tests { public class ToEnumerableTest : ReactiveTest { [Test] public void ToEnumerable_ArgumentChecking() { ReactiveAssert.Throws<ArgumentNullException>(() => Observable.ToEnumerable(default(IObservable<int>))); } [Test] public void ToEnumerable_Generic() { Assert.True(Observable.Range(0, 10).ToEnumerable().SequenceEqual(Enumerable.Range(0, 10))); } [Test] public void ToEnumerable_NonGeneric() { Assert.True(((IEnumerable)Observable.Range(0, 10).ToEnumerable()).Cast<int>().SequenceEqual(Enumerable.Range(0, 10))); } [Test] public void ToEnumerable_ManualGeneric() { var res = Observable.Range(0, 10).ToEnumerable(); var ieg = res.GetEnumerator(); for (var i = 0; i < 10; i++) { Assert.True(ieg.MoveNext()); Assert.AreEqual(i, ieg.Current); } Assert.False(ieg.MoveNext()); } [Test] public void ToEnumerable_ManualNonGeneric() { var res = (IEnumerable)Observable.Range(0, 10).ToEnumerable(); var ien = res.GetEnumerator(); for (var i = 0; i < 10; i++) { Assert.True(ien.MoveNext()); Assert.AreEqual(i, ien.Current); } Assert.False(ien.MoveNext()); } [Test] public void ToEnumerable_ResetNotSupported() { ReactiveAssert.Throws<NotSupportedException>(() => Observable.Range(0, 10).ToEnumerable().GetEnumerator().Reset()); } } }
30.101449
130
0.581127
[ "MIT" ]
grofit/unity-rx-test
RxUnityTest/Assets/Editor/Tests/Tests/Linq/Observable/ToEnumerableTest.cs
2,079
C#
using Microsoft.Maui.Controls.CustomAttributes; using Microsoft.Maui.Controls.Internals; #if UITEST using Microsoft.Maui.Controls.Compatibility.UITests; using Xamarin.UITest; using NUnit.Framework; #endif namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues { #if UITEST [Category(UITestCategories.ManualReview)] #endif [Preserve(AllMembers = true)] [Issue(IssueTracker.Github, 6021, "[macOS] ListView does not handle transparent backgrounds correctly", PlatformAffected.macOS)] public class Github6201 : TestContentPage // or TestFlyoutPage, etc ... { protected override void Init() { BackgroundColor = Color.Red; Content = new ListView { Margin = new Thickness(20), BackgroundColor = Color.FromRgba(0, 0, 1, 0.5), ItemsSource = new string[] { "Page background should be red", "ListView background should be blue with 50% alpha and so should appear purple", "[iOS, macOS] Default behavior is to make cells have the same color as the ListView, so the cells should appear 100% blue", "[Other platforms] Cells should be transparent, and appear purple", "If the cells appear pale blue, then the ListView has an extra white background", "If the cells appear dark blue, then the cells have the same blue with 50% alpha as a background", "If the ListView appears dark blue, then background colors with alpha is not supported" }, }; } } }
44.774194
610
0.757925
[ "MIT" ]
Eilon/maui
src/Compatibility/ControlGallery/src/Issues.Shared/Github6021.cs
1,390
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.Globalization; using System.Threading; using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.AppService.Models; using Azure.ResourceManager.Core; namespace Azure.ResourceManager.AppService { /// <summary> A Class representing a SiteSlotPrivateAccess along with the instance operations that can be performed on it. </summary> public partial class SiteSlotPrivateAccess : ArmResource { /// <summary> Generate the resource identifier of a <see cref="SiteSlotPrivateAccess"/> instance. </summary> public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name, string slot) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks"; return new ResourceIdentifier(resourceId); } private readonly ClientDiagnostics _siteSlotPrivateAccessWebAppsClientDiagnostics; private readonly WebAppsRestOperations _siteSlotPrivateAccessWebAppsRestClient; private readonly PrivateAccessData _data; /// <summary> Initializes a new instance of the <see cref="SiteSlotPrivateAccess"/> class for mocking. </summary> protected SiteSlotPrivateAccess() { } /// <summary> Initializes a new instance of the <see cref = "SiteSlotPrivateAccess"/> class. </summary> /// <param name="client"> The client parameters to use in these operations. </param> /// <param name="data"> The resource that is the target of operations. </param> internal SiteSlotPrivateAccess(ArmClient client, PrivateAccessData data) : this(client, data.Id) { HasData = true; _data = data; } /// <summary> Initializes a new instance of the <see cref="SiteSlotPrivateAccess"/> class. </summary> /// <param name="client"> The client parameters to use in these operations. </param> /// <param name="id"> The identifier of the resource that is the target of operations. </param> internal SiteSlotPrivateAccess(ArmClient client, ResourceIdentifier id) : base(client, id) { _siteSlotPrivateAccessWebAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, DiagnosticOptions); Client.TryGetApiVersion(ResourceType, out string siteSlotPrivateAccessWebAppsApiVersion); _siteSlotPrivateAccessWebAppsRestClient = new WebAppsRestOperations(_siteSlotPrivateAccessWebAppsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, siteSlotPrivateAccessWebAppsApiVersion); #if DEBUG ValidateResourceId(Id); #endif } /// <summary> Gets the resource type for the operations. </summary> public static readonly ResourceType ResourceType = "Microsoft.Web/sites/slots/privateAccess"; /// <summary> Gets whether or not the current instance has data. </summary> public virtual bool HasData { get; } /// <summary> Gets the data representing this Feature. </summary> /// <exception cref="InvalidOperationException"> Throws if there is no data loaded in the current instance. </exception> public virtual PrivateAccessData Data { get { if (!HasData) throw new InvalidOperationException("The current instance does not have data, you must call Get first."); return _data; } } internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceType) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } /// RequestPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// ContextualPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// OperationId: WebApps_GetPrivateAccessSlot /// <summary> Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. </summary> /// <param name="cancellationToken"> The cancellation token to use. </param> public async virtual Task<Response<SiteSlotPrivateAccess>> GetAsync(CancellationToken cancellationToken = default) { using var scope = _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateScope("SiteSlotPrivateAccess.Get"); scope.Start(); try { var response = await _siteSlotPrivateAccessWebAppsRestClient.GetPrivateAccessSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw await _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); return Response.FromValue(new SiteSlotPrivateAccess(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } /// RequestPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// ContextualPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// OperationId: WebApps_GetPrivateAccessSlot /// <summary> Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. </summary> /// <param name="cancellationToken"> The cancellation token to use. </param> public virtual Response<SiteSlotPrivateAccess> Get(CancellationToken cancellationToken = default) { using var scope = _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateScope("SiteSlotPrivateAccess.Get"); scope.Start(); try { var response = _siteSlotPrivateAccessWebAppsRestClient.GetPrivateAccessSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); if (response.Value == null) throw _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); return Response.FromValue(new SiteSlotPrivateAccess(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } /// RequestPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// ContextualPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// OperationId: WebApps_PutPrivateAccessVnetSlot /// <summary> Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. </summary> /// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> /// <param name="access"> The information for the private access. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="ArgumentNullException"> <paramref name="access"/> is null. </exception> public async virtual Task<SiteSlotPrivateAccessCreateOrUpdateOperation> CreateOrUpdateAsync(bool waitForCompletion, PrivateAccessData access, CancellationToken cancellationToken = default) { if (access == null) { throw new ArgumentNullException(nameof(access)); } using var scope = _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateScope("SiteSlotPrivateAccess.CreateOrUpdate"); scope.Start(); try { var response = await _siteSlotPrivateAccessWebAppsRestClient.PutPrivateAccessVnetSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, access, cancellationToken).ConfigureAwait(false); var operation = new SiteSlotPrivateAccessCreateOrUpdateOperation(Client, response); if (waitForCompletion) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) { scope.Failed(e); throw; } } /// RequestPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// ContextualPath: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks /// OperationId: WebApps_PutPrivateAccessVnetSlot /// <summary> Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. </summary> /// <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> /// <param name="access"> The information for the private access. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="ArgumentNullException"> <paramref name="access"/> is null. </exception> public virtual SiteSlotPrivateAccessCreateOrUpdateOperation CreateOrUpdate(bool waitForCompletion, PrivateAccessData access, CancellationToken cancellationToken = default) { if (access == null) { throw new ArgumentNullException(nameof(access)); } using var scope = _siteSlotPrivateAccessWebAppsClientDiagnostics.CreateScope("SiteSlotPrivateAccess.CreateOrUpdate"); scope.Start(); try { var response = _siteSlotPrivateAccessWebAppsRestClient.PutPrivateAccessVnetSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, access, cancellationToken); var operation = new SiteSlotPrivateAccessCreateOrUpdateOperation(Client, response); if (waitForCompletion) operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) { scope.Failed(e); throw; } } } }
58.314721
236
0.689415
[ "MIT" ]
danielortega-msft/azure-sdk-for-net
sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotPrivateAccess.cs
11,488
C#
using System; using System.Diagnostics; namespace Vitals { class RangeChecker { public static bool rangeCheckerVitals(float lowerlimit,float upperlimit, float vitalreading) { if(vitalreading > upperlimit || vitalreading < lowerlimit) { return false; } return true; } } }
20.777778
102
0.569519
[ "MIT" ]
Engin-Boot/vitals-simplification-cs-PallaviZoting
RangeChecker.cs
374
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from shared/dxgi1_3.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System; using System.Runtime.InteropServices; using static TerraFX.Interop.Windows; namespace TerraFX.Interop.UnitTests { /// <summary>Provides validation of the <see cref="IDXGIOutput3" /> struct.</summary> public static unsafe class IDXGIOutput3Tests { /// <summary>Validates that the <see cref="Guid" /> of the <see cref="IDXGIOutput3" /> struct is correct.</summary> [Test] public static void GuidOfTest() { Assert.That(typeof(IDXGIOutput3).GUID, Is.EqualTo(IID_IDXGIOutput3)); } /// <summary>Validates that the <see cref="IDXGIOutput3" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<IDXGIOutput3>(), Is.EqualTo(sizeof(IDXGIOutput3))); } /// <summary>Validates that the <see cref="IDXGIOutput3" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(IDXGIOutput3).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="IDXGIOutput3" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { if (Environment.Is64BitProcess) { Assert.That(sizeof(IDXGIOutput3), Is.EqualTo(8)); } else { Assert.That(sizeof(IDXGIOutput3), Is.EqualTo(4)); } } } }
35.923077
145
0.625803
[ "MIT" ]
phizch/terrafx.interop.windows
tests/Interop/Windows/shared/dxgi1_3/IDXGIOutput3Tests.cs
1,870
C#
using System; using System.Collections.Generic; using Android.App; using Android.Content; using Android.Content.PM; using Android.OS; using Android.Provider; using Android.Speech; namespace scripting.Droid { public class STT { public static int STT_REQUEST = 10; public static int STT_PERMISSIONS_REQUEST = 77; static SpeechRecognizer m_speechRecognizer; static Intent m_speechRecognizerIntent; static string m_voice = "en-US"; public static string Voice { get { return m_voice; } set { m_voice = value.Replace('_', '-'); } } static Intent InitSpeechIntent(string voice, string prompt = "") { var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech); voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm); // put a message on the modal dialog if (!string.IsNullOrWhiteSpace(prompt)) { voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, prompt); } // if there is more then 1.5s of silence, consider the speech over //voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 1500); //voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500); //voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 2000); voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 10); voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm); //voiceIntent.PutExtra(RecognizerIntent.ExtraCallingPackage, PackageName); voiceIntent.PutExtra("android.speech.extra.EXTRA_ADDITIONAL_LANGUAGES", new string[] { }); voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, voice); voiceIntent.PutExtra(RecognizerIntent.ExtraLanguagePreference, voice); voiceIntent.PutExtra(RecognizerIntent.ExtraOnlyReturnLanguagePreference, voice); return voiceIntent; } static bool m_microhoneChecked = false; static string CheckMicrophone() { if (m_microhoneChecked) { return null; } IList<ResolveInfo> activities = MainActivity.TheView.PackageManager.QueryIntentActivities( new Intent(RecognizerIntent.ActionRecognizeSpeech), 0); string rec = Android.Content.PM.PackageManager.FeatureMicrophone; if (rec != "android.hardware.microphone" || activities == null || activities.Count == 0) { return "No microphone found in the system"; } m_microhoneChecked = true; return null; } public static string StartVoiceRecognition(string prompt = "") { string check = CheckMicrophone(); if (check != null) { return check; } m_speechRecognizer = SpeechRecognizer.CreateSpeechRecognizer(MainActivity.TheView); m_speechRecognizerIntent = InitSpeechIntent(Voice, prompt); string serviceComponent = Android.Provider.Settings.Secure.GetString( MainActivity.TheView.ContentResolver, "voice_recognition_service"); Console.WriteLine("--> serviceComponent: [{0}]", serviceComponent); //"com.google.android.googlequicksearchbox/com.google.android.voicesearch.serviceapi.GoogleRecognitionService"; //if (false && !string.IsNullOrWhiteSpace(serviceComponent)) { // m_speechRecognizer.StartListening(m_speechRecognizerIntent); //} MainActivity.TheView.StartActivityForResult(m_speechRecognizerIntent, STT_REQUEST); return null; } public static Action<string, string> VoiceRecognitionDone; public static void SpeechRecognitionCompleted(Result resultCode, Intent data) { Console.WriteLine("--> SpeechRecognitionCompleted {0}", resultCode); if (resultCode == Result.Ok && data != null) { var matches = data.GetStringArrayListExtra(RecognizerIntent.ExtraResults); if (matches.Count != 0) { string recognized = matches[0]; Console.WriteLine("--> Recognized: {0}", recognized); VoiceRecognitionDone?.Invoke("", recognized); return; } } VoiceRecognitionDone?.Invoke("No speech was recognized", ""); } } }
36.538462
117
0.704795
[ "MIT" ]
vassilych/mobile
Droid/STT.cs
4,277
C#
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Squidex.Domain.Apps.Entities.Apps; using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Log.Adapter; using Squidex.Infrastructure.Log.Store; using Squidex.Web.Pipeline; namespace Squidex.Config.Domain { public static class LoggingServices { public static void ConfigureForSquidex(this ILoggingBuilder builder, IConfiguration config) { builder.AddConfiguration(config.GetSection("logging")); builder.AddSemanticLog(); builder.AddFilters(); builder.Services.AddServices(config); } private static void AddServices(this IServiceCollection services, IConfiguration config) { services.Configure<RequestLogOptions>( config.GetSection("logging")); services.Configure<RequestLogStoreOptions>( config.GetSection("logging")); services.Configure<SemanticLogOptions>( config.GetSection("logging")); if (config.GetValue<bool>("logging:human")) { services.AddSingletonAs(_ => JsonLogWriterFactory.Readable()) .As<IObjectWriterFactory>(); } else { services.AddSingletonAs(_ => JsonLogWriterFactory.Default()) .As<IObjectWriterFactory>(); } var loggingFile = config.GetValue<string>("logging:file"); if (!string.IsNullOrWhiteSpace(loggingFile)) { services.AddSingletonAs(_ => new FileChannel(loggingFile)) .As<ILogChannel>(); } var useColors = config.GetValue<bool>("logging:colors"); services.AddSingletonAs(_ => new ConsoleLogChannel(useColors)) .As<ILogChannel>(); services.AddSingletonAs(_ => new ApplicationInfoLogAppender(typeof(LoggingServices).Assembly, Guid.NewGuid())) .As<ILogAppender>(); services.AddSingletonAs<ActionContextLogAppender>() .As<ILogAppender>(); services.AddSingletonAs<TimestampLogAppender>() .As<ILogAppender>(); services.AddSingletonAs<DebugLogChannel>() .As<ILogChannel>(); services.AddSingletonAs<SemanticLog>() .As<ISemanticLog>(); services.AddSingletonAs<DefaultAppLogStore>() .As<IAppLogStore>(); services.AddSingletonAs<BackgroundRequestLogStore>() .AsOptional<IRequestLogStore>(); } private static void AddFilters(this ILoggingBuilder builder) { builder.AddFilter((category, level) => { if (level < LogLevel.Information) { return false; } if (category.StartsWith("Orleans.Runtime.NoOpHostEnvironmentStatistics", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Error; } if (category.StartsWith("Orleans.Runtime.SafeTimer", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Error; } if (category.StartsWith("Orleans.Runtime.Scheduler", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Warning; } if (category.StartsWith("Orleans.", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Warning; } if (category.StartsWith("Runtime.", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Warning; } if (category.StartsWith("Microsoft.AspNetCore.", StringComparison.OrdinalIgnoreCase)) { return level >= LogLevel.Warning; } #if LOG_ALL_IDENTITY_SERVER if (category.StartsWith("IdentityServer4.", StringComparison.OrdinalIgnoreCase)) { return true; } #endif return true; }); } } }
34.681159
125
0.542206
[ "MIT" ]
oguzhankahyaoglu/squidex
backend/src/Squidex/Config/Domain/LoggingServices.cs
4,789
C#
using System.IO; using System.Linq; using System.Xml.Linq; using System.Xml.Serialization; namespace Symphonia.DLNA.SOAP.Synology.ContentDirectory.Browse { public static class SoapSerialization { public static DIDLLite Deserialize(string response) { var xdoc = XDocument.Parse(response); var result = xdoc.Descendants(XName.Get("Result")).First().Value; var xs = new XmlSerializer(typeof(DIDLLite)); using (var rdr = new StringReader(result)) { return (DIDLLite) xs.Deserialize(rdr); } } } }
28.090909
77
0.618123
[ "MIT" ]
nefarius/Symphonia
Symphonia/DLNA/SOAP/Synology/ContentDirectory/Browse/SoapSerialization.cs
620
C#
using System; using System.Collections.Generic; namespace LINQ_Demo { public static class MyExtensions { public static IEnumerable<T> MyFilter<T>(this IEnumerable<T> source, Func<T, bool> predicate) { foreach (var item in source) { if (predicate(item)) { // deferred execution with yield return yield return item; } } } } }
23.142857
101
0.502058
[ "MIT" ]
LarsBergqvist/csharp-demos
LINQ_Demo/MyExtensions.cs
488
C#
using System; using System.Collections.Generic; using Newtonsoft.Json; using Kanyon.Kubernetes; namespace Kanyon.Kubernetes.Core.V1 { public partial class TopologySpreadConstraint { /** <summary>A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.</summary> */ public Core.V1.LabelSelector labelSelector { get; set; } /** <summary>MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.</summary> */ public int maxSkew { get; set; } /** <summary>TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each <key, value> as a "bucket", and try to put balanced number of pods into each bucket. It's a required field.</summary> */ public string topologyKey { get; set; } /** <summary>WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assignment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it &#42;more&#42; imbalanced. It's a required field.</summary> */ public string whenUnsatisfiable { get; set; } } }
126
844
0.74026
[ "MIT" ]
ermontgo/kapitan
src/Kanyon.Kubernetes/Core/V1/TopologySpreadConstraint.generated.cs
2,772
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the importexport-2010-06-01.normal.json service model. */ using System; using System.Net; using Amazon.Runtime; namespace Amazon.ImportExport.Model { ///<summary> /// ImportExport exception /// </summary> #if !PCL && !CORECLR [Serializable] #endif public class ExpiredJobIdException : AmazonImportExportException { /// <summary> /// Constructs a new ExpiredJobIdException with the specified error /// message. /// </summary> /// <param name="message"> /// Describes the error encountered. /// </param> public ExpiredJobIdException(string message) : base(message) {} /// <summary> /// Construct instance of ExpiredJobIdException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> public ExpiredJobIdException(string message, Exception innerException) : base(message, innerException) {} /// <summary> /// Construct instance of ExpiredJobIdException /// </summary> /// <param name="innerException"></param> public ExpiredJobIdException(Exception innerException) : base(innerException) {} /// <summary> /// Construct instance of ExpiredJobIdException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public ExpiredJobIdException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, innerException, errorType, errorCode, requestId, statusCode) {} /// <summary> /// Construct instance of ExpiredJobIdException /// </summary> /// <param name="message"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public ExpiredJobIdException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, errorType, errorCode, requestId, statusCode) {} #if !PCL && !CORECLR /// <summary> /// Constructs a new instance of the ExpiredJobIdException class with serialized data. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception> /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception> protected ExpiredJobIdException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } #endif } }
42.659794
178
0.646206
[ "Apache-2.0" ]
Bio2hazard/aws-sdk-net
sdk/src/Services/ImportExport/Generated/Model/ExpiredJobIdException.cs
4,138
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace Camera.UWP { public sealed partial class MainPage { public MainPage() { InitializeComponent(); LoadApplication(new App()); } } }
24.36
52
0.738916
[ "MIT" ]
hoppfull/Learning-Xamarin
ex - Camera/Camera/Camera.UWP/MainPage.xaml.cs
611
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="OpenWeatherMapException.cs" company="Joan Caron"> // Copyright (c) 2014 All Rights Reserved // </copyright> // <author>Joan Caron</author> // <summary>Implements the open weather map exception class</summary> // -------------------------------------------------------------------------------------------------------------------- namespace OpenWeatherMap { using System; using System.Net; using System.Net.Http; /// <summary> /// Class OpenWeatherMapException. /// </summary> /// <seealso cref="T:System.Exception"/> public sealed class OpenWeatherMapException : Exception { /// <summary> /// Initializes a new instance of the <see cref="OpenWeatherMapException"/> class. /// </summary> /// <param name="status">The status.</param> internal OpenWeatherMapException(HttpStatusCode status) { this.StatusCode = status; } /// <summary> /// Initializes a new instance of the <see cref="OpenWeatherMapException"/> class. /// </summary> /// <param name="response">The response.</param> internal OpenWeatherMapException(HttpResponseMessage response) : this(response.StatusCode) { this.Response = response; } /// <summary> /// Initializes a new instance of the <see cref="OpenWeatherMapException"/> class. /// </summary> /// <param name="ex">The ex.</param> internal OpenWeatherMapException(Exception ex) : base("OpenWeatherMap : an error occurred", ex) { } /// <summary> /// Gets the response message. /// </summary> /// <value> /// The response. /// </value> public HttpResponseMessage Response { get; private set; } /// <summary> /// Gets the status code. /// </summary> /// <value> /// The status code. /// </value> public HttpStatusCode StatusCode { get; private set; } } }
33.575758
120
0.50361
[ "MIT" ]
SeppPenner/OpenWeatherMap-Api-Net
src/OpenWeatherMap/Exceptions/OpenWeatherMapException.cs
2,218
C#
using System.Reflection; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Godot- Tools")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
36
81
0.737179
[ "MIT" ]
CptnRoughnight/Godot-tools
Properties/AssemblyInfo.cs
936
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.UnitTests; using Xunit; namespace Microsoft.ApiDesignGuidelines.Analyzers.UnitTests { public class DoNotDeclareVisibleInstanceFieldsFixerTests : CodeFixTestBase { protected override DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() { return new BasicDoNotDeclareVisibleInstanceFieldsAnalyzer(); } protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() { return new CSharpDoNotDeclareVisibleInstanceFieldsAnalyzer(); } protected override CodeFixProvider GetBasicCodeFixProvider() { return new BasicDoNotDeclareVisibleInstanceFieldsFixer(); } protected override CodeFixProvider GetCSharpCodeFixProvider() { return new CSharpDoNotDeclareVisibleInstanceFieldsFixer(); } } }
35.090909
160
0.737478
[ "Apache-2.0" ]
amcasey/roslyn-analyzers
src/Microsoft.ApiDesignGuidelines.Analyzers/UnitTests/DoNotDeclareVisibleInstanceFieldsTests.Fixer.cs
1,158
C#
using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using MiniSqlParser; namespace MiniSqlParser { /// <summary> /// IF文の条件式とSQL文を取得する /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] public class GetIfConditionsVisitor: Visitor { private readonly List<Predicate> _conditions; private readonly List<Stmts> _stmtsList; private IfStmt _topIfStmt; private readonly Stack<Predicate> _conditionStack; public GetIfConditionsVisitor() { _conditions = new List<Predicate>(); _stmtsList = new List<Stmts>(); _conditionStack = new Stack<Predicate>(); } public ReadOnlyCollection<Predicate> Conditions { get { return _conditions.AsReadOnly(); } } public ReadOnlyCollection<Stmts> StmtsList { get { return _stmtsList.AsReadOnly(); } } public int Count { get { return _conditions.Count; } } public override void VisitBefore(IfStmt ifStmt) { // 最上位階層のIF文のみを解析対象にする if(_topIfStmt == null) { _topIfStmt = ifStmt; } else if(_topIfStmt != ifStmt) { return; } _conditionStack.Push(ifStmt.Conditions[0]); } public override void VisitOnElsIf(IfStmt ifStmt, int ifThenIndex, int offset) { if(_topIfStmt != ifStmt) { return; } // ELSE(ELSIF)において、スタックの1番上の式を否定し、これをスタックに戻す var lastCondition = _conditionStack.Pop(); var lastNotCondition = new NotPredicate(this.EncloseIfNecessary(lastCondition)); _conditionStack.Push(lastNotCondition); // IFにおいて条件式をスタックにPUSHする _conditionStack.Push(this.EncloseIfNecessary(ifStmt.Conditions[ifThenIndex])); } public override void VisitOnThen(IfStmt ifStmt, int ifThenIndex, int offset) { if(_topIfStmt != ifStmt) { return; } // 条件式とSQL文をリストに格納する _conditions.Add(this.ConcatConditions(_conditionStack)); _stmtsList.Add(this.RemoveNullStmt(ifStmt.StatementsList[ifThenIndex])); } public override void VisitOnElse(IfStmt ifStmt, int offset) { if(_topIfStmt != ifStmt) { return; } // ELSE(ELSIF)において、スタックの1番上の式を否定し、これをスタックに戻す var lastCondition = _conditionStack.Pop(); var lastNotCondition = new NotPredicate(this.EncloseIfNecessary(lastCondition)); _conditionStack.Push(lastNotCondition); // 条件式とSQL文をリストに格納する _conditions.Add(this.ConcatConditions(_conditionStack)); _stmtsList.Add(this.RemoveNullStmt(ifStmt.ElseStatements)); } public override void VisitAfter(IfStmt ifStmt) { if(_topIfStmt != ifStmt) { return; } // IF部分の条件式をPOPする _conditionStack.Pop(); // ELSIF部分の条件式をPOPする for(int i = 0; i < ifStmt.CountElsIfStatements; ++i) { _conditionStack.Pop(); } } private Predicate EncloseIfNecessary(Predicate predicate) { if(predicate.GetType() == typeof(AndPredicate) || predicate.GetType() == typeof(OrPredicate) || predicate.GetType() == typeof(CollatePredicate)) { return new BracketedPredicate(predicate); } else { return predicate; } } // 空SQL文は構文木ではNullStmtオブジェクトが割り当てられるが、 // IF文の結果には含めないよう削除する private Stmts RemoveNullStmt(Stmts stmts) { for(int i = stmts.Count - 1; i >= 0; --i) { if(stmts[i].Type == StmtType.Null) { stmts.RemoveAt(i); } } return stmts; } private Predicate ConcatConditions(Stack<Predicate> conditionStack) { var e = conditionStack.GetEnumerator(); if(!e.MoveNext()) { return null; } Predicate ret = e.Current; while(e.MoveNext()) { ret = new AndPredicate(e.Current, ret); } return ret; } } }
28.970588
87
0.629442
[ "MIT" ]
hiro80/SqlAccessor
Src/SqlAccessor/SqlBuilder/Visitors/GetIfConditionsVisitor.cs
4,318
C#
using System; using System.Collections.Generic; using System.Reactive.Subjects; using log4net; using JetBlack.MessageBus.FeedBus.Messages; using JetBlack.MessageBus.FeedBus.Distributor.Config; namespace JetBlack.MessageBus.FeedBus.Distributor { internal class PublisherManager { private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private readonly PublisherRepository _repository = new PublisherRepository(); private readonly ISubject<SourceMessage<IEnumerable<FeedAndTopic>>> _stalePublishers = new Subject<SourceMessage<IEnumerable<FeedAndTopic>>>(); // TODO: This should just be by feed. public IObservable<SourceMessage<IEnumerable<FeedAndTopic>>> StalePublishers { get { return _stalePublishers; } } public void SendMulticastData(IInteractor publisher, MulticastData multicastData, IInteractor subscriber) { if (!publisher.HasRole(multicastData.Feed, ClientRole.Publish)) { Log.WarnFormat("Publish change request denied for client \"{0}\" on feed \"{1}\" with topic \"{2}\"", publisher, multicastData.Feed, multicastData.Topic); return; } _repository.AddPublisher(publisher, multicastData.Feed, multicastData.Topic); subscriber.SendMessage(multicastData); } public void SendUnicastData(IInteractor publisher, UnicastData unicastData, IInteractor subscriber) { if (!publisher.HasRole(unicastData.Feed, ClientRole.Publish)) { Log.WarnFormat("Publish change request denied for client \"{0}\" on feed \"{1}\" with topic \"{2}\"", publisher, unicastData.Feed, unicastData.Topic); return; } _repository.AddPublisher(publisher, unicastData.Feed, unicastData.Topic); subscriber.SendMessage(unicastData); } public void OnClosedInteractor(IInteractor interactor) { var feedsAndTopicsWithoutPublishers = _repository.RemovePublisher(interactor); if (feedsAndTopicsWithoutPublishers != null) _stalePublishers.OnNext(SourceMessage.Create(interactor, feedsAndTopicsWithoutPublishers)); } public void OnFaultedInteractor(IInteractor interactor, Exception error) { Log.Warn("Interactor faulted: " + interactor, error); OnClosedInteractor(interactor); } } }
41.754098
170
0.676875
[ "MIT" ]
rob-blackbourn/JetBlack.MessageBus
JetBlack.MessageBus.FeedBus.Distributor/PublisherManager.cs
2,549
C#
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace KeenSap.Portal.Data.Entities { [Table("roles")] public class Role : TrackableEntity { [Required] [StringLength(50, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 3)] [DataType(DataType.Text)] [Display(Name = "Role Name")] [Column("name", Order = 6)] public string Name { get; set; } } }
29.882353
125
0.641732
[ "Apache-2.0" ]
keensap/portal
Data/Entities/Role.cs
508
C#
/* * MindTouch Dream - a distributed REST framework * Copyright (C) 2006-2014 MindTouch, Inc. * www.mindtouch.com oss@mindtouch.com * * For community documentation and downloads visit mindtouch.com; * please review the licensing section. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections; using System.Collections.Generic; using MindTouch.Tasking; namespace MindTouch.Collections { /// <summary> /// Represents a set of values with an expiration time. /// </summary> /// <remarks> /// Values inserted into this this set will expire after some set time (which may be updated and reset), automatically removing the value /// from the set and firing a notification event <see cref="EntryExpired"/>. The set may optionally be configured to extend a value's /// expiration on access, including accessing the entry via the instances iterator. /// </remarks> /// <typeparam name="T">The type of elements in the list.</typeparam> public class ExpiringHashSet<T> : IEnumerable<ExpiringHashSet<T>.Entry>, IDisposable { //--- Types --- /// <summary> /// A wrapper class containing meta data about values stored in the <see cref="ExpiringHashSet{T}"/>. /// </summary> /// <remarks> /// The meta-data is created on demand, i.e. it will not reflect changes in <see cref="When"/> or <see cref="TTL"/> that happen /// after it is retrieved from the set. /// </remarks> public class Entry { //--- Class Methods --- internal static Entry FromExpiringSetEntry(ExpiringSet<T,T>.Entry entry) { return new Entry(entry.Value, entry.When, entry.TTL); } //--- Fields --- /// <summary> /// The absolute time at which the entry will expire /// </summary> public readonly DateTime When; /// <summary> /// The time-to-live of the entry at insertion time /// </summary> public readonly TimeSpan TTL; /// <summary> /// The value stored in the set /// </summary> public readonly T Value; //--- Constructors --- private Entry(T value, DateTime when, TimeSpan ttl) { Value = value; When = when; TTL = ttl; } } //--- Events --- /// <summary> /// Fired for every entry that expires. /// </summary> public event EventHandler<ExpirationEventArgs<T>> EntryExpired; /// <summary> /// Fired any time a value is added, removed or experiation is changed. /// </summary> public event EventHandler CollectionChanged; //--- Fields --- private readonly ExpiringSet<T,T> _set; //--- Constructors --- /// <summary> /// Create a new hashset /// </summary> /// <param name="taskTimerFactory">The timer factory to create the set's timer from</param> public ExpiringHashSet(TaskTimerFactory taskTimerFactory) : this(taskTimerFactory,false) { } /// <summary> /// Create a new hashset /// </summary> /// <param name="taskTimerFactory">The timer factory to create the set's timer from</param> /// <param name="autoRefresh"><see langword="True"/> if accessing an entry should extend the expiration time by the time-to-live</param> public ExpiringHashSet(TaskTimerFactory taskTimerFactory, bool autoRefresh) { _set = new ExpiringSet<T, T>(taskTimerFactory, autoRefresh); _set.CollectionChanged += OnCollectionChanged; _set.EntriesExpired += OnEntriesExpired; } //--- Properties --- /// <summary> /// Get the <see cref="Entry"/> meta-data container for the given value. /// </summary> /// <remarks> /// This access will refresh the entry's expiration, if the set was created with the 'autoRefresh' flag. /// </remarks> /// <param name="value">Set value.</param> /// <returns>Meta-data for specified value. Returns <see langword="null"/> if the value is not stored in the set.</returns> public Entry this[T value] { get { var entry = _set[value]; return entry == null ? null : Entry.FromExpiringSetEntry(entry); } } //--- Methods --- /// <summary> /// Add or update the expiration for an item /// </summary> /// <param name="value">The value in the set</param> /// <param name="ttl">The time-to-live from right now</param> public bool SetOrUpdate(T value, TimeSpan ttl) { var when = GlobalClock.UtcNow + ttl; return _set.SetExpiration(value, value, when, ttl, true); } /// <summary> /// Add or update the expiration for an item /// </summary> /// <param name="value">The value in the set</param> /// <param name="when">The absolute expiration time of the item</param> public bool SetOrUpdate(T value, DateTime when) { var ttl = when - GlobalClock.UtcNow; return _set.SetExpiration(value, value, when, ttl, true); } /// <summary> /// Add or update the expiration for an item /// </summary> /// <remarks> /// Thie overload takes both the when and ttl. The <paramref name="when"/> is authoritative for expiration, /// but <paramref name="ttl"/> is used for <see cref="RefreshExpiration"/> /// </remarks> /// <param name="value"></param> /// <param name="when"></param> /// <param name="ttl"></param> public bool SetOrUpdate(T value, DateTime when, TimeSpan ttl) { return _set.SetExpiration(value, value, when, ttl, true); } /// <summary> /// Remove a value from the set. /// </summary> /// <param name="value">Value to remove</param> /// <returns><see langword="True"/> if an entry existed for the given key.</returns> public bool Delete(T value) { T oldValue; return _set.TryDelete(value, out oldValue); } /// <summary> /// Extend an entry's expiration by its time-to-live. /// </summary> /// <param name="value">The value in the set</param> public void RefreshExpiration(T value) { _set.RefreshExpiration(value); } /// <summary> /// Clear the entire set immediately /// </summary> public void Clear() { _set.Clear(); } /// <summary> /// Dispose the set, releasing all entries. /// </summary> public void Dispose() { _set.CollectionChanged -= OnCollectionChanged; _set.Dispose(); _set.EntriesExpired -= OnEntriesExpired; } private void OnEntriesExpired(object sender, ExpiringSet<T, T>.ExpiredArgs e) { if(EntryExpired == null) { return; } foreach(var entry in e.Entries) { EntryExpired(this, new ExpirationEventArgs<T>(Entry.FromExpiringSetEntry(entry))); } } private void OnCollectionChanged(object sender, EventArgs e) { if(CollectionChanged != null) { CollectionChanged(this, EventArgs.Empty); } } //--- IEnumerable Members --- IEnumerator<Entry> IEnumerable<Entry>.GetEnumerator() { foreach(var entry in _set.GetEntries()) { yield return Entry.FromExpiringSetEntry(entry); } } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<Entry>)this).GetEnumerator(); } } /// <summary> /// Event argument for <see cref="ExpiringHashSet{T}.EntryExpired"/> event. /// </summary> /// <typeparam name="T">Type of the value stored in the <see cref="ExpiringHashSet{T}"/> that fired the event.</typeparam> public class ExpirationEventArgs<T> : EventArgs { //--- Fields --- /// <summary> /// Entry that expired. /// </summary> public readonly ExpiringHashSet<T>.Entry Entry; //--- Constructors ---- internal ExpirationEventArgs(ExpiringHashSet<T>.Entry entry) { Entry = entry; } } }
37.243028
145
0.563436
[ "Apache-2.0" ]
MindTouch/DReAM
src/mindtouch.dream/Collections/ExpiringHashSet.cs
9,350
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/xapobase.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. namespace TerraFX.Interop { public static partial class Windows { [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT")] public const int XAPOBASE_DEFAULT_FORMAT_TAG = 0x0003; [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS")] public const int XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS = 1; [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS")] public const int XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS = 64; [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE")] public const int XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE = 1000; [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE")] public const int XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE = 200000; [NativeTypeName("#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32")] public const int XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE = 32; [NativeTypeName("#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED)")] public const int XAPOBASE_DEFAULT_FLAG = (0x00000001 | 0x00000002 | 0x00000004 | 0x00000008 | 0x00000010); [NativeTypeName("#define XAPOBASE_DEFAULT_BUFFER_COUNT 1")] public const int XAPOBASE_DEFAULT_BUFFER_COUNT = 1; } }
51.057143
224
0.775602
[ "MIT" ]
DaZombieKiller/terrafx.interop.windows
sources/Interop/Windows/um/xapobase/Windows.cs
1,789
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Kata.CustomTypes.Kata.Recipe.Part15 { public class DishBase { protected List<Stage> Stages { get; } public string DishName { get; } public DishBase(string dishName) { DishName = dishName; } public override string ToString() { return DishName; // return $"DishBase({this.GetType().Name}): {DishName} \n " + string.Join("\n ", Ingreds.Select(ing => ing.Name)); } } }
24.416667
137
0.575085
[ "MIT" ]
contino/dotnet-training-course
Kata/CustomTypes/InProgress/Recipe/Part15/DishBase.cs
588
C#
namespace Square.Models { using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Square; using Square.Http.Client; using Square.Utilities; /// <summary> /// BatchUpsertCatalogObjectsResponse. /// </summary> public class BatchUpsertCatalogObjectsResponse { /// <summary> /// Initializes a new instance of the <see cref="BatchUpsertCatalogObjectsResponse"/> class. /// </summary> /// <param name="errors">errors.</param> /// <param name="objects">objects.</param> /// <param name="updatedAt">updated_at.</param> /// <param name="idMappings">id_mappings.</param> public BatchUpsertCatalogObjectsResponse( IList<Models.Error> errors = null, IList<Models.CatalogObject> objects = null, string updatedAt = null, IList<Models.CatalogIdMapping> idMappings = null) { this.Errors = errors; this.Objects = objects; this.UpdatedAt = updatedAt; this.IdMappings = idMappings; } /// <summary> /// Gets http context. /// </summary> [JsonIgnore] public HttpContext Context { get; internal set; } /// <summary> /// Any errors that occurred during the request. /// </summary> [JsonProperty("errors", NullValueHandling = NullValueHandling.Ignore)] public IList<Models.Error> Errors { get; } /// <summary> /// The created successfully created CatalogObjects. /// </summary> [JsonProperty("objects", NullValueHandling = NullValueHandling.Ignore)] public IList<Models.CatalogObject> Objects { get; } /// <summary> /// The database [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". /// </summary> [JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] public string UpdatedAt { get; } /// <summary> /// The mapping between client and server IDs for this upsert. /// </summary> [JsonProperty("id_mappings", NullValueHandling = NullValueHandling.Ignore)] public IList<Models.CatalogIdMapping> IdMappings { get; } /// <inheritdoc/> public override string ToString() { var toStringOutput = new List<string>(); this.ToString(toStringOutput); return $"BatchUpsertCatalogObjectsResponse : ({string.Join(", ", toStringOutput)})"; } /// <inheritdoc/> public override bool Equals(object obj) { if (obj == null) { return false; } if (obj == this) { return true; } return obj is BatchUpsertCatalogObjectsResponse other && ((this.Context == null && other.Context == null) || (this.Context?.Equals(other.Context) == true)) && ((this.Errors == null && other.Errors == null) || (this.Errors?.Equals(other.Errors) == true)) && ((this.Objects == null && other.Objects == null) || (this.Objects?.Equals(other.Objects) == true)) && ((this.UpdatedAt == null && other.UpdatedAt == null) || (this.UpdatedAt?.Equals(other.UpdatedAt) == true)) && ((this.IdMappings == null && other.IdMappings == null) || (this.IdMappings?.Equals(other.IdMappings) == true)); } /// <inheritdoc/> public override int GetHashCode() { int hashCode = -2062011310; if (this.Context != null) { hashCode += this.Context.GetHashCode(); } if (this.Errors != null) { hashCode += this.Errors.GetHashCode(); } if (this.Objects != null) { hashCode += this.Objects.GetHashCode(); } if (this.UpdatedAt != null) { hashCode += this.UpdatedAt.GetHashCode(); } if (this.IdMappings != null) { hashCode += this.IdMappings.GetHashCode(); } return hashCode; } /// <summary> /// ToString overload. /// </summary> /// <param name="toStringOutput">List of strings.</param> protected void ToString(List<string> toStringOutput) { toStringOutput.Add($"this.Errors = {(this.Errors == null ? "null" : $"[{string.Join(", ", this.Errors)} ]")}"); toStringOutput.Add($"this.Objects = {(this.Objects == null ? "null" : $"[{string.Join(", ", this.Objects)} ]")}"); toStringOutput.Add($"this.UpdatedAt = {(this.UpdatedAt == null ? "null" : this.UpdatedAt == string.Empty ? "" : this.UpdatedAt)}"); toStringOutput.Add($"this.IdMappings = {(this.IdMappings == null ? "null" : $"[{string.Join(", ", this.IdMappings)} ]")}"); } /// <summary> /// Converts to builder object. /// </summary> /// <returns> Builder. </returns> public Builder ToBuilder() { var builder = new Builder() .Errors(this.Errors) .Objects(this.Objects) .UpdatedAt(this.UpdatedAt) .IdMappings(this.IdMappings); return builder; } /// <summary> /// Builder class. /// </summary> public class Builder { private IList<Models.Error> errors; private IList<Models.CatalogObject> objects; private string updatedAt; private IList<Models.CatalogIdMapping> idMappings; /// <summary> /// Errors. /// </summary> /// <param name="errors"> errors. </param> /// <returns> Builder. </returns> public Builder Errors(IList<Models.Error> errors) { this.errors = errors; return this; } /// <summary> /// Objects. /// </summary> /// <param name="objects"> objects. </param> /// <returns> Builder. </returns> public Builder Objects(IList<Models.CatalogObject> objects) { this.objects = objects; return this; } /// <summary> /// UpdatedAt. /// </summary> /// <param name="updatedAt"> updatedAt. </param> /// <returns> Builder. </returns> public Builder UpdatedAt(string updatedAt) { this.updatedAt = updatedAt; return this; } /// <summary> /// IdMappings. /// </summary> /// <param name="idMappings"> idMappings. </param> /// <returns> Builder. </returns> public Builder IdMappings(IList<Models.CatalogIdMapping> idMappings) { this.idMappings = idMappings; return this; } /// <summary> /// Builds class object. /// </summary> /// <returns> BatchUpsertCatalogObjectsResponse. </returns> public BatchUpsertCatalogObjectsResponse Build() { return new BatchUpsertCatalogObjectsResponse( this.errors, this.objects, this.updatedAt, this.idMappings); } } } }
35.72807
175
0.503192
[ "Apache-2.0" ]
AdrianaMusic/square-dotnet-sdk
Square/Models/BatchUpsertCatalogObjectsResponse.cs
8,146
C#
// <auto-generated> // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/datacatalog/v1/datacatalog.proto // </auto-generated> // Original file comments: // Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #pragma warning disable 0414, 1591 #region Designer generated code using grpc = global::Grpc.Core; namespace Google.Cloud.DataCatalog.V1 { /// <summary> /// Data Catalog API service allows clients to discover, understand, and manage /// their data. /// </summary> public static partial class DataCatalog { static readonly string __ServiceName = "google.cloud.datacatalog.v1.DataCatalog"; static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest> __Marshaller_google_cloud_datacatalog_v1_SearchCatalogRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse> __Marshaller_google_cloud_datacatalog_v1_SearchCatalogResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest> __Marshaller_google_cloud_datacatalog_v1_CreateEntryGroupRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.EntryGroup> __Marshaller_google_cloud_datacatalog_v1_EntryGroup = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.EntryGroup.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest> __Marshaller_google_cloud_datacatalog_v1_GetEntryGroupRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest> __Marshaller_google_cloud_datacatalog_v1_UpdateEntryGroupRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest> __Marshaller_google_cloud_datacatalog_v1_DeleteEntryGroupRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest> __Marshaller_google_cloud_datacatalog_v1_ListEntryGroupsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse> __Marshaller_google_cloud_datacatalog_v1_ListEntryGroupsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.CreateEntryRequest> __Marshaller_google_cloud_datacatalog_v1_CreateEntryRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.CreateEntryRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.Entry> __Marshaller_google_cloud_datacatalog_v1_Entry = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.Entry.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest> __Marshaller_google_cloud_datacatalog_v1_UpdateEntryRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest> __Marshaller_google_cloud_datacatalog_v1_DeleteEntryRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.GetEntryRequest> __Marshaller_google_cloud_datacatalog_v1_GetEntryRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.GetEntryRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.LookupEntryRequest> __Marshaller_google_cloud_datacatalog_v1_LookupEntryRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.LookupEntryRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListEntriesRequest> __Marshaller_google_cloud_datacatalog_v1_ListEntriesRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListEntriesRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListEntriesResponse> __Marshaller_google_cloud_datacatalog_v1_ListEntriesResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListEntriesResponse.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest> __Marshaller_google_cloud_datacatalog_v1_CreateTagTemplateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.TagTemplate> __Marshaller_google_cloud_datacatalog_v1_TagTemplate = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.TagTemplate.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest> __Marshaller_google_cloud_datacatalog_v1_GetTagTemplateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest> __Marshaller_google_cloud_datacatalog_v1_UpdateTagTemplateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest> __Marshaller_google_cloud_datacatalog_v1_DeleteTagTemplateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest> __Marshaller_google_cloud_datacatalog_v1_CreateTagTemplateFieldRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.TagTemplateField> __Marshaller_google_cloud_datacatalog_v1_TagTemplateField = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.TagTemplateField.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest> __Marshaller_google_cloud_datacatalog_v1_UpdateTagTemplateFieldRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest> __Marshaller_google_cloud_datacatalog_v1_RenameTagTemplateFieldRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest> __Marshaller_google_cloud_datacatalog_v1_RenameTagTemplateFieldEnumValueRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest> __Marshaller_google_cloud_datacatalog_v1_DeleteTagTemplateFieldRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.CreateTagRequest> __Marshaller_google_cloud_datacatalog_v1_CreateTagRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.CreateTagRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.Tag> __Marshaller_google_cloud_datacatalog_v1_Tag = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.Tag.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.UpdateTagRequest> __Marshaller_google_cloud_datacatalog_v1_UpdateTagRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.UpdateTagRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.DeleteTagRequest> __Marshaller_google_cloud_datacatalog_v1_DeleteTagRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.DeleteTagRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListTagsRequest> __Marshaller_google_cloud_datacatalog_v1_ListTagsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListTagsRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.DataCatalog.V1.ListTagsResponse> __Marshaller_google_cloud_datacatalog_v1_ListTagsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.DataCatalog.V1.ListTagsResponse.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.Iam.V1.SetIamPolicyRequest> __Marshaller_google_iam_v1_SetIamPolicyRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.Iam.V1.SetIamPolicyRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.Iam.V1.Policy> __Marshaller_google_iam_v1_Policy = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.Iam.V1.Policy.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.Iam.V1.GetIamPolicyRequest> __Marshaller_google_iam_v1_GetIamPolicyRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.Iam.V1.GetIamPolicyRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.Iam.V1.TestIamPermissionsRequest> __Marshaller_google_iam_v1_TestIamPermissionsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.Iam.V1.TestIamPermissionsRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Google.Cloud.Iam.V1.TestIamPermissionsResponse> __Marshaller_google_iam_v1_TestIamPermissionsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Cloud.Iam.V1.TestIamPermissionsResponse.Parser.ParseFrom); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest, global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse> __Method_SearchCatalog = new grpc::Method<global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest, global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse>( grpc::MethodType.Unary, __ServiceName, "SearchCatalog", __Marshaller_google_cloud_datacatalog_v1_SearchCatalogRequest, __Marshaller_google_cloud_datacatalog_v1_SearchCatalogResponse); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup> __Method_CreateEntryGroup = new grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>( grpc::MethodType.Unary, __ServiceName, "CreateEntryGroup", __Marshaller_google_cloud_datacatalog_v1_CreateEntryGroupRequest, __Marshaller_google_cloud_datacatalog_v1_EntryGroup); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup> __Method_GetEntryGroup = new grpc::Method<global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>( grpc::MethodType.Unary, __ServiceName, "GetEntryGroup", __Marshaller_google_cloud_datacatalog_v1_GetEntryGroupRequest, __Marshaller_google_cloud_datacatalog_v1_EntryGroup); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup> __Method_UpdateEntryGroup = new grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>( grpc::MethodType.Unary, __ServiceName, "UpdateEntryGroup", __Marshaller_google_cloud_datacatalog_v1_UpdateEntryGroupRequest, __Marshaller_google_cloud_datacatalog_v1_EntryGroup); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteEntryGroup = new grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest, global::Google.Protobuf.WellKnownTypes.Empty>( grpc::MethodType.Unary, __ServiceName, "DeleteEntryGroup", __Marshaller_google_cloud_datacatalog_v1_DeleteEntryGroupRequest, __Marshaller_google_protobuf_Empty); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest, global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse> __Method_ListEntryGroups = new grpc::Method<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest, global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse>( grpc::MethodType.Unary, __ServiceName, "ListEntryGroups", __Marshaller_google_cloud_datacatalog_v1_ListEntryGroupsRequest, __Marshaller_google_cloud_datacatalog_v1_ListEntryGroupsResponse); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry> __Method_CreateEntry = new grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>( grpc::MethodType.Unary, __ServiceName, "CreateEntry", __Marshaller_google_cloud_datacatalog_v1_CreateEntryRequest, __Marshaller_google_cloud_datacatalog_v1_Entry); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry> __Method_UpdateEntry = new grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>( grpc::MethodType.Unary, __ServiceName, "UpdateEntry", __Marshaller_google_cloud_datacatalog_v1_UpdateEntryRequest, __Marshaller_google_cloud_datacatalog_v1_Entry); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteEntry = new grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest, global::Google.Protobuf.WellKnownTypes.Empty>( grpc::MethodType.Unary, __ServiceName, "DeleteEntry", __Marshaller_google_cloud_datacatalog_v1_DeleteEntryRequest, __Marshaller_google_protobuf_Empty); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.GetEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry> __Method_GetEntry = new grpc::Method<global::Google.Cloud.DataCatalog.V1.GetEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>( grpc::MethodType.Unary, __ServiceName, "GetEntry", __Marshaller_google_cloud_datacatalog_v1_GetEntryRequest, __Marshaller_google_cloud_datacatalog_v1_Entry); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.LookupEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry> __Method_LookupEntry = new grpc::Method<global::Google.Cloud.DataCatalog.V1.LookupEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>( grpc::MethodType.Unary, __ServiceName, "LookupEntry", __Marshaller_google_cloud_datacatalog_v1_LookupEntryRequest, __Marshaller_google_cloud_datacatalog_v1_Entry); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.ListEntriesRequest, global::Google.Cloud.DataCatalog.V1.ListEntriesResponse> __Method_ListEntries = new grpc::Method<global::Google.Cloud.DataCatalog.V1.ListEntriesRequest, global::Google.Cloud.DataCatalog.V1.ListEntriesResponse>( grpc::MethodType.Unary, __ServiceName, "ListEntries", __Marshaller_google_cloud_datacatalog_v1_ListEntriesRequest, __Marshaller_google_cloud_datacatalog_v1_ListEntriesResponse); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate> __Method_CreateTagTemplate = new grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>( grpc::MethodType.Unary, __ServiceName, "CreateTagTemplate", __Marshaller_google_cloud_datacatalog_v1_CreateTagTemplateRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplate); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate> __Method_GetTagTemplate = new grpc::Method<global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>( grpc::MethodType.Unary, __ServiceName, "GetTagTemplate", __Marshaller_google_cloud_datacatalog_v1_GetTagTemplateRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplate); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate> __Method_UpdateTagTemplate = new grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>( grpc::MethodType.Unary, __ServiceName, "UpdateTagTemplate", __Marshaller_google_cloud_datacatalog_v1_UpdateTagTemplateRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplate); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteTagTemplate = new grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest, global::Google.Protobuf.WellKnownTypes.Empty>( grpc::MethodType.Unary, __ServiceName, "DeleteTagTemplate", __Marshaller_google_cloud_datacatalog_v1_DeleteTagTemplateRequest, __Marshaller_google_protobuf_Empty); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField> __Method_CreateTagTemplateField = new grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>( grpc::MethodType.Unary, __ServiceName, "CreateTagTemplateField", __Marshaller_google_cloud_datacatalog_v1_CreateTagTemplateFieldRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplateField); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField> __Method_UpdateTagTemplateField = new grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>( grpc::MethodType.Unary, __ServiceName, "UpdateTagTemplateField", __Marshaller_google_cloud_datacatalog_v1_UpdateTagTemplateFieldRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplateField); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField> __Method_RenameTagTemplateField = new grpc::Method<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>( grpc::MethodType.Unary, __ServiceName, "RenameTagTemplateField", __Marshaller_google_cloud_datacatalog_v1_RenameTagTemplateFieldRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplateField); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField> __Method_RenameTagTemplateFieldEnumValue = new grpc::Method<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>( grpc::MethodType.Unary, __ServiceName, "RenameTagTemplateFieldEnumValue", __Marshaller_google_cloud_datacatalog_v1_RenameTagTemplateFieldEnumValueRequest, __Marshaller_google_cloud_datacatalog_v1_TagTemplateField); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteTagTemplateField = new grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest, global::Google.Protobuf.WellKnownTypes.Empty>( grpc::MethodType.Unary, __ServiceName, "DeleteTagTemplateField", __Marshaller_google_cloud_datacatalog_v1_DeleteTagTemplateFieldRequest, __Marshaller_google_protobuf_Empty); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag> __Method_CreateTag = new grpc::Method<global::Google.Cloud.DataCatalog.V1.CreateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag>( grpc::MethodType.Unary, __ServiceName, "CreateTag", __Marshaller_google_cloud_datacatalog_v1_CreateTagRequest, __Marshaller_google_cloud_datacatalog_v1_Tag); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag> __Method_UpdateTag = new grpc::Method<global::Google.Cloud.DataCatalog.V1.UpdateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag>( grpc::MethodType.Unary, __ServiceName, "UpdateTag", __Marshaller_google_cloud_datacatalog_v1_UpdateTagRequest, __Marshaller_google_cloud_datacatalog_v1_Tag); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteTag = new grpc::Method<global::Google.Cloud.DataCatalog.V1.DeleteTagRequest, global::Google.Protobuf.WellKnownTypes.Empty>( grpc::MethodType.Unary, __ServiceName, "DeleteTag", __Marshaller_google_cloud_datacatalog_v1_DeleteTagRequest, __Marshaller_google_protobuf_Empty); static readonly grpc::Method<global::Google.Cloud.DataCatalog.V1.ListTagsRequest, global::Google.Cloud.DataCatalog.V1.ListTagsResponse> __Method_ListTags = new grpc::Method<global::Google.Cloud.DataCatalog.V1.ListTagsRequest, global::Google.Cloud.DataCatalog.V1.ListTagsResponse>( grpc::MethodType.Unary, __ServiceName, "ListTags", __Marshaller_google_cloud_datacatalog_v1_ListTagsRequest, __Marshaller_google_cloud_datacatalog_v1_ListTagsResponse); static readonly grpc::Method<global::Google.Cloud.Iam.V1.SetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy> __Method_SetIamPolicy = new grpc::Method<global::Google.Cloud.Iam.V1.SetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy>( grpc::MethodType.Unary, __ServiceName, "SetIamPolicy", __Marshaller_google_iam_v1_SetIamPolicyRequest, __Marshaller_google_iam_v1_Policy); static readonly grpc::Method<global::Google.Cloud.Iam.V1.GetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy> __Method_GetIamPolicy = new grpc::Method<global::Google.Cloud.Iam.V1.GetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy>( grpc::MethodType.Unary, __ServiceName, "GetIamPolicy", __Marshaller_google_iam_v1_GetIamPolicyRequest, __Marshaller_google_iam_v1_Policy); static readonly grpc::Method<global::Google.Cloud.Iam.V1.TestIamPermissionsRequest, global::Google.Cloud.Iam.V1.TestIamPermissionsResponse> __Method_TestIamPermissions = new grpc::Method<global::Google.Cloud.Iam.V1.TestIamPermissionsRequest, global::Google.Cloud.Iam.V1.TestIamPermissionsResponse>( grpc::MethodType.Unary, __ServiceName, "TestIamPermissions", __Marshaller_google_iam_v1_TestIamPermissionsRequest, __Marshaller_google_iam_v1_TestIamPermissionsResponse); /// <summary>Service descriptor</summary> public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { get { return global::Google.Cloud.DataCatalog.V1.DatacatalogReflection.Descriptor.Services[0]; } } /// <summary>Base class for server-side implementations of DataCatalog</summary> [grpc::BindServiceMethod(typeof(DataCatalog), "BindService")] public abstract partial class DataCatalogBase { /// <summary> /// Searches Data Catalog for multiple resources like entries, tags that /// match a query. /// /// This is a custom method /// (https://cloud.google.com/apis/design/custom_methods) and does not return /// the complete resource, only the resource identifier and high level /// fields. Clients can subsequently call `Get` methods. /// /// Note that Data Catalog search queries do not guarantee full recall. Query /// results that match your query may not be returned, even in subsequent /// result pages. Also note that results returned (and not returned) can vary /// across repeated search queries. /// /// See [Data Catalog Search /// Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) /// for more information. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse> SearchCatalog(global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Creates an EntryGroup. /// /// An entry group contains logically related entries together with Cloud /// Identity and Access Management policies that specify the users who can /// create, edit, and view entries within the entry group. /// /// Data Catalog automatically creates an entry group for BigQuery entries /// ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry /// group to contain Cloud Storage fileset entries or custom type entries, /// and the IAM policies associated with those entries. Entry groups, like /// entries, can be searched. /// /// A maximum of 10,000 entry groups may be created per organization across all /// locations. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.EntryGroup> CreateEntryGroup(global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Gets an EntryGroup. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.EntryGroup> GetEntryGroup(global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Updates an EntryGroup. The user should enable the Data Catalog API in the /// project identified by the `entry_group.name` parameter (see [Data Catalog /// Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.EntryGroup> UpdateEntryGroup(global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Deletes an EntryGroup. Only entry groups that do not contain entries can be /// deleted. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntryGroup(global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Lists entry groups. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse> ListEntryGroups(global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' /// or with a user-specified type can be created. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// /// A maximum of 100,000 entries may be created per entry group. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Entry> CreateEntry(global::Google.Cloud.DataCatalog.V1.CreateEntryRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Updates an existing entry. /// Users should enable the Data Catalog API in the project identified by /// the `entry.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Entry> UpdateEntry(global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Deletes an existing entry. Only entries created through /// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] /// method can be deleted. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntry(global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Gets an entry. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Entry> GetEntry(global::Google.Cloud.DataCatalog.V1.GetEntryRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Get an entry by target resource name. This method allows clients to use /// the resource name from the source Google Cloud Platform service to get the /// Data Catalog Entry. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Entry> LookupEntry(global::Google.Cloud.DataCatalog.V1.LookupEntryRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Lists entries. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.ListEntriesResponse> ListEntries(global::Google.Cloud.DataCatalog.V1.ListEntriesRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Creates a tag template. The user should enable the Data Catalog API in /// the project identified by the `parent` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplate> CreateTagTemplate(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Gets a tag template. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplate> GetTagTemplate(global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Updates a tag template. This method cannot be used to update the fields of /// a template. The tag template fields are represented as separate resources /// and should be updated using their own create/update/delete methods. /// Users should enable the Data Catalog API in the project identified by /// the `tag_template.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplate> UpdateTagTemplate(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Deletes a tag template and all tags using the template. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplate(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Creates a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `parent` parameter (see /// [Data Catalog Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplateField> CreateTagTemplateField(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Updates a field in a tag template. This method cannot be used to update the /// field type. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplateField> UpdateTagTemplateField(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Renames a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `name` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateField(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Renames an enum value in a tag template. The enum values have to be unique /// within one enum field. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateFieldEnumValue(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Deletes a field in a tag template and all uses of that field. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplateField(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Creates a tag on an [Entry][google.cloud.datacatalog.v1.Entry]. /// Note: The project identified by the `parent` parameter for the /// [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) /// and the /// [tag /// template](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) /// used to create the tag must be from the same organization. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Tag> CreateTag(global::Google.Cloud.DataCatalog.V1.CreateTagRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Updates an existing tag. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.Tag> UpdateTag(global::Google.Cloud.DataCatalog.V1.UpdateTagRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Deletes a tag. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTag(global::Google.Cloud.DataCatalog.V1.DeleteTagRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.DataCatalog.V1.ListTagsResponse> ListTags(global::Google.Cloud.DataCatalog.V1.ListTagsRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Sets the access control policy for a resource. Replaces any existing /// policy. /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag /// templates. /// - `datacatalog.entries.setIamPolicy` to set policies on entries. /// - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.Iam.V1.Policy> SetIamPolicy(global::Google.Cloud.Iam.V1.SetIamPolicyRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Gets the access control policy for a resource. A `NOT_FOUND` error /// is returned if the resource does not exist. An empty policy is returned /// if the resource exists but does not have a policy set on it. /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag /// templates. /// - `datacatalog.entries.getIamPolicy` to get policies on entries. /// - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.Iam.V1.Policy> GetIamPolicy(global::Google.Cloud.Iam.V1.GetIamPolicyRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } /// <summary> /// Returns the caller's permissions on a resource. /// If the resource does not exist, an empty set of permissions is returned /// (We don't return a `NOT_FOUND` error). /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// A caller is not required to have Google IAM permission to make this /// request. /// </summary> /// <param name="request">The request received from the client.</param> /// <param name="context">The context of the server-side call handler being invoked.</param> /// <returns>The response to send back to the client (wrapped by a task).</returns> public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.Iam.V1.TestIamPermissionsResponse> TestIamPermissions(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest request, grpc::ServerCallContext context) { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } } /// <summary>Client for DataCatalog</summary> public partial class DataCatalogClient : grpc::ClientBase<DataCatalogClient> { /// <summary>Creates a new client for DataCatalog</summary> /// <param name="channel">The channel to use to make remote calls.</param> public DataCatalogClient(grpc::ChannelBase channel) : base(channel) { } /// <summary>Creates a new client for DataCatalog that uses a custom <c>CallInvoker</c>.</summary> /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> public DataCatalogClient(grpc::CallInvoker callInvoker) : base(callInvoker) { } /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> protected DataCatalogClient() : base() { } /// <summary>Protected constructor to allow creation of configured clients.</summary> /// <param name="configuration">The client configuration.</param> protected DataCatalogClient(ClientBaseConfiguration configuration) : base(configuration) { } /// <summary> /// Searches Data Catalog for multiple resources like entries, tags that /// match a query. /// /// This is a custom method /// (https://cloud.google.com/apis/design/custom_methods) and does not return /// the complete resource, only the resource identifier and high level /// fields. Clients can subsequently call `Get` methods. /// /// Note that Data Catalog search queries do not guarantee full recall. Query /// results that match your query may not be returned, even in subsequent /// result pages. Also note that results returned (and not returned) can vary /// across repeated search queries. /// /// See [Data Catalog Search /// Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) /// for more information. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse SearchCatalog(global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SearchCatalog(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Searches Data Catalog for multiple resources like entries, tags that /// match a query. /// /// This is a custom method /// (https://cloud.google.com/apis/design/custom_methods) and does not return /// the complete resource, only the resource identifier and high level /// fields. Clients can subsequently call `Get` methods. /// /// Note that Data Catalog search queries do not guarantee full recall. Query /// results that match your query may not be returned, even in subsequent /// result pages. Also note that results returned (and not returned) can vary /// across repeated search queries. /// /// See [Data Catalog Search /// Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) /// for more information. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse SearchCatalog(global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_SearchCatalog, null, options, request); } /// <summary> /// Searches Data Catalog for multiple resources like entries, tags that /// match a query. /// /// This is a custom method /// (https://cloud.google.com/apis/design/custom_methods) and does not return /// the complete resource, only the resource identifier and high level /// fields. Clients can subsequently call `Get` methods. /// /// Note that Data Catalog search queries do not guarantee full recall. Query /// results that match your query may not be returned, even in subsequent /// result pages. Also note that results returned (and not returned) can vary /// across repeated search queries. /// /// See [Data Catalog Search /// Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) /// for more information. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse> SearchCatalogAsync(global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SearchCatalogAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Searches Data Catalog for multiple resources like entries, tags that /// match a query. /// /// This is a custom method /// (https://cloud.google.com/apis/design/custom_methods) and does not return /// the complete resource, only the resource identifier and high level /// fields. Clients can subsequently call `Get` methods. /// /// Note that Data Catalog search queries do not guarantee full recall. Query /// results that match your query may not be returned, even in subsequent /// result pages. Also note that results returned (and not returned) can vary /// across repeated search queries. /// /// See [Data Catalog Search /// Syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference) /// for more information. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse> SearchCatalogAsync(global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_SearchCatalog, null, options, request); } /// <summary> /// Creates an EntryGroup. /// /// An entry group contains logically related entries together with Cloud /// Identity and Access Management policies that specify the users who can /// create, edit, and view entries within the entry group. /// /// Data Catalog automatically creates an entry group for BigQuery entries /// ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry /// group to contain Cloud Storage fileset entries or custom type entries, /// and the IAM policies associated with those entries. Entry groups, like /// entries, can be searched. /// /// A maximum of 10,000 entry groups may be created per organization across all /// locations. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup CreateEntryGroup(global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateEntryGroup(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates an EntryGroup. /// /// An entry group contains logically related entries together with Cloud /// Identity and Access Management policies that specify the users who can /// create, edit, and view entries within the entry group. /// /// Data Catalog automatically creates an entry group for BigQuery entries /// ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry /// group to contain Cloud Storage fileset entries or custom type entries, /// and the IAM policies associated with those entries. Entry groups, like /// entries, can be searched. /// /// A maximum of 10,000 entry groups may be created per organization across all /// locations. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup CreateEntryGroup(global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CreateEntryGroup, null, options, request); } /// <summary> /// Creates an EntryGroup. /// /// An entry group contains logically related entries together with Cloud /// Identity and Access Management policies that specify the users who can /// create, edit, and view entries within the entry group. /// /// Data Catalog automatically creates an entry group for BigQuery entries /// ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry /// group to contain Cloud Storage fileset entries or custom type entries, /// and the IAM policies associated with those entries. Entry groups, like /// entries, can be searched. /// /// A maximum of 10,000 entry groups may be created per organization across all /// locations. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> CreateEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateEntryGroupAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates an EntryGroup. /// /// An entry group contains logically related entries together with Cloud /// Identity and Access Management policies that specify the users who can /// create, edit, and view entries within the entry group. /// /// Data Catalog automatically creates an entry group for BigQuery entries /// ("@bigquery") and Pub/Sub topics ("@pubsub"). Users create their own entry /// group to contain Cloud Storage fileset entries or custom type entries, /// and the IAM policies associated with those entries. Entry groups, like /// entries, can be searched. /// /// A maximum of 10,000 entry groups may be created per organization across all /// locations. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> CreateEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CreateEntryGroup, null, options, request); } /// <summary> /// Gets an EntryGroup. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup GetEntryGroup(global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetEntryGroup(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets an EntryGroup. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup GetEntryGroup(global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetEntryGroup, null, options, request); } /// <summary> /// Gets an EntryGroup. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> GetEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetEntryGroupAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets an EntryGroup. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> GetEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetEntryGroup, null, options, request); } /// <summary> /// Updates an EntryGroup. The user should enable the Data Catalog API in the /// project identified by the `entry_group.name` parameter (see [Data Catalog /// Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup UpdateEntryGroup(global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateEntryGroup(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an EntryGroup. The user should enable the Data Catalog API in the /// project identified by the `entry_group.name` parameter (see [Data Catalog /// Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.EntryGroup UpdateEntryGroup(global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UpdateEntryGroup, null, options, request); } /// <summary> /// Updates an EntryGroup. The user should enable the Data Catalog API in the /// project identified by the `entry_group.name` parameter (see [Data Catalog /// Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> UpdateEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateEntryGroupAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an EntryGroup. The user should enable the Data Catalog API in the /// project identified by the `entry_group.name` parameter (see [Data Catalog /// Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.EntryGroup> UpdateEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UpdateEntryGroup, null, options, request); } /// <summary> /// Deletes an EntryGroup. Only entry groups that do not contain entries can be /// deleted. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteEntryGroup(global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteEntryGroup(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes an EntryGroup. Only entry groups that do not contain entries can be /// deleted. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteEntryGroup(global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_DeleteEntryGroup, null, options, request); } /// <summary> /// Deletes an EntryGroup. Only entry groups that do not contain entries can be /// deleted. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteEntryGroupAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes an EntryGroup. Only entry groups that do not contain entries can be /// deleted. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntryGroupAsync(global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_DeleteEntryGroup, null, options, request); } /// <summary> /// Lists entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse ListEntryGroups(global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListEntryGroups(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse ListEntryGroups(global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_ListEntryGroups, null, options, request); } /// <summary> /// Lists entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse> ListEntryGroupsAsync(global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListEntryGroupsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse> ListEntryGroupsAsync(global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_ListEntryGroups, null, options, request); } /// <summary> /// Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' /// or with a user-specified type can be created. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// /// A maximum of 100,000 entries may be created per entry group. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry CreateEntry(global::Google.Cloud.DataCatalog.V1.CreateEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateEntry(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' /// or with a user-specified type can be created. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// /// A maximum of 100,000 entries may be created per entry group. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry CreateEntry(global::Google.Cloud.DataCatalog.V1.CreateEntryRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CreateEntry, null, options, request); } /// <summary> /// Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' /// or with a user-specified type can be created. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// /// A maximum of 100,000 entries may be created per entry group. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> CreateEntryAsync(global::Google.Cloud.DataCatalog.V1.CreateEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateEntryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates an entry. Only entries of types 'FILESET', 'CLUSTER', 'DATA_STREAM' /// or with a user-specified type can be created. /// /// Users should enable the Data Catalog API in the project identified by /// the `parent` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// /// A maximum of 100,000 entries may be created per entry group. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> CreateEntryAsync(global::Google.Cloud.DataCatalog.V1.CreateEntryRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CreateEntry, null, options, request); } /// <summary> /// Updates an existing entry. /// Users should enable the Data Catalog API in the project identified by /// the `entry.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry UpdateEntry(global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateEntry(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an existing entry. /// Users should enable the Data Catalog API in the project identified by /// the `entry.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry UpdateEntry(global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UpdateEntry, null, options, request); } /// <summary> /// Updates an existing entry. /// Users should enable the Data Catalog API in the project identified by /// the `entry.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> UpdateEntryAsync(global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateEntryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an existing entry. /// Users should enable the Data Catalog API in the project identified by /// the `entry.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> UpdateEntryAsync(global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UpdateEntry, null, options, request); } /// <summary> /// Deletes an existing entry. Only entries created through /// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] /// method can be deleted. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteEntry(global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteEntry(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes an existing entry. Only entries created through /// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] /// method can be deleted. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteEntry(global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_DeleteEntry, null, options, request); } /// <summary> /// Deletes an existing entry. Only entries created through /// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] /// method can be deleted. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntryAsync(global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteEntryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes an existing entry. Only entries created through /// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry] /// method can be deleted. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteEntryAsync(global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_DeleteEntry, null, options, request); } /// <summary> /// Gets an entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry GetEntry(global::Google.Cloud.DataCatalog.V1.GetEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetEntry(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets an entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry GetEntry(global::Google.Cloud.DataCatalog.V1.GetEntryRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetEntry, null, options, request); } /// <summary> /// Gets an entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> GetEntryAsync(global::Google.Cloud.DataCatalog.V1.GetEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetEntryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets an entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> GetEntryAsync(global::Google.Cloud.DataCatalog.V1.GetEntryRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetEntry, null, options, request); } /// <summary> /// Get an entry by target resource name. This method allows clients to use /// the resource name from the source Google Cloud Platform service to get the /// Data Catalog Entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry LookupEntry(global::Google.Cloud.DataCatalog.V1.LookupEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return LookupEntry(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Get an entry by target resource name. This method allows clients to use /// the resource name from the source Google Cloud Platform service to get the /// Data Catalog Entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Entry LookupEntry(global::Google.Cloud.DataCatalog.V1.LookupEntryRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_LookupEntry, null, options, request); } /// <summary> /// Get an entry by target resource name. This method allows clients to use /// the resource name from the source Google Cloud Platform service to get the /// Data Catalog Entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> LookupEntryAsync(global::Google.Cloud.DataCatalog.V1.LookupEntryRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return LookupEntryAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Get an entry by target resource name. This method allows clients to use /// the resource name from the source Google Cloud Platform service to get the /// Data Catalog Entry. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Entry> LookupEntryAsync(global::Google.Cloud.DataCatalog.V1.LookupEntryRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_LookupEntry, null, options, request); } /// <summary> /// Lists entries. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListEntriesResponse ListEntries(global::Google.Cloud.DataCatalog.V1.ListEntriesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListEntries(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists entries. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListEntriesResponse ListEntries(global::Google.Cloud.DataCatalog.V1.ListEntriesRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_ListEntries, null, options, request); } /// <summary> /// Lists entries. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListEntriesResponse> ListEntriesAsync(global::Google.Cloud.DataCatalog.V1.ListEntriesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListEntriesAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists entries. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListEntriesResponse> ListEntriesAsync(global::Google.Cloud.DataCatalog.V1.ListEntriesRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_ListEntries, null, options, request); } /// <summary> /// Creates a tag template. The user should enable the Data Catalog API in /// the project identified by the `parent` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate CreateTagTemplate(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTagTemplate(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a tag template. The user should enable the Data Catalog API in /// the project identified by the `parent` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate CreateTagTemplate(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CreateTagTemplate, null, options, request); } /// <summary> /// Creates a tag template. The user should enable the Data Catalog API in /// the project identified by the `parent` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> CreateTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTagTemplateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a tag template. The user should enable the Data Catalog API in /// the project identified by the `parent` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> CreateTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CreateTagTemplate, null, options, request); } /// <summary> /// Gets a tag template. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate GetTagTemplate(global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetTagTemplate(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets a tag template. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate GetTagTemplate(global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetTagTemplate, null, options, request); } /// <summary> /// Gets a tag template. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> GetTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetTagTemplateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets a tag template. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> GetTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetTagTemplate, null, options, request); } /// <summary> /// Updates a tag template. This method cannot be used to update the fields of /// a template. The tag template fields are represented as separate resources /// and should be updated using their own create/update/delete methods. /// Users should enable the Data Catalog API in the project identified by /// the `tag_template.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate UpdateTagTemplate(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTagTemplate(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates a tag template. This method cannot be used to update the fields of /// a template. The tag template fields are represented as separate resources /// and should be updated using their own create/update/delete methods. /// Users should enable the Data Catalog API in the project identified by /// the `tag_template.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplate UpdateTagTemplate(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UpdateTagTemplate, null, options, request); } /// <summary> /// Updates a tag template. This method cannot be used to update the fields of /// a template. The tag template fields are represented as separate resources /// and should be updated using their own create/update/delete methods. /// Users should enable the Data Catalog API in the project identified by /// the `tag_template.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> UpdateTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTagTemplateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates a tag template. This method cannot be used to update the fields of /// a template. The tag template fields are represented as separate resources /// and should be updated using their own create/update/delete methods. /// Users should enable the Data Catalog API in the project identified by /// the `tag_template.name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplate> UpdateTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UpdateTagTemplate, null, options, request); } /// <summary> /// Deletes a tag template and all tags using the template. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTagTemplate(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTagTemplate(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a tag template and all tags using the template. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTagTemplate(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_DeleteTagTemplate, null, options, request); } /// <summary> /// Deletes a tag template and all tags using the template. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTagTemplateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a tag template and all tags using the template. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplateAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_DeleteTagTemplate, null, options, request); } /// <summary> /// Creates a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `parent` parameter (see /// [Data Catalog Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField CreateTagTemplateField(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTagTemplateField(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `parent` parameter (see /// [Data Catalog Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField CreateTagTemplateField(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CreateTagTemplateField, null, options, request); } /// <summary> /// Creates a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `parent` parameter (see /// [Data Catalog Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> CreateTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTagTemplateFieldAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `parent` parameter (see /// [Data Catalog Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> CreateTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CreateTagTemplateField, null, options, request); } /// <summary> /// Updates a field in a tag template. This method cannot be used to update the /// field type. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField UpdateTagTemplateField(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTagTemplateField(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates a field in a tag template. This method cannot be used to update the /// field type. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField UpdateTagTemplateField(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UpdateTagTemplateField, null, options, request); } /// <summary> /// Updates a field in a tag template. This method cannot be used to update the /// field type. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> UpdateTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTagTemplateFieldAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates a field in a tag template. This method cannot be used to update the /// field type. Users should enable the Data Catalog API in the project /// identified by the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> UpdateTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UpdateTagTemplateField, null, options, request); } /// <summary> /// Renames a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `name` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField RenameTagTemplateField(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RenameTagTemplateField(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Renames a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `name` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField RenameTagTemplateField(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_RenameTagTemplateField, null, options, request); } /// <summary> /// Renames a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `name` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RenameTagTemplateFieldAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Renames a field in a tag template. The user should enable the Data Catalog /// API in the project identified by the `name` parameter (see [Data Catalog /// Resource /// Project](https://cloud.google.com/data-catalog/docs/concepts/resource-project) /// for more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_RenameTagTemplateField, null, options, request); } /// <summary> /// Renames an enum value in a tag template. The enum values have to be unique /// within one enum field. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField RenameTagTemplateFieldEnumValue(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RenameTagTemplateFieldEnumValue(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Renames an enum value in a tag template. The enum values have to be unique /// within one enum field. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.TagTemplateField RenameTagTemplateFieldEnumValue(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_RenameTagTemplateFieldEnumValue, null, options, request); } /// <summary> /// Renames an enum value in a tag template. The enum values have to be unique /// within one enum field. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateFieldEnumValueAsync(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RenameTagTemplateFieldEnumValueAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Renames an enum value in a tag template. The enum values have to be unique /// within one enum field. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.TagTemplateField> RenameTagTemplateFieldEnumValueAsync(global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_RenameTagTemplateFieldEnumValue, null, options, request); } /// <summary> /// Deletes a field in a tag template and all uses of that field. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTagTemplateField(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTagTemplateField(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a field in a tag template and all uses of that field. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTagTemplateField(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_DeleteTagTemplateField, null, options, request); } /// <summary> /// Deletes a field in a tag template and all uses of that field. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTagTemplateFieldAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a field in a tag template and all uses of that field. /// Users should enable the Data Catalog API in the project identified by /// the `name` parameter (see [Data Catalog Resource Project] /// (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for /// more information). /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagTemplateFieldAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_DeleteTagTemplateField, null, options, request); } /// <summary> /// Creates a tag on an [Entry][google.cloud.datacatalog.v1.Entry]. /// Note: The project identified by the `parent` parameter for the /// [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) /// and the /// [tag /// template](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) /// used to create the tag must be from the same organization. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Tag CreateTag(global::Google.Cloud.DataCatalog.V1.CreateTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTag(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a tag on an [Entry][google.cloud.datacatalog.v1.Entry]. /// Note: The project identified by the `parent` parameter for the /// [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) /// and the /// [tag /// template](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) /// used to create the tag must be from the same organization. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Tag CreateTag(global::Google.Cloud.DataCatalog.V1.CreateTagRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_CreateTag, null, options, request); } /// <summary> /// Creates a tag on an [Entry][google.cloud.datacatalog.v1.Entry]. /// Note: The project identified by the `parent` parameter for the /// [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) /// and the /// [tag /// template](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) /// used to create the tag must be from the same organization. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Tag> CreateTagAsync(global::Google.Cloud.DataCatalog.V1.CreateTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return CreateTagAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Creates a tag on an [Entry][google.cloud.datacatalog.v1.Entry]. /// Note: The project identified by the `parent` parameter for the /// [tag](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) /// and the /// [tag /// template](https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) /// used to create the tag must be from the same organization. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Tag> CreateTagAsync(global::Google.Cloud.DataCatalog.V1.CreateTagRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_CreateTag, null, options, request); } /// <summary> /// Updates an existing tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Tag UpdateTag(global::Google.Cloud.DataCatalog.V1.UpdateTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTag(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an existing tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.Tag UpdateTag(global::Google.Cloud.DataCatalog.V1.UpdateTagRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_UpdateTag, null, options, request); } /// <summary> /// Updates an existing tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Tag> UpdateTagAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return UpdateTagAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Updates an existing tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.Tag> UpdateTagAsync(global::Google.Cloud.DataCatalog.V1.UpdateTagRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_UpdateTag, null, options, request); } /// <summary> /// Deletes a tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTag(global::Google.Cloud.DataCatalog.V1.DeleteTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTag(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTag(global::Google.Cloud.DataCatalog.V1.DeleteTagRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_DeleteTag, null, options, request); } /// <summary> /// Deletes a tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return DeleteTagAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Deletes a tag. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTagAsync(global::Google.Cloud.DataCatalog.V1.DeleteTagRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_DeleteTag, null, options, request); } /// <summary> /// Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListTagsResponse ListTags(global::Google.Cloud.DataCatalog.V1.ListTagsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListTags(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.DataCatalog.V1.ListTagsResponse ListTags(global::Google.Cloud.DataCatalog.V1.ListTagsRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_ListTags, null, options, request); } /// <summary> /// Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListTagsResponse> ListTagsAsync(global::Google.Cloud.DataCatalog.V1.ListTagsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListTagsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Lists the tags on an [Entry][google.cloud.datacatalog.v1.Entry]. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.DataCatalog.V1.ListTagsResponse> ListTagsAsync(global::Google.Cloud.DataCatalog.V1.ListTagsRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_ListTags, null, options, request); } /// <summary> /// Sets the access control policy for a resource. Replaces any existing /// policy. /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag /// templates. /// - `datacatalog.entries.setIamPolicy` to set policies on entries. /// - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.Policy SetIamPolicy(global::Google.Cloud.Iam.V1.SetIamPolicyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SetIamPolicy(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Sets the access control policy for a resource. Replaces any existing /// policy. /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag /// templates. /// - `datacatalog.entries.setIamPolicy` to set policies on entries. /// - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.Policy SetIamPolicy(global::Google.Cloud.Iam.V1.SetIamPolicyRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_SetIamPolicy, null, options, request); } /// <summary> /// Sets the access control policy for a resource. Replaces any existing /// policy. /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag /// templates. /// - `datacatalog.entries.setIamPolicy` to set policies on entries. /// - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.Policy> SetIamPolicyAsync(global::Google.Cloud.Iam.V1.SetIamPolicyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SetIamPolicyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Sets the access control policy for a resource. Replaces any existing /// policy. /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.setIamPolicy` to set policies on tag /// templates. /// - `datacatalog.entries.setIamPolicy` to set policies on entries. /// - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.Policy> SetIamPolicyAsync(global::Google.Cloud.Iam.V1.SetIamPolicyRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_SetIamPolicy, null, options, request); } /// <summary> /// Gets the access control policy for a resource. A `NOT_FOUND` error /// is returned if the resource does not exist. An empty policy is returned /// if the resource exists but does not have a policy set on it. /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag /// templates. /// - `datacatalog.entries.getIamPolicy` to get policies on entries. /// - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.Policy GetIamPolicy(global::Google.Cloud.Iam.V1.GetIamPolicyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetIamPolicy(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets the access control policy for a resource. A `NOT_FOUND` error /// is returned if the resource does not exist. An empty policy is returned /// if the resource exists but does not have a policy set on it. /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag /// templates. /// - `datacatalog.entries.getIamPolicy` to get policies on entries. /// - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.Policy GetIamPolicy(global::Google.Cloud.Iam.V1.GetIamPolicyRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_GetIamPolicy, null, options, request); } /// <summary> /// Gets the access control policy for a resource. A `NOT_FOUND` error /// is returned if the resource does not exist. An empty policy is returned /// if the resource exists but does not have a policy set on it. /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag /// templates. /// - `datacatalog.entries.getIamPolicy` to get policies on entries. /// - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.Policy> GetIamPolicyAsync(global::Google.Cloud.Iam.V1.GetIamPolicyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetIamPolicyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Gets the access control policy for a resource. A `NOT_FOUND` error /// is returned if the resource does not exist. An empty policy is returned /// if the resource exists but does not have a policy set on it. /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// Callers must have following Google IAM permission /// - `datacatalog.tagTemplates.getIamPolicy` to get policies on tag /// templates. /// - `datacatalog.entries.getIamPolicy` to get policies on entries. /// - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.Policy> GetIamPolicyAsync(global::Google.Cloud.Iam.V1.GetIamPolicyRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_GetIamPolicy, null, options, request); } /// <summary> /// Returns the caller's permissions on a resource. /// If the resource does not exist, an empty set of permissions is returned /// (We don't return a `NOT_FOUND` error). /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// A caller is not required to have Google IAM permission to make this /// request. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.TestIamPermissionsResponse TestIamPermissions(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return TestIamPermissions(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Returns the caller's permissions on a resource. /// If the resource does not exist, an empty set of permissions is returned /// (We don't return a `NOT_FOUND` error). /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// A caller is not required to have Google IAM permission to make this /// request. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The response received from the server.</returns> public virtual global::Google.Cloud.Iam.V1.TestIamPermissionsResponse TestIamPermissions(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest request, grpc::CallOptions options) { return CallInvoker.BlockingUnaryCall(__Method_TestIamPermissions, null, options, request); } /// <summary> /// Returns the caller's permissions on a resource. /// If the resource does not exist, an empty set of permissions is returned /// (We don't return a `NOT_FOUND` error). /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// A caller is not required to have Google IAM permission to make this /// request. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.TestIamPermissionsResponse> TestIamPermissionsAsync(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return TestIamPermissionsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } /// <summary> /// Returns the caller's permissions on a resource. /// If the resource does not exist, an empty set of permissions is returned /// (We don't return a `NOT_FOUND` error). /// /// Supported resources are: /// - Tag templates. /// - Entries. /// - Entry groups. /// Note, this method cannot be used to manage policies for BigQuery, Pub/Sub /// and any external Google Cloud Platform resources synced to Data Catalog. /// /// A caller is not required to have Google IAM permission to make this /// request. /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="options">The options for the call.</param> /// <returns>The call object.</returns> public virtual grpc::AsyncUnaryCall<global::Google.Cloud.Iam.V1.TestIamPermissionsResponse> TestIamPermissionsAsync(global::Google.Cloud.Iam.V1.TestIamPermissionsRequest request, grpc::CallOptions options) { return CallInvoker.AsyncUnaryCall(__Method_TestIamPermissions, null, options, request); } /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> protected override DataCatalogClient NewInstance(ClientBaseConfiguration configuration) { return new DataCatalogClient(configuration); } } /// <summary>Creates service definition that can be registered with a server</summary> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static grpc::ServerServiceDefinition BindService(DataCatalogBase serviceImpl) { return grpc::ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_SearchCatalog, serviceImpl.SearchCatalog) .AddMethod(__Method_CreateEntryGroup, serviceImpl.CreateEntryGroup) .AddMethod(__Method_GetEntryGroup, serviceImpl.GetEntryGroup) .AddMethod(__Method_UpdateEntryGroup, serviceImpl.UpdateEntryGroup) .AddMethod(__Method_DeleteEntryGroup, serviceImpl.DeleteEntryGroup) .AddMethod(__Method_ListEntryGroups, serviceImpl.ListEntryGroups) .AddMethod(__Method_CreateEntry, serviceImpl.CreateEntry) .AddMethod(__Method_UpdateEntry, serviceImpl.UpdateEntry) .AddMethod(__Method_DeleteEntry, serviceImpl.DeleteEntry) .AddMethod(__Method_GetEntry, serviceImpl.GetEntry) .AddMethod(__Method_LookupEntry, serviceImpl.LookupEntry) .AddMethod(__Method_ListEntries, serviceImpl.ListEntries) .AddMethod(__Method_CreateTagTemplate, serviceImpl.CreateTagTemplate) .AddMethod(__Method_GetTagTemplate, serviceImpl.GetTagTemplate) .AddMethod(__Method_UpdateTagTemplate, serviceImpl.UpdateTagTemplate) .AddMethod(__Method_DeleteTagTemplate, serviceImpl.DeleteTagTemplate) .AddMethod(__Method_CreateTagTemplateField, serviceImpl.CreateTagTemplateField) .AddMethod(__Method_UpdateTagTemplateField, serviceImpl.UpdateTagTemplateField) .AddMethod(__Method_RenameTagTemplateField, serviceImpl.RenameTagTemplateField) .AddMethod(__Method_RenameTagTemplateFieldEnumValue, serviceImpl.RenameTagTemplateFieldEnumValue) .AddMethod(__Method_DeleteTagTemplateField, serviceImpl.DeleteTagTemplateField) .AddMethod(__Method_CreateTag, serviceImpl.CreateTag) .AddMethod(__Method_UpdateTag, serviceImpl.UpdateTag) .AddMethod(__Method_DeleteTag, serviceImpl.DeleteTag) .AddMethod(__Method_ListTags, serviceImpl.ListTags) .AddMethod(__Method_SetIamPolicy, serviceImpl.SetIamPolicy) .AddMethod(__Method_GetIamPolicy, serviceImpl.GetIamPolicy) .AddMethod(__Method_TestIamPermissions, serviceImpl.TestIamPermissions).Build(); } /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> public static void BindService(grpc::ServiceBinderBase serviceBinder, DataCatalogBase serviceImpl) { serviceBinder.AddMethod(__Method_SearchCatalog, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.SearchCatalogRequest, global::Google.Cloud.DataCatalog.V1.SearchCatalogResponse>(serviceImpl.SearchCatalog)); serviceBinder.AddMethod(__Method_CreateEntryGroup, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.CreateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>(serviceImpl.CreateEntryGroup)); serviceBinder.AddMethod(__Method_GetEntryGroup, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.GetEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>(serviceImpl.GetEntryGroup)); serviceBinder.AddMethod(__Method_UpdateEntryGroup, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.UpdateEntryGroupRequest, global::Google.Cloud.DataCatalog.V1.EntryGroup>(serviceImpl.UpdateEntryGroup)); serviceBinder.AddMethod(__Method_DeleteEntryGroup, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.DeleteEntryGroupRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteEntryGroup)); serviceBinder.AddMethod(__Method_ListEntryGroups, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.ListEntryGroupsRequest, global::Google.Cloud.DataCatalog.V1.ListEntryGroupsResponse>(serviceImpl.ListEntryGroups)); serviceBinder.AddMethod(__Method_CreateEntry, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.CreateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>(serviceImpl.CreateEntry)); serviceBinder.AddMethod(__Method_UpdateEntry, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.UpdateEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>(serviceImpl.UpdateEntry)); serviceBinder.AddMethod(__Method_DeleteEntry, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.DeleteEntryRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteEntry)); serviceBinder.AddMethod(__Method_GetEntry, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.GetEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>(serviceImpl.GetEntry)); serviceBinder.AddMethod(__Method_LookupEntry, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.LookupEntryRequest, global::Google.Cloud.DataCatalog.V1.Entry>(serviceImpl.LookupEntry)); serviceBinder.AddMethod(__Method_ListEntries, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.ListEntriesRequest, global::Google.Cloud.DataCatalog.V1.ListEntriesResponse>(serviceImpl.ListEntries)); serviceBinder.AddMethod(__Method_CreateTagTemplate, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>(serviceImpl.CreateTagTemplate)); serviceBinder.AddMethod(__Method_GetTagTemplate, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.GetTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>(serviceImpl.GetTagTemplate)); serviceBinder.AddMethod(__Method_UpdateTagTemplate, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateRequest, global::Google.Cloud.DataCatalog.V1.TagTemplate>(serviceImpl.UpdateTagTemplate)); serviceBinder.AddMethod(__Method_DeleteTagTemplate, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteTagTemplate)); serviceBinder.AddMethod(__Method_CreateTagTemplateField, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.CreateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>(serviceImpl.CreateTagTemplateField)); serviceBinder.AddMethod(__Method_UpdateTagTemplateField, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.UpdateTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>(serviceImpl.UpdateTagTemplateField)); serviceBinder.AddMethod(__Method_RenameTagTemplateField, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>(serviceImpl.RenameTagTemplateField)); serviceBinder.AddMethod(__Method_RenameTagTemplateFieldEnumValue, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.RenameTagTemplateFieldEnumValueRequest, global::Google.Cloud.DataCatalog.V1.TagTemplateField>(serviceImpl.RenameTagTemplateFieldEnumValue)); serviceBinder.AddMethod(__Method_DeleteTagTemplateField, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.DeleteTagTemplateFieldRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteTagTemplateField)); serviceBinder.AddMethod(__Method_CreateTag, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.CreateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag>(serviceImpl.CreateTag)); serviceBinder.AddMethod(__Method_UpdateTag, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.UpdateTagRequest, global::Google.Cloud.DataCatalog.V1.Tag>(serviceImpl.UpdateTag)); serviceBinder.AddMethod(__Method_DeleteTag, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.DeleteTagRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteTag)); serviceBinder.AddMethod(__Method_ListTags, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.DataCatalog.V1.ListTagsRequest, global::Google.Cloud.DataCatalog.V1.ListTagsResponse>(serviceImpl.ListTags)); serviceBinder.AddMethod(__Method_SetIamPolicy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.Iam.V1.SetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy>(serviceImpl.SetIamPolicy)); serviceBinder.AddMethod(__Method_GetIamPolicy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.Iam.V1.GetIamPolicyRequest, global::Google.Cloud.Iam.V1.Policy>(serviceImpl.GetIamPolicy)); serviceBinder.AddMethod(__Method_TestIamPermissions, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.Iam.V1.TestIamPermissionsRequest, global::Google.Cloud.Iam.V1.TestIamPermissionsResponse>(serviceImpl.TestIamPermissions)); } } } #endregion
72.772258
405
0.716433
[ "Apache-2.0" ]
viacheslav-rostovtsev/google-cloud-dotnet
apis/Google.Cloud.DataCatalog.V1/Google.Cloud.DataCatalog.V1/DatacatalogGrpc.cs
190,445
C#
// The MIT License (MIT) // // Copyright (c) 2014 Beanstream Internet Commerce Corp, Digital River, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using System; using Newtonsoft.Json; namespace Beanstream { public class PaymentProfileField { [JsonProperty(PropertyName = "customer_code")] public string CustomerCode { get; set; } [JsonProperty(PropertyName = "card_id")] public int CardId { get; set; } [JsonProperty(PropertyName = "complete")] public bool Complete { get; set; } public PaymentProfileField() { CardId = 1; // 1+ Complete = true; } } }
34.468085
80
0.740741
[ "MIT" ]
jonagh/beanstream-dotnetcore
BeanstreamNETCore/Domain/PaymentProfileField.cs
1,622
C#
using System.Linq; namespace Collection_Hierarchy { public class AddRemoveCollection : Collection, IAdder, IRemover { public int Add(string item) { this.StringCollection.Insert(0, item); return 0; } public string Remove() { var result = this.StringCollection.Last(); this.StringCollection.RemoveAt(this.StringCollection.Count - 1); return result; } } }
22.666667
76
0.577731
[ "MIT" ]
BlueDress/School
C# OOP Advanced/Interfaces and Abstraction Exercises/Collection Hierarchy/AddRemoveCollection.cs
478
C#
namespace OnlineShop.Models.Products.ProductsModels.ComponentsModels { public class PowerSupply : Component { private const double MULTIPLIER = 1.05; public PowerSupply(int id, string manufacturer, string model, decimal price, double overallPerformance, int generation) : base(id, manufacturer, model, price, overallPerformance, generation) { } public override double OverallPerformance => base.OverallPerformance * MULTIPLIER; } }
34
127
0.688235
[ "MIT" ]
danstoyanov/CSharp-Advanced-Tasks
02 - [CSharp OOP]/[CSharp OOP - Exams]/03 - [C# OOP Exam - 16 August 2020]/01 - [Structure & Business Logic]/Models/Products/ProductsModels/ComponentsModels/PowerSupply.cs
512
C#
namespace Microsoft.AspNetCore.Mvc.Versioning { using Abstractions; using AspNetCore.Routing; using Builder; using Controllers; using Conventions; using Extensions.DependencyInjection; using FluentAssertions; using Infrastructure; using Internal; using Simulators; using System; using System.Linq; using System.Net.Http; using System.Reflection; using System.Threading.Tasks; using Xunit; using static ApiVersion; using static System.Environment; using static System.Net.Http.HttpMethod; using static System.Net.HttpStatusCode; public partial class ApiVersionActionSelectorTest { [Theory] [InlineData( "1.0", typeof( AttributeRoutedTestController ) )] [InlineData( "2.0", typeof( AttributeRoutedTest2Controller ) )] [InlineData( "3.0", typeof( AttributeRoutedTest2Controller ) )] public async Task select_best_candidate_should_return_correct_versionedX2C_attributeX2Dbased_controller( string version, Type controllerType ) { // arrange using ( var server = new WebServer() ) { await server.Client.GetAsync( $"api/attributed?api-version={version}" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.GetProperty<ApiVersionModel>().SupportedApiVersions.Should().Contain( Parse( version ) ); action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType.GetTypeInfo() ); } } [Theory] [InlineData( "1.0", typeof( TestController ) )] [InlineData( "2.0", typeof( TestVersion2Controller ) )] [InlineData( "3.0", typeof( TestVersion2Controller ) )] public async Task select_best_candidate_should_return_correct_versionedX2C_conventionX2Dbased_controller( string version, Type controllerType ) { // arrange void ConfigureOptions( ApiVersioningOptions options ) => options.UseApiBehavior = false; using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { var response = await server.Client.GetAsync( $"api/test?api-version={version}" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.GetProperty<ApiVersionModel>().SupportedApiVersions.Should().Contain( Parse( version ) ); action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType.GetTypeInfo() ); } } [Theory] [InlineData( "http://localhost/api/attributed-neutral" )] [InlineData( "http://localhost/api/attributed-neutral?api-version=2.0" )] public async Task select_best_candidate_should_return_correct_versionX2DneutralX2C_attributeX2Dbased_controller( string requestUri ) { // arrange var controllerType = typeof( AttributeRoutedVersionNeutralController ).GetTypeInfo(); using ( var server = new WebServer() ) { await server.Client.GetAsync( requestUri ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Theory] [InlineData( "http://localhost/api/neutral" )] [InlineData( "http://localhost/api/neutral?api-version=2.0" )] public async Task select_best_candidate_should_return_correct_versionX2DneutralX2C_conventionX2Dbased_controller( string requestUri ) { // arrange var controllerType = typeof( NeutralController ).GetTypeInfo(); using ( var server = new WebServer( setupRoutes: routes => routes.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { await server.Client.GetAsync( requestUri ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_return_400_for_unmatchedX2C_attributeX2Dbased_controller_version() { // arrange using ( var server = new WebServer( options => options.ReportApiVersions = true ) ) { // act var response = await server.Client.GetAsync( "http://localhost/api/attributed?api-version=42.0" ); // assert response.StatusCode.Should().Be( BadRequest ); response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0, 4.0" ); response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "3.0-Alpha" ); } } [Fact] public async Task select_best_candidate_should_return_400_for_attributeX2Dbased_controller_with_bad_version() { // arrange using ( var server = new WebServer( options => options.ReportApiVersions = true ) ) { // act var response = await server.Client.GetAsync( "http://localhost/api/attributed?api-version=2016-06-32" ); // assert response.StatusCode.Should().Be( BadRequest ); response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0, 4.0" ); response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "3.0-Alpha" ); } } [Fact] public async Task select_best_candidate_should_return_400_for_unmatchedX2C_conventionX2Dbased_controller_version() { // arrange void ConfigureOptions( ApiVersioningOptions options ) { options.ReportApiVersions = true; options.UseApiBehavior = false; } using ( var server = new WebServer( ConfigureOptions, routes => routes.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { // act var response = await server.Client.GetAsync( "http://localhost/api/test?api-version=4.0" ); // assert response.StatusCode.Should().Be( BadRequest ); response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0" ); response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "1.8, 1.9" ); } } [Fact] public async Task select_best_candidate_should_return_400_for_conventionX2Dbased_controller_with_bad_version() { // arrange void ConfigureOptions( ApiVersioningOptions options ) { options.ReportApiVersions = true; options.UseApiBehavior = false; } using ( var server = new WebServer( ConfigureOptions, routes => routes.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { // act var response = await server.Client.GetAsync( "http://localhost/api/test?api-version=2016-06-32" ); // assert response.StatusCode.Should().Be( BadRequest ); response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0" ); response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "1.8, 1.9" ); } } [Theory] [InlineData( "http://localhost/api/random" )] [InlineData( "http://localhost/api/random?api-version=10.0" )] public async Task select_best_candidate_should_return_404_for_unmatched_controller( string requestUri ) { // arrange using ( var server = new WebServer( setupRoutes: routes => routes.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { // act var response = await server.Client.GetAsync( requestUri ); // assert response.StatusCode.Should().Be( NotFound ); } } [Fact] public async Task select_best_candidate_should_return_405_for_unmatched_action() { // arrange var request = new HttpRequestMessage( Post, "api/attributed?api-version=1.0" ); using ( var server = new WebServer( options => options.ReportApiVersions = true ) ) { // act var response = await server.Client.SendAsync( request ); // assert response.StatusCode.Should().Be( MethodNotAllowed ); response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0, 4.0" ); response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "3.0-Alpha" ); } } [Fact] public async Task return_only_path_for_unmatched_action() { // arrange var request = new HttpRequestMessage( Post, "api/attributed?api-version=1.0" ); using ( var server = new WebServer( options => options.ReportApiVersions = true ) ) { // act var response = await server.Client.SendAsync( request ); // assert var content = await response.Content.ReadAsStringAsync(); content.Should().Contain( "api/attributed" ); content.Should().NotContain( "?api-version=1.0" ); } } [Fact] public async Task select_best_candidate_should_assume_1X2E0_for_attributeX2Dbased_controller_when_allowed() { // arrange var controllerType = typeof( AttributeRoutedTestController ).GetTypeInfo(); using ( var server = new WebServer( o => o.AssumeDefaultVersionWhenUnspecified = true ) ) { await server.Client.GetAsync( "api/attributed" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_assume_configured_default_api_version_for_attributeX2Dbased_controller() { // arrange var controllerType = typeof( AttributeRoutedTestController ).GetTypeInfo(); using ( var server = new WebServer( o => o.DefaultApiVersion = new ApiVersion( 42, 0 ) ) ) { await server.Client.GetAsync( "api/attributed?api-version=42.0" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_assume_1X2E0_for_conventionX2Dbased_controller_when_allowed() { // arrange var controllerType = typeof( TestController ).GetTypeInfo(); Action<ApiVersioningOptions> versioningSetup = options => { options.UseApiBehavior = false; options.AssumeDefaultVersionWhenUnspecified = true; }; Action<IRouteBuilder> routesSetup = r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ); using ( var server = new WebServer( versioningSetup, routesSetup ) ) { await server.Client.GetAsync( "api/test" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_assume_configured_default_api_version_for_conventionX2Dbased_controller() { // arrange var controllerType = typeof( TestController ).GetTypeInfo(); void ConfigureOptions( ApiVersioningOptions options ) { options.UseApiBehavior = false; options.DefaultApiVersion = new ApiVersion( 42, 0 ); } using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { await server.Client.GetAsync( "api/test?api-version=42.0" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_use_api_version_selector_for_conventionX2Dbased_controller_when_allowed() { // arrange var controllerType = typeof( OrdersController ).GetTypeInfo(); void ConfigureOptions( ApiVersioningOptions options ) { options.UseApiBehavior = false; options.AssumeDefaultVersionWhenUnspecified = true; options.ApiVersionSelector = new LowestImplementedApiVersionSelector( options ); } using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { await server.Client.GetAsync( "api/orders" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().Should().BeEquivalentTo( new { ControllerTypeInfo = controllerType, ActionName = nameof( OrdersController.Get ) }, options => options.ExcludingMissingMembers() ); } } [Fact] public void select_best_candidate_should_throw_exception_for_ambiguously_versionedX2C_attributeX2Dbased_controller() { // arrange var message = $"Multiple actions matched. The following actions matched route data and had all constraints satisfied:{NewLine}{NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AttributeRoutedAmbiguous2Controller.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests){NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AttributeRoutedAmbiguous3Controller.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests)"; using ( var server = new WebServer( o => o.AssumeDefaultVersionWhenUnspecified = true ) ) { Func<Task> test = () => server.Client.GetAsync( "api/attributed/ambiguous" ); // act // assert test.Should().Throw<AmbiguousActionException>().WithMessage( message ); } } [Fact] public void select_best_candidate_should_throw_exception_for_ambiguously_versionedX2C_conventionX2Dbased_controller() { // arrange void ConfigureOptions( ApiVersioningOptions options ) { options.UseApiBehavior = false; options.AssumeDefaultVersionWhenUnspecified = true; } var message = $"Multiple actions matched. The following actions matched route data and had all constraints satisfied:{NewLine}{NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AmbiguousToo2Controller.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests){NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AmbiguousTooController.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests)"; using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { Func<Task> test = () => server.Client.GetAsync( "api/ambiguoustoo" ); // act // assert test.Should().Throw<AmbiguousActionException>().WithMessage( message ); } } [Fact] public void select_best_candidate_should_throw_exception_for_ambiguous_neutral_and_versionedX2C_attributeX2Dbased_controller() { // arrange var message = $"Multiple actions matched. The following actions matched route data and had all constraints satisfied:{NewLine}{NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AttributeRoutedAmbiguousNeutralController.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests){NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AttributeRoutedAmbiguousController.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests)"; using ( var server = new WebServer( options => options.AssumeDefaultVersionWhenUnspecified = true ) ) { Func<Task> test = () => server.Client.GetAsync( "api/attributed-ambiguous" ); // act // assert test.Should().Throw<AmbiguousActionException>().WithMessage( message ); } } [Fact] public void select_best_candidate_should_throw_exception_for_ambiguous_neutral_and_versionedX2C_conventionX2Dbased_controller() { // arrange void ConfigureOptions( ApiVersioningOptions options ) { options.UseApiBehavior = false; options.AssumeDefaultVersionWhenUnspecified = true; } var message = $"Multiple actions matched. The following actions matched route data and had all constraints satisfied:{NewLine}{NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AmbiguousNeutralController.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests){NewLine}" + $"Microsoft.AspNetCore.Mvc.Versioning.AmbiguousController.Get() (Microsoft.AspNetCore.Mvc.Versioning.Tests)"; using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { Func<Task> test = () => server.Client.GetAsync( "api/ambiguous" ); // act // assert test.Should().Throw<AmbiguousActionException>().WithMessage( message ); } } [Fact] public async Task select_best_candidate_should_assume_current_version_for_attributeX2Dbased_controller_when_allowed() { // arrange var currentVersion = new ApiVersion( 4, 0 ); var controllerType = typeof( AttributeRoutedTest4Controller ).GetTypeInfo(); void ConfigureOptions( ApiVersioningOptions options ) { options.AssumeDefaultVersionWhenUnspecified = true; options.ApiVersionSelector = new CurrentImplementationApiVersionSelector( options ); } using ( var server = new WebServer( setupApiVersioning: ConfigureOptions ) ) { await server.Client.GetAsync( "api/attributed" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Fact] public async Task select_best_candidate_should_assume_current_version_for_conventionX2Dbased_controller_when_allowed() { // arrange var currentVersion = new ApiVersion( 3, 0 ); var controllerType = typeof( TestVersion2Controller ).GetTypeInfo(); void ConfigureOptions( ApiVersioningOptions options ) { options.UseApiBehavior = false; options.AssumeDefaultVersionWhenUnspecified = true; options.ApiVersionSelector = new CurrentImplementationApiVersionSelector( options ); } using ( var server = new WebServer( ConfigureOptions, r => r.MapRoute( "default", "api/{controller}/{action=Get}/{id?}" ) ) ) { await server.Client.GetAsync( "api/test" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( controllerType ); } } [Theory] [InlineData( "v1", typeof( ApiVersionedRouteController ), "Get", null )] [InlineData( "v1.0", typeof( ApiVersionedRouteController ), "Get", null )] [InlineData( "v2", typeof( ApiVersionedRouteController ), "Get", null )] [InlineData( "v3.0", typeof( ApiVersionedRouteController ), "Get", null )] [InlineData( "v4", typeof( ApiVersionedRoute2Controller ), "GetV4", "4.0" )] [InlineData( "v5", typeof( ApiVersionedRoute2Controller ), "Get", null )] public async Task select_best_candidate_should_return_correct_controller_for_versioned_route_attribute( string versionSegment, Type controllerType, string actionName, string declaredVersionsValue ) { // arrange var declared = declaredVersionsValue == null ? Array.Empty<ApiVersion>() : declaredVersionsValue.Split( ',' ).Select( Parse ).ToArray(); var supported = new[] { new ApiVersion( 1, 0 ), new ApiVersion( 2, 0 ), new ApiVersion( 3, 0 ), new ApiVersion( 5, 0 ) }; var deprecated = new[] { new ApiVersion( 4, 0 ) }; var implemented = supported.Union( deprecated ).OrderBy( v => v ).ToArray(); using ( var server = new WebServer( options => options.ReportApiVersions = true ) ) { await server.Client.GetAsync( $"api/{versionSegment}/attributed" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().Should().BeEquivalentTo( new { ActionName = actionName, ControllerTypeInfo = controllerType.GetTypeInfo(), }, options => options.ExcludingMissingMembers() ); action.GetProperty<ApiVersionModel>().Should().BeEquivalentTo( new { IsApiVersionNeutral = false, DeclaredApiVersions = declared, ImplementedApiVersions = implemented, SupportedApiVersions = supported, DeprecatedApiVersions = deprecated } ); } } [Fact] public async Task select_controller_should_return_400_when_requested_api_version_is_ambiguous() { // arrange void ConfigureOptions( ApiVersioningOptions options ) => options.ApiVersionReader = ApiVersionReader.Combine( new QueryStringApiVersionReader(), new HeaderApiVersionReader( "api-version" ) ); using ( var server = new WebServer( ConfigureOptions ) ) { server.Client.DefaultRequestHeaders.TryAddWithoutValidation( "api-version", "1.0" ); // act var response = await server.Client.GetAsync( $"api/attributed?api-version=2.0" ); // assert response.StatusCode.Should().Be( BadRequest ); } } [Fact] public async Task select_controller_should_resolve_controller_action_using_api_versioning_conventions() { // arrange void ConfigureOptions( ApiVersioningOptions options ) => options.Conventions.Controller<ConventionsController>() .HasApiVersion( 1, 0 ) .HasApiVersion( 2, 0 ) .AdvertisesApiVersion( 3, 0 ) .Action( c => c.GetV2() ).MapToApiVersion( 2, 0 ) .Action( c => c.GetV2( default ) ).MapToApiVersion( 2, 0 ); using ( var server = new WebServer( ConfigureOptions ) ) { var response = await server.Client.GetAsync( $"api/conventions/1?api-version=2.0" ); // act var action = ( (TestApiVersionActionSelector) server.Services.GetRequiredService<IActionSelector>() ).SelectedCandidate; // assert action.As<ControllerActionDescriptor>().ControllerTypeInfo.Should().Be( typeof( ConventionsController ).GetTypeInfo() ); action.As<ControllerActionDescriptor>().ActionName.Should().Be( nameof( ConventionsController.GetV2 ) ); action.Parameters.Count.Should().Be( 1 ); action.GetProperty<ApiVersionModel>().Should().BeEquivalentTo( new { IsApiVersionNeutral = false, DeclaredApiVersions = new[] { new ApiVersion( 2, 0 ) }, ImplementedApiVersions = new[] { new ApiVersion( 1, 0 ), new ApiVersion( 2, 0 ), new ApiVersion( 3, 0 ) }, SupportedApiVersions = new[] { new ApiVersion( 1, 0 ), new ApiVersion( 2, 0 ), new ApiVersion( 3, 0 ) }, DeprecatedApiVersions = new ApiVersion[0] } ); } } } }
46.247019
205
0.592588
[ "MIT" ]
SiberaIndustries/aspnet-api-versioning
test/Microsoft.AspNetCore.Mvc.Versioning.Tests/Versioning/ApiVersionActionSelectorTest.cs
27,149
C#
using System.Collections.Generic; namespace Spard.Common { internal sealed class CacheDictionary: Dictionary<SimpleTransformState, List<SimpleTransformState>> { } }
19.888889
103
0.765363
[ "MIT" ]
VladimirKhil/Lingware
src/Spard/Common/CacheDictionary.cs
181
C#
//namespace UnitTests.Accounts.CloseAccount; //using System; //using Xunit; //internal sealed class InvalidDataSetup : TheoryData<Guid> //{ // public InvalidDataSetup() //{ // Add(Guid.NewGuid()); // Add(Guid.NewGuid()); // Add(Guid.NewGuid()); // } //}
18.0625
59
0.595156
[ "MIT" ]
MartsTech/D-Wallet
packages/api/tests/UnitTests/Accounts/CloseAccount/InvalidDataSetup.cs
291
C#
using System; using System.Globalization; using System.Windows; using System.Windows.Data; using System.Windows.Media; using NuGet.ProjectManagement; namespace NuGet.PackageManagement.UI { [ValueConversion(typeof(MessageLevel), typeof(Brush))] internal class MessageLevelToBrushConverter : Freezable, IValueConverter { public static readonly DependencyProperty WarningProperty = DependencyProperty.Register(nameof(Warning), typeof(Brush), typeof(MessageLevelToBrushConverter)); public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(nameof(Message), typeof(Brush), typeof(MessageLevelToBrushConverter)); public Brush Warning { get { return (Brush)GetValue(WarningProperty); } set { SetValue(WarningProperty, value); } } public Brush Message { get { return (Brush)GetValue(MessageProperty); } set { SetValue(MessageProperty, value); } } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var messageLevel = (MessageLevel)value; switch (messageLevel) { case MessageLevel.Error: case MessageLevel.Warning: return Warning; case MessageLevel.Info: default: return Message; } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotSupportedException(); } public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var messageLevel = (MessageLevel)values[0]; switch (messageLevel) { case MessageLevel.Error: case MessageLevel.Warning: return Warning; case MessageLevel.Info: default: return Message; } } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotSupportedException(); } protected override Freezable CreateInstanceCore() => new MessageLevelToBrushConverter(); } }
32.391892
110
0.609095
[ "Apache-2.0" ]
0xced/NuGet.Client
src/NuGet.Clients/NuGet.PackageManagement.UI/Converters/MessageLevelToBrushConverter.cs
2,397
C#
using System; using AuthService.Domain.Aggregates.AccountAggregate; using EasyDesk.CleanArchitecture.Domain.Model; using EasyDesk.Tools.Options; using EasyDesk.Tools.PrimitiveTypes.DateAndTime; namespace AuthService.Domain.Authentication; public interface IAccessTokenService { AccessToken GenerateAccessToken(Account account); Option<Guid> ValidateForRefresh(Token accessToken); } public record AccessToken(Guid Id, Token Value, Timestamp Expiration);
27.411765
70
0.832618
[ "MIT" ]
ldeluigi/microchat
services/auth/src/AuthService.Domain/Authentication/IAccessTokenService.cs
468
C#
using Newtonsoft.Json; namespace RecklessBoon.MacroDeck.Discord.RPC.Model { public class EmbedImage { [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] public string Url { get; set; } [JsonProperty("proxy_url", NullValueHandling = NullValueHandling.Ignore)] public string ProxyUrl { get; set; } [JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)] public int Height { get; set; } [JsonProperty("width", NullValueHandling = NullValueHandling.Ignore)] public int Width { get; set; } } }
30.1
81
0.671096
[ "MIT" ]
RecklessBoon/Macro-Deck-Discord-Plugin
RPC/Model/EmbedImage.cs
604
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.BotService.V20171201.Inputs { /// <summary> /// The parameters to provide for the Direct Line channel. /// </summary> public sealed class DirectLineChannelPropertiesArgs : Pulumi.ResourceArgs { [Input("sites")] private InputList<Inputs.DirectLineSiteArgs>? _sites; /// <summary> /// The list of Direct Line sites /// </summary> public InputList<Inputs.DirectLineSiteArgs> Sites { get => _sites ?? (_sites = new InputList<Inputs.DirectLineSiteArgs>()); set => _sites = value; } public DirectLineChannelPropertiesArgs() { } } }
28.4
83
0.645875
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/BotService/V20171201/Inputs/DirectLineChannelPropertiesArgs.cs
994
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Runtime.InteropServices; using System.Speech.Synthesis.TtsEngine; namespace System.Speech.Internal.Synthesis { internal abstract class ITtsEngineProxy { internal ITtsEngineProxy(int lcid) { _alphabetConverter = new AlphabetConverter(lcid); } internal abstract IntPtr GetOutputFormat(IntPtr targetFormat); internal abstract void AddLexicon(Uri lexicon, string mediaType); internal abstract void RemoveLexicon(Uri lexicon); internal abstract void Speak(List<TextFragment> frags, byte[] wfx); internal abstract void ReleaseInterface(); internal abstract char[] ConvertPhonemes(char[] phones, AlphabetType alphabet); internal abstract AlphabetType EngineAlphabet { get; } internal AlphabetConverter AlphabetConverter { get { return _alphabetConverter; } } protected AlphabetConverter _alphabetConverter; } internal class TtsProxySsml : ITtsEngineProxy { #region Constructors internal TtsProxySsml(TtsEngineSsml ssmlEngine, ITtsEngineSite site, int lcid) : base(lcid) { _ssmlEngine = ssmlEngine; _site = site; } #endregion #region Internal Methods internal override IntPtr GetOutputFormat(IntPtr targetFormat) { return _ssmlEngine.GetOutputFormat(SpeakOutputFormat.WaveFormat, targetFormat); } internal override void AddLexicon(Uri lexicon, string mediaType) { _ssmlEngine.AddLexicon(lexicon, mediaType, _site); } internal override void RemoveLexicon(Uri lexicon) { _ssmlEngine.RemoveLexicon(lexicon, _site); } internal override void Speak(List<TextFragment> frags, byte[] wfx) { GCHandle gc = GCHandle.Alloc(wfx, GCHandleType.Pinned); try { IntPtr waveFormat = gc.AddrOfPinnedObject(); _ssmlEngine.Speak(frags.ToArray(), waveFormat, _site); } finally { gc.Free(); } } internal override char[] ConvertPhonemes(char[] phones, AlphabetType alphabet) { if (alphabet == AlphabetType.Ipa) { return phones; } else { return _alphabetConverter.SapiToIpa(phones); } } internal override AlphabetType EngineAlphabet { get { return AlphabetType.Ipa; } } /// <summary> /// Release the COM interface for COM object /// </summary> internal override void ReleaseInterface() { } #endregion #region private Fields private TtsEngineSsml _ssmlEngine; private ITtsEngineSite _site; #endregion } internal class TtsProxySapi : ITtsEngineProxy { #region Constructors internal TtsProxySapi(ITtsEngine sapiEngine, IntPtr iSite, int lcid) : base(lcid) { _iSite = iSite; _sapiEngine = sapiEngine; } #endregion #region Internal Methods internal override IntPtr GetOutputFormat(IntPtr preferedFormat) { // Initialize TTS Engine Guid formatId = SAPIGuids.SPDFID_WaveFormatEx; Guid guidNull = new(); IntPtr coMem = IntPtr.Zero; _sapiEngine.GetOutputFormat(ref formatId, preferedFormat, out guidNull, out coMem); return coMem; } internal override void AddLexicon(Uri lexicon, string mediaType) { // SAPI: Ignore } internal override void RemoveLexicon(Uri lexicon) { // SAPI: Ignore } internal override void Speak(List<TextFragment> frags, byte[] wfx) { GCHandle gc = GCHandle.Alloc(wfx, GCHandleType.Pinned); try { IntPtr waveFormat = gc.AddrOfPinnedObject(); GCHandle spvTextFragment = new(); if (ConvertTextFrag.ToSapi(frags, ref spvTextFragment)) { Guid formatId = SAPIGuids.SPDFID_WaveFormatEx; try { _sapiEngine.Speak( 0, ref formatId, waveFormat, spvTextFragment.AddrOfPinnedObject(), _iSite ); } finally { ConvertTextFrag.FreeTextSegment(ref spvTextFragment); } } } finally { gc.Free(); } } internal override AlphabetType EngineAlphabet { get { return AlphabetType.Sapi; } } internal override char[] ConvertPhonemes(char[] phones, AlphabetType alphabet) { if (alphabet == AlphabetType.Ipa) { return _alphabetConverter.IpaToSapi(phones); } else { return phones; } } /// <summary> /// Release the COM interface for COM object /// </summary> internal override void ReleaseInterface() { Marshal.ReleaseComObject(_sapiEngine); } #endregion #region private Fields private ITtsEngine _sapiEngine; // This variable is stored here but never created or deleted private IntPtr _iSite; #endregion } }
28.519048
99
0.548506
[ "MIT" ]
belav/runtime
src/libraries/System.Speech/src/Internal/Synthesis/TTSEngineProxy.cs
5,989
C#
// Instance generated by TankLibHelper.InstanceBuilder // ReSharper disable All namespace TankLib.STU.Types { [STUAttribute(0xF34A7244, "STUAnimNode_BlendPartition")] public class STUAnimNode_BlendPartition : STUAnimNode_Base { [STUFieldAttribute(0x57C51236, ReaderType = typeof(InlineInstanceFieldReader))] public STUAnimBlendDriverParam m_57C51236; [STUFieldAttribute(0xEDDE8B55, ReaderType = typeof(InlineInstanceFieldReader))] public STU_3426C7F2 m_EDDE8B55; [STUFieldAttribute(0xA1946787, ReaderType = typeof(InlineInstanceFieldReader))] public STUAnimBlendTimeParams m_A1946787; [STUFieldAttribute(0xD61E9A22, ReaderType = typeof(InlineInstanceFieldReader))] public STU_CCC326B7 m_D61E9A22; [STUFieldAttribute(0x98B05B42, ReaderType = typeof(InlineInstanceFieldReader))] public STU_CCC326B7 m_98B05B42; [STUFieldAttribute(0x226537CB, ReaderType = typeof(InlineInstanceFieldReader))] public STU_ABD8FE73 m_226537CB; [STUFieldAttribute(0x1B74A4CB, ReaderType = typeof(InlineInstanceFieldReader))] public STU_15EF3A7E m_1B74A4CB; [STUFieldAttribute(0x3C82DF27, ReaderType = typeof(EmbeddedInstanceFieldReader))] public STU_629D3B64[] m_3C82DF27; [STUFieldAttribute(0x78E7248F, ReaderType = typeof(InlineInstanceFieldReader))] public STUAnimNode_BlendPartition_ExtraPartitionBoneItem[] m_78E7248F; [STUFieldAttribute(0x826E408F, ReaderType = typeof(EmbeddedInstanceFieldReader))] public STU_2F6BD485 m_826E408F; [STUFieldAttribute(0x04FE49C9, ReaderType = typeof(EmbeddedInstanceFieldReader))] public STU_8C127DE2 m_04FE49C9; [STUFieldAttribute(0x0857723F, ReaderType = typeof(EmbeddedInstanceFieldReader))] public STU_5861C542 m_0857723F; [STUFieldAttribute(0xCA1600A0, ReaderType = typeof(EmbeddedInstanceFieldReader))] public STU_5861C542 m_CA1600A0; [STUFieldAttribute(0xBA663469)] public byte m_BA663469; } }
41.32
89
0.752178
[ "MIT" ]
Mike111177/OWLib
TankLib/STU/Types/STUAnimNode_BlendPartition.cs
2,066
C#
using System.Collections.Generic; namespace Sitecore.Trekroner.Proxy { public class ProxyConfiguration { public static readonly string Key = "Proxy"; public string DefaultDomain { get; set; } public IDictionary<string,ServiceConfiguration> Services { get; set; } } }
23.538462
78
0.689542
[ "MIT" ]
Sitecore/Trekroner
src/Sitecore.Trekoner/Proxy/ProxyConfiguration.cs
308
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.ContainerService.Inputs { /// <summary> /// SSH configuration for Linux-based VMs running on Azure. /// </summary> public sealed class ContainerServiceSshConfigurationArgs : Pulumi.ResourceArgs { [Input("publicKeys", required: true)] private InputList<Inputs.ContainerServiceSshPublicKeyArgs>? _publicKeys; /// <summary> /// The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. /// </summary> public InputList<Inputs.ContainerServiceSshPublicKeyArgs> PublicKeys { get => _publicKeys ?? (_publicKeys = new InputList<Inputs.ContainerServiceSshPublicKeyArgs>()); set => _publicKeys = value; } public ContainerServiceSshConfigurationArgs() { } } }
33.142857
113
0.681897
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/ContainerService/Inputs/ContainerServiceSshConfigurationArgs.cs
1,160
C#
using Neo.IO.Json; using Neo.VM.Types; namespace Neo.SmartContract { partial class ApplicationEngine { public static readonly InteropDescriptor System_Json_Serialize = Register("System.Json.Serialize", nameof(JsonSerialize), 0_00100000, CallFlags.None, true); public static readonly InteropDescriptor System_Json_Deserialize = Register("System.Json.Deserialize", nameof(JsonDeserialize), 0_00500000, CallFlags.None, true); internal byte[] JsonSerialize(StackItem item) { return JsonSerializer.SerializeToByteArray(item, MaxItemSize); } internal StackItem JsonDeserialize(byte[] json) { return JsonSerializer.Deserialize(JObject.Parse(json, 10), ReferenceCounter); } } }
35.136364
170
0.71022
[ "MIT" ]
cloud8little/neo
src/neo/SmartContract/ApplicationEngine.Json.cs
773
C#
using System; namespace MusicApp.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
17.25
70
0.661836
[ "MIT" ]
CaptainUltra/IT-Career-Course
Year 2/Module 7 - Software Development/Apps/MusicApp/MusicApp/Models/ErrorViewModel.cs
207
C#
using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Diagnostics; using log4net; using System.Reflection; namespace GSharpTools { public enum Presence { Optional = 0, Required } public enum InputArgType { Flag = 0, Parameter, ExistingDirectory, RemainingParameters, StringList, Enum, SizeInBytes } public class InputArgs { private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); internal class InputArg { public readonly InputArgType Type; public readonly string Name; public readonly Presence Presence; public readonly string HelpString; public bool HasBeenSeen; public object Value; internal InputArg(InputArgType type, string name, object defaultValue, Presence presence, string helpString) { HasBeenSeen = false; Type = type; Name = name; Value = defaultValue; Presence = presence; HelpString = helpString; HasBeenSeen = false; } } private List<InputArg> Options = new List<InputArg>(); private string Caption; private string AppName; private StringComparison SCType; private ProcessArg CurrentArgMethod; private InputArg ExpectedArg; private InputArg RemainingArgs; public InputArgs(string appName, string caption) { AppName = appName; Caption = caption; SCType = StringComparison.OrdinalIgnoreCase; } public void Add(InputArgType type, string name, object defaultvalue, Presence presence, string helpString) { Options.Add(new InputArg(type, name, defaultvalue, presence, helpString)); } public bool Process(string[] args) { Console.WriteLine("{0} - {1}\r\n", AppName, Caption); RemainingArgs = ExpectRemainingParameters(); CurrentArgMethod = DefaultProcessFunc; ExpectedArg = null; foreach (string arg in args) { if (!CurrentArgMethod(arg)) return false; } if (!AreAllRequiredArgumentsPresent()) return false; return true; } private delegate bool ProcessArg(string arg); private bool MatchesOption(string arg, InputArg option) { return option.Name.Equals(arg, SCType); } private bool HandleRemainingParameters(string arg) { if (RemainingArgs != null) { RemainingArgs.HasBeenSeen = true; if (RemainingArgs.Value == null) { RemainingArgs.Value = new List<string>(); } (RemainingArgs.Value as List<string>).Add(arg); } return true; } private bool DefaultProcessFunc(string arg) { if (arg.StartsWith("/")) { arg = arg.Substring(1); } else if (arg.StartsWith("--")) { arg = arg.Substring(2); } else if (RemainingArgs != null) { return HandleRemainingParameters(arg); } if( arg.Equals("?") || arg.Equals("help", SCType) ) return Help(); foreach (InputArg option in Options) { if (MatchesOption(arg, option)) { return OnProcessOption(option, arg); } } Console.WriteLine("Error, argument '{0}' is invalid.", arg); return false; } private bool ExpectParameter(string arg) { ExpectedArg.Value = arg; ExpectedArg.HasBeenSeen = true; CurrentArgMethod = DefaultProcessFunc; return true; } private bool ExpectStringList(string arg) { List<string> items = new List<string>(); foreach (string s in arg.Split(';')) { items.Add(s); } ExpectedArg.Value = items; ExpectedArg.HasBeenSeen = true; CurrentArgMethod = DefaultProcessFunc; return true; } private bool ExpectNewDirectory(string arg) { ExpectedArg.Value = arg; ExpectedArg.HasBeenSeen = true; /* See https://github.com/zippy1981/GTools/commit/e29b375d14ceb24a0f1ce9039fb33ebc63beba43: + * If you use double quotes on a command line argument and end in a \ the string gets passed as + * ending in ". e.g if you issue the command [pathed /add "c:\program files\foo\"], the last + * argument gets passed as [c:\program files\foo"]. This is because windows tries to be forgiving + * about spaces, but the '\' escapes a double quote. + */ if (arg.EndsWith("\"")) arg = arg.Remove(arg.LastIndexOf('"')); // Its just a waste of a character in your path. if (arg.EndsWith("\\")) arg = arg.Remove(arg.LastIndexOf('\\')); if (!Directory.Exists(arg)) { Console.WriteLine("ERROR, argument {0} must specify an existing directory, '{1}' does not exist.", ExpectedArg.Name, arg); return false; } CurrentArgMethod = DefaultProcessFunc; return true; } private bool ExpectSizeInBytes(string arg) { decimal sizeAsDecimal = 0.0m; string digits = "0123456789"; bool recording_fraction = false; decimal fraction_divisor = 0.0m; bool expectByte = false; for (int i = 0; i < arg.Length; ++i) { char c = arg[i]; int digit = digits.IndexOf(c); if (expectByte) { if ((c == 'b') || (c == 'B')) { expectByte = true; } else { Console.WriteLine("ERROR, '{0}' is not a valid size indicator", arg); return false; } } else if (digit >= 0) { if (recording_fraction) { sizeAsDecimal += ((decimal)digit) / fraction_divisor; fraction_divisor *= 10.0m; } sizeAsDecimal *= 10.0m; sizeAsDecimal += digit; } else if( c == '.' ) { recording_fraction = true; fraction_divisor = 10.0m; } else if ((c == 'k') || (c == 'K')) { sizeAsDecimal *= 1024; expectByte = true; } else if ((c == 'm') || (c == 'm')) { sizeAsDecimal *= 1024 * 1024; expectByte = true; } else if ((c == 'g') || (c == 'g')) { sizeAsDecimal *= 1024 * 1024 * 1024; expectByte = true; } else if (c != ' ') { Console.WriteLine("ERROR, '{0}' is not a valid size indicator", arg); return false; } } long sizeInBytes = (long)sizeAsDecimal; ExpectedArg.Value = sizeInBytes; ExpectedArg.HasBeenSeen = true; CurrentArgMethod = DefaultProcessFunc; return true; } internal virtual bool OnProcessOption(InputArg option, string arg) { switch (option.Type) { case InputArgType.ExistingDirectory: ExpectedArg = option; CurrentArgMethod = ExpectNewDirectory; return true; case InputArgType.SizeInBytes: ExpectedArg = option; CurrentArgMethod = ExpectSizeInBytes; return true; case InputArgType.Parameter: ExpectedArg = option; CurrentArgMethod = ExpectParameter; return true; case InputArgType.StringList: ExpectedArg = option; CurrentArgMethod = ExpectStringList; return true; case InputArgType.Flag: option.Value = true; option.HasBeenSeen = true; CurrentArgMethod = DefaultProcessFunc; return true; default: Console.WriteLine("Error, argument type {0} not implemented yet.", option.Type); return false; } } private bool AreAllRequiredArgumentsPresent() { bool success = true; foreach (InputArg arg in Options) { if ((Presence.Required == arg.Presence) && !arg.HasBeenSeen) { Console.WriteLine("Error, required argument {0} missing.", arg.Name); success = false; } } return success; } private InputArg ExpectRemainingParameters() { foreach (InputArg arg in Options) { if (arg.Type == InputArgType.RemainingParameters) { return arg; } } return null; } private bool Help() { InputArg remainingParameters = ExpectRemainingParameters(); if( remainingParameters == null ) Console.WriteLine("USAGE: {0}.EXE [OPTIONS]", AppName); else Console.WriteLine("USAGE: {0}.EXE [OPTIONS] {1}.", AppName, remainingParameters.Name); Console.WriteLine("OPTIONS:"); foreach (InputArg arg in Options) { if( arg != remainingParameters ) Console.WriteLine("{0,14}: {1}", "/" + arg.Name.ToUpper(), string.Format(arg.HelpString, arg.Value)); } if( remainingParameters != null ) Console.WriteLine("{0,14}: {1}", remainingParameters.Name, remainingParameters.HelpString); return false; } private InputArg GetOptionByName(string argName) { foreach (InputArg option in Options) { if (MatchesOption(argName, option)) { return option; } } throw new KeyNotFoundException(string.Format("Argument '{0}' is undefined", argName)); } public object GetValue(string argName) { return GetOptionByName(argName).Value; } public string GetString(string argName) { return (string) GetValue(argName); } public bool GetFlag(string argName) { return (bool)GetValue(argName); } public long GetSizeInBytes(string argName) { object result = GetValue(argName); if( result is int ) return (long)(int)result; return (long)result; } public List<string> FindOrCreateStringList(string argName) { InputArg option = GetOptionByName(argName); if (option.Value == null) option.Value = new List<string>(); return (List<string>)option.Value; } public List<string> GetStringList(string argName) { object temp = GetValue(argName); if( temp is List<string> ) return temp as List<string>; if( temp is string ) { List<string> result = new List<string>(); result.Add(temp as string); return result; } return null; } } }
32.543424
139
0.465498
[ "BSD-2-Clause" ]
jwg4/gtools
GSharpTools/InputArgs.cs
13,117
C#
#region License // Copyright (c) 2011, ClearCanvas Inc. // All rights reserved. // http://www.clearcanvas.ca // // This software is licensed under the Open Software License v3.0. // For the complete license, see http://www.clearcanvas.ca/OSLv3.0 #endregion using System; using System.Collections.Generic; using System.Text; namespace ClearCanvas.Enterprise.Core.Modelling { /// <summary> /// When applied to a property of a domain object class, indicates that the property is /// required to have a value (e.g. must not be null). /// </summary> [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] public class RequiredAttribute : Attribute { public RequiredAttribute() { } } }
26.666667
92
0.6675
[ "Apache-2.0" ]
SNBnani/Xian
Enterprise/Core/Modelling/RequiredAttribute.cs
800
C#
using System; using System.Windows.Forms; using JetBrains.Annotations; using LVK.Logging; namespace WinFormsSandbox { public partial class MainForm : Form { [NotNull] private readonly ILogger _Logger; public MainForm([NotNull] ILogger logger) { _Logger = logger ?? throw new ArgumentNullException(nameof(logger)); InitializeComponent(); } private void Button1_Click(Object sender, EventArgs e) { _Logger.LogInformation("Test"); } } }
20.444444
80
0.619565
[ "MIT" ]
FeatureToggleStudy/LVK
WinFormsSandbox/MainForm.cs
554
C#
// // PlayerController.cs // MB2D Engine // // --------------------------------------------------- // // Create by Jacob Milligan on 12/09/2016. // Copyright (c) Jacob Milligan 2016. All rights reserved. // using Microsoft.Xna.Framework.Input; using MB2D.IO; namespace MB2D.EntityComponent { /// <summary> /// Declares the attached entity as able to control utility /// commands such as opening the debug console /// </summary> public class UtilityController : IComponent { /// <summary> /// The input map for the controller. /// </summary> private InputMap _inputMap; /// <summary> /// Initializes a new instance of the <see cref="T:MidnightBlue.UtilityController"/> component /// with default input assignment /// </summary> public UtilityController() { _inputMap = new InputMap(); _inputMap.Assign<ConsoleCommand>(Keys.OemTilde, CommandType.Trigger); } /// <summary> /// Gets the input map. /// </summary> /// <value>The input map.</value> public InputMap InputMap { get { return _inputMap; } } } }
22.734694
98
0.609515
[ "Unlicense", "MIT" ]
jacobmilligan/MB2D
src/EntityComponent/Components/UtilityController.cs
1,114
C#
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using HotChocolate.Execution.Properties; using HotChocolate.Language; using HotChocolate.Resolvers; using HotChocolate.Types; using Microsoft.Extensions.DependencyInjection; namespace HotChocolate.Execution.Processing { internal partial class MiddlewareContext { private IOperationContext _operationContext = default!; private IServiceProvider _services = default!; private InputParser _parser = default!; private object? _resolverResult; private bool _hasResolverResult; public IServiceProvider Services { get => _services; set { if (value is null!) { throw new ArgumentNullException(nameof(value)); } _services = value; } } public ISchema Schema => _operationContext.Schema; public IObjectType RootType => _operationContext.Operation.RootType; public DocumentNode Document => _operationContext.Operation.Document; public OperationDefinitionNode Operation => _operationContext.Operation.Definition; public IDictionary<string, object?> ContextData => _operationContext.ContextData; public IVariableValueCollection Variables => _operationContext.Variables; public CancellationToken RequestAborted { get; private set; } public IReadOnlyList<IFieldSelection> GetSelections( ObjectType typeContext, SelectionSetNode? selectionSet = null, bool allowInternals = false) { if (typeContext is null) { throw new ArgumentNullException(nameof(typeContext)); } selectionSet ??= _selection.SelectionSet; if (selectionSet is null) { return Array.Empty<IFieldSelection>(); } ISelectionSet fields = _operationContext.CollectFields(selectionSet, typeContext); if (fields.IsConditional) { var finalFields = new List<IFieldSelection>(); for (var i = 0; i < fields.Selections.Count; i++) { ISelection selection = fields.Selections[i]; if (selection.IsIncluded(_operationContext.Variables, allowInternals)) { finalFields.Add(selection); } } return finalFields; } return fields.Selections; } public void ReportError(string errorMessage) { if (string.IsNullOrEmpty(errorMessage)) { throw new ArgumentException( Resources.MiddlewareContext_ReportErrorCannotBeNull, nameof(errorMessage)); } ReportError(ErrorBuilder.New() .SetMessage(errorMessage) .SetPath(Path) .AddLocation(_selection.SyntaxNode) .Build()); } public void ReportError(Exception exception, Action<IErrorBuilder>? configure = null) { if (exception is null) { throw new ArgumentNullException(nameof(exception)); } if (exception is GraphQLException graphQLException) { foreach (IError error in graphQLException.Errors) { ReportError(error); } } else if (exception is AggregateException aggregateException) { foreach (Exception innerException in aggregateException.InnerExceptions) { ReportError(innerException); } } else { IErrorBuilder errorBuilder = _operationContext.ErrorHandler .CreateUnexpectedError(exception) .SetPath(Path) .AddLocation(_selection.SyntaxNode); configure?.Invoke(errorBuilder); ReportError(errorBuilder.Build()); } } public void ReportError(IError error) { if (error is null) { throw new ArgumentNullException(nameof(error)); } if (error is AggregateError aggregateError) { foreach (var innerError in aggregateError.Errors) { ReportSingle(innerError); } } else { ReportSingle(error); } void ReportSingle(IError singleError) { AddProcessedError(_operationContext.ErrorHandler.Handle(singleError)); HasErrors = true; } void AddProcessedError(IError processed) { if (processed is AggregateError ar) { foreach (var ie in ar.Errors) { _operationContext.Result.AddError(ie, _selection.SyntaxNode); _operationContext.DiagnosticEvents.ResolverError(this, ie); } } else { _operationContext.Result.AddError(processed, _selection.SyntaxNode); _operationContext.DiagnosticEvents.ResolverError(this, processed); } } } public async ValueTask<T> ResolveAsync<T>() { if (!_hasResolverResult) { _resolverResult = Field.Resolver is null ? null : await Field.Resolver(this).ConfigureAwait(false); _hasResolverResult = true; } return _resolverResult is null ? default! : (T)_resolverResult; } public T Resolver<T>() => _operationContext.Activator.GetOrCreate<T>(_operationContext.Services); public T Service<T>() => Services.GetRequiredService<T>(); public object Service(Type service) { if (service is null) { throw new ArgumentNullException(nameof(service)); } return Services.GetRequiredService(service); } public void RegisterForCleanup(Action action) => _operationContext.RegisterForCleanup(action); public T GetQueryRoot<T>() => _operationContext.GetQueryRoot<T>(); } }
31.418605
93
0.540192
[ "MIT" ]
BlacKCaT27/hotchocolate
src/HotChocolate/Core/src/Execution/Processing/MiddlewareContext.Global.cs
6,755
C#
// // The Open Toolkit Library License // // Copyright (c) 2006 - 2009 the Open Toolkit library. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Collections.Generic; using System.Text; namespace OpenTK { #if NO_SYSDRAWING /// <summary> /// Represents a rectangular region on a two-dimensional plane. /// </summary> public struct Rectangle : IEquatable<Rectangle> { Point location; Size size; /// <summary> /// Constructs a new Rectangle instance. /// </summary> /// <param name="location">The top-left corner of the Rectangle.</param> /// <param name="size">The width and height of the Rectangle.</param> public Rectangle(Point location, Size size) : this() { Location = location; Size = size; } /// <summary> /// Constructs a new Rectangle instance. /// </summary> /// <param name="x">The x coordinate of the Rectangle.</param> /// <param name="y">The y coordinate of the Rectangle.</param> /// <param name="width">The width coordinate of the Rectangle.</param> /// <param name="height">The height coordinate of the Rectangle.</param> public Rectangle(int x, int y, int width, int height) : this(new Point(x, y), new Size(width, height)) { } /// <summary> /// Gets or sets the x coordinate of the Rectangle. /// </summary> public int X { get { return Location.X; } set { Location = new Point (value, Y); } } /// <summary> /// Gets or sets the y coordinate of the Rectangle. /// </summary> public int Y { get { return Location.Y; } set { Location = new Point (X, value); } } /// <summary> /// Gets or sets the width of the Rectangle. /// </summary> public int Width { get { return Size.Width; } set { Size = new Size (value, Height); } } /// <summary> /// Gets or sets the height of the Rectangle. /// </summary> public int Height { get { return Size.Height; } set { Size = new Size(Width, value); } } /// <summary> /// Gets or sets a <see cref="Point"/> representing the x and y coordinates /// of the Rectangle. /// </summary> public Point Location { get { return location; } set { location = value; } } /// <summary> /// Gets or sets a <see cref="Size"/> representing the width and height /// of the Rectangle. /// </summary> public Size Size { get { return size; } set { size = value; } } /// <summary> /// Gets the y coordinate of the top edge of this Rectangle. /// </summary> public int Top { get { return Y; } } /// <summary> /// Gets the x coordinate of the right edge of this Rectangle. /// </summary> public int Right { get { return X + Width; } } /// <summary> /// Gets the y coordinate of the bottom edge of this Rectangle. /// </summary> public int Bottom { get { return Y + Height; } } /// <summary> /// Gets the x coordinate of the left edge of this Rectangle. /// </summary> public int Left { get { return X; } } /// <summary> /// Gets a <see cref="System.Boolean"/> that indicates whether this /// Rectangle is equal to the empty Rectangle. /// </summary> public bool IsEmpty { get { return Location.IsEmpty && Size.IsEmpty; } } /// <summary> /// Defines the empty Rectangle. /// </summary> public static readonly Rectangle Zero = new Rectangle(); /// <summary> /// Defines the empty Rectangle. /// </summary> public static readonly Rectangle Empty = new Rectangle(); /// <summary> /// Constructs a new instance with the specified edges. /// </summary> /// <param name="left">The left edge of the Rectangle.</param> /// <param name="top">The top edge of the Rectangle.</param> /// <param name="right">The right edge of the Rectangle.</param> /// <param name="bottom">The bottom edge of the Rectangle.</param> /// <returns>A new Rectangle instance with the specified edges.</returns> public static Rectangle FromLTRB(int left, int top, int right, int bottom) { return new Rectangle(new Point(left, top), new Size(right - left, bottom - top)); } /// <summary> /// Tests whether this instance contains the specified Point. /// </summary> /// <param name="point">The <see cref="Point"/> to test.</param> /// <returns>True if this instance contains point; false otherwise.</returns> /// <remarks>The left and top edges are inclusive. The right and bottom edges /// are exclusive.</remarks> public bool Contains(Point point) { return point.X >= Left && point.X < Right && point.Y >= Top && point.Y < Bottom; } /// <summary> /// Tests whether this instance contains the specified Rectangle. /// </summary> /// <param name="rect">The <see cref="Rectangle"/> to test.</param> /// <returns>True if this instance contains rect; false otherwise.</returns> /// <remarks>The left and top edges are inclusive. The right and bottom edges /// are exclusive.</remarks> public bool Contains(Rectangle rect) { return Contains(rect.Location) && Contains(rect.Location + rect.Size); } /// <summary> /// Compares two instances for equality. /// </summary> /// <param name="left">The first instance.</param> /// <param name="right">The second instance.</param> /// <returns>True, if left is equal to right; false otherwise.</returns> public static bool operator ==(Rectangle left, Rectangle right) { return left.Equals(right); } /// <summary> /// Compares two instances for inequality. /// </summary> /// <param name="left">The first instance.</param> /// <param name="right">The second instance.</param> /// <returns>True, if left is not equal to right; false otherwise.</returns> public static bool operator !=(Rectangle left, Rectangle right) { return !left.Equals(right); } /// <summary> /// Converts an OpenTK.Rectangle instance to a LayoutFarm.Drawing.Rectangle. /// </summary> /// <param name="rect"> /// The <see cref="Rectangle"/> instance to convert. /// </param> /// <returns> /// A <see cref="LayoutFarm.Drawing.Rectangle"/> instance equivalent to rect. /// </returns> public static implicit operator LayoutFarm.Drawing.Rectangle(Rectangle rect) { return new LayoutFarm.Drawing.Rectangle(rect.Location, rect.Size); } /// <summary> /// Converts a LayoutFarm.Drawing.Rectangle instance to an OpenTK.Rectangle. /// </summary> /// <param name="rect"> /// The <see cref="LayoutFarm.Drawing.Rectangle"/> instance to convert. /// </param> /// <returns> /// A <see cref="Rectangle"/> instance equivalent to point. /// </returns> public static implicit operator Rectangle(LayoutFarm.Drawing.Rectangle rect) { return new Rectangle(rect.Location, rect.Size); } /// <summary> /// Converts an OpenTK.Rectangle instance to a LayoutFarm.Drawing.RectangleF. /// </summary> /// <param name="rect"> /// The <see cref="Rectangle"/> instance to convert. /// </param> /// <returns> /// A <see cref="LayoutFarm.Drawing.RectangleF"/> instance equivalent to rect. /// </returns> public static implicit operator LayoutFarm.Drawing.RectangleF(Rectangle rect) { return new LayoutFarm.Drawing.RectangleF(rect.Location, rect.Size); } /// <summary> /// Indicates whether this instance is equal to the specified object. /// </summary> /// <param name="obj">The object instance to compare to.</param> /// <returns>True, if both instances are equal; false otherwise.</returns> public override bool Equals(object obj) { if (obj is Rectangle) return Equals((Rectangle)obj); return false; } /// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A <see cref="System.Int32"/> that represents the hash code for this instance./></returns> public override int GetHashCode() { return Location.GetHashCode() & Size.GetHashCode(); } /// <summary> /// Returns a <see cref="System.String"/> that describes this instance. /// </summary> /// <returns>A <see cref="System.String"/> that describes this instance.</returns> public override string ToString() { return String.Format("{{{0}-{1}}}", Location, Location + Size); } /// <summary> /// Indicates whether this instance is equal to the specified Rectangle. /// </summary> /// <param name="other">The instance to compare to.</param> /// <returns>True, if both instances are equal; false otherwise.</returns> public bool Equals(Rectangle other) { return Location.Equals(other.Location) && Size.Equals(other.Size); } } #endif }
35.57508
110
0.569286
[ "MIT" ]
PaintLab/PixelFarm.External
src/BackEnd.MiniOpenTK_OLD/BackEnd.MiniOpenTK/OpenTK/Math/Rectangle.cs
11,135
C#
using UnityEngine; namespace Plugins.GameService.Tools.AsyncAwaitUtil.Source.Internal { public class AsyncCoroutineRunner : MonoBehaviour { static AsyncCoroutineRunner _instance; public static AsyncCoroutineRunner Instance { get { if (_instance == null) { _instance = new GameObject("AsyncCoroutineRunner") .AddComponent<AsyncCoroutineRunner>(); } return _instance; } } void Awake() { // Don't show in scene hierarchy gameObject.hideFlags = HideFlags.HideAndDontSave; DontDestroyOnLoad(gameObject); } } }
23.6875
70
0.534301
[ "Apache-2.0" ]
AR-Ghodrati/DoooZ
Assets/Plugins/GameService/Tools/AsyncAwaitUtil/Source/Internal/AsyncCoroutineRunner.cs
758
C#
using System.Collections.Generic; using Essensoft.Paylink.Alipay.Response; namespace Essensoft.Paylink.Alipay.Request { /// <summary> /// alipay.ebpp.recharge.trade.detect /// </summary> public class AlipayEbppRechargeTradeDetectRequest : IAlipayRequest<AlipayEbppRechargeTradeDetectResponse> { /// <summary> /// 校验支付宝绑定手机号是否有充值记录 /// </summary> public string BizContent { get; set; } #region IAlipayRequest Members private bool needEncrypt = false; private string apiVersion = "1.0"; private string terminalType; private string terminalInfo; private string prodCode; private string notifyUrl; private string returnUrl; private AlipayObject bizModel; public void SetNeedEncrypt(bool needEncrypt) { this.needEncrypt = needEncrypt; } public bool GetNeedEncrypt() { return needEncrypt; } public void SetNotifyUrl(string notifyUrl) { this.notifyUrl = notifyUrl; } public string GetNotifyUrl() { return notifyUrl; } public void SetReturnUrl(string returnUrl) { this.returnUrl = returnUrl; } public string GetReturnUrl() { return returnUrl; } public void SetTerminalType(string terminalType) { this.terminalType = terminalType; } public string GetTerminalType() { return terminalType; } public void SetTerminalInfo(string terminalInfo) { this.terminalInfo = terminalInfo; } public string GetTerminalInfo() { return terminalInfo; } public void SetProdCode(string prodCode) { this.prodCode = prodCode; } public string GetProdCode() { return prodCode; } public string GetApiName() { return "alipay.ebpp.recharge.trade.detect"; } public void SetApiVersion(string apiVersion) { this.apiVersion = apiVersion; } public string GetApiVersion() { return apiVersion; } public IDictionary<string, string> GetParameters() { var parameters = new AlipayDictionary { { "biz_content", BizContent } }; return parameters; } public AlipayObject GetBizModel() { return bizModel; } public void SetBizModel(AlipayObject bizModel) { this.bizModel = bizModel; } #endregion } }
22.620968
109
0.546881
[ "MIT" ]
fory77/paylink
src/Essensoft.Paylink.Alipay/Request/AlipayEbppRechargeTradeDetectRequest.cs
2,841
C#
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Collections.Generic; using Newtonsoft.Json; using QuantConnect.Brokerages.Binance.Messages; using QuantConnect.Securities; using Order = QuantConnect.Orders.Order; namespace QuantConnect.Brokerages.Binance { /// <summary> /// Binance REST API implementation /// </summary> public class BinanceCrossMarginRestApiClient : BinanceBaseRestApiClient { private const string _apiPrefix = "/sapi/v1/margin"; private const string _wsPrefix = "/sapi/v1"; public BinanceCrossMarginRestApiClient( SymbolPropertiesDatabaseSymbolMapper symbolMapper, ISecurityProvider securityProvider, string apiKey, string apiSecret, string restApiUrl ) : base(symbolMapper, securityProvider, apiKey, apiSecret, restApiUrl, _apiPrefix, _wsPrefix) { } protected override JsonConverter CreateAccountConverter() => new MarginAccountConverter(); protected override IDictionary<string, object> CreateOrderBody(Order order) { var body = base.CreateOrderBody(order); body["isisolated"] = "FALSE"; body["sideEffectType"] = "MARGIN_BUY"; return body; } } }
35.410714
104
0.693394
[ "Apache-2.0" ]
PaulFanen/Lean
Brokerages/Binance/BinanceCrossMarginRestApiClient.cs
1,983
C#
using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using SharpLearning.Examples.Properties; using SharpLearning.FeatureTransformations.MatrixTransforms; using SharpLearning.InputOutput.Csv; using SharpLearning.InputOutput.Serialization; using SharpLearning.Neural; using SharpLearning.Neural.Layers; using SharpLearning.Neural.Learners; using SharpLearning.Neural.Loss; namespace SharpLearning.Examples.FeatureTransformations { [TestClass] public class FeatureNormalizationExample { [TestMethod] public void FeatureNormalization_Normalize() { // Use StreamReader(filepath) when running from filesystem var parser = new CsvParser(() => new StringReader(Resources.winequality_white)); var targetName = "quality"; // read feature matrix (all columns different from the targetName) var observations = parser.EnumerateRows(c => c != targetName) .ToF64Matrix(); // create minmax normalizer (normalizes each feature from 0.0 to 1.0) var minMaxTransformer = new MinMaxTransformer(0.0, 1.0); // transforms features using the feature normalization transform minMaxTransformer.Transform(observations, observations); // read targets var targets = parser.EnumerateRows(targetName) .ToF64Vector(); // Create neural net. var net = new NeuralNet(); net.Add(new InputLayer(observations.ColumnCount)); net.Add(new SquaredErrorRegressionLayer()); // Create regression learner. var learner = new RegressionNeuralNetLearner(net, new SquareLoss()); // learns a neural net regression model. var model = learner.Learn(observations, targets); // serializer for saving the MinMaxTransformer var serializer = new GenericXmlDataContractSerializer(); // Serialize transform for use with the model. // Replace this with StreamWriter for use with file system. var data = new StringBuilder(); var writer = new StringWriter(data); serializer.Serialize(minMaxTransformer, () => writer); // Deserialize transform for use with the model. // Replace this with StreamReader for use with file system. var reader = new StringReader(data.ToString()); var deserializedMinMaxTransform = serializer.Deserialize<MinMaxTransformer>(() => reader); // Normalize observation and predict using the model. var normalizedObservation = deserializedMinMaxTransform.Transform(observations.Row(0)); var prediction = model.Predict(normalizedObservation); Trace.WriteLine($"Prediction: {prediction}"); } } }
39.675676
102
0.667234
[ "MIT" ]
mdabros/SharpLearning.Examples
src/SharpLearning.Examples/FeatureTransformations/FeatureNormalizationExample.cs
2,938
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("SnipeSharp.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SnipeSharp.Tests")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("012a8e24-aa43-47d1-9a5d-7f38f59da537")] // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
30.095238
56
0.754747
[ "MIT" ]
ReticentRobot/SnipeSharp
SnipeSharp.Tests/Properties/AssemblyInfo.cs
633
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the honeycode-2020-03-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.Honeycode.Model { /// <summary> /// An object that contains the options specified by the sumitter of the import request. /// </summary> public partial class ImportOptions { private DelimitedTextImportOptions _delimitedTextOptions; private DestinationOptions _destinationOptions; /// <summary> /// Gets and sets the property DelimitedTextOptions. /// <para> /// Options relating to parsing delimited text. Required if dataFormat is DELIMITED_TEXT. /// </para> /// </summary> public DelimitedTextImportOptions DelimitedTextOptions { get { return this._delimitedTextOptions; } set { this._delimitedTextOptions = value; } } // Check to see if DelimitedTextOptions property is set internal bool IsSetDelimitedTextOptions() { return this._delimitedTextOptions != null; } /// <summary> /// Gets and sets the property DestinationOptions. /// <para> /// Options relating to the destination of the import request. /// </para> /// </summary> public DestinationOptions DestinationOptions { get { return this._destinationOptions; } set { this._destinationOptions = value; } } // Check to see if DestinationOptions property is set internal bool IsSetDestinationOptions() { return this._destinationOptions != null; } } }
32.986842
108
0.638213
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/Honeycode/Generated/Model/ImportOptions.cs
2,507
C#
////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Arrays.cs // This is a helper class offering generic functionality to builtin Arrays. // // MeshKit For Unity, Created By Melli Georgiou // © 2018 Hell Tap Entertainment LTD // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// using System; using System.Collections; using System.Collections.Generic; using UnityEngine; // Using the HellTap namespace namespace HellTap.MeshKit { public static class Arrays { // ================================================================================================================== // ADD ITEM // Adds another item to an Array[] // ================================================================================================================== public static bool AddItem<T>(ref T[] _arr, T item ){ // Make sure the array is valid if( _arr != null ){ Array.Resize(ref _arr, _arr.Length + 1); _arr[_arr.Length - 1] = item; return true; // Show an error message if no array was sent } else { Debug.LogWarning("ARRAYS - AddItem(): Array cannot be null. Skipping."); } // Return false if we couldn't add the item return false; } // Same as the above version but without any checks public static void AddItemFastest<T>( ref T[] _arr, T item ){ Array.Resize(ref _arr, _arr.Length + 1); _arr[_arr.Length - 1] = item; } // ================================================================================================================== // ADD ITEM IF NOT PRESENT // Adds another item to an Array[] as long as it doesn't already exist // ================================================================================================================== public static bool AddItemIfNotPresent<T>(ref T[] _arr, T item){ // Make sure the array is valid if( _arr != null ){ // Make sure the item doesn't already exist in the array if( ItemExistsAtIndex( ref _arr, ref item ) == -1 ){ Array.Resize(ref _arr, _arr.Length + 1); _arr[_arr.Length - 1] = item; return true; } // Show an error message if no array was sent } else if( _arr == null ){ Debug.LogWarning("ARRAYS - AddItemIfNotPresent(): Array cannot be null. Skipping."); } // Return false if we couldn't add the item return false; } // ================================================================================================================== // REMOVE ITEM // Removes a single or all items from an Array[] // To only remove the first found instance of an item, set onlyRemoveFirstInstance to TRUE. // ================================================================================================================== // Remove Item from Array public static bool RemoveItem<T>(ref T[] _arr, ref T item, bool onlyRemoveFirstInstance = false ){ // Make sure the array is valid if( _arr != null ){ // Track if we removed any items bool anItemWasRemoved = false; // While the array still has that item in one of its slots ... while( Arrays.ItemExistsAtIndex( ref _arr, ref item) != -1 ){ // Cache the Index of the item int id = Arrays.ItemExistsAtIndex( ref _arr, ref item); // Create a new array 1 item less than the current size T[] newArray = new T[ _arr.Length-1 ]; // Loop through the old array and copy every item except the cached ID for( int i = 0; i<newArray.Length; i++ ){ if(i<id){ newArray[i] = _arr[i]; } else if( _arr.Length > 1 ){ newArray[i] = _arr[i+1]; } } // Update the main array _arr = newArray; // Track that an item was removed anItemWasRemoved = true; // If we should only remove the first instance, end it after the first item is removed ... if( onlyRemoveFirstInstance ){ return true; } } // If we did remove an item, return true. if( anItemWasRemoved ){ return true; } // Show an error message if no array was sent } else { Debug.LogWarning("ARRAYS - RemoveItem(): Array cannot be null. Skipping."); } // Return false if we couldn't remove the item return false; } // ================================================================================================================== // REMOVE FIRST ITEM // Removes an item at a given index // ================================================================================================================== public static bool RemoveFirstItem<T>( ref T[] _arr ){ // Make sure the array is valid // if( _arr != null && _arr.Length > 1 ){ // Make a new array 1 less than the current one T[] newArray = new T[_arr.Length-1]; // Loop through the new array, and copy every item with a +1 offset for( int i = 0; i<newArray.Length; i++ ){ newArray[i] = _arr[i+1]; } // Update the main array _arr = newArray; // Item was removed successfully return true; // Show an error message if no array was sent // } else if( _arr == null ){ Debug.LogWarning("ARRAYS - RemoveFirstItem(): Array cannot be null or must have at least 1 item. Skipping."); } // Return false if we couldn't remove the item // return false; } // ================================================================================================================== // REMOVE ITEM AT INDEX // Removes an item at a given index // ================================================================================================================== public static bool RemoveItemAtIndex<T>(ref T[] _arr, int index ){ // Make sure the array is valid if( _arr != null ){ // Make sure the index is valid if( index >= 0 && index < _arr.Length ){ // Make a new array 1 less than the current one T[] newArray = new T[_arr.Length-1]; // Loop through the old array and copy every item except the index for( int i = 0; i<newArray.Length; i++ ){ if(i<index){ newArray[i] = _arr[i]; } else if( _arr.Length > 1 ){ newArray[i] = _arr[i+1]; } } // Update the main array _arr = newArray; // Item was removed successfully return true; // Show an error message if the index is out of range } else { Debug.LogWarning("ARRAYS - RemoveItemAtIndex(): Index is out of range. Skipping."); } // Show an error message if no array was sent } else if( _arr == null ){ Debug.LogWarning("ARRAYS - RemoveItemAtIndex(): Array cannot be null. Skipping."); } // Return false if we couldn't remove the item return false; } // ================================================================================================================== // ITEM EXISTS AT INDEX // If an item exists in the array, it will return its ID. if not, it returns -1. // ================================================================================================================== public static int ItemExistsAtIndex<T>( ref T[] _arr, ref T item ){ // Loop through the index if( _arr != null ){ for( int i = 0; i<_arr.Length; i++ ){ if( _arr[i].Equals( item ) ){ return i; } } // Show an error message if no array was sent } else { Debug.LogWarning("ARRAYS - ItemExistsAtIndex(): Array cannot be null. Returning -1."); } // If we didn't find anything, return -1 return -1; } // ================================================================================================================== // ITEM EXISTS // Simplified bool version of the above, if an item exists true is returned // ================================================================================================================== public static bool ItemExists<T>( T[] _arr, T item ){ // Loop through the index if( _arr != null ){ for( int i = 0; i<_arr.Length; i++ ){ if( _arr[i].Equals( item ) ){ return true; } } // Show an error message if no array was sent } else { Debug.LogWarning("ARRAYS - ItemExistsAtIndex(): Array cannot be null. Returning false."); } // If we didn't find anything, return false return false; } // ================================================================================================================== // CONCAT // Combines two of the same types of Array[] together (untested so far) // ================================================================================================================== public static T[] Concat<T>(this T[] a, T[] b){ if (a == null) throw new ArgumentNullException("x"); if (b == null) throw new ArgumentNullException("b"); int oldLen = a.Length; Array.Resize<T>(ref a, a.Length + b.Length); Array.Copy(b, 0, a, oldLen, b.Length); return a; } // ================================================================================================================== // COMBINE // Combines two of the same types of Array[] together (untested so far) // ================================================================================================================== public static T[] Combine<T>( T[] a, T[] b ){ T[] newArray = new T[ a.Length + b.Length ]; a.CopyTo( newArray, 0 ); b.CopyTo( newArray, a.Length ); return newArray; } // ================================================================================================================== // CLEAR // Removes all entries in an array // ================================================================================================================== public static bool Clear<T>( ref T[] arr ){ if( arr != null ){ arr = new T[0]; return true; } else { Debug.LogWarning("ARRAYS - Cannot clear an array that is null. Returning null."); return false; } } // ================================================================================================================== // SHIFT ITEM // Shifts an item up or down in an array (this method is a bit slow and is designed for use with the inspector) // ================================================================================================================== public static bool Shift<T>( ref T[] _arr, int id, bool moveUp ){ // Make sure the event ID we're moving is less than the total amount of _arr events, and ... if( _arr!=null && id < _arr.Length /*&& _arr[id] != null*/ && ( moveUp == true && id > 0 || // If we're moving up, this cant be the first ID. moveUp == false && id < _arr.Length-1 // If we're moving down, this can't be the last event ID. ) ){ // Cache the event we're about to move. T eventToMove = _arr[id]; // Backup the old index into an ArrayList and remove the event we're about to move. var oldarr = new ArrayList( _arr ); oldarr.RemoveAt(id); // Create a new ArrayList from the _arr events. var newArr = new ArrayList(); newArr.Clear(); // Loop through the _arr events so we can recreate a new array. for( int i = 0; i<oldarr.Count; i++ ){ // If this the event we're moving ( Moving Up) if( i == id-1 && moveUp ){ newArr.Add( eventToMove ); } // Add old element to this array newArr.Add( oldarr[i] ); // If this the event we're moving ( Moving Down) if( i == id && !moveUp ){ newArr.Add( eventToMove ); } } // Convert this array into a builtin list. T[] builtinArray = newArr.ToArray( typeof( T ) ) as T[]; _arr = builtinArray; // Return true as the process succeeded! return true; } // Return false if anything goes wrong return false; } } }
35.110119
143
0.472578
[ "MIT" ]
HOUJUNGYAO/MA_MovingPlatform
0428/Assets/Plugins/Hell Tap Entertainment/MeshKit/Scripts/Support/Core/Arrays.cs
11,800
C#
using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.IO; using Microsoft.AspNetCore.Hosting; using WorldJourney.Models; using WorldJourney.Filters; namespace WorldJourney.Controllers { public class CityController : Controller { private readonly IData _data; private readonly IHostingEnvironment _environment; public CityController(IData data, IHostingEnvironment environment) { _data = data; _environment = environment; _data.CityInitializeData(); } [ServiceFilter(typeof(LogActionFilterAttribute))] [Route("WorldJourney")] public IActionResult Index() { ViewData["Page"] = "Search city"; return View(); } [Route("CityDetails/{id?}")] public IActionResult Details(int? id) { ViewData["Page"] = "Selected city"; City city = _data.GetCityById(id); if (city == null) { return NotFound(); } ViewBag.Title = city.CityName; return View(city); } public IActionResult GetImage(int? cityId) { ViewData["Message"] = "display Image"; City requestedCity = _data.GetCityById(cityId); if (requestedCity != null) { string webRootpath = _environment.WebRootPath; string folderPath = "\\images\\"; string fullPath = webRootpath + folderPath + requestedCity.ImageName; FileStream fileOnDisk = new FileStream(fullPath, FileMode.Open); byte[] fileBytes; using (BinaryReader br = new BinaryReader(fileOnDisk)) { fileBytes = br.ReadBytes((int)fileOnDisk.Length); } return File(fileBytes, requestedCity.ImageMimeType); } else { return NotFound(); } } } }
29.178082
85
0.553521
[ "MIT" ]
DerksArno/20486D-DevelopingASPNETMVCWebApplications
Allfiles/Mod04/Labfiles/01_WorldJourney_begin/WorldJourney/Controllers/CityController.cs
2,132
C#
using System; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using MicrosoftTeamsIntegration.Jira.Helpers; using MicrosoftTeamsIntegration.Jira.Models; using MicrosoftTeamsIntegration.Jira.Models.Jira; using MicrosoftTeamsIntegration.Jira.Services.Interfaces; using MicrosoftTeamsIntegration.Jira.Services.SignalR.Interfaces; using Newtonsoft.Json; namespace MicrosoftTeamsIntegration.Jira.Services { public sealed class JiraAuthService : IJiraAuthService { private readonly ISignalRService _signalRService; private readonly IDatabaseService _databaseService; private readonly ILogger<JiraAuthService> _logger; public JiraAuthService( ISignalRService signalRService, IDatabaseService databaseService, ILogger<JiraAuthService> logger) { _signalRService = signalRService; _databaseService = databaseService; _logger = logger; } public async Task<JiraAuthResponse> SubmitOauthLoginInfo(string msTeamsUserId, string msTeamsTenantId, string accessToken, string jiraId, string verificationCode, string requestToken) { var result = new JiraAuthResponse(); if (string.IsNullOrEmpty(jiraId) || string.IsNullOrEmpty(msTeamsUserId)) { return result; } var user = new IntegratedUser { JiraServerId = jiraId, MsTeamsUserId = msTeamsUserId }; if (string.IsNullOrEmpty(accessToken)) { return null; } // Send auth info to Java Addon result = await ProcessRequestForAuthResponse(user, new JiraAuthParamMessage { VerificationCode = verificationCode, RequestToken = requestToken, JiraId = jiraId, AccessToken = accessToken, TeamsId = msTeamsUserId }); if (result.IsSuccess && !string.IsNullOrEmpty(requestToken)) { await _databaseService.GetOrCreateJiraServerUser(msTeamsUserId, msTeamsTenantId, jiraId); } return result; } public async Task<JiraAuthResponse> Logout(IntegratedUser user) { var response = await DoLogout(user); if (response.IsSuccess) { await _databaseService.DeleteJiraServerUser(user.MsTeamsUserId, user.JiraServerId); } return response; } public async Task<bool> IsJiraConnected(IntegratedUser user) { var userId = user?.MsTeamsUserId; var jiraServerId = user?.JiraServerId; var addonStatus = await _databaseService.GetJiraServerAddonStatus(jiraServerId, userId); return !string.IsNullOrEmpty(user?.JiraServerId) && addonStatus.AddonIsInstalled; } private async Task<JiraAuthResponse> ProcessRequestForAuthResponse(IntegratedUser user, object request = null) { var message = JsonConvert.SerializeObject(request); var response = await _signalRService.SendRequestAndWaitForResponse(user.JiraServerId, message, CancellationToken.None); if (response.Received) { var responseObj = new JsonDeserializer(_logger).Deserialize<JiraResponse<JiraAuthResponse>>(response.Message); if (JiraHelpers.IsResponseForTheUser(responseObj)) { return new JiraAuthResponse { IsSuccess = responseObj.ResponseCode == 200, Message = responseObj.Message }; } await JiraHelpers.HandleJiraServerError( _databaseService, _logger, responseObj.ResponseCode, responseObj.Message, (request as JiraBaseRequest)?.TeamsId, (request as JiraBaseRequest)?.JiraId); } return new JiraAuthResponse { IsSuccess = false, Message = "Error during connection to Jira Server addon." }; } private async Task<JiraAuthResponse> DoLogout(IntegratedUser user) { var request = new JiraCommandRequest { TeamsId = user.MsTeamsUserId, JiraId = user.JiraServerId, AccessToken = user.AccessToken, Command = "Logout" }; return await ProcessRequestForAuthResponse(user, request); } } }
35.977444
191
0.598119
[ "Apache-2.0" ]
atlassian-labs/msteams-jira-server
src/MicrosoftTeamsIntegration.Jira/Services/JiraAuthService.cs
4,787
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace eBiblioteka.Mobile.UWP { public sealed partial class MainPage { public MainPage() { this.InitializeComponent(); LoadApplication(new eBiblioteka.Mobile.App()); } } }
23.464286
58
0.733638
[ "MIT" ]
almedinagolos/eBiblioteka
eBiblioteka/eBiblioteka.Mobile/eBiblioteka.Mobile.UWP/MainPage.xaml.cs
659
C#
using System; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 namespace XamarinFormsMVVM.Windows { /// <summary> /// Provides application-specific behavior to supplement the default Application class. /// </summary> public sealed partial class App : Application { /// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += this.OnSuspending; } /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); // TODO: change this value to a cache size that is appropriate for your application rootFrame.CacheSize = 1; Xamarin.Forms.Forms.Init(e); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) { throw new Exception("Failed to create initial page"); } } // Ensure the current window is active Window.Current.Activate(); } /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); // TODO: Save application state and stop any background activity deferral.Complete(); } } }
38.319149
99
0.597446
[ "MIT" ]
wpbest/XamarinFormsMVVM
XamarinFormsMVVM/XamarinFormsMVVM.Windows/App.xaml.cs
3,604
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Azure.AppService.Inputs { public sealed class FunctionAppSlotSiteConfigGetArgs : Pulumi.ResourceArgs { /// <summary> /// Should the Function App be loaded at all times? Defaults to `false`. /// </summary> [Input("alwaysOn")] public Input<bool>? AlwaysOn { get; set; } /// <summary> /// The name of the slot to automatically swap to during deployment /// </summary> [Input("autoSwapSlotName")] public Input<string>? AutoSwapSlotName { get; set; } /// <summary> /// A `cors` block as defined below. /// </summary> [Input("cors")] public Input<Inputs.FunctionAppSlotSiteConfigCorsGetArgs>? Cors { get; set; } /// <summary> /// State of FTP / FTPS service for this function app. Possible values include: `AllAllowed`, `FtpsOnly` and `Disabled`. /// </summary> [Input("ftpsState")] public Input<string>? FtpsState { get; set; } [Input("healthCheckPath")] public Input<string>? HealthCheckPath { get; set; } /// <summary> /// Specifies whether or not the http2 protocol should be enabled. Defaults to `false`. /// </summary> [Input("http2Enabled")] public Input<bool>? Http2Enabled { get; set; } [Input("ipRestrictions")] private InputList<Inputs.FunctionAppSlotSiteConfigIpRestrictionGetArgs>? _ipRestrictions; /// <summary> /// A [List of objects](https://www.terraform.io/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below. /// </summary> public InputList<Inputs.FunctionAppSlotSiteConfigIpRestrictionGetArgs> IpRestrictions { get => _ipRestrictions ?? (_ipRestrictions = new InputList<Inputs.FunctionAppSlotSiteConfigIpRestrictionGetArgs>()); set => _ipRestrictions = value; } [Input("javaVersion")] public Input<string>? JavaVersion { get; set; } /// <summary> /// Linux App Framework and version for the AppService, e.g. `DOCKER|(golang:latest)`. /// </summary> [Input("linuxFxVersion")] public Input<string>? LinuxFxVersion { get; set; } /// <summary> /// The minimum supported TLS version for the function app. Possible values are `1.0`, `1.1`, and `1.2`. Defaults to `1.2` for new function apps. /// </summary> [Input("minTlsVersion")] public Input<string>? MinTlsVersion { get; set; } /// <summary> /// The number of pre-warmed instances for this function app. Only affects apps on the Premium plan. /// </summary> [Input("preWarmedInstanceCount")] public Input<int>? PreWarmedInstanceCount { get; set; } [Input("scmIpRestrictions")] private InputList<Inputs.FunctionAppSlotSiteConfigScmIpRestrictionGetArgs>? _scmIpRestrictions; public InputList<Inputs.FunctionAppSlotSiteConfigScmIpRestrictionGetArgs> ScmIpRestrictions { get => _scmIpRestrictions ?? (_scmIpRestrictions = new InputList<Inputs.FunctionAppSlotSiteConfigScmIpRestrictionGetArgs>()); set => _scmIpRestrictions = value; } [Input("scmType")] public Input<string>? ScmType { get; set; } [Input("scmUseMainIpRestriction")] public Input<bool>? ScmUseMainIpRestriction { get; set; } /// <summary> /// Should the Function App run in 32 bit mode, rather than 64 bit mode? Defaults to `true`. /// </summary> [Input("use32BitWorkerProcess")] public Input<bool>? Use32BitWorkerProcess { get; set; } /// <summary> /// Should WebSockets be enabled? /// </summary> [Input("websocketsEnabled")] public Input<bool>? WebsocketsEnabled { get; set; } public FunctionAppSlotSiteConfigGetArgs() { } } }
38.294643
153
0.62602
[ "ECL-2.0", "Apache-2.0" ]
aangelisc/pulumi-azure
sdk/dotnet/AppService/Inputs/FunctionAppSlotSiteConfigGetArgs.cs
4,289
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.AlertsManagement.V20200804Preview.Inputs { /// <summary> /// Specifies the health alert criteria to alert on. /// </summary> public sealed class VmGuestHealthAlertCriterionArgs : Pulumi.ResourceArgs { [Input("healthStates", required: true)] private InputList<Inputs.HealthStateArgs>? _healthStates; /// <summary> /// Health states to alert on /// </summary> public InputList<Inputs.HealthStateArgs> HealthStates { get => _healthStates ?? (_healthStates = new InputList<Inputs.HealthStateArgs>()); set => _healthStates = value; } [Input("monitorNames")] private InputList<string>? _monitorNames; /// <summary> /// Names of health monitor on which to define alert /// </summary> public InputList<string> MonitorNames { get => _monitorNames ?? (_monitorNames = new InputList<string>()); set => _monitorNames = value; } [Input("monitorTypes")] private InputList<string>? _monitorTypes; /// <summary> /// Names of health monitor type on which to define alert /// </summary> public InputList<string> MonitorTypes { get => _monitorTypes ?? (_monitorTypes = new InputList<string>()); set => _monitorTypes = value; } /// <summary> /// specifies the type of the alert criterion. /// Expected value is 'GuestVmHealth'. /// </summary> [Input("namespace", required: true)] public Input<string> Namespace { get; set; } = null!; public VmGuestHealthAlertCriterionArgs() { } } }
31.212121
94
0.606311
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/AlertsManagement/V20200804Preview/Inputs/VmGuestHealthAlertCriterionArgs.cs
2,060
C#
using System.IO; using CP77.CR2W.Reflection; using FastMember; using static CP77.CR2W.Types.Enums; namespace CP77.CR2W.Types { [REDMeta] public class TaggedObjectsListDef : gamebbScriptDefinition { [Ordinal(0)] [RED("taggedObjectsList")] public gamebbScriptID_Variant TaggedObjectsList { get; set; } public TaggedObjectsListDef(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { } } }
27.1875
107
0.74023
[ "MIT" ]
Eingin/CP77Tools
CP77.CR2W/Types/cp77/TaggedObjectsListDef.cs
420
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using Microsoft.Cci; using Microsoft.Cci.Differs; using Microsoft.Cci.Filters; using Microsoft.Cci.Mappings; using Microsoft.Cci.Traversers; using System; namespace Microsoft.Cci.Writers { public class DifferenceWriter : DifferenceTraverser, ICciDifferenceWriter { private readonly List<Difference> _differences; private readonly TextWriter _writer; private int _totalDifferences = 0; public static int ExitCode { get; set; } public DifferenceWriter(TextWriter writer, MappingSettings settings, IDifferenceFilter filter) : base(settings, filter) { _writer = writer; _differences = new List<Difference>(); } public void Write(string oldAssembliesName, IEnumerable<IAssembly> oldAssemblies, string newAssembliesName, IEnumerable<IAssembly> newAssemblies) { this.Visit(oldAssemblies, newAssemblies); if (!this.Settings.GroupByAssembly) { if (_differences.Count > 0) { string header = string.Format("Compat issues between implementation set {0} and contract set {1}:", oldAssembliesName, newAssembliesName); OutputDifferences(header, _differences); _totalDifferences += _differences.Count; _differences.Clear(); } } _writer.WriteLine("Total Issues: {0}", _totalDifferences); _totalDifferences = 0; } public override void Visit(AssemblyMapping mapping) { Contract.Assert(_differences.Count == 0); base.Visit(mapping); if (this.Settings.GroupByAssembly) { if (_differences.Count > 0) { string header = string.Format("Compat issues with assembly {0}:", mapping.Representative.Name.Value); OutputDifferences(header, _differences); _totalDifferences += _differences.Count; _differences.Clear(); } } } private void OutputDifferences(string header, IEnumerable<Difference> differences) { _writer.WriteLine(header); foreach (var diff in differences) _writer.WriteLine(diff.ToString()); } public override void Visit(Difference difference) { _differences.Add(difference); // For now use this to set the ExitCode to 2 if there are any differences DifferenceWriter.ExitCode = 2; } } }
34.162791
158
0.612662
[ "MIT" ]
dseefeld/buildtools
src/ApiCompat/DifferenceWriter.cs
2,940
C#
//Author Maxim Kuzmin//makc// using Makc2020.Core.Base.Executable.Services.Async; using Makc2020.Core.Base.Resources.Errors; using System; using System.Threading.Tasks; namespace Makc2020.Mods.DummyTree.Base.Jobs.List.Get { /// <summary> /// Мод "DummyTree". Задания. Список. Получение. Сервис. /// </summary> public class ModDummyTreeBaseJobListGetService : CoreBaseExecutableServiceAsyncWithInputAndOutput < ModDummyTreeBaseJobListGetInput, ModDummyTreeBaseJobListGetOutput > { #region Constructors /// <summary> /// Конструктор. /// </summary> /// <param name="executable">Выполняемое.</param> /// <param name="coreBaseResourceErrors">Ядро. Основа. Ресурсы. Ошибки.</param> public ModDummyTreeBaseJobListGetService( Func<ModDummyTreeBaseJobListGetInput, Task<ModDummyTreeBaseJobListGetOutput>> executable, CoreBaseResourceErrors coreBaseResourceErrors ) : base(executable, coreBaseResourceErrors) { Execution.FuncTransformInput = TransformInput; } #endregion Constructors #region Private methods private ModDummyTreeBaseJobListGetInput TransformInput(ModDummyTreeBaseJobListGetInput input) { if (input == null) { input = new ModDummyTreeBaseJobListGetInput(); } input.Normalize(); return input; } #endregion Private methods } }
29.769231
101
0.643411
[ "MIT" ]
maxim-kuzmin/Makc2020
net-core/Makc2020.Mods.DummyTree.Base/Jobs/List/Get/ModDummyTreeBaseJobListGetService.cs
1,626
C#
namespace Saplin.CPDT.UICore.Localization { public static class Locales { public const string en = "en"; public const string ru = "ru"; public const string fr = "fr"; public const string zh = "zh"; public static bool IsValid(string locale) { if (locale == en) return true; if (locale == ru) return true; if (locale == fr) return true; if (locale == zh) return true; return false; } }; }
25.85
49
0.524178
[ "MIT" ]
Luzianic-kalati/CrossPlatformDiskTest
Saplin.CPDT.UICore/Localization/Locales.cs
519
C#
using Betting.Abstract; using SQLite; using System; using UtilityEnum; using Betting.Enum; namespace Betting.Entity.Sqlite { [Dapper.Contrib.Extensions.Table("Order")] public class Order : DBEntity, IOrder { public Order(Guid betId, Guid marketId, Guid selectionId, uint price, uint averagePriceMatched, uint size, uint sizeMatched, TradeSide side, YesNo isComplete, DateTime placedDate, DateTime matchedDate) : this(betId, marketId, selectionId, price, averagePriceMatched, size, sizeMatched, side, isComplete, placedDate, matchedDate, Guid.NewGuid()) { } public Order(Guid guid, Guid betId, Guid marketId, Guid selectionId, uint price, uint averagePriceMatched, uint size, uint sizeMatched, TradeSide side, YesNo isComplete, DateTime placedDate, DateTime matchedDate) : this(betId, marketId, selectionId, price, averagePriceMatched, size, sizeMatched, side, isComplete, placedDate, matchedDate, guid) { } private Order(Guid betId, Guid marketId, Guid selectionId, uint price, uint averagePriceMatched, uint size, uint sizeMatched, TradeSide side, YesNo isComplete, DateTime placedDate, DateTime matchedDate, Guid guid) : base(guid) { BetId = betId; MarketId = marketId; SelectionId = selectionId; Price = price; Size = size; Side = side; IsComplete = isComplete; PlacedDate = placedDate; MatchedDate = matchedDate; AveragePriceMatched = averagePriceMatched; SizeMatched = sizeMatched; } public Order() { } [Indexed] public Guid BetId { get; set; } [Indexed] public Guid MarketId { get; set; } [Indexed] public Guid SelectionId { get; set; } public uint Price { get; set; } public uint Size { get; set; } public uint SizeMatched { get; set; } public TradeSide Side { get; set; } public YesNo IsComplete { get; set; } public DateTime PlacedDate { get; set; } public DateTime MatchedDate { get; set; } public uint AveragePriceMatched { get; set; } //public double Handicap { get; set; } //public OrderStatus Status { get; set; } //public PriceSize PriceSize { get; set; } //public double BspLiability { get; set; } //public PersistenceType PersistenceType { get; set; } //public OrderType OrderType { get; set; } //public double SizeRemaining { get; set; } //public double SizeLapsed { get; set; } //public double SizeCancelled { get; set; } //public double SizeVoided { get; set; } //public string RegulatorAuthCode { get; set; } //public string RegulatorCode { get; set; } } }
30.808511
223
0.620511
[ "MIT" ]
dt-bet/Betting
Betting.Entity.Sqlite/Order.cs
2,898
C#
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace Inbox2.Platform.Framework.Text.iFilter { [ComVisible(false)] [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00000001-0000-0000-C000-000000000046")] internal interface IClassFactory { void CreateInstance([MarshalAs(UnmanagedType.Interface)] object pUnkOuter, ref Guid refiid, [MarshalAs(UnmanagedType.Interface)] out object ppunk); void LockServer(bool fLock); } /// <summary> /// Utility class to get a Class Factory for a certain Class ID /// by loading the dll that implements that class /// </summary> internal static class ComHelper { //DllGetClassObject fuction pointer signature private delegate int DllGetClassObject(ref Guid ClassId, ref Guid InterfaceId, [Out, MarshalAs(UnmanagedType.Interface)] out object ppunk); //Some win32 methods to load\unload dlls and get a function pointer private class Win32NativeMethods { [DllImport("kernel32.dll", CharSet=CharSet.Ansi)] public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName); [DllImport("kernel32.dll")] public static extern bool FreeLibrary(IntPtr hModule); [DllImport("kernel32.dll")] public static extern IntPtr LoadLibrary(string lpFileName); } /// <summary> /// Holds a list of dll handles and unloads the dlls /// in the destructor /// </summary> private class DllList { private List<IntPtr> _dllList=new List<IntPtr>(); public void AddDllHandle(IntPtr dllHandle) { lock (_dllList) { _dllList.Add(dllHandle); } } ~DllList() { foreach (IntPtr dllHandle in _dllList) { try { Win32NativeMethods.FreeLibrary(dllHandle); } catch { }; } } } static DllList _dllList=new DllList(); /// <summary> /// Gets a class factory for a specific COM Class ID. /// </summary> /// <param name="dllName">The dll where the COM class is implemented</param> /// <param name="filterPersistClass">The requested Class ID</param> /// <returns>IClassFactory instance used to create instances of that class</returns> internal static IClassFactory GetClassFactory(string dllName, string filterPersistClass) { //Load the class factory from the dll IClassFactory classFactory=GetClassFactoryFromDll(dllName, filterPersistClass); return classFactory; } private static IClassFactory GetClassFactoryFromDll(string dllName, string filterPersistClass) { //Load the dll IntPtr dllHandle=Win32NativeMethods.LoadLibrary(dllName); if (dllHandle==IntPtr.Zero) return null; //Keep a reference to the dll until the process\AppDomain dies _dllList.AddDllHandle(dllHandle); //Get a pointer to the DllGetClassObject function IntPtr dllGetClassObjectPtr=Win32NativeMethods.GetProcAddress(dllHandle, "DllGetClassObject"); if (dllGetClassObjectPtr==IntPtr.Zero) return null; //Convert the function pointer to a .net delegate DllGetClassObject dllGetClassObject=(DllGetClassObject)Marshal.GetDelegateForFunctionPointer(dllGetClassObjectPtr, typeof(DllGetClassObject)); //Call the DllGetClassObject to retreive a class factory for out Filter class Guid filterPersistGUID=new Guid(filterPersistClass); Guid IClassFactoryGUID=new Guid("00000001-0000-0000-C000-000000000046"); //IClassFactory class id Object unk; if (dllGetClassObject(ref filterPersistGUID, ref IClassFactoryGUID, out unk)!=0) return null; //Yippie! cast the returned object to IClassFactory return (unk as IClassFactory); } } }
33.881818
150
0.722028
[ "BSD-3-Clause" ]
Klaudit/inbox2_desktop
Code/Platform/Framework/Text/iFilter/ComHelper.cs
3,727
C#
using System.Data.Entity; using System.Data.Entity.SqlServer; namespace ContosoUniversity.DAL { public class SchoolConfiguration : DbConfiguration { public SchoolConfiguration() { SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy()); } } }
24.692308
97
0.676012
[ "Apache-2.0" ]
DiegoCasallas/MVC
C#/ContosoUniversity/DAL/SchoolConfiguration.cs
323
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Globalization; namespace Microsoft.AspNetCore.Authentication { /// <summary> /// Dictionary used to store state values about the authentication session. /// </summary> public class AuthenticationProperties { internal const string IssuedUtcKey = ".issued"; internal const string ExpiresUtcKey = ".expires"; internal const string IsPersistentKey = ".persistent"; internal const string RedirectUriKey = ".redirect"; internal const string RefreshKey = ".refresh"; internal const string UtcDateTimeFormat = "r"; /// <summary> /// Initializes a new instance of the <see cref="AuthenticationProperties"/> class. /// </summary> public AuthenticationProperties() : this(items: null, parameters: null) { } /// <summary> /// Initializes a new instance of the <see cref="AuthenticationProperties"/> class. /// </summary> /// <param name="items">State values dictionary to use.</param> public AuthenticationProperties(IDictionary<string, string> items) : this(items, parameters: null) { } /// <summary> /// Initializes a new instance of the <see cref="AuthenticationProperties"/> class. /// </summary> /// <param name="items">State values dictionary to use.</param> /// <param name="parameters">Parameters dictionary to use.</param> public AuthenticationProperties(IDictionary<string, string> items, IDictionary<string, object> parameters) { Items = items ?? new Dictionary<string, string>(StringComparer.Ordinal); Parameters = parameters ?? new Dictionary<string, object>(StringComparer.Ordinal); } /// <summary> /// Return a copy. /// </summary> /// <returns>A copy.</returns> public AuthenticationProperties Clone() => new AuthenticationProperties(new Dictionary<string, string>(Items, StringComparer.Ordinal), new Dictionary<string, object>(Parameters, StringComparer.Ordinal)); /// <summary> /// State values about the authentication session. /// </summary> public IDictionary<string, string> Items { get; } /// <summary> /// Collection of parameters that are passed to the authentication handler. These are not intended for /// serialization or persistence, only for flowing data between call sites. /// </summary> public IDictionary<string, object> Parameters { get; } /// <summary> /// Gets or sets whether the authentication session is persisted across multiple requests. /// </summary> public bool IsPersistent { get => GetString(IsPersistentKey) != null; set => SetString(IsPersistentKey, value ? string.Empty : null); } /// <summary> /// Gets or sets the full path or absolute URI to be used as an http redirect response value. /// </summary> public string RedirectUri { get => GetString(RedirectUriKey); set => SetString(RedirectUriKey, value); } /// <summary> /// Gets or sets the time at which the authentication ticket was issued. /// </summary> public DateTimeOffset? IssuedUtc { get => GetDateTimeOffset(IssuedUtcKey); set => SetDateTimeOffset(IssuedUtcKey, value); } /// <summary> /// Gets or sets the time at which the authentication ticket expires. /// </summary> public DateTimeOffset? ExpiresUtc { get => GetDateTimeOffset(ExpiresUtcKey); set => SetDateTimeOffset(ExpiresUtcKey, value); } /// <summary> /// Gets or sets if refreshing the authentication session should be allowed. /// </summary> public bool? AllowRefresh { get => GetBool(RefreshKey); set => SetBool(RefreshKey, value); } /// <summary> /// Get a string value from the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <returns>Retrieved value or <c>null</c> if the property is not set.</returns> public string GetString(string key) { return Items.TryGetValue(key, out string value) ? value : null; } /// <summary> /// Set a string value in the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <param name="value">Value to set or <c>null</c> to remove the property.</param> public void SetString(string key, string value) { if (value != null) { Items[key] = value; } else { Items.Remove(key); } } /// <summary> /// Get a parameter from the <see cref="Parameters"/> collection. /// </summary> /// <typeparam name="T">Parameter type.</typeparam> /// <param name="key">Parameter key.</param> /// <returns>Retrieved value or the default value if the property is not set.</returns> public T GetParameter<T>(string key) => Parameters.TryGetValue(key, out var obj) && obj is T value ? value : default; /// <summary> /// Set a parameter value in the <see cref="Parameters"/> collection. /// </summary> /// <typeparam name="T">Parameter type.</typeparam> /// <param name="key">Parameter key.</param> /// <param name="value">Value to set.</param> public void SetParameter<T>(string key, T value) => Parameters[key] = value; /// <summary> /// Get a bool value from the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <returns>Retrieved value or <c>null</c> if the property is not set.</returns> protected bool? GetBool(string key) { if (Items.TryGetValue(key, out string value) && bool.TryParse(value, out bool boolValue)) { return boolValue; } return null; } /// <summary> /// Set a bool value in the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <param name="value">Value to set or <c>null</c> to remove the property.</param> protected void SetBool(string key, bool? value) { if (value.HasValue) { Items[key] = value.GetValueOrDefault().ToString(); } else { Items.Remove(key); } } /// <summary> /// Get a DateTimeOffset value from the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <returns>Retrieved value or <c>null</c> if the property is not set.</returns> protected DateTimeOffset? GetDateTimeOffset(string key) { if (Items.TryGetValue(key, out string value) && DateTimeOffset.TryParseExact(value, UtcDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out DateTimeOffset dateTimeOffset)) { return dateTimeOffset; } return null; } /// <summary> /// Set a DateTimeOffset value in the <see cref="Items"/> collection. /// </summary> /// <param name="key">Property key.</param> /// <param name="value">Value to set or <c>null</c> to remove the property.</param> protected void SetDateTimeOffset(string key, DateTimeOffset? value) { if (value.HasValue) { Items[key] = value.GetValueOrDefault().ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture); } else { Items.Remove(key); } } } }
38.153846
169
0.56926
[ "Apache-2.0" ]
AhmedKhalil777/aspnetcore
src/Http/Authentication.Abstractions/src/AuthenticationProperties.cs
8,432
C#
using System; using System.Xml; using System.Text; namespace AIMLBot.Core.AIMLTagHandlers { /// <summary> /// The formal element tells the AIML interpreter to render the contents of the element /// such that the first letter of each word is in uppercase, as defined (if defined) by /// the locale indicated by the specified language (if specified). This is similar to methods /// that are sometimes called "Title Case". /// /// If no character in this string has a different uppercase version, based on the Unicode /// standard, then the original string is returned. /// </summary> public class formal : AIMLBot.Core.Utils.AIMLTagHandler { /// <summary> /// Ctor /// </summary> /// <param name="bot">The bot involved in this request</param> /// <param name="user">The user making the request</param> /// <param name="query">The query that originated this node</param> /// <param name="request">The request inputted into the system</param> /// <param name="result">The result to be passed to the user</param> /// <param name="templateNode">The node to be processed</param> public formal(AIMLBot.Core.Bot bot, AIMLBot.Core.User user, AIMLBot.Core.Utils.SubQuery query, AIMLBot.Core.Request request, AIMLBot.Core.Result result, XmlNode templateNode) : base(bot, user, query, request, result, templateNode) { } protected override string ProcessChange() { if (this.templateNode.Name.ToLower() == "formal") { StringBuilder result = new StringBuilder(); if (this.templateNode.InnerText.Length > 0) { string[] words = this.templateNode.InnerText.ToLower().Split(); foreach (string word in words) { string newWord = word.Substring(0, 1); newWord = newWord.ToUpper(); if (word.Length > 1) { newWord += word.Substring(1); } result.Append(newWord + " "); } } return result.ToString().Trim(); } return string.Empty; } } }
40.274194
98
0.529836
[ "MIT" ]
AshokSubedi5/AIMLBot
AIMLBot.Core/AIMLTagHandlers/formal.cs
2,497
C#
using System.Runtime.Serialization; using EltraCommon.Contracts.CommandSets; using EltraCommon.Contracts.Devices; namespace EposMaster.DeviceManager.Device.Epos4.Commands { [DataContract] class GetMotorParameterCommand : DeviceCommand { public GetMotorParameterCommand(EltraDevice device) :base(device) { Name = "GetMotorParameter"; } public override bool Execute(string source) { //TODO return true; } } }
20.086957
57
0.720779
[ "Apache-2.0" ]
eltra-ch/eltra-sdk
samples/Maxon/Epos4/EposMaster/DeviceManager/Device/Epos4/Commands/GetMotorParameterCommand.cs
462
C#
namespace MassTransit.ExtensionsDependencyInjectionIntegration.Registration { using System; using MassTransit.Registration; using Mediator; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using ScopeProviders; using Scoping; public class ServiceCollectionMediatorConfigurator : RegistrationConfigurator, IServiceCollectionMediatorConfigurator { Action<IMediatorRegistrationContext, IReceiveEndpointConfigurator> _configure; public ServiceCollectionMediatorConfigurator(IServiceCollection collection) : base(new DependencyInjectionMediatorContainerRegistrar(collection)) { IMediatorRegistrationContext CreateRegistrationContext(IServiceProvider provider) { var registration = CreateRegistration(provider.GetRequiredService<IConfigurationServiceProvider>()); return new MediatorRegistrationContext(registration); } Collection = collection; Collection.AddSingleton(MediatorFactory); Collection.AddSingleton(CreateRegistrationContext); AddMassTransitComponents(collection); } public IServiceCollection Collection { get; } public void ConfigureMediator(Action<IMediatorRegistrationContext, IReceiveEndpointConfigurator> configure) { if (configure == null) throw new ArgumentNullException(nameof(configure)); ThrowIfAlreadyConfigured(nameof(ConfigureMediator)); _configure = configure; } static void AddMassTransitComponents(IServiceCollection collection) { collection.TryAddScoped<ScopedConsumeContextProvider>(); collection.TryAddScoped(provider => provider.GetRequiredService<ScopedConsumeContextProvider>().GetContext()); collection.TryAddSingleton<IConsumerScopeProvider>(provider => new DependencyInjectionConsumerScopeProvider(provider)); collection.TryAddSingleton<IConfigurationServiceProvider>(provider => new DependencyInjectionConfigurationServiceProvider(provider)); } IMediator MediatorFactory(IServiceProvider serviceProvider) { var provider = serviceProvider.GetRequiredService<IConfigurationServiceProvider>(); ConfigureLogContext(provider); var context = serviceProvider.GetRequiredService<IMediatorRegistrationContext>(); return Bus.Factory.CreateMediator(cfg => { _configure?.Invoke(context, cfg); cfg.ConfigureConsumers(context); cfg.ConfigureSagas(context); }); } } }
39.6
145
0.70202
[ "ECL-2.0", "Apache-2.0" ]
AlexGoemanDigipolis/MassTransit
src/Containers/MassTransit.ExtensionsDependencyInjectionIntegration/Registration/ServiceCollectionMediatorConfigurator.cs
2,772
C#
namespace AEIEditor { public class AeImageTextureSymbolData { public AeImageTextureSymbolData(int newSymbolGroupId, ushort newSymbol) { GroupId = newSymbolGroupId; Symbol = newSymbol; } public int GroupId; public ushort Symbol; } }
15.875
73
0.744094
[ "MIT", "Unlicense" ]
xyx0826/AbyssEngineTools
AEIEditor/AEImageTextureSymbolData.cs
256
C#
#if UNITY_EDITOR using System.IO; using UnityEngine; using UnityEngine.SceneManagement; namespace Planetaria { public static class VectorGraphicsWriter // FIXME: TODO: clean this up! // CONSIDER: make into an abstract interface? // Parameters for "edge creation" get weird if an interface is used { public static void begin_canvas() { scene_index = SceneManager.GetActiveScene().buildIndex; string svg_folder_path = Application.dataPath + "/Planetaria/Art/VectorGraphics/Resources/"; if (!Directory.Exists(svg_folder_path + "/" + scene_index)) { Directory.CreateDirectory(svg_folder_path + "/" + scene_index); } string name = scene_index + "/" + scene_index; write_header(name); } public static void begin_shape() { first = true; writer.Write("\t<path d=\""); } public static void set_edge(QuadraticBezierCurve curve) { if (first) { writer.Write("M" + curve.begin_uv.x * scale + "," + (1 - curve.begin_uv.y) * scale); first = false; } writer.Write(" Q" + curve.control_uv.x * scale + "," + (1 - curve.control_uv.y) * scale); writer.Write(" " + curve.end_uv.x * scale + "," + (1 - curve.end_uv.y) * scale); } public static optional<TextAsset> end_canvas() { string name = scene_index + "/" + scene_index; return write_footer(name, true); } public static void end_shape(Color32 color, float width) { writer.Write(" Z\" "); // Close shape with direct line from end to beginning writer.Write("stroke-width=\"" + width + "\" "); // line thickness writer.Write("stroke=\"rgb(" + color.r + "," + color.g + "," + color.b + ")\" "); // line color writer.Write("fill =\"rgb(" + color.r + "," + color.g + "," + color.b + ")\" "); // fill color writer.Write("/>\n"); // Path block finished } public static void write_header(string identifier) { writer = new StringWriter(); writer.Write("<svg width=\"" + scale + "\" height=\"" + scale + "\">\n"); } public static optional<TextAsset> write_footer(string identifier, bool add_global_unique_identifier) // TODO: simplify { writer.Write("</svg>"); string svg_relative_folder_path = "Assets/Planetaria/Art/VectorGraphics/Resources/"; Miscellaneous.write_file(svg_relative_folder_path + identifier + ".svg", writer.ToString(), add_global_unique_identifier); return Miscellaneous.write_file(svg_relative_folder_path + identifier + ".txt", writer.ToString(), add_global_unique_identifier); } private static StringWriter writer; private static int scene_index; private static string resource_location; private static int scale = 1024; private static bool first = true; } } #endif // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE.
43.322581
189
0.622735
[ "MIT-0" ]
U3DC/Planetaria
Assets/Planetaria/Code/EditorCode/Builder/Rendering/VectorGraphicsWriter.cs
4,031
C#
// ReSharper disable All namespace OpenTl.Schema { using System; using System.Collections; using OpenTl.Schema; public interface IInputFileLocation : IObject { } }
12.466667
49
0.695187
[ "MIT" ]
zzz8415/OpenTl.Schema
src/OpenTl.Schema/_generated/_Entities/InputFileLocation/IInputFileLocation.cs
189
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace PersonalizerTravelAgencyDemo.Models { public class Action { public string Id { get; set; } public string ButtonColor { get; set; } public PartialImageModel Image { get; set; } public string ToneFont { get; set; } public string Layout { get; set; } public bool Enabled { get; set; } } }
24.947368
53
0.624473
[ "MIT" ]
Azure-Samples/cognitive-services-personalizer-samples
demos/PersonalizerTravelAgencyDemo/PersonalizerTravelAgencyDemo/Models/Action.cs
476
C#
// // Copyright 2020 Google LLC // // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // using Google.Solutions.Common.Util; using Google.Solutions.IapDesktop.Application.Services.Settings; using Google.Solutions.IapDesktop.Application.Util; using Google.Solutions.IapDesktop.Application.Views; using Google.Solutions.IapDesktop.Application.Views.Options; using Microsoft.Win32; using Moq; using NUnit.Framework; using System.Collections.Generic; namespace Google.Solutions.IapDesktop.Application.Test.Views.Options { [TestFixture] public class TestGeneralOptionsViewModel : ApplicationFixtureBase { private const string TestKeyPath = @"Software\Google\__Test"; private const string TestMachinePolicyKeyPath = @"Software\Google\__TestMachinePolicy"; private readonly RegistryKey hkcu = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default); private Mock<IAppProtocolRegistry> protocolRegistryMock; [SetUp] public void SetUp() { this.protocolRegistryMock = new Mock<IAppProtocolRegistry>(); } private ApplicationSettingsRepository CreateSettingsRepository( IDictionary<string, object> policies = null) { this.hkcu.DeleteSubKeyTree(TestKeyPath, false); this.hkcu.DeleteSubKeyTree(TestMachinePolicyKeyPath, false); var baseKey = this.hkcu.CreateSubKey(TestKeyPath); var policyKey = this.hkcu.CreateSubKey(TestMachinePolicyKeyPath); foreach (var policy in policies.EnsureNotNull()) { policyKey.SetValue(policy.Key, policy.Value); } return new ApplicationSettingsRepository(baseKey, policyKey, null); } //--------------------------------------------------------------------- // Update check. //--------------------------------------------------------------------- [Test] public void WhenSettingEnabled_ThenIsUpdateCheckEnabledIsTrue() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsUpdateCheckEnabled.BoolValue = true; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsTrue(viewModel.IsUpdateCheckEnabled); Assert.IsTrue(viewModel.IsUpdateCheckEditable); } [Test] public void WhenSettingDisabled_ThenIsUpdateCheckEnabledIsTrue() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsUpdateCheckEnabled.BoolValue = false; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsUpdateCheckEnabled); Assert.IsTrue(viewModel.IsUpdateCheckEditable); } [Test] public void WhenSettingDisabledByPolicy_ThenIsUpdateCheckEditableIsFalse() { var settingsRepository = CreateSettingsRepository( new Dictionary<string, object> { { "IsUpdateCheckEnabled", 0 } }); var settings = settingsRepository.GetSettings(); settings.IsUpdateCheckEnabled.BoolValue = false; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsUpdateCheckEnabled); Assert.IsFalse(viewModel.IsUpdateCheckEditable); } [Test] public void WhenDisablingUpdateCheck_ThenChangeIsApplied() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsUpdateCheckEnabled.BoolValue = true; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()) { IsUpdateCheckEnabled = false }; viewModel.ApplyChanges(); settings = settingsRepository.GetSettings(); Assert.IsFalse(settings.IsUpdateCheckEnabled.BoolValue); } [Test] public void WhenUpdateCheckChanged_ThenIsDirtyIsTrueUntilApplied() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsDirty); viewModel.IsUpdateCheckEnabled = !viewModel.IsUpdateCheckEnabled; Assert.IsTrue(viewModel.IsDirty); } [Test] public void WhenLastCheckIsZero_ThenLastUpdateCheckReturnsNever() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.AreEqual("never", viewModel.LastUpdateCheck); } [Test] public void WhenLastCheckIsNonZero_ThenLastUpdateCheckReturnsNever() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.LastUpdateCheck.LongValue = 1234567L; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.AreNotEqual("never", viewModel.LastUpdateCheck); } //--------------------------------------------------------------------- // DCA. //--------------------------------------------------------------------- [Test] public void WhenSettingEnabled_ThenIsDeviceCertificateAuthenticationEnabledIsTrue() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsDeviceCertificateAuthenticationEnabled.BoolValue = true; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsTrue(viewModel.IsDeviceCertificateAuthenticationEnabled); } [Test] public void WhenSettingDisabled_ThenIsDeviceCertificateAuthenticationEnabledIsTrue() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsDeviceCertificateAuthenticationEnabled.BoolValue = false; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsDeviceCertificateAuthenticationEnabled); } [Test] public void WhenSettingEnabledByPolicy_ThenIsDeviceCertificateAuthenticationEeditableIsFalse() { var settingsRepository = CreateSettingsRepository( new Dictionary<string, object> { { "IsDeviceCertificateAuthenticationEnabled", 1 } }); var settings = settingsRepository.GetSettings(); settings.IsDeviceCertificateAuthenticationEnabled.BoolValue = false; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsTrue(viewModel.IsDeviceCertificateAuthenticationEnabled); Assert.IsFalse(viewModel.IsDeviceCertificateAuthenticationEditable); } [Test] public void WhenDisablingDca_ThenChangeIsApplied() { var settingsRepository = CreateSettingsRepository(); var settings = settingsRepository.GetSettings(); settings.IsDeviceCertificateAuthenticationEnabled.BoolValue = true; settingsRepository.SetSettings(settings); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()) { IsDeviceCertificateAuthenticationEnabled = false }; viewModel.ApplyChanges(); settings = settingsRepository.GetSettings(); Assert.IsFalse(settings.IsDeviceCertificateAuthenticationEnabled.BoolValue); } [Test] public void WhenDcaChanged_ThenIsDirtyIsTrueUntilApplied() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsDirty); viewModel.IsDeviceCertificateAuthenticationEnabled = !viewModel.IsDeviceCertificateAuthenticationEnabled; Assert.IsTrue(viewModel.IsDirty); } //--------------------------------------------------------------------- // Browser integration. //--------------------------------------------------------------------- [Test] public void WhenBrowserIntegrationChanged_ThenIsDirtyIsTrueUntilApplied() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()); Assert.IsFalse(viewModel.IsDirty); viewModel.IsBrowserIntegrationEnabled = !viewModel.IsBrowserIntegrationEnabled; Assert.IsTrue(viewModel.IsDirty); } [Test] public void WhenBrowserIntegrationEnabled_ThenApplyChangesRegistersProtocol() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()) { IsBrowserIntegrationEnabled = true }; viewModel.ApplyChanges(); this.protocolRegistryMock.Verify(r => r.Register( It.Is<string>(s => s == IapRdpUrl.Scheme), It.Is<string>(s => s == GeneralOptionsViewModel.FriendlyName), It.IsAny<string>()), Times.Once); } [Test] public void WhenBrowserIntegrationDisabled_ThenApplyChangesUnregistersProtocol() { var settingsRepository = CreateSettingsRepository(); var viewModel = new GeneralOptionsViewModel( settingsRepository, this.protocolRegistryMock.Object, new HelpService()) { IsBrowserIntegrationEnabled = false }; viewModel.ApplyChanges(); this.protocolRegistryMock.Verify(r => r.Unregister( It.Is<string>(s => s == IapRdpUrl.Scheme)), Times.Once); } } }
37.811047
117
0.611901
[ "Apache-2.0" ]
Theschme96/iap-desktop
sources/Google.Solutions.IapDesktop.Application.Test/Views/Options/TestGeneralOptionsViewModel.cs
13,009
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the iotanalytics-2017-11-27.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.IoTAnalytics.Model { /// <summary> /// Container for the parameters to the DescribeDataset operation. /// Retrieves information about a data set. /// </summary> public partial class DescribeDatasetRequest : AmazonIoTAnalyticsRequest { private string _datasetName; /// <summary> /// Gets and sets the property DatasetName. /// <para> /// The name of the data set whose information is retrieved. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=128)] public string DatasetName { get { return this._datasetName; } set { this._datasetName = value; } } // Check to see if DatasetName property is set internal bool IsSetDatasetName() { return this._datasetName != null; } } }
30.288136
110
0.664801
[ "Apache-2.0" ]
DetlefGolze/aws-sdk-net
sdk/src/Services/IoTAnalytics/Generated/Model/DescribeDatasetRequest.cs
1,787
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.FlowAnalysis; using Microsoft.CodeAnalysis.Operations; using Microsoft.CodeAnalysis.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { public class IOperationTests_NullCheckedParameters : SemanticModelTestBase { [CompilerTrait(CompilerFeature.IOperation, CompilerFeature.Dataflow)] [Fact] public void NullCheckedMethodDeclarationIOp() { var source = @" public class C { public void M(string input!!) { } }"; var compilation = CreateCompilation(source, parseOptions: TestOptions.RegularPreview); compilation.VerifyDiagnostics(); var tree = compilation.SyntaxTrees.Single(); var node1 = tree.GetRoot().DescendantNodes().OfType<BaseMethodDeclarationSyntax>().Single(); compilation.VerifyOperationTree(node1, expectedOperationTree: @" IMethodBodyOperation (OperationKind.MethodBody, Type: null) (Syntax: 'public void ... nput!!) { }') BlockBody: IBlockOperation (0 statements) (OperationKind.Block, Type: null) (Syntax: '{ }') ExpressionBody: null"); VerifyFlowGraph(compilation, node1, expectedFlowGraph: @" Block[B0] - Entry Statements (0) Next (Regular) Block[B1] Block[B1] - Exit Predecessors: [B0] Statements (0)"); } } }
33.54
104
0.707812
[ "MIT" ]
AlexanderSemenyak/roslyn
src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_NullCheckedParameters.cs
1,679
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. #if !IS_CORECLR using System; using System.Collections.Generic; using System.IdentityModel.Protocols.WSTrust; using System.IdentityModel.Tokens; using System.Linq; using System.Net; using System.Net.Http; using System.ServiceModel; using System.ServiceModel.Security; using System.Text; using System.Threading; using System.Threading.Tasks; namespace NuGet.Protocol { public class StsAuthenticationHandler : DelegatingHandler { // Only one source may prompt at a time private readonly static SemaphoreSlim _credentialPromptLock = new SemaphoreSlim(1, 1); /// <summary> /// Response header that specifies the WSTrust13 Windows Transport endpoint. /// </summary> public const string STSEndPointHeader = "X-NuGet-STS-EndPoint"; /// <summary> /// Response header that specifies the realm to authenticate for. In most cases this would be the gallery we are going up against. /// </summary> public const string STSRealmHeader = "X-NuGet-STS-Realm"; /// <summary> /// Request header that contains the SAML token. /// </summary> public const string STSTokenHeader = "X-NuGet-STS-Token"; private readonly Uri _baseUri; private readonly TokenStore _tokenStore; private readonly Func<string, string, string> _tokenFactory; public StsAuthenticationHandler(Configuration.PackageSource packageSource, TokenStore tokenStore) : this(packageSource, tokenStore, tokenFactory: (endpoint, realm) => AcquireSTSToken(endpoint, realm)) { } public StsAuthenticationHandler(Configuration.PackageSource packageSource, TokenStore tokenStore, Func<string, string, string> tokenFactory) { if (packageSource == null) { throw new ArgumentNullException(nameof(packageSource)); } _baseUri = packageSource.SourceUri; if (tokenStore == null) { throw new ArgumentNullException(nameof(tokenStore)); } _tokenStore = tokenStore; if (tokenFactory == null) { throw new ArgumentNullException(nameof(tokenFactory)); } _tokenFactory = tokenFactory; } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { HttpResponseMessage response = null; bool shouldRetry = false; do { // Clean up any previous responses if (response != null) { response.Dispose(); } // keep the token store version var cacheVersion = _tokenStore.Version; PrepareSTSRequest(request); response = await base.SendAsync(request, cancellationToken); if (!shouldRetry && response.StatusCode == HttpStatusCode.Unauthorized) { try { await _credentialPromptLock.WaitAsync(); if (cacheVersion != _tokenStore.Version) { // retry the request with updated credentials shouldRetry = true; } else { shouldRetry = TryRetrieveSTSToken(response); } } finally { _credentialPromptLock.Release(); } } else { shouldRetry = false; } } while (shouldRetry); return response; } /// <summary> /// Adds the SAML token as a header to the request if it is already cached for this source. /// </summary> private void PrepareSTSRequest(HttpRequestMessage request) { var STSToken = _tokenStore.GetToken(_baseUri); if (!string.IsNullOrEmpty(STSToken)) { request.Headers.TryAddWithoutValidation(STSTokenHeader, STSToken); } } /// <summary> /// Attempts to retrieve a SAML token if the response indicates that server requires STS-based auth. /// </summary> public bool TryRetrieveSTSToken(HttpResponseMessage response) { var endpoint = GetHeader(response, STSEndPointHeader); var realm = GetHeader(response, STSRealmHeader); if (string.IsNullOrEmpty(endpoint) || string.IsNullOrEmpty(realm)) { // The server does not conform to NuGet STS-auth requirements. return false; } var STSToken = _tokenStore.GetToken(_baseUri); if (string.IsNullOrEmpty(STSToken)) { var rawStsToken = _tokenFactory.Invoke(endpoint, realm); if (rawStsToken != null) { STSToken = Convert.ToBase64String(Encoding.UTF8.GetBytes(rawStsToken)); _tokenStore.AddToken(_baseUri, STSToken); return true; } } return false; } private static string AcquireSTSToken(string endpoint, string realm) { var binding = new WS2007HttpBinding(SecurityMode.Transport); var factory = new WSTrustChannelFactory(binding, endpoint) { TrustVersion = TrustVersion.WSTrust13 }; var endPointReference = new EndpointReference(realm); var requestToken = new RequestSecurityToken { RequestType = RequestTypes.Issue, KeyType = KeyTypes.Bearer, AppliesTo = endPointReference }; var channel = factory.CreateChannel(); var responseToken = channel.Issue(requestToken) as GenericXmlSecurityToken; return responseToken?.TokenXml.OuterXml; } private static string GetHeader(HttpResponseMessage response, string header) { IEnumerable<string> values; if (response.Headers.TryGetValues(header, out values)) { return values.FirstOrDefault(); } return null; } } } #endif
33.716418
148
0.562933
[ "Apache-2.0" ]
BdDsl/NuGet.Client
src/NuGet.Core/NuGet.Protocol/HttpSource/StsAuthenticationHandler.cs
6,779
C#
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Linq; using NiL.JS; using NiL.JS.Core; using NiL.JS.Core.Interop; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Storage; using Windows.Storage.Pickers; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; using NiL.JS.Extensions; // Документацию по шаблону элемента "Пустая страница" см. по адресу http://go.microsoft.com/fwlink/?LinkId=391641 namespace Portable.Test.Phone { /// <summary> /// Пустая страница, которую можно использовать саму по себе или для перехода внутри фрейма. /// </summary> public sealed partial class MainPage : Page { private sealed class Tester : INotifyPropertyChanged { private class Logger { private Tester tester; public Logger(Tester tester) { this.tester = tester; } public void log(Arguments arguments) { string str = null; for (var i = 0; i < arguments.Length; i++) { if (i > 0) str += " "; var r = arguments[i].ToString(); str += r; } tester.Messages.Add(str); } } private static string staCode; private Logger logger; public ObservableCollection<string> Messages { get; private set; } public int Passed { get; set; } public int Failed { get; set; } public Tester() { Messages = new ObservableCollection<string>(); logger = new Logger(this); } public async void BeginTest() { if (staCode == null) { var staFile = enumerateFiles(Package.Current.InstalledLocation).First(x => x.DisplayName == "sta"); staCode = new StreamReader((await staFile.OpenReadAsync()).AsStream(0)).ReadToEnd(); } (Application.Current as App).Activation += activation; FolderPicker picker = new FolderPicker(); picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; picker.FileTypeFilter.Add(".js"); picker.PickFolderAndContinue(); } private async void activation(Windows.ApplicationModel.Activation.IActivatedEventArgs obj) { (Application.Current as App).Activation -= activation; var ea = obj as FolderPickerContinuationEventArgs; var files = enumerateFiles(ea.Folder); foreach (var file in files) test(new StreamReader((await file.OpenReadAsync()).AsStream(0)).ReadToEnd()); } private void test(string code) { bool pass = true; bool negative = code.IndexOf("@negative") != -1; try { Context.ResetGlobalContext(); var s = new Module(staCode); // инициализация s.Context.DefineVariable("console").Assign(JSValue.Wrap(logger)); s.Run(); try { s.Context.Eval(code, true); } finally { pass ^= negative; } } catch (JSException e) { pass = negative; if (!pass) logger.log(new Arguments { e.Message }); } catch (Exception e) { logger.log(new Arguments { e.ToString() }); pass = false; } if (pass) { Passed++; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Passed")); } else { Failed++; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Failed")); } } private static IEnumerable<StorageFile> enumerateFiles(StorageFolder folder) { var folders = folder.GetFoldersAsync(); folders.AsTask().Wait(); foreach (var subfolder in folders.GetResults()) { foreach (var file in enumerateFiles(subfolder)) yield return file; } var files = folder.GetFilesAsync(); files.AsTask().Wait(); foreach (var file in files.GetResults()) yield return file; } #region Члены INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; #endregion } public MainPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Required; } /// <summary> /// Вызывается перед отображением этой страницы во фрейме. /// </summary> /// <param name="e">Данные события, описывающие, каким образом была достигнута эта страница. /// Этот параметр обычно используется для настройки страницы.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { // TODO: Подготовьте здесь страницу для отображения. // TODO: Если приложение содержит несколько страниц, обеспечьте // обработку нажатия аппаратной кнопки "Назад", выполнив регистрацию на // событие Windows.Phone.UI.Input.HardwareButtons.BackPressed. // Если вы используете NavigationHelper, предоставляемый некоторыми шаблонами, // данное событие обрабатывается для вас. } private void Button_Click(object sender, RoutedEventArgs e) { var tester = new Tester(); DataContext = tester; tester.BeginTest(); } } }
34.39267
119
0.509514
[ "BSD-3-Clause" ]
0xF6/NiL.JS
Portable.Test.Phone/MainPage.xaml.cs
7,109
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Maya.CrashReporter.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
39.740741
151
0.583411
[ "MIT" ]
fossabot/Maya-1
Maya.CrashReporter/Properties/Settings.Designer.cs
1,075
C#
using System; using OpenTK; namespace SimpleScene { #region Particle Plane Generators /// <summary> /// Generates a number of particles with 2D coordinates /// </summary> public abstract class ParticlesPlaneGenerator { public delegate bool NewParticleDelegate(int id, Vector2 pos); // return true for accept protected Random m_rand = new Random(); public void SetSeed(int seed) { m_rand = new Random(seed); } abstract public void Generate(int numParticles, NewParticleDelegate newPartDel); } public class ParticlesOvalGenerator : ParticlesPlaneGenerator { private readonly float m_horizontalMax; private readonly float m_verticalMax; public ParticlesOvalGenerator(float horizontalMax, float verticalMax) { m_horizontalMax = horizontalMax; m_verticalMax = verticalMax; } public override void Generate(int numParticles, NewParticleDelegate newPartDel) { for (int i = 0; i < numParticles; ++i) { bool accepted = false; while (!accepted) { float r = (float)m_rand.NextDouble(); float theta = (float)(m_rand.NextDouble() * 2.0 * Math.PI); float x = r * (float)Math.Cos(theta) * m_horizontalMax; float y = r * (float)Math.Sin(theta) * m_verticalMax; accepted = newPartDel(i, new Vector2(x, y)); } } } } #endregion }
30.882353
96
0.588571
[ "Apache-2.0" ]
8Observer8/SimpleScene
SimpleScene/Meshes/Instancing/ParticlesPlaneGenerators.cs
1,577
C#
using System; using System.Collections.Generic; using System.Text; /* * This file is part of the iText project. * Copyright (c) 1998-2016 iText Group NV * Authors: Bruno Lowagie, Paulo Soares, et al. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License version 3 * as published by the Free Software Foundation with the addition of the * following permission added to Section 15 as permitted in Section 7(a): * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY * ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT * OF THIRD PARTY RIGHTS * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program; if not, see http://www.gnu.org/licenses or write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA, 02110-1301 USA, or download the license from the following URL: * http://itextpdf.com/terms-of-use/ * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License. * * In accordance with Section 7(b) of the GNU Affero General Public License, * a covered work must retain the producer line in every PDF that is created * or manipulated using iText. * * You can be released from the requirements of the license by purchasing * a commercial license. Buying such a license is mandatory as soon as you * develop commercial activities involving the iText software without * disclosing the source code of your own applications. * These activities include: offering paid services to customers as an ASP, * serving PDFs on the fly in a web application, shipping iText with a closed * source product. * * For more information, please contact iText Software Corp. at this * address: sales@itextpdf.com */ namespace iTextSharp.text.pdf { /** * Shape arabic characters. This code was inspired by an LGPL'ed C library: * Pango ( see http://www.pango.com/ ). Note that the code of this is the * original work of Paulo Soares. Hence it is perfectly justifiable to distribute * it under the MPL. * * @author Paulo Soares */ public class ArabicLigaturizer { private static readonly Dictionary<char, char[]> maptable = new Dictionary<char, char[]>(); /** * Some fonts do not implement ligaturized variations on Arabic characters * e.g. Simplified Arabic has got code point 0xFEED but not 0xFEEE */ private static readonly Dictionary<char, char> reverseLigatureMapTable = new Dictionary<char, char>(); static bool IsVowel(char s) { return ((s >= '\u064B') && (s <= '\u0655')) || (s == '\u0670'); } static char Charshape(char s, int which) /* which 0=isolated 1=final 2=initial 3=medial */ { if ((s >= '\u0621') && (s <= '\u06D3')) { char[] c; if(maptable.TryGetValue(s, out c)) return c[which + 1]; } else if (s >= '\ufef5' && s <= '\ufefb') return (char)(s + which); return s; } static int Shapecount(char s) { if ((s >= '\u0621') && (s <= '\u06D3') && !IsVowel(s)) { char[] c; if(maptable.TryGetValue(s, out c)) return c.Length - 1; } else if (s == ZWJ) { return 4; } return 1; } static int Ligature(char newchar, Charstruct oldchar) { /* 0 == no ligature possible; 1 == vowel; 2 == two chars; 3 == Lam+Alef */ int retval = 0; if (oldchar.basechar == 0) return 0; if (IsVowel(newchar)) { retval = 1; if ((oldchar.vowel != 0) && (newchar != SHADDA)) { retval = 2; /* we eliminate the old vowel .. */ } switch (newchar) { case SHADDA: if (oldchar.mark1 == 0) { oldchar.mark1 = SHADDA; } else { return 0; /* no ligature possible */ } break; case HAMZABELOW: switch (oldchar.basechar) { case ALEF: oldchar.basechar = ALEFHAMZABELOW; retval = 2; break; case LAM_ALEF: oldchar.basechar = LAM_ALEFHAMZABELOW; retval = 2; break; default: oldchar.mark1 = HAMZABELOW; break; } break; case HAMZAABOVE: switch (oldchar.basechar) { case ALEF: oldchar.basechar = ALEFHAMZA; retval = 2; break; case LAM_ALEF: oldchar.basechar = LAM_ALEFHAMZA; retval = 2; break; case WAW: oldchar.basechar = WAWHAMZA; retval = 2; break; case YEH: case ALEFMAKSURA: case FARSIYEH: oldchar.basechar = YEHHAMZA; retval = 2; break; default: /* whatever sense this may make .. */ oldchar.mark1 = HAMZAABOVE; break; } break; case MADDA: switch (oldchar.basechar) { case ALEF: oldchar.basechar = ALEFMADDA; retval = 2; break; } break; default: oldchar.vowel = newchar; break; } if (retval == 1) { oldchar.lignum++; } return retval; } if (oldchar.vowel != 0) { /* if we already joined a vowel, we can't join a Hamza */ return 0; } switch (oldchar.basechar) { case LAM: switch (newchar) { case ALEF: oldchar.basechar = LAM_ALEF; oldchar.numshapes = 2; retval = 3; break; case ALEFHAMZA: oldchar.basechar = LAM_ALEFHAMZA; oldchar.numshapes = 2; retval = 3; break; case ALEFHAMZABELOW: oldchar.basechar = LAM_ALEFHAMZABELOW; oldchar.numshapes = 2; retval = 3; break; case ALEFMADDA: oldchar.basechar = LAM_ALEFMADDA; oldchar.numshapes = 2; retval = 3; break; } break; case (char)0: oldchar.basechar = newchar; oldchar.numshapes = Shapecount(newchar); retval = 1; break; } return retval; } static void Copycstostring(StringBuilder str, Charstruct s, int level) { /* s is a shaped charstruct; i is the index into the string */ if (s.basechar == 0) return; str.Append(s.basechar); s.lignum--; if (s.mark1 != 0) { if ((level & ar_novowel) == 0) { str.Append(s.mark1); s.lignum--; } else { s.lignum--; } } if (s.vowel != 0) { if ((level & ar_novowel) == 0) { str.Append(s.vowel); s.lignum--; } else { /* vowel elimination */ s.lignum--; } } } // return len internal static void Doublelig(StringBuilder str, int level) /* Ok. We have presentation ligatures in our font. */ { int len; int olen = len = str.Length; int j = 0, si = 1; char lapresult; while (si < olen) { lapresult = (char)0; if ((level & ar_composedtashkeel) != 0) { switch (str[j]) { case SHADDA: switch (str[si]) { case KASRA: lapresult = '\uFC62'; break; case FATHA: lapresult = '\uFC60'; break; case DAMMA: lapresult = '\uFC61'; break; case '\u064C': lapresult = '\uFC5E'; break; case '\u064D': lapresult = '\uFC5F'; break; } break; case KASRA: if (str[si] == SHADDA) lapresult = '\uFC62'; break; case FATHA: if (str[si] == SHADDA) lapresult = '\uFC60'; break; case DAMMA: if (str[si] == SHADDA) lapresult = '\uFC61'; break; } } if ((level & ar_lig) != 0) { switch (str[j]) { case '\uFEDF': /* LAM initial */ switch (str[si]) { case '\uFE9E': lapresult = '\uFC3F'; break; /* JEEM final */ case '\uFEA0': lapresult = '\uFCC9'; break; /* JEEM medial */ case '\uFEA2': lapresult = '\uFC40'; break; /* HAH final */ case '\uFEA4': lapresult = '\uFCCA'; break; /* HAH medial */ case '\uFEA6': lapresult = '\uFC41'; break; /* KHAH final */ case '\uFEA8': lapresult = '\uFCCB'; break; /* KHAH medial */ case '\uFEE2': lapresult = '\uFC42'; break; /* MEEM final */ case '\uFEE4': lapresult = '\uFCCC'; break; /* MEEM medial */ } break; case '\uFE97': /* TEH inital */ switch (str[si]) { case '\uFEA0': lapresult = '\uFCA1'; break; /* JEEM medial */ case '\uFEA4': lapresult = '\uFCA2'; break; /* HAH medial */ case '\uFEA8': lapresult = '\uFCA3'; break; /* KHAH medial */ } break; case '\uFE91': /* BEH inital */ switch (str[si]) { case '\uFEA0': lapresult = '\uFC9C'; break; /* JEEM medial */ case '\uFEA4': lapresult = '\uFC9D'; break; /* HAH medial */ case '\uFEA8': lapresult = '\uFC9E'; break; /* KHAH medial */ } break; case '\uFEE7': /* NOON inital */ switch (str[si]) { case '\uFEA0': lapresult = '\uFCD2'; break; /* JEEM initial */ case '\uFEA4': lapresult = '\uFCD3'; break; /* HAH medial */ case '\uFEA8': lapresult = '\uFCD4'; break; /* KHAH medial */ } break; case '\uFEE8': /* NOON medial */ switch (str[si]) { case '\uFEAE': lapresult = '\uFC8A'; break; /* REH final */ case '\uFEB0': lapresult = '\uFC8B'; break; /* ZAIN final */ } break; case '\uFEE3': /* MEEM initial */ switch (str[si]) { case '\uFEA0': lapresult = '\uFCCE'; break; /* JEEM medial */ case '\uFEA4': lapresult = '\uFCCF'; break; /* HAH medial */ case '\uFEA8': lapresult = '\uFCD0'; break; /* KHAH medial */ case '\uFEE4': lapresult = '\uFCD1'; break; /* MEEM medial */ } break; case '\uFED3': /* FEH initial */ switch (str[si]) { case '\uFEF2': lapresult = '\uFC32'; break; /* YEH final */ } break; default: break; } /* end switch string[si] */ } if (lapresult != 0) { str[j] = lapresult; len--; si++; /* jump over one character */ /* we'll have to change this, too. */ } else { j++; str[j] = str[si]; si++; } } str.Length = len; } static bool Connects_to_left(Charstruct a) { return a.numshapes > 2; } internal static void Shape(char[] text, StringBuilder str, int level) { /* string is assumed to be empty and big enough. * text is the original text. * This routine does the basic arabic reshaping. * *len the number of non-null characters. * * Note: We have to unshape each character first! */ int join; int which; char nextletter; int p = 0; /* initialize for output */ Charstruct oldchar = new Charstruct(); Charstruct curchar = new Charstruct(); while (p < text.Length) { nextletter = text[p++]; //nextletter = unshape (nextletter); join = Ligature(nextletter, curchar); if (join == 0) { /* shape curchar */ int nc = Shapecount(nextletter); //(*len)++; if (nc == 1) { which = 0; /* final or isolated */ } else { which = 2; /* medial or initial */ } if (Connects_to_left(oldchar)) { which++; } which = which % (curchar.numshapes); curchar.basechar = Charshape(curchar.basechar, which); /* get rid of oldchar */ Copycstostring(str, oldchar, level); oldchar = curchar; /* new values in oldchar */ /* init new curchar */ curchar = new Charstruct(); curchar.basechar = nextletter; curchar.numshapes = nc; curchar.lignum++; // (*len) += unligature (&curchar, level); } else if (join == 1) { } // else // { // (*len) += unligature (&curchar, level); // } // p = g_utf8_next_char (p); } /* Handle last char */ if (Connects_to_left(oldchar)) which = 1; else which = 0; which = which % (curchar.numshapes); curchar.basechar = Charshape(curchar.basechar, which); /* get rid of oldchar */ Copycstostring(str, oldchar, level); Copycstostring(str, curchar, level); } internal static int Arabic_shape(char[] src, int srcoffset, int srclength, char[] dest, int destoffset, int destlength, int level) { char[] str = new char[srclength]; for (int k = srclength + srcoffset - 1; k >= srcoffset; --k) str[k - srcoffset] = src[k]; StringBuilder str2 = new StringBuilder(srclength); Shape(str, str2, level); if ((level & (ar_composedtashkeel | ar_lig)) != 0) Doublelig(str2, level); // string.Reverse(); System.Array.Copy(str2.ToString().ToCharArray(), 0, dest, destoffset, str2.Length); return str2.Length; } internal static void ProcessNumbers(char[] text, int offset, int length, int options) { int limit = offset + length; if ((options & DIGITS_MASK) != 0) { char digitBase = '\u0030'; // European digits switch (options & DIGIT_TYPE_MASK) { case DIGIT_TYPE_AN: digitBase = '\u0660'; // Arabic-Indic digits break; case DIGIT_TYPE_AN_EXTENDED: digitBase = '\u06f0'; // Eastern Arabic-Indic digits (Persian and Urdu) break; default: break; } switch (options & DIGITS_MASK) { case DIGITS_EN2AN: { int digitDelta = digitBase - '\u0030'; for (int i = offset; i < limit; ++i) { char ch = text[i]; if (ch <= '\u0039' && ch >= '\u0030') { text[i] += (char)digitDelta; } } } break; case DIGITS_AN2EN: { char digitTop = (char)(digitBase + 9); int digitDelta = '\u0030' - digitBase; for (int i = offset; i < limit; ++i) { char ch = text[i]; if (ch <= digitTop && ch >= digitBase) { text[i] += (char)digitDelta; } } } break; case DIGITS_EN2AN_INIT_LR: ShapeToArabicDigitsWithContext(text, 0, length, digitBase, false); break; case DIGITS_EN2AN_INIT_AL: ShapeToArabicDigitsWithContext(text, 0, length, digitBase, true); break; default: break; } } } internal static void ShapeToArabicDigitsWithContext(char[] dest, int start, int length, char digitBase, bool lastStrongWasAL) { digitBase -= '0'; // move common adjustment out of loop int limit = start + length; for (int i = start; i < limit; ++i) { char ch = dest[i]; switch (BidiOrder.GetDirection(ch)) { case BidiOrder.L: case BidiOrder.R: lastStrongWasAL = false; break; case BidiOrder.AL: lastStrongWasAL = true; break; case BidiOrder.EN: if (lastStrongWasAL && ch <= '\u0039') { dest[i] = (char)(ch + digitBase); } break; default: break; } } } public static bool TryGetReverseMapping(char key, out char value) { return reverseLigatureMapTable.TryGetValue(key, out value); } private const char ALEF = '\u0627'; private const char ALEFHAMZA = '\u0623'; private const char ALEFHAMZABELOW = '\u0625'; private const char ALEFMADDA = '\u0622'; private const char LAM = '\u0644'; private const char HAMZA = '\u0621'; private const char TATWEEL = '\u0640'; private const char ZWJ = '\u200D'; private const char HAMZAABOVE = '\u0654'; private const char HAMZABELOW = '\u0655'; private const char WAWHAMZA = '\u0624'; private const char YEHHAMZA = '\u0626'; private const char WAW = '\u0648'; private const char ALEFMAKSURA = '\u0649'; private const char YEH = '\u064A'; private const char FARSIYEH = '\u06CC'; private const char SHADDA = '\u0651'; private const char KASRA = '\u0650'; private const char FATHA = '\u064E'; private const char DAMMA = '\u064F'; private const char MADDA = '\u0653'; private const char LAM_ALEF = '\uFEFB'; private const char LAM_ALEFHAMZA = '\uFEF7'; private const char LAM_ALEFHAMZABELOW = '\uFEF9'; private const char LAM_ALEFMADDA = '\uFEF5'; private static char[][] chartable = { new char[]{'\u0621', '\uFE80'}, /* HAMZA */ new char[]{'\u0622', '\uFE81', '\uFE82'}, /* ALEF WITH MADDA ABOVE */ new char[]{'\u0623', '\uFE83', '\uFE84'}, /* ALEF WITH HAMZA ABOVE */ new char[]{'\u0624', '\uFE85', '\uFE86'}, /* WAW WITH HAMZA ABOVE */ new char[]{'\u0625', '\uFE87', '\uFE88'}, /* ALEF WITH HAMZA BELOW */ new char[]{'\u0626', '\uFE89', '\uFE8A', '\uFE8B', '\uFE8C'}, /* YEH WITH HAMZA ABOVE */ new char[]{'\u0627', '\uFE8D', '\uFE8E'}, /* ALEF */ new char[]{'\u0628', '\uFE8F', '\uFE90', '\uFE91', '\uFE92'}, /* BEH */ new char[]{'\u0629', '\uFE93', '\uFE94'}, /* TEH MARBUTA */ new char[]{'\u062A', '\uFE95', '\uFE96', '\uFE97', '\uFE98'}, /* TEH */ new char[]{'\u062B', '\uFE99', '\uFE9A', '\uFE9B', '\uFE9C'}, /* THEH */ new char[]{'\u062C', '\uFE9D', '\uFE9E', '\uFE9F', '\uFEA0'}, /* JEEM */ new char[]{'\u062D', '\uFEA1', '\uFEA2', '\uFEA3', '\uFEA4'}, /* HAH */ new char[]{'\u062E', '\uFEA5', '\uFEA6', '\uFEA7', '\uFEA8'}, /* KHAH */ new char[]{'\u062F', '\uFEA9', '\uFEAA'}, /* DAL */ new char[]{'\u0630', '\uFEAB', '\uFEAC'}, /* THAL */ new char[]{'\u0631', '\uFEAD', '\uFEAE'}, /* REH */ new char[]{'\u0632', '\uFEAF', '\uFEB0'}, /* ZAIN */ new char[]{'\u0633', '\uFEB1', '\uFEB2', '\uFEB3', '\uFEB4'}, /* SEEN */ new char[]{'\u0634', '\uFEB5', '\uFEB6', '\uFEB7', '\uFEB8'}, /* SHEEN */ new char[]{'\u0635', '\uFEB9', '\uFEBA', '\uFEBB', '\uFEBC'}, /* SAD */ new char[]{'\u0636', '\uFEBD', '\uFEBE', '\uFEBF', '\uFEC0'}, /* DAD */ new char[]{'\u0637', '\uFEC1', '\uFEC2', '\uFEC3', '\uFEC4'}, /* TAH */ new char[]{'\u0638', '\uFEC5', '\uFEC6', '\uFEC7', '\uFEC8'}, /* ZAH */ new char[]{'\u0639', '\uFEC9', '\uFECA', '\uFECB', '\uFECC'}, /* AIN */ new char[]{'\u063A', '\uFECD', '\uFECE', '\uFECF', '\uFED0'}, /* GHAIN */ new char[]{'\u0640', '\u0640', '\u0640', '\u0640', '\u0640'}, /* TATWEEL */ new char[]{'\u0641', '\uFED1', '\uFED2', '\uFED3', '\uFED4'}, /* FEH */ new char[]{'\u0642', '\uFED5', '\uFED6', '\uFED7', '\uFED8'}, /* QAF */ new char[]{'\u0643', '\uFED9', '\uFEDA', '\uFEDB', '\uFEDC'}, /* KAF */ new char[]{'\u0644', '\uFEDD', '\uFEDE', '\uFEDF', '\uFEE0'}, /* LAM */ new char[]{'\u0645', '\uFEE1', '\uFEE2', '\uFEE3', '\uFEE4'}, /* MEEM */ new char[]{'\u0646', '\uFEE5', '\uFEE6', '\uFEE7', '\uFEE8'}, /* NOON */ new char[]{'\u0647', '\uFEE9', '\uFEEA', '\uFEEB', '\uFEEC'}, /* HEH */ new char[]{'\u0648', '\uFEED', '\uFEEE'}, /* WAW */ new char[]{'\u0649', '\uFEEF', '\uFEF0', '\uFBE8', '\uFBE9'}, /* ALEF MAKSURA */ new char[]{'\u064A', '\uFEF1', '\uFEF2', '\uFEF3', '\uFEF4'}, /* YEH */ new char[]{'\u0671', '\uFB50', '\uFB51'}, /* ALEF WASLA */ new char[]{'\u0679', '\uFB66', '\uFB67', '\uFB68', '\uFB69'}, /* TTEH */ new char[]{'\u067A', '\uFB5E', '\uFB5F', '\uFB60', '\uFB61'}, /* TTEHEH */ new char[]{'\u067B', '\uFB52', '\uFB53', '\uFB54', '\uFB55'}, /* BEEH */ new char[]{'\u067E', '\uFB56', '\uFB57', '\uFB58', '\uFB59'}, /* PEH */ new char[]{'\u067F', '\uFB62', '\uFB63', '\uFB64', '\uFB65'}, /* TEHEH */ new char[]{'\u0680', '\uFB5A', '\uFB5B', '\uFB5C', '\uFB5D'}, /* BEHEH */ new char[]{'\u0683', '\uFB76', '\uFB77', '\uFB78', '\uFB79'}, /* NYEH */ new char[]{'\u0684', '\uFB72', '\uFB73', '\uFB74', '\uFB75'}, /* DYEH */ new char[]{'\u0686', '\uFB7A', '\uFB7B', '\uFB7C', '\uFB7D'}, /* TCHEH */ new char[]{'\u0687', '\uFB7E', '\uFB7F', '\uFB80', '\uFB81'}, /* TCHEHEH */ new char[]{'\u0688', '\uFB88', '\uFB89'}, /* DDAL */ new char[]{'\u068C', '\uFB84', '\uFB85'}, /* DAHAL */ new char[]{'\u068D', '\uFB82', '\uFB83'}, /* DDAHAL */ new char[]{'\u068E', '\uFB86', '\uFB87'}, /* DUL */ new char[]{'\u0691', '\uFB8C', '\uFB8D'}, /* RREH */ new char[]{'\u0698', '\uFB8A', '\uFB8B'}, /* JEH */ new char[]{'\u06A4', '\uFB6A', '\uFB6B', '\uFB6C', '\uFB6D'}, /* VEH */ new char[]{'\u06A6', '\uFB6E', '\uFB6F', '\uFB70', '\uFB71'}, /* PEHEH */ new char[]{'\u06A9', '\uFB8E', '\uFB8F', '\uFB90', '\uFB91'}, /* KEHEH */ new char[]{'\u06AD', '\uFBD3', '\uFBD4', '\uFBD5', '\uFBD6'}, /* NG */ new char[]{'\u06AF', '\uFB92', '\uFB93', '\uFB94', '\uFB95'}, /* GAF */ new char[]{'\u06B1', '\uFB9A', '\uFB9B', '\uFB9C', '\uFB9D'}, /* NGOEH */ new char[]{'\u06B3', '\uFB96', '\uFB97', '\uFB98', '\uFB99'}, /* GUEH */ new char[]{'\u06BA', '\uFB9E', '\uFB9F'}, /* NOON GHUNNA */ new char[]{'\u06BB', '\uFBA0', '\uFBA1', '\uFBA2', '\uFBA3'}, /* RNOON */ new char[]{'\u06BE', '\uFBAA', '\uFBAB', '\uFBAC', '\uFBAD'}, /* HEH DOACHASHMEE */ new char[]{'\u06C0', '\uFBA4', '\uFBA5'}, /* HEH WITH YEH ABOVE */ new char[]{'\u06C1', '\uFBA6', '\uFBA7', '\uFBA8', '\uFBA9'}, /* HEH GOAL */ new char[]{'\u06C5', '\uFBE0', '\uFBE1'}, /* KIRGHIZ OE */ new char[]{'\u06C6', '\uFBD9', '\uFBDA'}, /* OE */ new char[]{'\u06C7', '\uFBD7', '\uFBD8'}, /* U */ new char[]{'\u06C8', '\uFBDB', '\uFBDC'}, /* YU */ new char[]{'\u06C9', '\uFBE2', '\uFBE3'}, /* KIRGHIZ YU */ new char[]{'\u06CB', '\uFBDE', '\uFBDF'}, /* VE */ new char[]{'\u06CC', '\uFBFC', '\uFBFD', '\uFBFE', '\uFBFF'}, /* FARSI YEH */ new char[]{'\u06D0', '\uFBE4', '\uFBE5', '\uFBE6', '\uFBE7'}, /* E */ new char[]{'\u06D2', '\uFBAE', '\uFBAF'}, /* YEH BARREE */ new char[]{'\u06D3', '\uFBB0', '\uFBB1'} /* YEH BARREE WITH HAMZA ABOVE */ }; public const int ar_nothing = 0x0; public const int ar_novowel = 0x1; public const int ar_composedtashkeel = 0x4; public const int ar_lig = 0x8; /** * Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits. */ public const int DIGITS_EN2AN = 0x20; /** * Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039). */ public const int DIGITS_AN2EN = 0x40; /** * Digit shaping option: * Replace European digits (U+0030...U+0039) by Arabic-Indic digits * if the most recent strongly directional character * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). * The initial state at the start of the text is assumed to be not an Arabic, * letter, so European digits at the start of the text will not change. * Compare to DIGITS_ALEN2AN_INIT_AL. */ public const int DIGITS_EN2AN_INIT_LR = 0x60; /** * Digit shaping option: * Replace European digits (U+0030...U+0039) by Arabic-Indic digits * if the most recent strongly directional character * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). * The initial state at the start of the text is assumed to be an Arabic, * letter, so European digits at the start of the text will change. * Compare to DIGITS_ALEN2AN_INT_LR. */ public const int DIGITS_EN2AN_INIT_AL = 0x80; /** Not a valid option value. */ private const int DIGITS_RESERVED = 0xa0; /** * Bit mask for digit shaping options. */ public const int DIGITS_MASK = 0xe0; /** * Digit type option: Use Arabic-Indic digits (U+0660...U+0669). */ public const int DIGIT_TYPE_AN = 0; /** * Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9). */ public const int DIGIT_TYPE_AN_EXTENDED = 0x100; /** * Bit mask for digit type options. */ public const int DIGIT_TYPE_MASK = '\u0100'; // '\u3f00'? private class Charstruct { internal char basechar; internal char mark1; /* has to be initialized to zero */ internal char vowel; internal int lignum; /* is a ligature with lignum aditional characters */ internal int numshapes = 1; } protected int options = 0; protected int runDirection = PdfWriter.RUN_DIRECTION_RTL; static ArabicLigaturizer() { foreach (char[] c in chartable) { maptable[c[0]] = c; switch (c.Length) { // only store the 2->1 and 4->3 mapping, if they are there case 5: reverseLigatureMapTable[c[4]] = c[3]; reverseLigatureMapTable[c[2]] = c[1]; break; case 3: reverseLigatureMapTable[c[2]] = c[1]; break; } if (c[0] == 0x0637 || c[0] == 0x0638) { reverseLigatureMapTable[c[4]] = c[1]; reverseLigatureMapTable[c[3]] = c[1]; } } } public ArabicLigaturizer() { } public ArabicLigaturizer(int runDirection, int options) { this.runDirection = runDirection; this.options = options; } virtual public String Process(String s) { return BidiLine.ProcessLTR(s, runDirection, options); } /** * Arabic is written from right to left. * @return true * @see com.itextpdf.text.pdf.languages.LanguageProcessor#isRTL() */ virtual public bool IsRTL() { return true; } } }
44.8425
140
0.399203
[ "MIT" ]
mdalaminmiah/Diagnostic-Bill-management-System
packages/itextsharp-all-5.5.10/itextsharp-src-core/iTextSharp/text/pdf/languages/ArabicLigaturizer.cs
35,874
C#
using UnityEngine; public class GameEventSystemSingleton : MonoBehaviour { static GameEventSystemSingleton _instance; void Awake() { if (_instance != null && _instance != this) DestroyImmediate(gameObject); else { _instance = this; ObjectExtension.DontDestroyOnLoad(gameObject); } } }
20.666667
58
0.604839
[ "MIT" ]
nokia-wroclaw/innovativeproject-action-race
Action Race/Assets/Scripts/GameEventSystemSingleton.cs
374
C#
using System.Reflection; using Exceptional.Core; using NSpec; namespace Exceptional.Tests.Standard { public class describe_ClientSummary : nspec { public void when_creating_client_summary() { ClientSummary summary = null; context["with default values"] = () => { before = () => summary = new ClientSummary(); it["Name should be Exceptional.NET"] = () => summary.Name.should_be("Exceptional.NET"); it["ProtocolVersion should be 6"] = () => summary.ProtocolVersion.should_be("6"); it["Version should match Exceptional.Core version"] = () => summary.Version.should_be(Assembly.GetAssembly(typeof (ClientSummary)).GetName().Version.ToString()); }; } } }
35.375
182
0.567727
[ "Apache-2.0" ]
mroach/exceptional-net
src/Exceptional.Tests/Standard/describe_ClientSummary.cs
851
C#
using System; using System.Xml.Serialization; using System.ComponentModel.DataAnnotations; using BroadWorksConnector.Ocip.Validation; using System.Collections.Generic; namespace BroadWorksConnector.Ocip.Models { /// <summary> /// Add a user schedule. /// The response is either a SuccessResponse or an ErrorResponse. /// <see cref="SuccessResponse"/> /// <see cref="ErrorResponse"/> /// </summary> [Serializable] [XmlRoot(Namespace = "")] [Groups(@"[{""__type"":""Sequence:#BroadWorksConnector.Ocip.Validation"",""id"":""53d18cc797d03d802cbc411ad821f1d4:3514""}]")] public class UserScheduleAddRequest : BroadWorksConnector.Ocip.Models.C.OCIRequest { private string _userId; [XmlElement(ElementName = "userId", IsNullable = false, Namespace = "")] [Group(@"53d18cc797d03d802cbc411ad821f1d4:3514")] [MinLength(1)] [MaxLength(161)] public string UserId { get => _userId; set { UserIdSpecified = true; _userId = value; } } [XmlIgnore] protected bool UserIdSpecified { get; set; } private string _scheduleName; [XmlElement(ElementName = "scheduleName", IsNullable = false, Namespace = "")] [Group(@"53d18cc797d03d802cbc411ad821f1d4:3514")] [MinLength(1)] [MaxLength(40)] public string ScheduleName { get => _scheduleName; set { ScheduleNameSpecified = true; _scheduleName = value; } } [XmlIgnore] protected bool ScheduleNameSpecified { get; set; } private BroadWorksConnector.Ocip.Models.ScheduleType _scheduleType; [XmlElement(ElementName = "scheduleType", IsNullable = false, Namespace = "")] [Group(@"53d18cc797d03d802cbc411ad821f1d4:3514")] public BroadWorksConnector.Ocip.Models.ScheduleType ScheduleType { get => _scheduleType; set { ScheduleTypeSpecified = true; _scheduleType = value; } } [XmlIgnore] protected bool ScheduleTypeSpecified { get; set; } } }
28.911392
130
0.589755
[ "MIT" ]
JTOne123/broadworks-connector-net
BroadworksConnector/Ocip/Models/UserScheduleAddRequest.cs
2,284
C#
namespace LayoutDesigner.Console { public class LayoutLayer { } }
13
33
0.666667
[ "Apache-2.0" ]
Patrickkk/Tests
LayoutDesigner/LayoutDesigner.Console/LayoutLayer.cs
80
C#
namespace ZeroLevel.Patterns.Queries { public class QueryResult { public bool Success { get; set; } public string Reason { get; set; } public long Count { get; set; } public static QueryResult Result(long count = 0) { return new QueryResult { Count = count, Success = true }; } public static QueryResult Fault(string reason) { return new QueryResult { Reason = reason, Success = false }; } } }
22.814815
56
0.465909
[ "MIT" ]
ogoun/Zero
ZeroLevel/Services/Queries/Storage/QueryResult.cs
618
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Peering { /// <summary> /// The peering service prefix class. /// API Version: 2021-01-01. /// </summary> [AzureNativeResourceType("azure-native:peering:Prefix")] public partial class Prefix : Pulumi.CustomResource { /// <summary> /// The error message for validation state /// </summary> [Output("errorMessage")] public Output<string> ErrorMessage { get; private set; } = null!; /// <summary> /// The list of events for peering service prefix /// </summary> [Output("events")] public Output<ImmutableArray<Outputs.PeeringServicePrefixEventResponse>> Events { get; private set; } = null!; /// <summary> /// The prefix learned type /// </summary> [Output("learnedType")] public Output<string> LearnedType { get; private set; } = null!; /// <summary> /// The name of the resource. /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// The peering service prefix key /// </summary> [Output("peeringServicePrefixKey")] public Output<string?> PeeringServicePrefixKey { get; private set; } = null!; /// <summary> /// The prefix from which your traffic originates. /// </summary> [Output("prefix")] public Output<string?> PrefixValue { get; private set; } = null!; /// <summary> /// The prefix validation state /// </summary> [Output("prefixValidationState")] public Output<string> PrefixValidationState { get; private set; } = null!; /// <summary> /// The provisioning state of the resource. /// </summary> [Output("provisioningState")] public Output<string> ProvisioningState { get; private set; } = null!; /// <summary> /// The type of the resource. /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Create a Prefix resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public Prefix(string name, PrefixArgs args, CustomResourceOptions? options = null) : base("azure-native:peering:Prefix", name, args ?? new PrefixArgs(), MakeResourceOptions(options, "")) { } private Prefix(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:peering:Prefix", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:peering:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20190801preview:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20190801preview:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20190901preview:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20190901preview:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20200101preview:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20200101preview:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20200401:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20200401:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20201001:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20201001:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20210101:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20210101:Prefix"}, new Pulumi.Alias { Type = "azure-native:peering/v20210601:Prefix"}, new Pulumi.Alias { Type = "azure-nextgen:peering/v20210601:Prefix"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing Prefix resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static Prefix Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new Prefix(name, id, options); } } public sealed class PrefixArgs : Pulumi.ResourceArgs { /// <summary> /// The name of the peering service. /// </summary> [Input("peeringServiceName", required: true)] public Input<string> PeeringServiceName { get; set; } = null!; /// <summary> /// The peering service prefix key /// </summary> [Input("peeringServicePrefixKey")] public Input<string>? PeeringServicePrefixKey { get; set; } /// <summary> /// The prefix from which your traffic originates. /// </summary> [Input("prefix")] public Input<string>? Prefix { get; set; } /// <summary> /// The name of the prefix. /// </summary> [Input("prefixName")] public Input<string>? PrefixName { get; set; } /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; public PrefixArgs() { } } }
40.614035
118
0.582433
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Peering/Prefix.cs
6,945
C#
namespace TimeLog.ReportingApi.SDK { public class TaskStatus { public static int All { get { return -1; } } public static int Active { get { return 1; } } public static int Inactive { get { return 0; } } } }
16
36
0.3
[ "MIT" ]
DBFBlackbull/worktimeanalyzer.
TimeLog.ReportingApi.SDK/TaskStatus.cs
482
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class playAnimation : MonoBehaviour { public Animator animator; // Use this for initialization void Start () { animator.Play("loading"); } // Update is called once per frame void Update () { } }
17.055556
44
0.697068
[ "MIT" ]
Sketching101/moon2
Assets/Scripts/playAnimation.cs
309
C#
using CodingTest.Domain.Models.Enum; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Threading.Tasks; namespace CodingTest.Resources { public class TodoResource { public int Id { get; set; } [StringLength(255)] public string Title { get; set; } public string Description { get; set; } public int Complete { get; set; } [Column(TypeName = "Date")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")] public DateTime TimeExpired { get; set; } [JsonConverter(typeof(StringEnumConverter))] public EStatus Status { get; set; } } }
26.3125
90
0.686461
[ "Apache-2.0" ]
MasDeny/Todo-List
CodingTest/Resources/TodoResource.cs
844
C#
using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; using NBitcoin; using Stratis.Bitcoin.Consensus; using Stratis.Bitcoin.Features.Consensus.Rules.CommonRules; using Stratis.Bitcoin.Features.MemoryPool; using Stratis.Bitcoin.Features.MemoryPool.Interfaces; using Stratis.Bitcoin.Features.Miner.Comparers; using Stratis.Bitcoin.Mining; using Stratis.Bitcoin.Utilities; namespace Stratis.Bitcoin.Features.Miner { /// <summary> /// A high level class that will allow the ability to override or inject functionality based on what type of block creation logic is used. /// </summary> public abstract class BlockDefinition { /// <summary> /// Tip of the chain that this instance will work with without touching any shared chain resources. /// </summary> protected ChainedHeader ChainTip; /// <summary>Manager of the longest fully validated chain of blocks.</summary> protected readonly IConsensusManager ConsensusManager; /// <summary>Provider of date time functions.</summary> protected readonly IDateTimeProvider DateTimeProvider; /// <summary>Instance logger.</summary> private readonly ILogger logger; /// <summary>Transaction memory pool for managing transactions in the memory pool.</summary> protected readonly ITxMempool Mempool; /// <summary>Lock for memory pool access.</summary> protected readonly MempoolSchedulerLock MempoolLock; /// <summary>The current network.</summary> protected readonly Network Network; /// <summary>Assembler options specific to the assembler e.g. <see cref="BlockDefinitionOptions.BlockMaxSize"/>.</summary> protected BlockDefinitionOptions Options; /// <summary> /// Limit the number of attempts to add transactions to the block when it is /// close to full; this is just a simple heuristic to finish quickly if the /// mempool has a lot of entries. /// </summary> protected const int MaxConsecutiveAddTransactionFailures = 1000; /// <summary> /// Unconfirmed transactions in the memory pool often depend on other /// transactions in the memory pool. When we select transactions from the /// pool, we select by highest fee rate of a transaction combined with all /// its ancestors. /// </summary> protected long LastBlockTx = 0; protected long LastBlockSize = 0; protected long LastBlockWeight = 0; protected long MedianTimePast; /// <summary> /// The constructed block template. /// </summary> protected BlockTemplate BlockTemplate; /// <summary> /// A convenience pointer that always refers to the <see cref="Block"/> in <see cref="BlockTemplate"/>. /// </summary> protected Block block; /// <summary> /// Configuration parameters for the block size. /// </summary> protected bool IncludeWitness; protected bool NeedSizeAccounting; protected FeeRate BlockMinFeeRate; /// <summary> /// Information on the current status of the block. /// </summary> protected long BlockWeight; protected long BlockSize; protected long BlockTx; protected long BlockSigOpsCost; public Money fees; protected TxMempool.SetEntries inBlock; protected Transaction coinbase; /// <summary> /// Chain context for the block. /// </summary> protected int height; protected long LockTimeCutoff; protected Script scriptPubKey; protected BlockDefinition( IConsensusManager consensusManager, IDateTimeProvider dateTimeProvider, ILoggerFactory loggerFactory, ITxMempool mempool, MempoolSchedulerLock mempoolLock, MinerSettings minerSettings, Network network) { this.ConsensusManager = consensusManager; this.DateTimeProvider = dateTimeProvider; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); this.Mempool = mempool; this.MempoolLock = mempoolLock; this.Network = network; this.Options = minerSettings.BlockDefinitionOptions; this.BlockMinFeeRate = this.Options.BlockMinFeeRate; // Whether we need to account for byte usage (in addition to weight usage). this.NeedSizeAccounting = (this.Options.BlockMaxSize < network.Consensus.Options.MaxBlockSerializedSize); this.Configure(); } /// <summary> /// Compute the block version. /// </summary> protected virtual void ComputeBlockVersion() { this.height = this.ChainTip.Height + 1; var headerVersionRule = this.ConsensusManager.ConsensusRules.GetRule<HeaderVersionRule>(); this.block.Header.Version = headerVersionRule.ComputeBlockVersion(this.ChainTip); } /// <summary> /// Create coinbase transaction. /// Set the coin base with zero money. /// Once we have the fee we can update the amount. /// </summary> protected virtual void CreateCoinbase() { this.coinbase = this.Network.CreateTransaction(); this.coinbase.Time = (uint)this.DateTimeProvider.GetAdjustedTimeAsUnixTimestamp(); this.coinbase.AddInput(TxIn.CreateCoinbase(this.ChainTip.Height + 1)); this.coinbase.AddOutput(new TxOut(Money.Zero, this.scriptPubKey)); this.block.AddTransaction(this.coinbase); } /// <summary> /// Configures (resets) the builder to its default state /// before constructing a new block. /// </summary> private void Configure() { this.BlockSize = 1000; this.BlockTemplate = new BlockTemplate(this.Network); this.BlockTx = 0; this.BlockWeight = 1000 * this.Network.Consensus.Options.WitnessScaleFactor; this.BlockSigOpsCost = 400; this.fees = 0; this.inBlock = new TxMempool.SetEntries(); this.IncludeWitness = false; } /// <summary> /// Constructs a block template which will be passed to consensus. /// </summary> /// <param name="chainTip">Tip of the chain that this instance will work with without touching any shared chain resources.</param> /// <param name="scriptPubKey">Script that explains what conditions must be met to claim ownership of a coin.</param> /// <returns>The contructed <see cref="Mining.BlockTemplate"/>.</returns> protected void OnBuild(ChainedHeader chainTip, Script scriptPubKey) { this.Configure(); this.ChainTip = chainTip; this.block = this.BlockTemplate.Block; this.scriptPubKey = scriptPubKey; this.CreateCoinbase(); this.ComputeBlockVersion(); // TODO: MineBlocksOnDemand // -regtest only: allow overriding block.nVersion with // -blockversion=N to test forking scenarios //if (this.network. chainparams.MineBlocksOnDemand()) // pblock->nVersion = GetArg("-blockversion", pblock->nVersion); this.MedianTimePast = Utils.DateTimeToUnixTime(this.ChainTip.GetMedianTimePast()); this.LockTimeCutoff = MempoolValidator.StandardLocktimeVerifyFlags.HasFlag(Transaction.LockTimeFlags.MedianTimePast) ? this.MedianTimePast : this.block.Header.Time; // TODO: Implement Witness Code // Decide whether to include witness transactions // This is only needed in case the witness softfork activation is reverted // (which would require a very deep reorganization) or when // -promiscuousmempoolflags is used. // TODO: replace this with a call to main to assess validity of a mempool // transaction (which in most cases can be a no-op). this.IncludeWitness = false; //IsWitnessEnabled(pindexPrev, chainparams.GetConsensus()) && fMineWitnessTx; // Add transactions from the mempool this.AddTransactions(out int nPackagesSelected, out int nDescendantsUpdated); this.LastBlockTx = this.BlockTx; this.LastBlockSize = this.BlockSize; this.LastBlockWeight = this.BlockWeight; // TODO: Implement Witness Code // pblocktemplate->CoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus()); var coinviewRule = this.ConsensusManager.ConsensusRules.GetRule<CoinViewRule>(); this.coinbase.Outputs[0].Value = this.fees + coinviewRule.GetProofOfWorkReward(this.height); this.BlockTemplate.TotalFee = this.fees; // We need the fee details per transaction to be readily available in case we have to remove transactions from the block later. this.BlockTemplate.FeeDetails = this.inBlock.Select(i => new { i.TransactionHash, i.Fee }).ToDictionary(d => d.TransactionHash, d => d.Fee); int nSerializeSize = this.block.GetSerializedSize(); this.logger.LogDebug("Serialized size is {0} bytes, block weight is {1}, number of txs is {2}, tx fees are {3}, number of sigops is {4}.", nSerializeSize, this.block.GetBlockWeight(this.Network.Consensus), this.BlockTx, this.fees, this.BlockSigOpsCost); this.UpdateHeaders(); } /// <summary> /// Network specific logic to add a transaction to the block from a given mempool entry. /// </summary> public abstract void AddToBlock(TxMempoolEntry mempoolEntry); /// <summary> /// Adds a transaction to the block and updates the <see cref="BlockSize"/> and <see cref="BlockTx"/> values. /// </summary> protected void AddTransactionToBlock(Transaction transaction) { this.block.AddTransaction(transaction); this.BlockTx++; if (this.NeedSizeAccounting) this.BlockSize += transaction.GetSerializedSize(); } /// <summary> /// Updates block statistics from the given mempool entry. /// <para>The block's <see cref="BlockSigOpsCost"/> and <see cref="BlockWeight"/> values are adjusted. /// </para> /// </summary> protected void UpdateBlockStatistics(TxMempoolEntry mempoolEntry) { this.BlockSigOpsCost += mempoolEntry.SigOpCost; this.BlockWeight += mempoolEntry.TxWeight; this.inBlock.Add(mempoolEntry); } /// <summary> /// Updates the total fee amount for this block. /// </summary> protected void UpdateTotalFees(Money fee) { this.fees += fee; } /// <summary> /// Method for how to add transactions to a block. /// Add transactions based on feerate including unconfirmed ancestors /// Increments nPackagesSelected / nDescendantsUpdated with corresponding /// statistics from the package selection (for logging statistics). /// This transaction selection algorithm orders the mempool based /// on feerate of a transaction including all unconfirmed ancestors. /// Since we don't remove transactions from the mempool as we select them /// for block inclusion, we need an alternate method of updating the feerate /// of a transaction with its not-yet-selected ancestors as we go. /// This is accomplished by walking the in-mempool descendants of selected /// transactions and storing a temporary modified state in mapModifiedTxs. /// Each time through the loop, we compare the best transaction in /// mapModifiedTxs with the next transaction in the mempool to decide what /// transaction package to work on next. /// </summary> protected virtual void AddTransactions(out int nPackagesSelected, out int nDescendantsUpdated) { nPackagesSelected = 0; nDescendantsUpdated = 0; // mapModifiedTx will store sorted packages after they are modified // because some of their txs are already in the block. var mapModifiedTx = new Dictionary<uint256, TxMemPoolModifiedEntry>(); //var mapModifiedTxRes = this.mempoolScheduler.ReadAsync(() => mempool.MapTx.Values).GetAwaiter().GetResult(); // mapModifiedTxRes.Select(s => new TxMemPoolModifiedEntry(s)).OrderBy(o => o, new CompareModifiedEntry()); // Keep track of entries that failed inclusion, to avoid duplicate work. var failedTx = new TxMempool.SetEntries(); // Start by adding all descendants of previously added txs to mapModifiedTx // and modifying them for their already included ancestors. this.UpdatePackagesForAdded(this.inBlock, mapModifiedTx); List<TxMempoolEntry> ancestorScoreList = this.MempoolLock.ReadAsync(() => this.Mempool.MapTx.AncestorScore).ConfigureAwait(false).GetAwaiter().GetResult().ToList(); TxMempoolEntry iter; int nConsecutiveFailed = 0; while (ancestorScoreList.Any() || mapModifiedTx.Any()) { TxMempoolEntry mi = ancestorScoreList.FirstOrDefault(); if (mi != null) { // Skip entries in mapTx that are already in a block or are present // in mapModifiedTx (which implies that the mapTx ancestor state is // stale due to ancestor inclusion in the block). // Also skip transactions that we've already failed to add. This can happen if // we consider a transaction in mapModifiedTx and it fails: we can then // potentially consider it again while walking mapTx. It's currently // guaranteed to fail again, but as a belt-and-suspenders check we put it in // failedTx and avoid re-evaluation, since the re-evaluation would be using // cached size/sigops/fee values that are not actually correct. // First try to find a new transaction in mapTx to evaluate. if (mapModifiedTx.ContainsKey(mi.TransactionHash) || this.inBlock.Contains(mi) || failedTx.Contains(mi)) { ancestorScoreList.Remove(mi); continue; } } // Now that mi is not stale, determine which transaction to evaluate: // the next entry from mapTx, or the best from mapModifiedTx? bool fUsingModified = false; TxMemPoolModifiedEntry modit; var compare = new CompareModifiedEntry(); if (mi == null) { modit = mapModifiedTx.Values.OrderBy(o => o, compare).First(); iter = modit.MempoolEntry; fUsingModified = true; } else { // Try to compare the mapTx entry to the mapModifiedTx entry iter = mi; modit = mapModifiedTx.Values.OrderBy(o => o, compare).FirstOrDefault(); if ((modit != null) && (compare.Compare(modit, new TxMemPoolModifiedEntry(iter)) < 0)) { // The best entry in mapModifiedTx has higher score // than the one from mapTx.. // Switch which transaction (package) to consider. iter = modit.MempoolEntry; fUsingModified = true; } else { // Either no entry in mapModifiedTx, or it's worse than mapTx. // Increment mi for the next loop iteration. ancestorScoreList.Remove(iter); } } // We skip mapTx entries that are inBlock, and mapModifiedTx shouldn't // contain anything that is inBlock. Guard.Assert(!this.inBlock.Contains(iter)); long packageSize = iter.SizeWithAncestors; Money packageFees = iter.ModFeesWithAncestors; long packageSigOpsCost = iter.SigOpCostWithAncestors; if (fUsingModified) { packageSize = modit.SizeWithAncestors; packageFees = modit.ModFeesWithAncestors; packageSigOpsCost = modit.SigOpCostWithAncestors; } int opReturnCount = iter.Transaction.Outputs.Select(o => o.ScriptPubKey.ToBytes(true)).Count(b => IsOpReturn(b)); // When there are zero fee's we want to still include the transaction. // If there is OP_RETURN data, we will want to make sure there is a fee. if (this.Network.MinTxFee > Money.Zero || opReturnCount > 0) { if (packageFees < this.BlockMinFeeRate.GetFee((int)packageSize)) { // Everything else we might consider has a lower fee rate return; } } if (!this.TestPackage(iter, packageSize, packageSigOpsCost)) { if (fUsingModified) { // Since we always look at the best entry in mapModifiedTx, // we must erase failed entries so that we can consider the // next best entry on the next loop iteration mapModifiedTx.Remove(modit.MempoolEntry.TransactionHash); failedTx.Add(iter); } nConsecutiveFailed++; if ((nConsecutiveFailed > MaxConsecutiveAddTransactionFailures) && (this.BlockWeight > this.Options.BlockMaxWeight - 4000)) { // Give up if we're close to full and haven't succeeded in a while break; } continue; } var ancestors = new TxMempool.SetEntries(); long nNoLimit = long.MaxValue; string dummy; this.MempoolLock.ReadAsync(() => this.Mempool.CalculateMemPoolAncestors(iter, ancestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, out dummy, false)).ConfigureAwait(false).GetAwaiter().GetResult(); this.OnlyUnconfirmed(ancestors); ancestors.Add(iter); // Test if all tx's are Final. if (!this.TestPackageTransactions(ancestors)) { if (fUsingModified) { mapModifiedTx.Remove(modit.MempoolEntry.TransactionHash); failedTx.Add(iter); } continue; } // This transaction will make it in; reset the failed counter. nConsecutiveFailed = 0; // Package can be added. Sort the entries in a valid order. // Sort package by ancestor count // If a transaction A depends on transaction B, then A's ancestor count // must be greater than B's. So this is sufficient to validly order the // transactions for block inclusion. List<TxMempoolEntry> sortedEntries = ancestors.ToList().OrderBy(o => o, new CompareTxIterByAncestorCount()).ToList(); foreach (TxMempoolEntry sortedEntry in sortedEntries) { this.AddToBlock(sortedEntry); // Erase from the modified set, if present mapModifiedTx.Remove(sortedEntry.TransactionHash); } nPackagesSelected++; // Update transactions that depend on each of these nDescendantsUpdated += this.UpdatePackagesForAdded(ancestors, mapModifiedTx); } } /// <summary> /// Remove confirmed <see cref="inBlock"/> entries from given set. /// </summary> private void OnlyUnconfirmed(TxMempool.SetEntries testSet) { foreach (TxMempoolEntry setEntry in testSet.ToList()) { // Only test txs not already in the block if (this.inBlock.Contains(setEntry)) { testSet.Remove(setEntry); } } } /// <summary> /// Test if a new package would "fit" in the block. /// </summary> protected virtual bool TestPackage(TxMempoolEntry entry, long packageSize, long packageSigOpsCost) { // TODO: Switch to weight-based accounting for packages instead of vsize-based accounting. if (this.BlockWeight + this.Network.Consensus.Options.WitnessScaleFactor * packageSize >= this.Options.BlockMaxWeight) { this.logger.LogTrace("(-)[MAX_WEIGHT_REACHED]:false"); return false; } if (this.BlockSigOpsCost + packageSigOpsCost >= this.Network.Consensus.Options.MaxBlockSigopsCost) { this.logger.LogTrace("(-)[MAX_SIGOPS_REACHED]:false"); return false; } this.logger.LogTrace("(-):true"); return true; } /// <summary> /// Perform transaction-level checks before adding to block. /// <para> /// <list> /// <item>Transaction finality (locktime).</item> /// <item>Premature witness (in case segwit transactions are added to mempool before segwit activation).</item> /// <item>serialized size (in case -blockmaxsize is in use).</item> /// </list> /// </para> /// </summary> private bool TestPackageTransactions(TxMempool.SetEntries package) { foreach (TxMempoolEntry it in package) { if (!it.Transaction.IsFinal(Utils.UnixTimeToDateTime(this.LockTimeCutoff), this.height)) return false; if (!this.IncludeWitness && it.Transaction.HasWitness) return false; if (this.NeedSizeAccounting) { long nPotentialBlockSize = this.BlockSize; // only used with needSizeAccounting int nTxSize = it.Transaction.GetSerializedSize(); if (nPotentialBlockSize + nTxSize >= this.Options.BlockMaxSize) return false; nPotentialBlockSize += nTxSize; } } return true; } /// <summary> /// Add descendants of given transactions to mapModifiedTx with ancestor /// state updated assuming given transactions are inBlock. Returns number /// of updated descendants. /// </summary> private int UpdatePackagesForAdded(TxMempool.SetEntries alreadyAdded, Dictionary<uint256, TxMemPoolModifiedEntry> mapModifiedTx) { int descendantsUpdated = 0; foreach (TxMempoolEntry addedEntry in alreadyAdded) { var setEntries = new TxMempool.SetEntries(); this.MempoolLock.ReadAsync(() => { if (!this.Mempool.MapTx.ContainsKey(addedEntry.TransactionHash)) { this.logger.LogWarning("{0} is not present in {1} any longer, skipping.", addedEntry.TransactionHash, nameof(this.Mempool.MapTx)); return; } this.Mempool.CalculateDescendants(addedEntry, setEntries); }).GetAwaiter().GetResult(); foreach (TxMempoolEntry desc in setEntries) { if (alreadyAdded.Contains(desc)) continue; descendantsUpdated++; TxMemPoolModifiedEntry modEntry; if (!mapModifiedTx.TryGetValue(desc.TransactionHash, out modEntry)) { modEntry = new TxMemPoolModifiedEntry(desc); mapModifiedTx.Add(desc.TransactionHash, modEntry); this.logger.LogDebug("Added transaction '{0}' to the block template because it's a required ancestor for '{1}'.", desc.TransactionHash, addedEntry.TransactionHash); } modEntry.SizeWithAncestors -= addedEntry.GetTxSize(); modEntry.ModFeesWithAncestors -= addedEntry.ModifiedFee; modEntry.SigOpCostWithAncestors -= addedEntry.SigOpCost; } } return descendantsUpdated; } /// <summary>Network specific logic specific as to how the block will be built.</summary> public abstract BlockTemplate Build(ChainedHeader chainTip, Script scriptPubKey); /// <summary>Update the block's header information.</summary> protected void UpdateBaseHeaders() { this.block.Header.HashPrevBlock = this.ChainTip.HashBlock; this.block.Header.UpdateTime(this.DateTimeProvider.GetTimeOffset(), this.Network, this.ChainTip); this.block.Header.Nonce = 0; } /// <summary>Network specific logic specific as to how the block's header will be set.</summary> public abstract void UpdateHeaders(); public static bool IsOpReturn(byte[] bytes) { return bytes.Length > 0 && bytes[0] == (byte)OpcodeType.OP_RETURN; } } }
43.68325
265
0.591132
[ "MIT" ]
juliopcrj/X42-FullNode
src/Stratis.Bitcoin.Features.Miner/BlockDefinition.cs
26,343
C#
using UnityEngine; using UnityEngine.Events; namespace Common.GameEvent { public class GameEventListener : MonoBehaviour { [SerializeField] public GameEvent gameEvent; [SerializeField] public UnityEvent unityEvent; [SerializeField] public bool debuggingEnabled; private void Awake() => RegisterGameEvent(this); private void OnDestroy() => DeregisterGameEvent(this); public void RegisterGameEvent(GameEventListener listener) { if (gameEvent == null) return; if(debuggingEnabled) Debug.Log("GameEventListener was registered"); gameEvent.Register(listener); } public void DeregisterGameEvent(GameEventListener listener) { if (gameEvent == null) return; if(debuggingEnabled) Debug.Log("GameEventListener was Deregistered"); gameEvent.Deregister(listener); } public virtual void RaiseEvent() { if(debuggingEnabled) Debug.Log("Unity Event was triggered"); unityEvent.Invoke(); } } }
30.918919
81
0.617133
[ "MIT" ]
tunderix/FGJ-TD-22
Assets/Scripts/Common/GameEvent/GameEventListener.cs
1,144
C#