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
namespace Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210 { using Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PowerShell; /// <summary>Subnets of the network.</summary> [System.ComponentModel.TypeConverter(typeof(SubnetTypeConverter))] public partial class Subnet { /// <summary> /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the /// object before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); /// <summary> /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object /// before it is returned. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); /// <summary> /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); /// <summary> /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization /// of the object before it is deserialized. /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter. /// Implement this method in a partial class to enable this behavior. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return /// instantly.</param> partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.Subnet" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnet" />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnet DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Subnet(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.Subnet" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> /// <returns> /// an instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnet" />. /// </returns> public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Subnet(content); } /// <summary> /// Creates a new instance of <see cref="Subnet" />, deserializing the content from a json string. /// </summary> /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param> /// <returns>an instance of the <see cref="className" /> model class.</returns> public static Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Json.JsonNode.Parse(jsonText)); /// <summary> /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.Subnet" /// />. /// </summary> /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param> internal Subnet(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).FriendlyName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).AddressList = (string[]) content.GetValueForProperty("AddressList",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).AddressList, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); AfterDeserializeDictionary(content); } /// <summary> /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.Subnet" /// />. /// </summary> /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param> internal Subnet(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); if (returnNow) { return; } // actually deserialize ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).Name, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).FriendlyName = (string) content.GetValueForProperty("FriendlyName",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).FriendlyName, global::System.Convert.ToString); ((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).AddressList = (string[]) content.GetValueForProperty("AddressList",((Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210210.ISubnetInternal)this).AddressList, __y => TypeConverterExtensions.SelectToArray<string>(__y, global::System.Convert.ToString)); AfterDeserializePSObject(content); } /// <summary>Serializes this instance to a json string.</summary> /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns> public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.SerializationMode.IncludeAll)?.ToString(); } /// Subnets of the network. [System.ComponentModel.TypeConverter(typeof(SubnetTypeConverter))] public partial interface ISubnet { } }
66.82963
357
0.690202
[ "MIT" ]
AverageDesigner/azure-powershell
src/Migrate/generated/api/Models/Api20210210/Subnet.PowerShell.cs
8,888
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ObjectCalisthenics { class Withdrawal : Transaction { public Withdrawal(Amount amount) : base(amount) { } public override Amount AddTo(Amount givenAmount) { return givenAmount - amount; } } }
18.714286
56
0.638677
[ "MIT" ]
it-depends/SoftwareCraftmanship
ObjectCalisthenics/Withdrawal.cs
395
C#
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Palette Creator")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Palette Creator")] [assembly: AssemblyCopyright("Copyright © Peter Wagner (aka Wagnerp) & Simon Coghlan (aka Smurf-IV) 2018 - 2020. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e668a872-620b-4247-9629-28f12f7b0fd7")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("5.470.738.0")] [assembly: AssemblyFileVersion("5.470.738.0")] [assembly: NeutralResourcesLanguage("en-GB")]
39.075
136
0.75048
[ "BSD-3-Clause" ]
Krypton-Suite-Legacy-Archive/Krypton-Toolkit-Suite-Extended-NET-5.470
Source/Krypton Toolkit Suite Extended/Applications/Palette Creator/Properties/AssemblyInfo.cs
1,566
C#
using System; using System.Collections.Generic; using System.Linq; using Grabacr07.KanColleWrapper; using Grabacr07.KanColleWrapper.Models; using Livet; using Livet.EventListeners; using LvChartPlugin.Settings; namespace LvChartPlugin.ViewModels { public class ChartWindowViewModel : ViewModel { #region Ships変更通知プロパティ private IEnumerable<Ship> _Ships; public IEnumerable<Ship> Ships { get { return this._Ships; } set { if (Equals(this._Ships, value)) return; this._Ships = value; this.RaisePropertyChanged(); } } #endregion #region CountMaximumMaxValue変更通知プロパティ private int _CountMaximumMaxValue; public int CountMaximumMaxValue { get { return this._CountMaximumMaxValue; } set { if (this._CountMaximumMaxValue == value) return; this._CountMaximumMaxValue = value; this.RaisePropertyChanged(); } } #endregion #region CountMaximumCurrentValue変更通知プロパティ private int _CountMaximumCurrentValue; public int CountMaximumCurrentValue { get { return this._CountMaximumCurrentValue; } set { if (this._CountMaximumCurrentValue == value) return; this._CountMaximumCurrentValue = value; ChartSettings.CountMaximumCurrentValue.Value = value; this.RaisePropertyChanged(); } } #endregion #region LevelInterval変更通知プロパティ private int _LevelInterval; public int LevelInterval { get { return this._LevelInterval; } set { if (this._LevelInterval == value) return; this._LevelInterval = value; ChartSettings.LevelInterval.Value = value; this.UpdateCountMaximum(); this.RaisePropertyChanged(); } } #endregion #region IsLocked変更通知プロパティ private bool _IsLocked; public bool IsLocked { get { return this._IsLocked; } set { if (this._IsLocked == value) return; this._IsLocked = value; ChartSettings.IsLocked.Value = value; this.UpdateView(); this.RaisePropertyChanged(); } } #endregion #region IsCheckALL変更通知プロパティ private bool isCheckAll; public bool IsCheckAll { get { return this.isCheckAll; } set { if (this.isCheckAll == value) return; this.isCheckAll = value; this.CheckAll(); this.RaisePropertyChanged(); } } #endregion public IReadOnlyCollection<ShipTypeViewModel> ShipTypes { get; private set; } public ChartWindowViewModel() { if (KanColleClient.Current.IsStarted) { var masterShipTypes = KanColleClient.Current.Master.Ships //艦娘マスタで使ってるタイプだけ .Where(x => x.Value.Id < 1500) //敵以外 .GroupBy(x => x.Value.ShipType, (key, elements) => key) .OrderBy(x => x.Id); if(ChartSettings.SelectedShipTypes.Value == null) { ChartSettings.SelectedShipTypes.Value = masterShipTypes.Select(x => x.Id).ToArray(); } this.ShipTypes = masterShipTypes .Select(type => new ShipTypeViewModel(type) { IsSelected = ChartSettings.SelectedShipTypes.Value.Any(id => type.Id == id), SelectionChangedAction = () => { ChartSettings.SelectedShipTypes.Value = this.ShipTypes.Where(x => x.IsSelected).Select(x => x.Id).ToArray(); this.UpdateView(); } }) .ToArray(); } this.CountMaximumCurrentValue = ChartSettings.CountMaximumCurrentValue; this.LevelInterval = ChartSettings.LevelInterval; this.IsLocked = ChartSettings.IsLocked; this.IsCheckAll = this.ShipTypes.All(x => x.IsSelected); } public void Initialize() { this.UpdateView(); this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleClient.Current.Homeport.Organization) { { () => KanColleClient.Current.Homeport.Organization.Ships, (_, __) => { DispatcherHelper.UIDispatcher.Invoke(this.UpdateView); } } }); } private void CheckAll() { if (this.ShipTypes == null) return; foreach (var type in this.ShipTypes) { type.IsSelected = this.IsCheckAll; } } private void UpdateView() { if (!KanColleClient.Current.IsStarted) return; this.Ships = KanColleClient.Current.Homeport.Organization.Ships.Values .Where(this.FilterView).ToArray(); this.UpdateCountMaximum(); } private void UpdateCountMaximum() { if (this.Ships == null) return; var maxValue = this.Ships.Any() ? this.Ships.CreateShipData(this.LevelInterval, 0, CommonSettings.LevelLimit).Values.SumValues().CountMaximum() : ChartSettings.CountMaximumCurrentValue.Default; maxValue = Math.Max(maxValue, ChartSettings.CountMaximumCurrentValue.Default); this.CountMaximumCurrentValue = Math.Min(this.CountMaximumCurrentValue, maxValue); this.CountMaximumMaxValue = maxValue; } private bool FilterView(Ship s) { if (s == null) return false; if (this.ShipTypes == null) return false; return (this.IsLocked && s.IsLocked || !this.IsLocked) && this.ShipTypes.Where(t => t.IsSelected).Any(t => s.Info.ShipType.Id == t.Id); } } }
30.747664
136
0.521884
[ "MIT" ]
veigr/LevelChartPlugin
LvChartPlugin/ViewModels/ChartWindowViewModel.cs
6,726
C#
using Mono.Cecil.Cil; namespace Stratis.SmartContracts.Executor.Reflection.ILRewrite { public class ObserverRewriterContext { public ObserverReferences Observer { get; } public VariableDefinition ObserverVariable { get; } public ObserverRewriterContext(ObserverReferences observer, VariableDefinition observerVariable) { this.Observer = observer; this.ObserverVariable = observerVariable; } } }
26.388889
104
0.696842
[ "MIT" ]
DennisAMenace/X42-FullNode
src/Stratis.SmartContracts.Executor.Reflection/ILRewrite/ObserverRewriterContext.cs
477
C#
using System; using System.Collections.Generic; namespace DataAccess.Model { public partial class Track { public Track() { InvoiceLine = new HashSet<InvoiceLine>(); PlaylistTrack = new HashSet<PlaylistTrack>(); } public int TrackId { get; set; } public string Name { get; set; } public int? AlbumId { get; set; } public int MediaTypeId { get; set; } public int? GenreId { get; set; } public string Composer { get; set; } public int Milliseconds { get; set; } public int? Bytes { get; set; } public decimal UnitPrice { get; set; } public virtual Album Album { get; set; } public virtual Genre Genre { get; set; } public virtual MediaType MediaType { get; set; } public virtual ICollection<InvoiceLine> InvoiceLine { get; set; } public virtual ICollection<PlaylistTrack> PlaylistTrack { get; set; } } }
31.516129
77
0.597748
[ "MIT" ]
2006-jun15-net/asher-code
ChinookApp/DataAccess/Model/Track.cs
979
C#
using System.Web.Mvc; using EpiCustomRendering.Models.Pages; using EpiCustomRendering.Models.ViewModels; using EPiServer.Web.Routing; namespace EpiCustomRendering.Business { /// <summary> /// Intercepts actions with view models of type IPageViewModel and populates the view models /// Layout and Section properties. /// </summary> /// <remarks> /// This filter frees controllers for pages from having to care about common context needed by layouts /// and other page framework components allowing the controllers to focus on the specifics for the page types /// and actions that they handle. /// </remarks> public class PageContextActionFilter : IResultFilter { private readonly PageViewContextFactory _contextFactory; public PageContextActionFilter(PageViewContextFactory contextFactory) { _contextFactory = contextFactory; } public void OnResultExecuting(ResultExecutingContext filterContext) { var viewModel = filterContext.Controller.ViewData.Model; var model = viewModel as IPageViewModel<SitePageData>; if (model != null) { var currentContentLink = filterContext.RequestContext.GetContentLink(); var layoutModel = model.Layout ?? _contextFactory.CreateLayoutModel(currentContentLink, filterContext.RequestContext); var layoutController = filterContext.Controller as IModifyLayout; if(layoutController != null) { layoutController.ModifyLayout(layoutModel); } model.Layout = layoutModel; if (model.Section == null) { model.Section = _contextFactory.GetSection(currentContentLink); } } } public void OnResultExecuted(ResultExecutedContext filterContext) { } } }
36.107143
134
0.628586
[ "Apache-2.0" ]
stormid/Episerver-conventional-rendering
EpiCustomRendering/Business/PageContextActionFilter.cs
2,022
C#
// Copyright (c) zhenlei520 All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using Newtonsoft.Json; namespace EInfrastructure.Core.AliYun.DaYu.Model.SendSms { /// <summary> /// 发送语音短信信息 /// </summary> internal class SendVoiceSmsResponseDto : BaseReponseDto { /// <summary> /// 消息 /// </summary> public string Message { get; set; } /// <summary> /// 状态码 /// </summary> public string Code { get; set; } } /// <summary> /// 发送成功消息 /// </summary> internal class SendVoiceSmsSuccessResponseDto : SendVoiceSmsResponseDto { /// <summary> ///发送回执ID /// </summary> [JsonProperty(PropertyName = "CallId", DefaultValueHandling = DefaultValueHandling.Ignore)] public string CallId { get; set; } } }
25.305556
99
0.592755
[ "MIT" ]
Hunfnfmvkvllv26/System.Extension.Core
src/Sms/AliDaYu/src/EInfrastructure.Core.AliYun.DaYu/Model/SendSms/SendVoiceSmsResponseDto.cs
957
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Store { public interface IBookRepository { Book[] GetAllByTitle(string titlePart); } }
16.785714
47
0.72766
[ "Unlicense" ]
GrimFatum/store
domain/Store/IBookRepository.cs
237
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("DirLink")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DirLink")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6f685807-9e1b-4170-820c-ac8aafb7e532")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.459459
85
0.724526
[ "MIT" ]
glueckkanja/dirlink
Properties/AssemblyInfo.cs
1,426
C#
using System; using System.Collections.Generic; using System.IO; using System.Text; using Workshell.OpenMcdf.Extensions.OLEProperties.Interfaces; namespace Workshell.OpenMcdf.Extensions.OLEProperties { internal class DictionaryProperty : IDictionaryProperty { private int codePage; public DictionaryProperty(int codePage) { this.codePage = codePage; this.entries = new Dictionary<uint, string>(); } public PropertyType PropertyType { get { return PropertyType.DictionaryProperty; } } private Dictionary<uint, string> entries; public object Value { get { return entries; } set { entries = (Dictionary<uint, string>)value; } } public void Read(BinaryReader br) { long curPos = br.BaseStream.Position; uint numEntries = br.ReadUInt32(); for (uint i = 0; i < numEntries; i++) { DictionaryEntry de = new DictionaryEntry(codePage); de.Read(br); this.entries.Add(de.PropertyIdentifier, de.Name); } int m = (int)(br.BaseStream.Position - curPos) % 4; if (m > 0) { for(int i = 0; i < m; i++) { br.ReadByte(); } } } public void Write(BinaryWriter bw) { bw.Write(entries.Count); foreach (KeyValuePair<uint, string> kv in entries) { bw.Write(kv.Key); string s = kv.Value; if (!s.EndsWith("\0")) s += "\0"; bw.Write(Encoding.GetEncoding(this.codePage).GetBytes(s)); } } } }
24.128205
74
0.494155
[ "MIT" ]
Workshell/file-formats
src/FileFormats/OpenMcdf/Extensions/OLEProperties/DictionaryProperty.cs
1,884
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.Reflection; using System.Diagnostics.CodeAnalysis; namespace System.Text.Json.Serialization.Converters { internal sealed class EnumConverterFactory : JsonConverterFactory { public EnumConverterFactory() { } public override bool CanConvert(Type type) { return type.IsEnum; } [DynamicDependency( "#ctor(System.Text.Json.Serialization.Converters.EnumConverterOptions,System.Text.Json.JsonSerializerOptions)", typeof(EnumConverter<>))] public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) { JsonConverter converter = (JsonConverter)Activator.CreateInstance( typeof(EnumConverter<>).MakeGenericType(type), BindingFlags.Instance | BindingFlags.Public, binder: null, new object[] { EnumConverterOptions.AllowNumbers, options }, culture: null)!; return converter; } } }
33.810811
123
0.657074
[ "MIT" ]
06needhamt/runtime
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverterFactory.cs
1,253
C#
using UnityEngine; // This class implements simple ghosting type Motion Blur. // If Extra Blur is selected, the scene will allways be a little blurred, // as it is scaled to a smaller resolution. // The effect works by accumulating the previous frames in an accumulation // texture. namespace UnitySampleAssets.ImageEffects { [ExecuteInEditMode] [AddComponentMenu("Image Effects/Motion Blur (Color Accumulation)")] [RequireComponent(typeof (Camera))] public class MotionBlur : ImageEffectBase { public float blurAmount = 0.8f; public bool extraBlur = false; private RenderTexture accumTexture; protected override void Start() { if (!SystemInfo.supportsRenderTextures) { enabled = false; return; } base.Start(); } protected override void OnDisable() { base.OnDisable(); DestroyImmediate(accumTexture); } // Called by camera to apply image effect private void OnRenderImage(RenderTexture source, RenderTexture destination) { // Create the accumulation texture if (accumTexture == null || accumTexture.width != source.width || accumTexture.height != source.height) { DestroyImmediate(accumTexture); accumTexture = new RenderTexture(source.width, source.height, 0); accumTexture.hideFlags = HideFlags.HideAndDontSave; Graphics.Blit(source, accumTexture); } // If Extra Blur is selected, downscale the texture to 4x4 smaller resolution. if (extraBlur) { RenderTexture blurbuffer = RenderTexture.GetTemporary(source.width/4, source.height/4, 0); Graphics.Blit(accumTexture, blurbuffer); Graphics.Blit(blurbuffer, accumTexture); RenderTexture.ReleaseTemporary(blurbuffer); } // Clamp the motion blur variable, so it can never leave permanent trails in the image blurAmount = Mathf.Clamp(blurAmount, 0.0f, 0.92f); // Setup the texture and floating point values in the shader material.SetTexture("_MainTex", accumTexture); material.SetFloat("_AccumOrig", 1.0F - blurAmount); // Render the image using the motion blur shader Graphics.Blit(source, accumTexture, material); Graphics.Blit(accumTexture, destination); } } }
37.628571
116
0.601367
[ "MIT" ]
DavidLibeau/Delphinarium-Unity
Assets/Store/Standard Assets/Effects/ImageEffects (Pro Only)/Scripts/MotionBlur.cs
2,634
C#
/* * This file is automatically generated; any changes will be lost. */ #nullable enable #pragma warning disable using NTangle.Cdc; using NTangle.Data; using System.Collections.Generic; using System.Data; namespace SqlServerDemo.Publisher.Data { /// <summary> /// Provides the <see cref="IdentifierMapping{T}"/> database mapper for table '[NTangle].[IdentifierMapping]'. /// </summary> /// <typeparam name="T">The global identifier <see cref="System.Type"/>.</typeparam> public class IdentifierMappingMapper<T> : IdentifierMappingMapperBase<T> { /// <summary> /// Initializes a new instance of the <see cref="VersionTrackingMapper"/> class. /// </summary> public IdentifierMappingMapper() : base("[NTangle].[udtIdentifierMappingList]") { } } } #pragma warning restore #nullable restore
29.37931
114
0.690141
[ "MIT" ]
Avanade/NTangle
samples/SqlServerDemo/SqlServerDemo.Publisher/Data/Generated/IdentifierMappingMapper.cs
852
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 ecs-2014-11-13.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.ECS.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ECS.Model.Internal.MarshallTransformations { /// <summary> /// ListClusters Request Marshaller /// </summary> public class ListClustersRequestMarshaller : IMarshaller<IRequest, ListClustersRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListClustersRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListClustersRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ECS"); string target = "AmazonEC2ContainerServiceV20141113.ListClusters"; request.Headers["X-Amz-Target"] = target; request.Headers["Content-Type"] = "application/x-amz-json-1.1"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2014-11-13"; request.HttpMethod = "POST"; request.ResourcePath = "/"; request.MarshallerVersion = 2; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetMaxResults()) { context.Writer.WritePropertyName("maxResults"); context.Writer.Write(publicRequest.MaxResults); } if(publicRequest.IsSetNextToken()) { context.Writer.WritePropertyName("nextToken"); context.Writer.Write(publicRequest.NextToken); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static ListClustersRequestMarshaller _instance = new ListClustersRequestMarshaller(); internal static ListClustersRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListClustersRequestMarshaller Instance { get { return _instance; } } } }
34.90991
139
0.618323
[ "Apache-2.0" ]
PureKrome/aws-sdk-net
sdk/src/Services/ECS/Generated/Model/Internal/MarshallTransformations/ListClustersRequestMarshaller.cs
3,875
C#
using System; using System.Linq; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; namespace WebApiContrib.Core.Versioning { /// <summary> /// This version strategy gets its version from the <c>Accept</c>-header, using a faceted sub-type. /// </summary> public class AcceptHeaderFacetVersionStrategy : AcceptHeaderVersionStrategy { private static readonly char[] DotSeparator = {'.'}; /// <inheritdoc /> protected override int? GetVersion(MediaTypeHeaderValue acceptHeader) { if (acceptHeader == null) { throw new ArgumentNullException(nameof(acceptHeader)); } var subType = StripSuffix(acceptHeader.SubType); if (!subType.HasValue) { return null; } int version; if (TryGetFacetVersion(subType, out version)) { return version; } return null; } private static bool TryGetFacetVersion(StringSegment subType, out int version) { var facetSeparatorIndex = subType.IndexOf('.'); if (facetSeparatorIndex >= 0) { var facets = subType.Split(DotSeparator).Reverse(); foreach (var facet in facets) { if (ParsingUtility.TryParseVersion(facet, out version)) { return true; } } } version = 0; return false; } } }
26.770492
103
0.524801
[ "MIT" ]
DevX-Realtobiz/WebAPIContrib.Core
src/WebApiContrib.Core.Versioning/Strategies/AcceptHeaderFacetVersionStrategy.cs
1,635
C#
using RimWorld; using AbilityUser; using Verse; namespace TorannMagic { public class Verb_DismissEarthSprites : Verb_UseAbility { protected override bool TryCastShot() { bool flag = false; CompAbilityUserMagic comp = this.CasterPawn.GetComp<CompAbilityUserMagic>(); if (comp.IsMagicUser) { if (comp.earthSpriteType != 0) { comp.earthSpriteType = 0; comp.earthSpriteMap = null; comp.earthSprites = IntVec3.Invalid; } else { Messages.Message("TM_NoSpritesToDismiss".Translate( this.CasterPawn.LabelShort ), MessageTypeDefOf.RejectInput); } } this.PostCastShot(flag, out flag); return flag; } } }
25.621622
88
0.492616
[ "BSD-3-Clause" ]
Evyatar108/TMagic-Optimized
Source/TMagic/TMagic/Verb_DismissEarthSprites.cs
950
C#
using System; using CodeMill.VMFirstNav; using System.ComponentModel; using Xamarin.Forms; namespace VMFirstNav.Demo { public class NormalChildTwoViewModel : IViewModel, INotifyPropertyChanged { INavigationService _navService; public NormalChildTwoViewModel() { Title = "Normal Two"; _navService = NavigationService.Instance; } string title; public string Title { get => title; set { title = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Title))); } } Command _navigateThree; public event PropertyChangedEventHandler PropertyChanged; public Command NavigateThree { get { if (_navigateThree == null) { _navigateThree = new Command(async () => await _navService.PushAsync<NormalChildThreeViewModel>()); } return _navigateThree; } } } }
19
104
0.694508
[ "MIT" ]
codemillmatt/codemill.vmfirstnav
VMFirstNav.Demo/ViewModels/Normal/NormalChildTwoViewModel.cs
876
C#
using System; using System.Collections.Generic; using System.Linq; using Framework.Pipeline.GameWorldObjects; using Framework.Pipeline.Geometry; using Framework.Pipeline.Geometry.Interactors; namespace Framework.Pipeline.Standard.PipeLineSteps.TrialCellularAutomata.Steps { public class TrialCaCellInitialisationStep : PipelineStep { public TrialCellState initialLandmarkAreaCellState; public TrialCellState initialPathAreaCellState; // TODO: Replace with lookup in a serializable range tree public InitialTrialStateWeighting[] weightings; private List<TrialStateRangeMapping> Mappings { get; set; } public override Type[] RequiredGuarantees => new Type[0]; public override bool AddToDebugStackedView => true; public override GameWorld Apply(GameWorld world) { SetMappings(); IEnumerable<Area> areas = world.Root.GetAllChildrenOfType<Area>(); foreach (Area area in areas) DistributeStates(area); return world; } private void SetMappings() { Mappings = new List<TrialStateRangeMapping>(weightings.Length); int totalWeight = weightings.Sum(weighting => weighting.weight); float currentFillPercentage = 0f; foreach (InitialTrialStateWeighting weighting in weightings) { TrialStateRangeMapping mapping = new TrialStateRangeMapping(weighting.state, currentFillPercentage, weighting.weight, totalWeight); Mappings.Add(mapping); currentFillPercentage = mapping.Maximum; } } private void DistributeStates(Area parentArea) { PolygonPolygonInteractor polygonInteractor = PolygonPolygonInteractor.Use(); PolygonLineInteractor lineInteractor = PolygonLineInteractor.Use(); PolygonPointInteractor pointInteractor = PolygonPointInteractor.Use(); IEnumerable<TrialAreaCell> areaCells = parentArea.GetAllChildrenOfType<TrialAreaCell>(); IEnumerable<OwPolygon> mainPaths = parentArea.GetAllChildrenOfType<MainPath>().Select(path => (OwPolygon)path.GetShape()); IEnumerable<OwPoint> landmarks = parentArea.GetAllChildrenOfType<Landmark>().Select(landmark => (OwPoint)landmark.GetShape()); foreach (TrialAreaCell areaCell in areaCells) { areaCell.Cell.CurrentState = default; SetRandomState(areaCell); } if (initialPathAreaCellState != default) { IEnumerable<TrialAreaCell> pathAreas = areaCells .Where(area => { OwPolygon polygon = area.GetShape(); return mainPaths.Any(path => polygonInteractor.PartiallyContains(polygon, path)); }); foreach (TrialAreaCell pathArea in pathAreas) pathArea.Cell.CurrentState = initialPathAreaCellState; } if (initialLandmarkAreaCellState != default) { IEnumerable<TrialAreaCell> landmarkAreas = areaCells .Where(area => { OwPolygon polygon = area.GetShape(); return landmarks.Any(landmark => pointInteractor.PartiallyContains(polygon, landmark)); }); foreach (TrialAreaCell landmarkArea in landmarkAreas) landmarkArea.Cell.CurrentState = initialLandmarkAreaCellState; } } private void SetRandomState(TrialAreaCell areaCell) { float r = (float) random.NextDouble(); foreach (TrialStateRangeMapping mapping in Mappings.Where(mapping => mapping.Minimum <= r && r <= mapping.Maximum)) { areaCell.Cell.CurrentState = mapping.State; return; } } } [Serializable] public class InitialTrialStateWeighting { public TrialCellState state = TrialCellState.Random; public int weight = 0; } public class TrialStateRangeMapping { public TrialCellState State { get; set; } public float Minimum { get; set; } public float Maximum { get; set; } public TrialStateRangeMapping(TrialCellState state, float minimum, int weight, int totalWeight) { State = state; Minimum = minimum; Maximum = minimum + (float) weight / totalWeight; } } }
39.62931
147
0.623015
[ "MIT" ]
OrganicaWild/OrganicaWild
Framework/Pipeline/Standard/PipeLineSteps/TrialCellularAutomata/Steps/TrialCaCellInitialisationStep.cs
4,599
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 autoscaling-2011-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AutoScaling.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; namespace Amazon.AutoScaling.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteTags operation /// </summary> public class DeleteTagsResponseUnmarshaller : XmlResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteTagsResponse response = new DeleteTagsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if(context.TestExpression("DeleteTagsResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return response; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="response")] private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteTagsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 2; while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceContention")) { return ResourceContentionExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceInUse")) { return ResourceInUseExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAutoScalingException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); } private static DeleteTagsResponseUnmarshaller _instance = new DeleteTagsResponseUnmarshaller(); internal static DeleteTagsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteTagsResponseUnmarshaller Instance { get { return _instance; } } } }
36.871429
166
0.606935
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/AutoScaling/Generated/Model/Internal/MarshallTransformations/DeleteTagsResponseUnmarshaller.cs
5,162
C#
using System; using System.Collections.Generic; using System.Configuration; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FileRemover { class Program { static void Main(string[] args) { String folderNames = File.ReadAllText("FolderNames.txt"); List<String> directoryList = new List<String>(); directoryList.AddRange(folderNames.Split(',')); String baseDir = Convert.ToString(ConfigurationManager.AppSettings["BaseDirectory"]); String[] fileFormats = Convert.ToString(ConfigurationManager.AppSettings["FileType"]).Split(','); DateTime lastDate = Convert.ToDateTime(Convert.ToString(ConfigurationManager.AppSettings["LastDate"])); UtilityClass utilClass = new UtilityClass(); utilClass.init(@"D:\FileRemover\Log\Log_DeleteFiles_" + DateTime.Now.ToString("dd-MMM-yyyy") + ".csv"); //utilClass.WriteLine("------------Proccess started------------"); //utilClass.WriteLine("Searching: " + folderNames + "\nFileTypes: " + Convert.ToString(ConfigurationManager.AppSettings["FileType"])); //utilClass.WriteLine("Deleting files before: " + lastDate.ToString("dd-MMM-yyyy HH:mm:ss")); utilClass.WriteLine("Deleted File Name,Path,Size in Bytes,DateCreated,LastModified"); //String directory = Convert.ToString(ConfigurationManager.AppSettings["DirectoryPath"]); //String[] fileFormats = Convert.ToString(ConfigurationManager.AppSettings["FileType"]).Split(','); //String[] fileFormats = new string[] { "pdf", "log" }; for (int i = 0; i < directoryList.Count(); i++) { directoryList[i] = directoryList[i].Trim(); } for (int i = 0; i < fileFormats.Count(); i++) { fileFormats[i] = fileFormats[i].Trim(); } foreach (String dir in directoryList) { DirectoryInfo directoryInfo = new DirectoryInfo(baseDir); utilClass.DirectoryTree(directoryInfo, fileFormats, lastDate); } utilClass.WriteLine("------------Proccess Ended------------"); //foreach (String directory in directoryList) //{ // DirectoryInfo directoryInfo = new DirectoryInfo(directory); // foreach (String format in fileFormats) // { // FileInfo[] files = directoryInfo.GetFiles("*." + format + "*"); // foreach (FileInfo fileInfo in files) // { // if (fileInfo.CreationTime < DateTime.Now.AddMonths(-12) && fileInfo.LastWriteTime < DateTime.Now.AddMonths(-12)) // fileInfo.Delete(); // } // } //} } } class UtilityClass { static string Logpath; public void DirectoryTree(DirectoryInfo root, String[] fileFormats, DateTime lastDate) { List<FileInfo> files = new List<FileInfo>(); List<DirectoryInfo> subDir = new List<DirectoryInfo>(); //WriteLine("CurrentDirectory: " + root.FullName); try { foreach (String format in fileFormats) { files.AddRange(root.GetFiles("*." + format + "*")); } } catch (Exception ex) { WriteLine("FailToRead : " + ex.Message + "\n" + ex.StackTrace); } if (files.Count != 0) { try { foreach (FileInfo fileInfo in files) { if (fileInfo.CreationTime < lastDate && fileInfo.LastWriteTime < lastDate) { //fileInfo.Delete(); Console.WriteLine("Deleted: " + fileInfo.Name); WriteLine(fileInfo.Name + "," + root.FullName + "," + fileInfo.Length + "," + fileInfo.CreationTime + "," + fileInfo.LastWriteTime); } } } catch (Exception ex) { WriteLine("FailToDelete : " + ex.Message + "\n" + ex.StackTrace); } } //else //{ // WriteLine("No files found!"); //} try { subDir.AddRange(root.GetDirectories()); if (subDir.Count != 0) { foreach (DirectoryInfo dirInfor in subDir) { DirectoryTree(dirInfor, fileFormats, lastDate); } } } catch (Exception ex) { WriteLine("FailToReadDirectory : " + ex.Message + "\n" + ex.StackTrace); } } public void init(string logFilePath) { Logpath = logFilePath; } //public void WriteLine(string strLog) //{ // FileStream fileStream = null; // DirectoryInfo logDirInfo = null; // FileInfo logFileInfo; // logFileInfo = new FileInfo(Logpath); // logDirInfo = new DirectoryInfo(logFileInfo.DirectoryName); // if (!logDirInfo.Exists) logDirInfo.Create(); // if (!logFileInfo.Exists) // { // fileStream = logFileInfo.Create(); // } // else // { // fileStream = new FileStream(Logpath, FileMode.Append); // } // StreamWriter log = new StreamWriter(fileStream); // log.WriteLine("Message: " + strLog); // log.WriteLine("Timestamp: " + DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss")); // log.WriteLine("<--> :"); // log.WriteLine("<--> :"); // log.Close(); // log.Dispose(); // fileStream.Close(); //} public void WriteLine(string strLog) { FileStream fileStream = null; DirectoryInfo logDirInfo = null; FileInfo logFileInfo; logFileInfo = new FileInfo(Logpath); logDirInfo = new DirectoryInfo(logFileInfo.DirectoryName); if (!logDirInfo.Exists) logDirInfo.Create(); if (!logFileInfo.Exists) { fileStream = logFileInfo.Create(); } else { fileStream = new FileStream(Logpath, FileMode.Append); } StreamWriter log = new StreamWriter(fileStream); log.WriteLine(strLog); log.Close(); log.Dispose(); fileStream.Close(); } } }
36.6
160
0.499425
[ "MIT" ]
GeekMasterX/File-Remover
FileRemover/Program.cs
6,956
C#
using System; namespace Terraria.GameContent.UI { // Token: 0x02000126 RID: 294 public class WiresUI { // Token: 0x170000B5 RID: 181 public static bool Open { // Token: 0x06000B50 RID: 2896 RVA: 0x001FAF53 File Offset: 0x001F9153 get { return WiresUI.radial.active; } } // Token: 0x0400129E RID: 4766 private static WiresUI.WiresRadial radial = new WiresUI.WiresRadial(); // Token: 0x02000127 RID: 295 public static class Settings { // Token: 0x170000B9 RID: 185 public static bool DrawToolAllowActuators { // Token: 0x06000B57 RID: 2903 RVA: 0x001FB064 File Offset: 0x001F9264 get { int type = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type; if (type == 3611) { WiresUI.Settings._lastActuatorEnabled = 2; } if (type == 3625) { WiresUI.Settings._lastActuatorEnabled = 1; } return WiresUI.Settings._lastActuatorEnabled == 2; } } // Token: 0x170000B8 RID: 184 public static bool DrawToolModeUI { // Token: 0x06000B56 RID: 2902 RVA: 0x001FB01C File Offset: 0x001F921C get { int type = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type; return type == 3611 || type == 3625; } } // Token: 0x170000B6 RID: 182 public static bool DrawWires { // Token: 0x06000B54 RID: 2900 RVA: 0x001FAF8C File Offset: 0x001F918C get { return Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].mech || (Main.player[Main.myPlayer].InfoAccMechShowWires && Main.player[Main.myPlayer].builderAccStatus[8] == 0); } } // Token: 0x170000B7 RID: 183 public static bool HideWires { // Token: 0x06000B55 RID: 2901 RVA: 0x001FAFEC File Offset: 0x001F91EC get { return Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 3620; } } // Token: 0x0400129F RID: 4767 public static WiresUI.Settings.MultiToolMode ToolMode = WiresUI.Settings.MultiToolMode.Red; // Token: 0x040012A0 RID: 4768 private static int _lastActuatorEnabled = 0; // Token: 0x02000128 RID: 296 [Flags] public enum MultiToolMode { // Token: 0x040012A2 RID: 4770 Red = 1, // Token: 0x040012A3 RID: 4771 Green = 2, // Token: 0x040012A4 RID: 4772 Blue = 4, // Token: 0x040012A5 RID: 4773 Yellow = 8, // Token: 0x040012A6 RID: 4774 Actuator = 16, // Token: 0x040012A7 RID: 4775 Cutter = 32 } } // Token: 0x02000129 RID: 297 public class WiresRadial { // Token: 0x06000B59 RID: 2905 RVA: 0x001FB0CA File Offset: 0x001F92CA public void Update() { } // Token: 0x040012A9 RID: 4777 public bool active; // Token: 0x040012AA RID: 4778 public bool OnWiresMenu; // Token: 0x040012A8 RID: 4776 public Vector2 position; // Token: 0x040012AB RID: 4779 private float _lineOpacity; } } }
25.68595
204
0.634813
[ "MIT" ]
BloodARG/tModLoaderTShock
TShock-general-devel/TerrariaServerAPI/Terraria/GameContent/UI/WiresUI.cs
2,990
C#
using Root.Coding.Code.Domains.E01D; using Root.Coding.Code.Models.E01D.Base.Cli.Metadata.Conceptual.Elements; namespace Root.Coding.Code.Api.E01D.Base.Cli.Metadata.Conceptual.Elements { public class ConceptualIndexerApi: ConceptualMemberVisbilityBaseApi { /// <summary> /// Gets whether the indexer is marked as abstract. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsAbstract(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsAbstract(indexer); } /// <summary> /// Gets whether the indexer is marked as new. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsNew(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsNew(indexer); } /// <summary> /// Gets whether the indexer is marked as overridden. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsOverride(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsOverride(indexer); } /// <summary> /// Gets whether the indexer is marked as static. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsStatic(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsStatic(indexer); } /// <summary> /// Gets whether the indexer is marked as unsafe. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsUnsafe(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsUnsafe(indexer); } /// <summary> /// Gets whether the indexer is marked as virtual. /// </summary> /// <param name="indexer"></param> /// <returns></returns> public bool IsVirtual(ConceptualIndexer_I indexer) { return XConceptualMetadataBase.Api.Elements.Metadata.IsVirtual(indexer); } } }
33.73913
85
0.594502
[ "Apache-2.0" ]
E01D/Base
src/E01D.Base.Cli.Metadata.Conceptual.Api/Coding/Code/Api/E01D/Base/Cli/Metadata/Conceptual/Elements/ConceptualIndexerApi.cs
2,330
C#
using UnityEngine; using SanAndreasUnity.Importing.Animation; namespace SanAndreasUnity.Behaviours.Weapons { public class DesertEagle : Weapon { public override AnimId IdleAnim { get { return new AnimId (AnimGroup.WalkCycle, AnimIndex.Idle); } } public override AnimId WalkAnim { get { return new AnimId (AnimGroup.WalkCycle, AnimIndex.Walk); } } public override AnimId RunAnim { get { return new AnimId (AnimGroup.WalkCycle, AnimIndex.Run); } } public override AnimId AimAnim { get { if (this.Data.gunData.AssocGroupId.EndsWith ("bad")) return new AnimId (AnimGroup.Python, AnimIndex.python_fire_poor); else return new AnimId (AnimGroup.Python, AnimIndex.python_fire); } } // public override void UpdateAnimWhileAiming (Player player) // { // var state = player.PlayerModel.PlayAnim (this.AimAnim); // // } } }
18.791667
70
0.694013
[ "MIT" ]
Bigbossbro08/SanAndreasUnity
Assets/Scripts/Behaviours/Weapons/DesertEagle.cs
904
C#
using SteamKit2; namespace SteamKit2X2.Internal.SteamAPI { internal sealed class ISteamEconomy { /// <summary> /// /// </summary> /// <param name="appid">Must be a steam economy app.</param> /// <param name="class_count">Number of classes requested. Must be at least one.</param> /// <param name="classid0">Class ID of the nth class.</param> public void GetAssetClassInfo(uint appid, uint class_count, ulong classid0) { using (dynamic data = WebAPI.GetInterface("ISteamEconomy", API.AppKey)) { KeyValue items = data.GetAssetClassInfo(appid: appid, class_count: class_count, classid0: classid0, l: "english"); } } /// <summary> /// /// </summary> /// <param name="appid">Must be a steam economy app.</param> /// <param name="class_count">Number of classes requested. Must be at least one.</param> /// <param name="classid0">Class ID of the nth class.</param> /// <param name="instanceid0">Instance ID of the nth class.</param> /// <param name="language">The user's local language</param> public void GetAssetClassInfo(uint appid, uint class_count, ulong classid0, ulong instanceid0, string language) { using (dynamic data = WebAPI.GetInterface("ISteamEconomy", API.AppKey)) { KeyValue items = data.GetAssetClassInfo(appid: appid, language: language, class_count: class_count, classid0: classid0, instanceid0: instanceid0, l: "english"); } } /// <summary> /// /// </summary> /// <param name="appid">Must be a steam economy app.</param> public void GetAssetPrices(uint appid) { using (dynamic data = WebAPI.GetInterface("ISteamEconomy", API.AppKey)) { KeyValue items = data.GetAssetPrices(appid: appid, l: "english"); } } /// <summary> /// /// </summary> /// <param name="appid">Must be a steam economy app.</param> /// <param name="currency">The currency to filter for</param> /// <param name="language">The user's local language</param> public void GetAssetPrices(uint appid, string currency, string language) { using (dynamic data = WebAPI.GetInterface("ISteamEconomy", API.AppKey)) { KeyValue items = data.GetAssetPrices(appid: appid, currency: currency, language: language, l: "english"); } } } }
40.875
176
0.580275
[ "MIT" ]
Scillman/SteamAchievementsViewer
SteamAchievementsViewer/SteamKit2X2/Internal/SteamAPI/ISteamEconomy.cs
2,618
C#
using System; class FibonacciNumbers { static void Main() { var n = int.Parse(Console.ReadLine()); long result = GetFibNum(n); Console.WriteLine(result); } private static int GetFibNum(int n) { var fi1 = 1; var fi2 = 0; var nextNumber = 0; for (int i = 0; i <= n; i++) { nextNumber = fi1+fi2; fi1 = fi2; fi2 = nextNumber; } return fi2; } }
18.576923
46
0.469979
[ "MIT" ]
V-Uzunov/Soft-Uni-Education
02.ProgrammingFundamentalsC#/05.MethodsAndDebuggingExercise/05.FibonacciNumbers/FibonacciNumbers.cs
485
C#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. namespace Microsoft.AspNet.SignalR.Hubs { public interface IJavaScriptProxyGenerator { string GenerateProxy(string serviceUrl); } }
28.6
132
0.748252
[ "Apache-2.0" ]
AlaShiban/SignalR
src/Microsoft.AspNet.SignalR.Core/Hubs/IJavaScriptProxyGenerator.cs
288
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Service")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Service")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("28a8bb00-1b28-4869-b97f-942d1d465c6b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.486486
84
0.743331
[ "Apache-2.0" ]
anovkova/BoardingHouse
Service/Properties/AssemblyInfo.cs
1,390
C#
using System.ComponentModel.DataAnnotations; namespace TestAuth01.Models.AccountViewModels { public class ForgotPasswordViewModel { [Required] [EmailAddress] public string Email { get; set; } } }
22.090909
46
0.654321
[ "Apache-2.0" ]
marcogazzola/TestAuth01
Models/AccountViewModels/ForgotPasswordViewModel.cs
245
C#
using Mzg.Module.Abstractions; using System; namespace Mzg.Business.DataAnalyse.Visualization { /// <summary> /// 模块描述 /// </summary> public class ModuleEntry : IModule { public string Name { get { return ChartDefaults.ModuleName; } } public Action<ModuleDescriptor> Configure() { return (o) => { o.Identity = 10; o.Name = this.Name; }; } public void OnStarting() { //Dependency.Abstractions.DependencyComponentTypes.Add(this.Name, 11); //Solution.Abstractions.SolutionComponentTypes.Add(this.Name, 10); Solution.Abstractions.SolutionComponentCollection.Configure((o) => { o.Module = Module.Core.ModuleCollection.GetDescriptor(this.Name); o.ComponentsEndpoint = "/api/chart/solutioncomponents"; }); } } }
26.051282
82
0.525591
[ "MIT" ]
lygwys/dlvm_lygwys
Libraries/Business/Mzg.Business.DataAnalyse/Visualization/ModuleEntry.cs
1,026
C#
using System; using Windows.UI.Xaml; namespace UnoAutomatedTestsApp.Wasm { public class Program { private static App _app; static int Main(string[] args) { Windows.UI.Xaml.Application.Start(_ => _app = new App()); return 0; } } }
16.777778
69
0.562914
[ "MIT" ]
PacktPublishing/Creating-Cross-Platform-C-Sharp-Applications-with-Uno-Platform
Chapter07/UnoAutomatedTestsApp.Wasm/Program.cs
304
C#
using Core; using LykkeWalletServices; using NBitcoin; using NBitcoin.OpenAsset; using Newtonsoft.Json; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using static LykkeWalletServices.OpenAssetsHelper; using System.Collections.Concurrent; namespace Lykkex.WalletBackend.Tests { [TestFixture] public class SwapTests : TaskTestsCommon { public IList<GenerateNewWalletTaskResult> usdWallets = new List<GenerateNewWalletTaskResult>(); public IList<GenerateNewWalletTaskResult> eurWallets = new List<GenerateNewWalletTaskResult>(); public ConcurrentBag<string> swapResult = new ConcurrentBag<string>(); public ConcurrentBag<string> swapError = new ConcurrentBag<string>(); public string[] usdWalletGuids = new string[100]; public string[] eurWalletGuids = new string[100]; public string[] swapGuids = new string[100]; public void GenerateNewWalletCallback(string transactionId, TransactionResponseBase result) { if (usdWalletGuids.Contains(transactionId)) { usdWallets.Add(((GenerateNewWalletResponse)result).Result); } if (eurWalletGuids.Contains(transactionId)) { eurWallets.Add(((GenerateNewWalletResponse)result).Result); } } private void ClearState() { usdWallets = new List<GenerateNewWalletTaskResult>(); eurWallets = new List<GenerateNewWalletTaskResult>(); swapResult = new ConcurrentBag<string>(); swapError = new ConcurrentBag<string>(); usdWalletGuids = new string[100]; eurWalletGuids = new string[100]; swapGuids = new string[100]; } public void SwapCallback(string transactionId, TransactionResponseBase result) { if (swapGuids.Contains(transactionId)) { var resp = ((SwapResponse)result); if (resp.Error == null) { swapResult.Add(resp.Result.TransactionHash); } else { swapError.Add(string.Format("Error number:{0} ,Error Message: {1}", resp.Error.Code, resp.Error.Message)); } } } private async Task Perform100SwapsFromClearState() { ClearState(); GenerateNewWalletTaskResult masterUsdWallet = await GenerateNewWallet(QueueReader, QueueWriter); GenerateNewWalletTaskResult masterEurWallet = await GenerateNewWallet(QueueReader, QueueWriter); usdWallets = new List<GenerateNewWalletTaskResult>(); eurWallets = new List<GenerateNewWalletTaskResult>(); for (int i = 0; i < 100; i++) { var usdGuid = Guid.NewGuid(); var eurGuid = Guid.NewGuid(); usdWalletGuids[i] = usdGuid.ToString(); eurWalletGuids[i] = eurGuid.ToString(); await GenerateNewWallet(QueueReader, QueueWriter, GenerateNewWalletCallback, usdGuid); await GenerateNewWallet(QueueReader, QueueWriter, GenerateNewWalletCallback, eurGuid); } while (usdWallets.Count < 100 && eurWallets.Count < 100) { Thread.Sleep(300); } await CashinToAddress(masterUsdWallet.WalletAddress, "TestExchangeUSD", 1000); await CashinToAddress(masterEurWallet.WalletAddress, "TestExchangeEUR", 1000); var usdAsset = await GetAssetFromName("TestExchangeUSD"); var eurAsset = await GetAssetFromName("TestExchangeEUR"); var usdSourceCoin = await GetAssetSourceCoin(masterUsdWallet.WalletAddress, usdAsset.AssetId); var eurSourceCoin = await GetAssetSourceCoin(masterEurWallet.WalletAddress, eurAsset.AssetId); await DistributeColoredCoins(usdWallets.ToArray(), usdAsset, usdSourceCoin, 10, masterUsdWallet); await DistributeColoredCoins(eurWallets.ToArray(), eurAsset, eurSourceCoin, 10, masterEurWallet); await GenerateBlocks(Settings, 1); for (int i = 0; i < 100; i++) { swapGuids[i] = Guid.NewGuid().ToString(); await SwapAssets(swapGuids[i], usdWallets[i].MultiSigAddress, "TestExchangeUSD", 1, eurWallets[i].MultiSigAddress, "TestExchangeEUR", 1, SwapCallback); } while ((swapError.Count() + swapResult.Count()) < 100) { Thread.Sleep(300); } await GenerateBlocks(Settings, 1); } [Test] public async Task SwapFeesShouldBeConsistent() { await Perform100SwapsFromClearState(); using (SqlexpressLykkeEntities entities = new SqlexpressLykkeEntities(WebSettings.ConnectionString)) { while(true) { if(entities.PregeneratedReserves.Count() > 0) { await Task.Delay(10000); } else { break; } } bool actualSpentStatus; foreach(var fee in entities.PreGeneratedOutputs) { actualSpentStatus = await PregeneratedHasBeenSpentInBlockchain (fee, WebSettings.ConnectionParams); if(actualSpentStatus != (fee.Consumed == 1 ? true : false)) { Assert.Fail(string.Format("Please check fee for TxId:{0} and output number:{1} ", fee.TransactionId, fee.OutputNumber)); } } } } [Test] public async Task SwapFeeStressTestFailuresLess5Percent() { await Perform100SwapsFromClearState(); Assert.LessOrEqual(swapError.Count(), 5); } private async Task<Asset> GetAssetFromName(string assetname) { string url = string.Format("http://localhost:8989/General/GetAssetFromName?assetname={0}", assetname); using (HttpClient webClient = new HttpClient()) { var str = await webClient.GetStringAsync(url); dynamic deserialize = JsonConvert.DeserializeObject(str); return new Asset { AssetId = deserialize.AssetId, AssetMultiplicationFactor = deserialize.AssetMultiplicationFactor }; } } private static async Task DistributeColoredCoins(GenerateNewWalletTaskResult[] wallets, Asset asset, ColoredCoin sourceCoin, int eachOutputAmount, GenerateNewWalletTaskResult sourceWallet) { var assetMoney = new AssetMoney(new AssetId(new BitcoinAssetId(asset.AssetId)), eachOutputAmount * asset.AssetMultiplicationFactor); TransactionBuilder builder = new TransactionBuilder(); builder.AddKeys(new BitcoinSecret(sourceWallet.WalletPrivateKey)); builder.AddCoins(sourceCoin); for (int i = 0; i < wallets.Count(); i++) { var usdAddress = Base58Data.GetFromBase58Data(wallets[i].MultiSigAddress) as BitcoinAddress; builder.SendAsset(usdAddress, assetMoney); } using (SqlexpressLykkeEntities entities = new SqlexpressLykkeEntities(WebSettings.ConnectionString)) { await builder.AddEnoughPaymentFee(entities, WebSettings.ConnectionParams, WebSettings.FeeAddress, 100); } var tx = builder.BuildTransaction(true); var rpcClient = new LykkeExtenddedRPCClient(new System.Net.NetworkCredential (WebSettings.ConnectionParams.Username, WebSettings.ConnectionParams.Password), WebSettings.ConnectionParams.IpAddress, WebSettings.ConnectionParams.BitcoinNetwork); await rpcClient.SendRawTransactionAsync(tx); await WaitUntillQBitNinjaHasIndexed(Settings, HasTransactionIndexed, new string[] { tx.GetHash().ToString() }, null); } private static async Task<ColoredCoin> GetAssetSourceCoin(string walletAddress, string assetName) { using (SqlexpressLykkeEntities entities = new SqlexpressLykkeEntities(WebSettings.ConnectionString)) { var walletOutputs = await OpenAssetsHelper.GetWalletOutputs(walletAddress, WebSettings.ConnectionParams.BitcoinNetwork, entities); if (walletOutputs.Item2) { Assert.Fail(walletOutputs.Item3); return null; // We normally not reach here } else { var coins = OpenAssetsHelper.GetColoredUnColoredCoins (walletOutputs.Item1, assetName, WebSettings.Assets); return (coins.Item1)[0]; } } } } }
41.047826
121
0.590721
[ "MIT" ]
LykkeCity/WalletBackEnd
Tests/SwapTests.cs
9,443
C#
using System.Text.Json.Serialization; namespace AzureMapsToolkit.Spatial { public class PointInPolygonResult { /// <summary> /// Geometries array /// </summary> [JsonPropertyName("intersectingGeometries")] public string[] IntersectingGeometries { get; set; } /// <summary> /// Point In Polygons Property /// </summary> [JsonPropertyName("pointInPolygons")] public bool PointInPolygons { get; set; } } }
26.157895
60
0.605634
[ "MIT" ]
anaratz/AzureMapsRestServices
AzureMapsRestToolkit/AzureMapsRestToolkit/Spatial/PointInPolygonResult.cs
499
C#
/* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information. */ namespace Adxstudio.Xrm.Web.UI.JsonConfiguration { /// <summary> /// Override the column display name and width. /// </summary> public interface IViewColumn { /// <summary> /// Logical name of the attribute. /// </summary> string AttributeLogicalName { get; set; } /// <summary> /// Display name. /// </summary> string DisplayName { get; set; } /// <summary> /// Width of the column in pixels. /// </summary> int Width { get; set; } } }
23.333333
94
0.655556
[ "MIT" ]
Adoxio/xRM-Portals-Community-Edition
Framework/Adxstudio.Xrm/Web/UI/JsonConfiguration/IViewColumn.cs
630
C#
using CommunityToolkit.WinUI.UI.Controls; using Microsoft.UI; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using Windows.Storage; using Windows.System; namespace WinUI3DEngine.Assets.Controls { internal enum EMessageType { MESSAGE, WARNING, ERROR } internal struct SMessageInfo { public EMessageType Type; public string Script; public string Method; public int Line; public string Message; public string GetInfo() { return Script.Split("\\").Last() + $":{Line} ({Method})"; } } internal class COutput { static Dictionary<SMessageInfo, List<DateTime>> m_messageCollection = new Dictionary<SMessageInfo, List<DateTime>>(); static TextBlock m_status; static StackPanel m_stack; static ScrollViewer m_scroll; static AppBarToggleButton m_collapse; static AppBarToggleButton m_filterMessages; static AppBarToggleButton m_filterWarnings; static AppBarToggleButton m_filterErrors; static AppBarToggleButton m_pauseError; internal AppBarToggleButton m_ClearPlay; internal COutput(StackPanel _stack, ScrollViewer _scroll, AppBarToggleButton _collapse, AppBarToggleButton _filterMessages, AppBarToggleButton _filterWarnings, AppBarToggleButton _filterErrors, AppBarToggleButton _pauseError, AppBarToggleButton _clearPlay) { m_stack = _stack; m_scroll = _scroll; m_collapse = _collapse; m_filterMessages = _filterMessages; m_filterWarnings = _filterWarnings; m_filterErrors = _filterErrors; m_pauseError = _pauseError; m_ClearPlay = _clearPlay; m_status = CMain.Singleton.m_Status; } static void SetStatus(SMessageInfo _m) { m_status.Text = _m.Message; } async void OpenMessage(string _path) { var file = await ApplicationData.Current.LocalFolder.GetFileAsync(_path); if (file != null) await Launcher.LaunchFileAsync(file); } static UIElement CreateMessage(DateTime _d, SMessageInfo _m, int? _i) { //Content of the message StackPanel stack = new StackPanel() { Orientation = Orientation.Horizontal, Spacing = 10, Margin = new Thickness(10, 0, 0, 0) }; if (_m.Type == EMessageType.WARNING) stack.Children.Add(new FontIcon() { Glyph = "\uE7BA" }); else stack.Children.Add(new SymbolIcon() { Symbol = _m.Type == EMessageType.MESSAGE ? Symbol.Message : Symbol.ReportHacked }); stack.Children.Add(new TextBlock() { Text = "[" + _d.TimeOfDay.ToString("hh\\:mm\\:ss").ToString() + "]" }); stack.Children.Add(new TextBlock() { Text = _m.Message }); //The flyout when clicked on the message StackPanel stackFlyout = new StackPanel() { Orientation = Orientation.Vertical }; stackFlyout.Children.Add(new TextBlock() { Text = _m.GetInfo() + "\n" }); stackFlyout.Children.Add(new MarkdownTextBlock() { Text = _m.Message, Padding = new Thickness(2) }); stackFlyout.Children.Add(new HyperlinkButton() { Content = Path.GetRelativePath(Directory.GetCurrentDirectory(), _m.Script) + ":" + _m.Line, Foreground = new SolidColorBrush(Colors.CadetBlue) }); Flyout flyout = new Flyout() { OverlayInputPassThroughElement = stack, Content = stackFlyout }; //Create main grid that gets returned Grid grid = new Grid() { HorizontalAlignment = HorizontalAlignment.Stretch }; grid.Children.Add(stack); //If there is a count the number gets shown on the right if (_i != null) grid.Children.Add(new TextBlock() { Margin = new Thickness(0, 0, 10, 0), MinWidth = 25, HorizontalAlignment = HorizontalAlignment.Right, Text = _i.ToString() }); //Set flyout to button that stretches along the grid grid.Children.Add(new Button() { Flyout = flyout, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Background = new SolidColorBrush( _m.Type == EMessageType.MESSAGE ? m_stack.Children.Count() % 2 == 0 ? Colors.Transparent : Windows.UI.Color.FromArgb(50, 50, 50, 50) : _m.Type == EMessageType.ERROR ? Windows.UI.Color.FromArgb(88, 255, 0, 0) : Windows.UI.Color.FromArgb(88, 255, 255, 0)) }); return grid; } public static void Log(string _m, EMessageType _t = EMessageType.MESSAGE, [CallerLineNumber] int _l = 0, [CallerMemberName] string _c = null, [CallerFilePath] string _s = null) { SMessageInfo message = new SMessageInfo() { Script = _s, Method = _c, Line = _l, Message = _m, Type = _t }; if (m_pauseError.IsChecked.Value) if (_t == EMessageType.ERROR) CMain.Singleton.m_Player.Pause(); if (!m_messageCollection.ContainsKey(message)) m_messageCollection.Add(message, new List<DateTime>() { DateTime.Now }); else m_messageCollection[message].Add(DateTime.Now); SetStatus(message); IterateOutputMessages(); } internal static void IterateOutputMessages() { Dictionary<DateTime, SMessageInfo> dic = new Dictionary<DateTime, SMessageInfo>(); m_stack.Children.Clear(); int numMessages = 0; int numWarnings = 0; int numErrors = 0; foreach (var kv in m_messageCollection) { switch (kv.Key.Type) { case EMessageType.MESSAGE: numMessages += kv.Value.Count; break; case EMessageType.WARNING: numWarnings += kv.Value.Count; break; case EMessageType.ERROR: numErrors += kv.Value.Count; break; default: break; } } m_filterMessages.Label = $"{numMessages} Messages"; m_filterWarnings.Label = $"{numWarnings} Warnings"; m_filterErrors.Label = $"{numErrors} Errors"; if (m_collapse.IsChecked.Value) { foreach (var k in m_messageCollection.Keys) dic.Add(m_messageCollection[k].Last(), k); var l = dic.OrderBy(key => key.Key); dic = l.ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value); foreach (var kv in dic) { switch (kv.Value.Type) { case EMessageType.MESSAGE: if (!m_filterMessages.IsChecked.Value) continue; break; case EMessageType.WARNING: if (!m_filterWarnings.IsChecked.Value) continue; break; case EMessageType.ERROR: if (!m_filterErrors.IsChecked.Value) continue; break; default: break; } m_stack.Children.Add(CreateMessage(kv.Key, kv.Value, m_messageCollection[kv.Value].Count())); } } else { foreach (var k in m_messageCollection.Keys) foreach (var v in m_messageCollection[k]) dic.Add(v, k); var l = dic.OrderBy(key => key.Key); dic = l.ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value); foreach (var kv in dic) { switch (kv.Value.Type) { case EMessageType.MESSAGE: if (!m_filterMessages.IsChecked.Value) continue; break; case EMessageType.WARNING: if (!m_filterWarnings.IsChecked.Value) continue; break; case EMessageType.ERROR: if (!m_filterErrors.IsChecked.Value) continue; break; default: break; } m_stack.Children.Add(CreateMessage(kv.Key, kv.Value, null)); } } m_stack.UpdateLayout(); m_scroll.ChangeView(0, double.MaxValue, 1); } internal void ClearOutput() { m_messageCollection.Clear(); m_stack.Children.Clear(); m_filterMessages.Label = $" Messages"; m_filterWarnings.Label = $" Warnings"; m_filterErrors.Label = $" Errors"; } } }
40.695833
264
0.530664
[ "MIT" ]
CanTalat-Yakan/3D_Engine-WinUI3
WinUI3DEngine/WinUI3DEngine/WinUI3DEngine/Assets/Controls/COutput.cs
9,769
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace StrongPlate.App.Services { public interface IFrameNavigation { void NavigateToFrame(Type frameType); void NavigateBack(); } }
18.8
45
0.72695
[ "MIT" ]
pxlit-projects/entmob2016_10
UWP2/StrongPlate.App/StrongPlate.App/Services/IFrameNavigation.cs
284
C#
using Abstract_Car_Example.Entities.Abstraction; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Abstract_Car_Example.Entities.Concrete { public class Car : BaseEntity { //car entities created public string Model { get; set; } private double _price; public double Price { get => _price; set => _price = value; } public Car() { } public Car(int id, string model, double price) { this.Id = id; this.Model = model; this.Price = price; } } }
21.3125
70
0.570381
[ "MIT" ]
kadir-code/OOP_Applications
Abstraction/Abstract_Car_Example/Abstract_Car_Example/Entities/Concrete/Car.cs
684
C#
namespace Specifications4Net { public interface ISpecificationBuilder<T> { ISpecificationBuilder<T> Property(string property,string filterOperator,object value); } }
20.888889
94
0.739362
[ "MIT" ]
ckalan/Spec4Net
src/Specifications4Net/ISpecificationBuilder.cs
190
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 System; using System.Collections.Immutable; using System.Threading; using Microsoft.CodeAnalysis.Operations; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Diagnostics { /// <summary> /// Context for initializing an analyzer. /// Analyzer initialization can use an <see cref="AnalysisContext"/> to register actions to be executed at any of: /// <list type="bullet"> /// <item> /// <description>compilation start,</description> /// </item> /// <item> /// <description>compilation end,</description> /// </item> /// <item> /// <description>completion of parsing a code document,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a code document,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a symbol,</description> /// </item> /// <item> /// <description>start of semantic analysis of a method body or an expression appearing outside a method body,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a method body or an expression appearing outside a method body, or</description> /// </item> /// <item> /// <description>completion of semantic analysis of a syntax node.</description> /// </item> /// </list> /// </summary> public abstract class AnalysisContext { /// <summary> /// Register an action to be executed at compilation start. /// A compilation start action can register other actions and/or collect state information to be used in diagnostic analysis, /// but cannot itself report any <see cref="Diagnostic"/>s. /// </summary> /// <param name="action">Action to be executed at compilation start.</param> public abstract void RegisterCompilationStartAction(Action<CompilationStartAnalysisContext> action); /// <summary> /// Register an action to be executed for a complete compilation. /// A compilation action reports <see cref="Diagnostic"/>s about the <see cref="Compilation"/>. /// </summary> /// <param name="action">Action to be executed at compilation end.</param> public abstract void RegisterCompilationAction(Action<CompilationAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of a document, /// which will operate on the <see cref="SemanticModel"/> of the document. A semantic model action /// reports <see cref="Diagnostic"/>s about the model. /// </summary> /// <param name="action">Action to be executed for a document's <see cref="SemanticModel"/>.</param> public abstract void RegisterSemanticModelAction(Action<SemanticModelAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. /// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. /// </summary> /// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> /// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> public void RegisterSymbolAction(Action<SymbolAnalysisContext> action, params SymbolKind[] symbolKinds) { this.RegisterSymbolAction(action, symbolKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. /// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. /// </summary> /// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> /// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> public abstract void RegisterSymbolAction(Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> symbolKinds); /// <summary> /// Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. /// A code block start action can register other actions and/or collect state information to be used in diagnostic analysis, /// but cannot itself report any <see cref="Diagnostic"/>s. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at the start of semantic analysis of a code block.</param> public abstract void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) where TLanguageKindEnum : struct; /// <summary> /// Register an action to be executed after semantic analysis of a method body or an expression appearing outside a method body. /// A code block action reports <see cref="Diagnostic"/>s about code blocks. /// </summary> /// <param name="action">Action to be executed for a code block.</param> public abstract void RegisterCodeBlockAction(Action<CodeBlockAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of parsing of a code document. /// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. /// </summary> /// <param name="action">Action to be executed at completion of parsing of a document.</param> public abstract void RegisterSyntaxTreeAction(Action<SyntaxTreeAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, params TLanguageKindEnum[] syntaxKinds) where TLanguageKindEnum : struct { this.RegisterSyntaxNodeAction(action, syntaxKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public abstract void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) where TLanguageKindEnum : struct; /// <summary> /// Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. /// An operation block start action can register other actions and/or collect state information to be used in diagnostic analysis, /// but cannot itself report any <see cref="Diagnostic"/>s. /// </summary> /// <param name="action">Action to be executed at the start of semantic analysis of an operation block.</param> public virtual void RegisterOperationBlockStartAction(Action<OperationBlockStartAnalysisContext> action) { throw new NotImplementedException(); } /// <summary> /// Register an action to be executed after semantic analysis of a method body or an expression appearing outside a method body. /// An operation block action reports <see cref="Diagnostic"/>s about operation blocks. /// </summary> /// <param name="action">Action to be executed for an operation block.</param> public virtual void RegisterOperationBlockAction(Action<OperationBlockAnalysisContext> action) { throw new NotImplementedException(); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="IOperation"/> with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) { this.RegisterOperationAction(action, operationKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="IOperation"/> with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public virtual void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) { throw new NotImplementedException(); } /// <summary> /// Enable concurrent execution of analyzer actions registered by this analyzer. /// An analyzer that registers for concurrent execution can have better performance than a non-concurrent analyzer. /// However, such an analyzer must ensure that its actions can execute correctly in parallel. /// </summary> /// <remarks> /// Even when an analyzer registers for concurrent execution, certain related actions are *never* executed concurrently. /// For example, end actions registered on any analysis unit (compilation, code block, operation block, etc.) are by definition semantically dependent on analysis from non-end actions registered on the same analysis unit. /// Hence, end actions are never executed concurrently with non-end actions operating on the same analysis unit. /// </remarks> public virtual void EnableConcurrentExecution() { throw new NotImplementedException(); } /// <summary> /// Configure analysis mode of generated code for this analyzer. /// Non-configured analyzers will default to an appropriate default mode for generated code. /// It is recommended for the analyzer to invoke this API with the required <see cref="GeneratedCodeAnalysisFlags"/> setting. /// </summary> public virtual void ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags analysisMode) { throw new NotImplementedException(); } /// <summary> /// Attempts to compute or get the cached value provided by the given <paramref name="valueProvider"/> for the given <paramref name="text"/>. /// Note that the pair {<paramref name="valueProvider"/>, <paramref name="text"/>} acts as the key. /// Reusing the same <paramref name="valueProvider"/> instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values. /// </summary> /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> /// <param name="text"><see cref="SourceText"/> for which the value is queried.</param> /// <param name="valueProvider">Provider that computes the underlying value.</param> /// <param name="value">Value associated with the key.</param> /// <returns>Returns true on success, false otherwise.</returns> public bool TryGetValue<TValue>(SourceText text, SourceTextValueProvider<TValue> valueProvider, out TValue value) { return TryGetValue(text, valueProvider.CoreValueProvider, out value); } private bool TryGetValue<TKey, TValue>(TKey key, AnalysisValueProvider<TKey, TValue> valueProvider, out TValue value) where TKey : class { DiagnosticAnalysisContextHelpers.VerifyArguments(key, valueProvider); return valueProvider.TryGetValue(key, out value); } } /// <summary> /// Flags to configure mode of generated code analysis. /// </summary> [Flags] public enum GeneratedCodeAnalysisFlags { /// <summary> /// Disable analyzer action callbacks and diagnostic reporting for generated code. /// Analyzer driver will not make callbacks into the analyzer for entities (source files, symbols, etc.) that it classifies as generated code. /// Additionally, any diagnostic reported by the analyzer with location in generated code will not be reported. /// </summary> None = 0x00, /// <summary> /// Enable analyzer action callbacks for generated code. /// Analyzer driver will make callbacks into the analyzer for all entities (source files, symbols, etc.) in the compilation, including generated code. /// </summary> Analyze = 0x01, /// <summary> /// Enable reporting diagnostics on generated code. /// Analyzer driver will not suppress any analyzer diagnostic based on whether or not it's location is in generated code. /// </summary> ReportDiagnostics = 0x02, } /// <summary> /// Context for a compilation start action. /// A compilation start action can use a <see cref="CompilationStartAnalysisContext"/> to register actions to be executed at any of: /// <list type="bullet"> /// <item> /// <description>compilation end,</description> /// </item> /// <item> /// <description>completion of parsing a code document,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a code document,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a symbol,</description> /// </item> /// <item> /// <description>start of semantic analysis of a method body or an expression appearing outside a method body,</description> /// </item> /// <item> /// <description>completion of semantic analysis of a method body or an expression appearing outside a method body, or</description> /// </item> /// <item> /// <description>completion of semantic analysis of a syntax node.</description> /// </item> /// </list> /// </summary> public abstract class CompilationStartAnalysisContext { private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> that is the subject of the analysis. /// </summary> public Compilation Compilation { get { return _compilation; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } protected CompilationStartAnalysisContext(Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) { _compilation = compilation; _options = options; _cancellationToken = cancellationToken; } /// <summary> /// Register an action to be executed at compilation end. /// A compilation end action reports <see cref="Diagnostic"/>s about the <see cref="CodeAnalysis.Compilation"/>. /// </summary> /// <param name="action">Action to be executed at compilation end.</param> public abstract void RegisterCompilationEndAction(Action<CompilationAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of a document, /// which will operate on the <see cref="SemanticModel"/> of the document. A semantic model action /// reports <see cref="Diagnostic"/>s about the model. /// </summary> /// <param name="action">Action to be executed for a document's <see cref="SemanticModel"/>.</param> public abstract void RegisterSemanticModelAction(Action<SemanticModelAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. /// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. /// </summary> /// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> /// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> public void RegisterSymbolAction(Action<SymbolAnalysisContext> action, params SymbolKind[] symbolKinds) { this.RegisterSymbolAction(action, symbolKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="ISymbol"/> with an appropriate Kind. /// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. /// </summary> /// <param name="action">Action to be executed for an <see cref="ISymbol"/>.</param> /// <param name="symbolKinds">Action will be executed only if an <see cref="ISymbol"/>'s Kind matches one of the <see cref="SymbolKind"/> values.</param> public abstract void RegisterSymbolAction(Action<SymbolAnalysisContext> action, ImmutableArray<SymbolKind> symbolKinds); /// <summary> /// Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. /// A code block start action can register other actions and/or collect state information to be used in diagnostic analysis, /// but cannot itself report any <see cref="Diagnostic"/>s. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at the start of semantic analysis of a code block.</param> public abstract void RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>> action) where TLanguageKindEnum : struct; /// <summary> /// Register an action to be executed at the end of semantic analysis of a method body or an expression appearing outside a method body. /// A code block action reports <see cref="Diagnostic"/>s about code blocks. /// </summary> /// <param name="action">Action to be executed for a code block.</param> public abstract void RegisterCodeBlockAction(Action<CodeBlockAnalysisContext> action); /// <summary> /// Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. /// An operation block start action can register other actions and/or collect state information to be used in diagnostic analysis, /// but cannot itself report any <see cref="Diagnostic"/>s. /// </summary> /// <param name="action">Action to be executed at the start of semantic analysis of an operation block.</param> public virtual void RegisterOperationBlockStartAction(Action<OperationBlockStartAnalysisContext> action) { throw new NotImplementedException(); } /// <summary> /// Register an action to be executed after semantic analysis of a method body or an expression appearing outside a method body. /// An operation block action reports <see cref="Diagnostic"/>s about operation blocks. /// </summary> /// <param name="action">Action to be executed for an operation block.</param> public virtual void RegisterOperationBlockAction(Action<OperationBlockAnalysisContext> action) { throw new NotImplementedException(); } /// <summary> /// Register an action to be executed at completion of parsing of a code document. /// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. /// </summary> /// <param name="action">Action to be executed at completion of parsing of a document.</param> public abstract void RegisterSyntaxTreeAction(Action<SyntaxTreeAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, params TLanguageKindEnum[] syntaxKinds) where TLanguageKindEnum : struct { this.RegisterSyntaxNodeAction(action, syntaxKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <typeparam name="TLanguageKindEnum">Enum type giving the syntax node kinds of the source language for which the action applies.</typeparam> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public abstract void RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds) where TLanguageKindEnum : struct; /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="IOperation"/> with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) { this.RegisterOperationAction(action, operationKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="IOperation"/> with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public virtual void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds) { throw new NotImplementedException(); } /// <summary> /// Attempts to compute or get the cached value provided by the given <paramref name="valueProvider"/> for the given <paramref name="text"/>. /// Note that the pair {<paramref name="valueProvider"/>, <paramref name="text"/>} acts as the key. /// Reusing the same <paramref name="valueProvider"/> instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values. /// </summary> /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> /// <param name="text"><see cref="SourceText"/> for which the value is queried.</param> /// <param name="valueProvider">Provider that computes the underlying value.</param> /// <param name="value">Value associated with the key.</param> /// <returns>Returns true on success, false otherwise.</returns> public bool TryGetValue<TValue>(SourceText text, SourceTextValueProvider<TValue> valueProvider, out TValue value) { return TryGetValue(text, valueProvider.CoreValueProvider, out value); } /// <summary> /// Attempts to compute or get the cached value provided by the given <paramref name="valueProvider"/> for the given <paramref name="tree"/>. /// Note that the pair {<paramref name="valueProvider"/>, <paramref name="tree"/>} acts as the key. /// Reusing the same <paramref name="valueProvider"/> instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values. /// </summary> /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> /// <param name="tree"><see cref="SyntaxTree"/> instance for which the value is queried.</param> /// <param name="valueProvider">Provider that computes the underlying value.</param> /// <param name="value">Value associated with the key.</param> /// <returns>Returns true on success, false otherwise.</returns> public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, out TValue value) { return TryGetValue(tree, valueProvider.CoreValueProvider, out value); } private bool TryGetValue<TKey, TValue>(TKey key, AnalysisValueProvider<TKey, TValue> valueProvider, out TValue value) where TKey : class { DiagnosticAnalysisContextHelpers.VerifyArguments(key, valueProvider); return TryGetValueCore(key, valueProvider, out value); } internal virtual bool TryGetValueCore<TKey, TValue>(TKey key, AnalysisValueProvider<TKey, TValue> valueProvider, out TValue value) where TKey : class { throw new NotImplementedException(); } } /// <summary> /// Context for a compilation action or compilation end action. /// A compilation action or compilation end action can use a <see cref="CompilationAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="CodeAnalysis.Compilation"/>. /// </summary> public struct CompilationAnalysisContext { private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CompilationAnalysisValueProviderFactory _compilationAnalysisValueProviderFactoryOpt; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> that is the subject of the analysis. /// </summary> public Compilation Compilation { get { return _compilation; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } public CompilationAnalysisContext(Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) : this(compilation, options, reportDiagnostic, isSupportedDiagnostic, null, cancellationToken) { } internal CompilationAnalysisContext( Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CompilationAnalysisValueProviderFactory compilationAnalysisValueProviderFactoryOpt, CancellationToken cancellationToken) { _compilation = compilation; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _compilationAnalysisValueProviderFactoryOpt = compilationAnalysisValueProviderFactoryOpt; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.Compilation"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } /// <summary> /// Attempts to compute or get the cached value provided by the given <paramref name="valueProvider"/> for the given <paramref name="text"/>. /// Note that the pair {<paramref name="valueProvider"/>, <paramref name="text"/>} acts as the key. /// Reusing the same <paramref name="valueProvider"/> instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values. /// </summary> /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> /// <param name="text"><see cref="SourceText"/> for which the value is queried.</param> /// <param name="valueProvider">Provider that computes the underlying value.</param> /// <param name="value">Value associated with the key.</param> /// <returns>Returns true on success, false otherwise.</returns> public bool TryGetValue<TValue>(SourceText text, SourceTextValueProvider<TValue> valueProvider, out TValue value) { return TryGetValue(text, valueProvider.CoreValueProvider, out value); } /// <summary> /// Attempts to compute or get the cached value provided by the given <paramref name="valueProvider"/> for the given <paramref name="tree"/>. /// Note that the pair {<paramref name="valueProvider"/>, <paramref name="tree"/>} acts as the key. /// Reusing the same <paramref name="valueProvider"/> instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values. /// </summary> /// <typeparam name="TValue">The type of the value associated with the key.</typeparam> /// <param name="tree"><see cref="SyntaxTree"/> for which the value is queried.</param> /// <param name="valueProvider">Provider that computes the underlying value.</param> /// <param name="value">Value associated with the key.</param> /// <returns>Returns true on success, false otherwise.</returns> public bool TryGetValue<TValue>(SyntaxTree tree, SyntaxTreeValueProvider<TValue> valueProvider, out TValue value) { return TryGetValue(tree, valueProvider.CoreValueProvider, out value); } private bool TryGetValue<TKey, TValue>(TKey key, AnalysisValueProvider<TKey, TValue> valueProvider, out TValue value) where TKey : class { DiagnosticAnalysisContextHelpers.VerifyArguments(key, valueProvider); if (_compilationAnalysisValueProviderFactoryOpt != null) { var compilationAnalysisValueProvider = _compilationAnalysisValueProviderFactoryOpt.GetValueProvider(valueProvider); return compilationAnalysisValueProvider.TryGetValue(key, out value); } return valueProvider.TryGetValue(key, out value); } } /// <summary> /// Context for a semantic model action. /// A semantic model action operates on the <see cref="CodeAnalysis.SemanticModel"/> of a code document, and can use a <see cref="SemanticModelAnalysisContext"/> to report <see cref="Diagnostic"/>s about the model. /// </summary> public struct SemanticModelAnalysisContext { private readonly SemanticModel _semanticModel; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="CodeAnalysis.SemanticModel"/> that is the subject of the analysis. /// </summary> public SemanticModel SemanticModel { get { return _semanticModel; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } public SemanticModelAnalysisContext(SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _semanticModel = semanticModel; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.SemanticModel"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _semanticModel.Compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for a symbol action. /// A symbol action can use a <see cref="SymbolAnalysisContext"/> to report <see cref="Diagnostic"/>s about an <see cref="ISymbol"/>. /// </summary> public struct SymbolAnalysisContext { private readonly ISymbol _symbol; private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="ISymbol"/> that is the subject of the analysis. /// </summary> public ISymbol Symbol { get { return _symbol; } } /// <summary> /// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="ISymbol"/>. /// </summary> public Compilation Compilation { get { return _compilation; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } internal Func<Diagnostic, bool> IsSupportedDiagnostic => _isSupportedDiagnostic; public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _symbol = symbol; _compilation = compilation; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about an <see cref="ISymbol"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for a code block start action. /// A code block start action can use a <see cref="CodeBlockStartAnalysisContext{TLanguageKindEnum}"/> to register actions to be executed /// at any of: /// <list type="bullet"> /// <item> /// <description>completion of semantic analysis of a method body or an expression appearing outside a method body, or</description> /// </item> /// <item> /// <description>completion of semantic analysis of a syntax node.</description> /// </item> /// </list> /// </summary> public abstract class CodeBlockStartAnalysisContext<TLanguageKindEnum> where TLanguageKindEnum : struct { private readonly SyntaxNode _codeBlock; private readonly ISymbol _owningSymbol; private readonly SemanticModel _semanticModel; private readonly AnalyzerOptions _options; private readonly CancellationToken _cancellationToken; /// <summary> /// Method body or expression subject to analysis. /// </summary> public SyntaxNode CodeBlock { get { return _codeBlock; } } /// <summary> /// <see cref="ISymbol"/> for which the code block provides a definition or value. /// </summary> public ISymbol OwningSymbol { get { return _owningSymbol; } } /// <summary> /// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. /// </summary> public SemanticModel SemanticModel { get { return _semanticModel; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } protected CodeBlockStartAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, CancellationToken cancellationToken) { _codeBlock = codeBlock; _owningSymbol = owningSymbol; _semanticModel = semanticModel; _options = options; _cancellationToken = cancellationToken; } /// <summary> /// Register an action to be executed at the end of semantic analysis of a method body or an expression appearing outside a method body. /// A code block end action reports <see cref="Diagnostic"/>s about code blocks. /// </summary> /// <param name="action">Action to be executed at the end of semantic analysis of a code block.</param> public abstract void RegisterCodeBlockEndAction(Action<CodeBlockAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public void RegisterSyntaxNodeAction(Action<SyntaxNodeAnalysisContext> action, params TLanguageKindEnum[] syntaxKinds) { this.RegisterSyntaxNodeAction(action, syntaxKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/> with an appropriate Kind. /// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect /// state information to be used by other syntax node actions or code block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of a <see cref="SyntaxNode"/>.</param> /// <param name="syntaxKinds">Action will be executed only if a <see cref="SyntaxNode"/>'s Kind matches one of the syntax kind values.</param> public abstract void RegisterSyntaxNodeAction(Action<SyntaxNodeAnalysisContext> action, ImmutableArray<TLanguageKindEnum> syntaxKinds); } /// <summary> /// Context for a code block action or code block end action. /// A code block action or code block end action can use a <see cref="CodeBlockAnalysisContext"/> to report <see cref="Diagnostic"/>s about a code block. /// </summary> public struct CodeBlockAnalysisContext { private readonly SyntaxNode _codeBlock; private readonly ISymbol _owningSymbol; private readonly SemanticModel _semanticModel; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// Code block that is the subject of the analysis. /// </summary> public SyntaxNode CodeBlock { get { return _codeBlock; } } /// <summary> /// <see cref="ISymbol"/> for which the code block provides a definition or value. /// </summary> public ISymbol OwningSymbol { get { return _owningSymbol; } } /// <summary> /// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>s in the code block. /// </summary> public SemanticModel SemanticModel { get { return _semanticModel; } } /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options { get { return _options; } } /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken { get { return _cancellationToken; } } public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _codeBlock = codeBlock; _owningSymbol = owningSymbol; _semanticModel = semanticModel; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a code block. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _semanticModel.Compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for an operation block start action. /// An operation block start action can use an <see cref="OperationBlockStartAnalysisContext"/> to register actions to be executed /// at any of: /// <list type="bullet"> /// <item> /// <description>completion of semantic analysis of a method body or an expression appearing outside a method body, or</description> /// </item> /// <item> /// <description>completion of semantic analysis of an operation.</description> /// </item> /// </list> /// </summary> public abstract class OperationBlockStartAnalysisContext { private readonly ImmutableArray<IOperation> _operationBlocks; private readonly ISymbol _owningSymbol; private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly CancellationToken _cancellationToken; /// <summary> /// One or more operation blocks that are the subject of the analysis. /// This includes all blocks associated with the <see cref="OwningSymbol"/>, /// such as method body, field/property/constructor/parameter initializer(s), attributes, etc. /// </summary> /// <remarks>Note that the operation blocks are not in any specific order.</remarks> public ImmutableArray<IOperation> OperationBlocks => _operationBlocks; /// <summary> /// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. /// </summary> public ISymbol OwningSymbol => _owningSymbol; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="OperationBlocks"/>. /// </summary> public Compilation Compilation => _compilation; /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options => _options; /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken => _cancellationToken; protected OperationBlockStartAnalysisContext(ImmutableArray<IOperation> operationBlocks, ISymbol owningSymbol, Compilation compilation, AnalyzerOptions options, CancellationToken cancellationToken) { _operationBlocks = operationBlocks; _owningSymbol = owningSymbol; _compilation = compilation; _options = options; _cancellationToken = cancellationToken; } /// <summary> /// Register an action to be executed at the end of semantic analysis of a method body or an expression appearing outside a method body. /// A code block end action reports <see cref="Diagnostic"/>s about code blocks. /// </summary> /// <param name="action">Action to be executed at the end of semantic analysis of a code block.</param> public abstract void RegisterOperationBlockEndAction(Action<OperationBlockAnalysisContext> action); /// <summary> /// Register an action to be executed at completion of semantic analysis of an operation with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or operation block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public void RegisterOperationAction(Action<OperationAnalysisContext> action, params OperationKind[] operationKinds) { this.RegisterOperationAction(action, operationKinds.AsImmutableOrEmpty()); } /// <summary> /// Register an action to be executed at completion of semantic analysis of an <see cref="IOperation"/> with an appropriate Kind. /// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect /// state information to be used by other operation actions or operation block end actions. /// </summary> /// <param name="action">Action to be executed at completion of semantic analysis of an <see cref="IOperation"/>.</param> /// <param name="operationKinds">Action will be executed only if an <see cref="IOperation"/>'s Kind matches one of the operation kind values.</param> public abstract void RegisterOperationAction(Action<OperationAnalysisContext> action, ImmutableArray<OperationKind> operationKinds); } /// <summary> /// Context for an operation block action or operation block end action. /// An operation block action or operation block end action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s about an operation block. /// </summary> public struct OperationBlockAnalysisContext { private readonly ImmutableArray<IOperation> _operationBlocks; private readonly ISymbol _owningSymbol; private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// One or more operation blocks that are the subject of the analysis. /// This includes all blocks associated with the <see cref="OwningSymbol"/>, /// such as method body, field/property/constructor/parameter initializer(s), attributes, etc. /// </summary> /// <remarks>Note that the operation blocks are not in any specific order.</remarks> public ImmutableArray<IOperation> OperationBlocks => _operationBlocks; /// <summary> /// <see cref="ISymbol"/> for which the <see cref="OperationBlocks"/> provides a definition or value. /// </summary> public ISymbol OwningSymbol => _owningSymbol; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="OperationBlocks"/>. /// </summary> public Compilation Compilation => _compilation; /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options => _options; /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken => _cancellationToken; public OperationBlockAnalysisContext(ImmutableArray<IOperation> operationBlocks, ISymbol owningSymbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _operationBlocks = operationBlocks; _owningSymbol = owningSymbol; _compilation = compilation; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a code block. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, Compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for a syntax tree action. /// A syntax tree action can use a <see cref="SyntaxTreeAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="SyntaxTree"/> for a code document. /// </summary> public struct SyntaxTreeAnalysisContext { private readonly SyntaxTree _tree; private readonly Compilation _compilationOpt; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="SyntaxTree"/> that is the subject of the analysis. /// </summary> public SyntaxTree Tree => _tree; /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options => _options; /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken => _cancellationToken; internal Compilation Compilation => _compilationOpt; public SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _tree = tree; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _compilationOpt = null; _cancellationToken = cancellationToken; } internal SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, Compilation compilation, CancellationToken cancellationToken) { _tree = tree; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _compilationOpt = compilation; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxTree"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _compilationOpt, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for a syntax node action. /// A syntax node action can use a <see cref="SyntaxNodeAnalysisContext"/> to report <see cref="Diagnostic"/>s for a <see cref="SyntaxNode"/>. /// </summary> public struct SyntaxNodeAnalysisContext { private readonly SyntaxNode _node; private readonly ISymbol _containingSymbol; private readonly SemanticModel _semanticModel; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="SyntaxNode"/> that is the subject of the analysis. /// </summary> public SyntaxNode Node => _node; /// <summary> /// <see cref="ISymbol"/> for the declaration containing the syntax node. /// </summary> public ISymbol ContainingSymbol => _containingSymbol; /// <summary> /// <see cref="CodeAnalysis.SemanticModel"/> that can provide semantic information about the <see cref="SyntaxNode"/>. /// </summary> public SemanticModel SemanticModel => _semanticModel; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="SyntaxNode"/>. /// </summary> public Compilation Compilation => _semanticModel?.Compilation; /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options => _options; /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken => _cancellationToken; public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _node = node; _containingSymbol = containingSymbol; _semanticModel = semanticModel; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } public SyntaxNodeAnalysisContext(SyntaxNode node, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) : this(node, null, semanticModel, options, reportDiagnostic, isSupportedDiagnostic, cancellationToken) { } /// <summary> /// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _semanticModel.Compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } /// <summary> /// Context for an operation action. /// An operation action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s for an <see cref="IOperation"/>. /// </summary> public struct OperationAnalysisContext { private readonly IOperation _operation; private readonly ISymbol _containingSymbol; private readonly Compilation _compilation; private readonly AnalyzerOptions _options; private readonly Action<Diagnostic> _reportDiagnostic; private readonly Func<Diagnostic, bool> _isSupportedDiagnostic; private readonly CancellationToken _cancellationToken; /// <summary> /// <see cref="IOperation"/> that is the subject of the analysis. /// </summary> public IOperation Operation => _operation; /// <summary> /// <see cref="ISymbol"/> for the declaration containing the operation. /// </summary> public ISymbol ContainingSymbol => _containingSymbol; /// <summary> /// <see cref="CodeAnalysis.Compilation"/> containing the <see cref="IOperation"/>. /// </summary> public Compilation Compilation => _compilation; /// <summary> /// Options specified for the analysis. /// </summary> public AnalyzerOptions Options => _options; /// <summary> /// Token to check for requested cancellation of the analysis. /// </summary> public CancellationToken CancellationToken => _cancellationToken; public OperationAnalysisContext(IOperation operation, ISymbol containingSymbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) { _operation = operation; _containingSymbol = containingSymbol; _compilation = compilation; _options = options; _reportDiagnostic = reportDiagnostic; _isSupportedDiagnostic = isSupportedDiagnostic; _cancellationToken = cancellationToken; } /// <summary> /// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>. /// </summary> /// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> public void ReportDiagnostic(Diagnostic diagnostic) { DiagnosticAnalysisContextHelpers.VerifyArguments(diagnostic, _compilation, _isSupportedDiagnostic); lock (_reportDiagnostic) { _reportDiagnostic(diagnostic); } } } }
54.278057
280
0.669532
[ "Apache-2.0" ]
DaiMichael/roslyn
src/Compilers/Core/Portable/DiagnosticAnalyzer/DiagnosticAnalysisContext.cs
64,810
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using DreamBuilder.Models; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; namespace DreamBuilder.Areas.Identity.Pages.Account { [AllowAnonymous] public class ExternalLoginModel : PageModel { private readonly SignInManager<DreamBuilderUser> _signInManager; private readonly UserManager<DreamBuilderUser> _userManager; //private readonly ILogger<ExternalLoginModel> _logger; public ExternalLoginModel( SignInManager<DreamBuilderUser> signInManager, UserManager<DreamBuilderUser> userManager //ILogger<ExternalLoginModel> logger ) { _signInManager = signInManager; _userManager = userManager; //_logger = logger; } [BindProperty] public InputModel Input { get; set; } public string LoginProvider { get; set; } public string ReturnUrl { get; set; } [TempData] public string ErrorMessage { get; set; } public class InputModel { [Required] [EmailAddress] public string Email { get; set; } } public IActionResult OnGetAsync() { return RedirectToPage("./Login"); } public IActionResult OnPost(string provider, string returnUrl = null) { // Request a redirect to the external login provider. var redirectUrl = Url.Page("./ExternalLogin", pageHandler: "Callback", values: new { returnUrl }); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return new ChallengeResult(provider, properties); } public async Task<IActionResult> OnGetCallbackAsync(string returnUrl = null, string remoteError = null) { returnUrl = returnUrl ?? Url.Content("~/"); if (remoteError != null) { ErrorMessage = $"Error from external provider: {remoteError}"; return RedirectToPage("./Login", new {ReturnUrl = returnUrl }); } var info = await _signInManager.GetExternalLoginInfoAsync(); if (info == null) { ErrorMessage = "Error loading external login information."; return RedirectToPage("./Login", new { ReturnUrl = returnUrl }); } // Sign in the user with this external login provider if the user already has a login. var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor : true); if (result.Succeeded) { //_logger.LogInformation("{Name} logged in with {LoginProvider} provider.", info.Principal.Identity.Name, info.LoginProvider); return LocalRedirect(returnUrl); } if (result.IsLockedOut) { return RedirectToPage("./Lockout"); } else { // If the user does not have an account, then ask the user to create an account. ReturnUrl = returnUrl; LoginProvider = info.LoginProvider; if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email)) { Input = new InputModel { Email = info.Principal.FindFirstValue(ClaimTypes.Email) }; } return Page(); } } public async Task<IActionResult> OnPostConfirmationAsync(string returnUrl = null) { returnUrl = returnUrl ?? Url.Content("~/"); // Get the information about the user from the external login provider var info = await _signInManager.GetExternalLoginInfoAsync(); if (info == null) { ErrorMessage = "Error loading external login information during confirmation."; return RedirectToPage("./Login", new { ReturnUrl = returnUrl }); } if (ModelState.IsValid) { var user = new DreamBuilderUser { UserName = Input.Email, Email = Input.Email }; var result = await _userManager.CreateAsync(user); if (result.Succeeded) { result = await _userManager.AddLoginAsync(user, info); if (result.Succeeded) { await _signInManager.SignInAsync(user, isPersistent: false); //_logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider); return LocalRedirect(returnUrl); } } foreach (var error in result.Errors) { ModelState.AddModelError(string.Empty, error.Description); } } LoginProvider = info.LoginProvider; ReturnUrl = returnUrl; return Page(); } } }
38.174825
154
0.576113
[ "MIT" ]
MiroslavaPetrova/DreamBuilder
DreamBuilder/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs
5,461
C#
namespace Attributes.Modifiers.BaseValueModifiers { public class AdditionBaseModifier : BaseModifier<float> { public float AdditionValue; public AdditionBaseModifier() { Order = 0; } public override float CalculateValue(float baseValue) { return AdditionValue + baseValue; } } }
23.25
61
0.604839
[ "MIT" ]
NikitaHerndlhofer/Attributes
Modifiers/BaseValueModifiers/AdditionBaseModifier.cs
374
C#
using System; using System.Collections.Generic; using System.Text; namespace SMBMessageParser.Models.NetworkStruct.Create { [Flags] public enum ShareAccessFlags : uint { None = 0, ShareRead = 0x00000001, ShareWrite = 0x00000002, ShareDelete = 0x00000004, } static class ShareAccessFlagsExtend { public static bool HasFlag(this ShareAccessFlags t, ShareAccessFlags sMB2HeaderFlags) { if (sMB2HeaderFlags == 0) { throw new ArgumentException("Can't be Zero"); } if ((t & sMB2HeaderFlags) == sMB2HeaderFlags) { return true; } else { return false; } } public static byte[] GetBytes(this ShareAccessFlags t) { return BitConverter.GetBytes((uint)t); } } }
24.394737
93
0.539374
[ "MIT" ]
tlsnns/NTLMClient
NTLMTest/SMBMessageParser/Models/NetworkStruct/Create/ShareAccessFlags.cs
929
C#
using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; namespace MyIP { public interface IMyIPClient { #region Methods MyIPResponse Get(); Task<MyIPResponse> GetAsync(); #endregion #region Properties bool IPv4 { get; set; } bool IPv6 { get; set; } #endregion } public sealed class MyIPClient : IMyIPClient { private static readonly HttpClient _httpClient; private readonly string _ipv4Url; private readonly string _ipv6Url; private int _timeout; private bool _ipv4; private bool _ipv6; static MyIPClient() { _httpClient = new HttpClient(); _httpClient.DefaultRequestHeaders.Add("User-Agent", "MyIP/Client 1.0"); } public MyIPClient(string ipv4Url = null, string ipv6Url = null) { _ipv4Url = string.IsNullOrWhiteSpace(ipv4Url) ? "https://api4.my-ip.io/ip" : ipv4Url; _ipv6Url = string.IsNullOrWhiteSpace(ipv6Url) ? "https://api6.my-ip.io/ip" : ipv6Url; _timeout = 20; _ipv4 = true; _ipv6 = Socket.OSSupportsIPv6; } #region Methods public MyIPResponse Get() { return GetAsync().GetAwaiter().GetResult(); } public async Task<MyIPResponse> GetAsync() { var cts = new CancellationTokenSource(); cts.CancelAfter(TimeSpan.FromSeconds(_timeout)); IPAddress ipv4 = null; IPAddress ipv6 = null; try { var tasks = new Queue<Task>(); if (_ipv4) { var task = Task.Run(async () => { try { var response = await _httpClient.GetAsync(_ipv4Url, cts.Token); if (response.IsSuccessStatusCode) { var content = await response.Content.ReadAsStringAsync(); if (IPAddress.TryParse(content, out var value) && value.AddressFamily == AddressFamily.InterNetwork) ipv4 = value; } } catch { // Squash } }, cts.Token); tasks.Enqueue(task); } if (_ipv6 && Socket.OSSupportsIPv6) { var task = Task.Run(async () => { try { var response = await _httpClient.GetAsync(_ipv6Url, cts.Token); if (response.IsSuccessStatusCode) { var content = await response.Content.ReadAsStringAsync(); if (IPAddress.TryParse(content, out var value) && value.AddressFamily == AddressFamily.InterNetworkV6) ipv6 = value; } } catch { // Squash } }, cts.Token); tasks.Enqueue(task); } await Task.WhenAll(tasks.ToArray()); } catch (Exception ex) { if (!(ex is TaskCanceledException || ex is OperationCanceledException)) throw; } var result = new MyIPResponse(ipv4, ipv6); return result; } #endregion #region Properties public int Timeout { get => _timeout; set { if (value <= 1) { _timeout = 1; } else { _timeout = value; } } } public bool IPv4 { get => _ipv4; set => _ipv4 = value; } public bool IPv6 { get => _ipv6; set => _ipv6 = value; } #endregion } }
25.948864
134
0.425224
[ "BSD-3-Clause" ]
Workshell/myip-dotnet
src/MyIP.Client/MyIPClient.cs
4,569
C#
using System; using System.Collections.Generic; using Zpp.DataLayer.impl.WrappersForCollections; namespace Zpp.Util.Graph.impl { public sealed class Nodes : CollectionWrapperWithStackSet<INode>, INodes { public Nodes(IEnumerable<INode> list) { AddAll(list); } public Nodes(INode item) { Add(item); } public Nodes() { } public IEnumerable<T> As<T>() { List<T> newList = new List<T>(); foreach (var item in StackSet) { newList.Add((T)item); } return newList; } public Stack<INode> ToStack() { Stack<INode> stack = new Stack<INode>(); foreach (var item in StackSet) { stack.Push(item); } return stack; } } }
20.422222
76
0.479869
[ "Apache-2.0" ]
MaxWeickert/ng-erp-4.0
Zpp/Utils/Graph/impl/Nodes.cs
919
C#
using SuperMemoAssistant.Interop.SuperMemo.Content.Components; using SuperMemoAssistant.Interop.SuperMemo.Content.Models; using SuperMemoAssistant.Interop.SuperMemo.Registry.Members; using SuperMemoAssistant.SuperMemo.SuperMemo17.Files; namespace SuperMemoAssistant.SuperMemo.SuperMemo17.Content.Components { public class ComponentHtml : ComponentBase, IComponentHtml { protected int TextId { get; set; } protected int ColorRed { get; set; } protected int ColorGreen { get; set; } protected int ColorBlue { get; set; } public ComponentHtml(ref InfComponentsHtml comp) : base(comp.left, comp.top, comp.width, comp.height, (AtFlags)comp.displayAt) { TextId = SetValue(comp.registryId, nameof(TextId)); IsFullHtml = SetValue(comp.isFullHtml != 0, nameof(IsFullHtml)); } public void Update(ref InfComponentsHtml comp) { ComponentFieldFlags flags = ComponentFieldFlags.None; TextId = SetValue(TextId, comp.registryId, nameof(TextId), ref flags); IsFullHtml = SetValue(IsFullHtml, comp.isFullHtml != 0, nameof(IsFullHtml), ref flags); base.Update( comp.left, comp.top, comp.width, comp.height, (AtFlags)comp.displayAt, flags ); } public IText Text => SMA.SMA.Instance.Registry.Text?[TextId]; public bool IsFullHtml { get; set; } } }
33.341463
93
0.709583
[ "MIT" ]
leowalkling/SuperMemoAssistant
src/Core/SuperMemoAssistant.Core/SuperMemo/SuperMemo17/Content/Components/ComponentHtml.cs
1,367
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace UsageSampleMvc.AspNetCore { public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } }
24.84
76
0.698873
[ "MIT" ]
TormentorMaharaj/stuntman
samples/UsageSampleMvc.AspNetCore/Program.cs
623
C#
using System; using FlightNode.Common.BaseClasses; namespace FlightNode.DataCollection.Domain.Entities { /// <summary> /// Models the results of running the view "WaterbirdForagingExport" /// </summary> public class RookeryCensusExportItem : IEntity { /// <summary> /// Gets or sets the observation id /// </summary> public int Id { get; set; } /// <summary> /// Gets or sets the Survey Identifier /// </summary> public Guid SurveyIdentifier { get; set; } /// <summary> /// Gets or sets the Site Code /// </summary> public string SiteCode { get; set; } /// <summary> /// Gets or sets the Site Name /// </summary> public string SiteName { get; set; } /// <summary> /// Gets or sets the city /// </summary> public string City { get; set; } /// <summary> /// Gets or sets the County /// </summary> public string County { get; set; } /// <summary> /// Gets or sets the Longitude /// </summary> public string Longitude { get; set; } /// <summary> /// Gets or sets the Latitude /// </summary> public string Latitude { get; set; } /// <summary> /// Gets or sets the Site Assessment /// </summary> public string Assessment { get; set; } /// <summary> /// Gets or sets the Start Date /// </summary> public string StartDate { get; set; } /// <summary> /// Gets or sets the End Date /// </summary> public string EndDate { get; set; } /// <summary> /// Gets or sets the Prep Time /// </summary> public string PrepTimeHours { get; set; } /// <summary> /// Gets or sets the Vantage Point /// </summary> public string VantagePoint { get; set; } /// <summary> /// Gets or sets the Access Point /// </summary> public string AccessPoint { get; set; } /// <summary> /// Gets or sets the name of the person who submitted the survey /// </summary> public string SubmittedBy { get; set; } /// <summary> /// Gets or sets the list of observers /// </summary> public string Observers { get; set; } /// <summary> /// Gets or sets general comments about the survey /// </summary> public string GeneralComments { get; set; } /// <summary> /// Gets or sets a bird's Genus. /// </summary> public string Genus { get; set; } /// <summary> /// Gets or sets a bird's Species /// </summary> public string Species { get; set; } /// <summary> /// Gets or sets a bird's common alpha code /// </summary> public string CommonAlphaCode { get; set; } /// <summary> /// Gets or sets a bird's commonly-used name /// </summary> public string CommonName { get; set; } /// <summary> /// Gets or sets the number of adults observed /// </summary> public string NumberOfAdults { get; set; } /// <summary> /// Gets or sets the number of juveniles observed /// </summary> public string NestsPresent { get; set; } /// <summary> /// Gets or sets the primary activity observed /// </summary> public string ChicksPresent { get; set; } /// <summary> /// Gets or sets the secondary activity observed /// </summary> public string FledglingsPresent { get; set; } /// <summary> /// Gets or sets the disturbance comments /// </summary> public string DisturbanceComments { get; set; } /// <summary> /// Gets or sets the number of kayakers /// </summary> public string KayakerQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of kayaker disturbance /// </summary> public string KayakerDurationMinutes { get; set; } /// <summary> /// Gets or sets the result of kayaker disturbance /// </summary> public string KayakResult { get; set; } /// <summary> /// Gets or sets the number of fishermen wading /// </summary> public string FishermenWadingQuantity { get; set; } /// <summary> /// Gets or sets the duration of fishermen wading /// </summary> public string FishermenWadingDurationMinutes { get; set; } /// <summary> /// Gets or sets the result of fishermen wading /// </summary> public string FishermenWadingResult { get; set; } /// <summary> /// Gets or sets the quantity of stationary boats /// </summary> public string StationaryBoatsQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of stationary boat disturbances /// </summary> public string StationaryBoatsDurationMinutes { get; set; } /// <summary> /// Gets or sets the result of stationary boat disturbances /// </summary> public string StationaryBoatsResult { get; set; } /// <summary> /// Gets or sets the quantity of moving boats /// </summary> public string MovingBoatsQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of moving boats disturbances /// </summary> public string MovingBoatsDurationMinutes { get; set; } /// <summary> /// Gets or sets the result of moving boats disturbances /// </summary> public string MovingBoatsResult { get; set; } /// <summary> /// Gets or set the number of personal watercraft /// </summary> public string PersonalWatercraftQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of personal watercraft disturbances /// </summary> public string PersonalWatercraftDurationMinutes { get; set; } /// <summary> /// Gets or sets the number of humans /// </summary> public string HumansQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of human disturbances /// </summary> public string HumansMinutes { get; set; } /// <summary> /// Gets or sets the result of human disturbances /// </summary> public string HumansResult { get; set; } /// <summary> /// Gets or sets the quantity of noise disturbances /// </summary> public string NoiseQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of noise disturbances /// </summary> public string NoiseMinutes { get; set; } /// <summary> /// Gets or sets the result of noise disturbances /// </summary> public string NoiseResult { get; set; } /// <summary> /// Gets or sets the quantity of other disturbances /// </summary> public string OtherDisturbanceQuantity { get; set; } /// <summary> /// Gets or sets the duration in minutes of other disturbances /// </summary> public string OtherDisturbanceMinutes { get; set; } /// <summary> /// Gets or sets the result of other disturbances /// </summary> public string OtherDisturbanceResult { get; set; } } }
30.108949
84
0.540579
[ "MIT" ]
FlightNode/FlightNode.Api
DataCollection/src/Domain/Entities/RookeryCensusExportItem.cs
7,740
C#
using System; using System.Collections.Generic; class LongestCommonSubsequence { const int NOT_CALCULATED = -1; static string firstStr = "xabcxxxx"; static string secondStr = "abcxxyxabcx"; static int[,] lcs = new int[firstStr.Length, secondStr.Length]; static void Main() { InitializeLCS(); CalcLCS(firstStr.Length - 1, secondStr.Length - 1); PrintLCS(firstStr.Length - 1, secondStr.Length - 1); } static void InitializeLCS() { for (int x = 0; x < firstStr.Length; x++) { for (int y = 0; y < secondStr.Length; y++) { lcs[x, y] = NOT_CALCULATED; } } } static int CalcLCS(int x, int y) { if (x < 0 || y < 0) { return 0; } if (lcs[x, y] == NOT_CALCULATED) { int lcsFirstMinusOne = CalcLCS(x - 1, y); int lcsSecondMinusOne = CalcLCS(x, y - 1); lcs[x, y] = Math.Max(lcsFirstMinusOne, lcsSecondMinusOne); if (firstStr[x] == secondStr[y]) { int lcsBothMinusOne = 1 + CalcLCS(x - 1, y - 1); lcs[x, y] = Math.Max(lcs[x, y], lcsBothMinusOne); } } return lcs[x, y]; } static void PrintLCS(int x, int y) { Console.WriteLine("LCS = " + CalcLCS(x, y)); List<char> lcsLetters = new List<char>(); while (x >= 0 && y >= 0) { if ((firstStr[x] == secondStr[y]) && (CalcLCS(x - 1, y - 1) + 1 == lcs[x, y])) { lcsLetters.Add(firstStr[x]); x--; y--; } else if (CalcLCS(x - 1, y) == lcs[x, y]) { x--; } else { y--; } } lcsLetters.Reverse(); string lcsStr = string.Join("", lcsLetters); Console.WriteLine(lcsStr); } }
21.2125
64
0.531526
[ "MIT" ]
Supbads/Softuni-Education
06 Algorithms 04.16/Demos/4. Dynamic-Programming-Demos/LongestCommonSubsequence/LongestCommonSubsequence.cs
1,699
C#
using System; namespace Eto.Drawing { /// <summary> /// Wrap mode for a gradient /// </summary> /// <copyright>(c) 2012-2014 by Curtis Wensley</copyright> /// <license type="BSD-3">See LICENSE for full terms</license> public enum GradientWrapMode { /// <summary> /// The start and end colors fill beyond the gradient /// </summary> Pad, /// <summary> /// The gradient repeats to fill the area /// </summary> Repeat, /// <summary> /// The gradient reflects (or reverses) each time it repeats to fill the area /// </summary> Reflect } /// <summary> /// Brush with a linear gradient at an angle /// </summary> /// <copyright>(c) 2012-2014 by Curtis Wensley</copyright> /// <license type="BSD-3">See LICENSE for full terms</license> public class LinearGradientBrush : Brush, ITransformBrush { readonly IHandler handler; /// <summary> /// Gets the platform handler object for the widget /// </summary> /// <value>The handler for the widget</value> public override object Handler { get { return handler; } } /// <summary> /// Gets a delegate to instantiate <see cref="LinearGradientBrush"/> objects /// </summary> /// <remarks> /// Use this to instantiate many objects of this type /// </remarks> [Obsolete("Since 2.4: Use new LinearGradientBrush() instead")] public static Func<Color, Color, PointF, PointF, LinearGradientBrush> Instantiator { get { var handler = Platform.Instance.LinearGradientBrushHandler; return (startColor, endColor, startPoint, endPoint) => { var control = handler.Create(startColor, endColor, startPoint, endPoint); return new LinearGradientBrush(handler, control); }; } } LinearGradientBrush(IHandler handler, object control) { this.handler = handler; ControlObject = control; } /// <summary> /// Initializes a new instance of the <see cref="Eto.Drawing.LinearGradientBrush"/> class between two points /// </summary> /// <param name="startColor">Start color for the gradient</param> /// <param name="endColor">End color for the gradient</param> /// <param name="startPoint">Start point for the gradient</param> /// <param name="endPoint">End point for the gradient</param> public LinearGradientBrush(Color startColor, Color endColor, PointF startPoint, PointF endPoint) { handler = Platform.Instance.LinearGradientBrushHandler; ControlObject = handler.Create(startColor, endColor, startPoint, endPoint); } /// <summary> /// Initializes a new instance of the <see cref="Eto.Drawing.LinearGradientBrush"/> class with a given <paramref name="rectangle"/> and <paramref name="angle"/> /// </summary> /// <param name="rectangle">Rectangle to define the area of the gradient</param> /// <param name="startColor">Start color for the gradient</param> /// <param name="endColor">End color for the gradient</param> /// <param name="angle">Angle of the gradient, in degrees</param> public LinearGradientBrush(RectangleF rectangle, Color startColor, Color endColor, float angle) { handler = Platform.Instance.LinearGradientBrushHandler; ControlObject = handler.Create(rectangle, startColor, endColor, angle); } /// <summary> /// Gets or sets the transform to apply to the gradient /// </summary> /// <value>The transform to apply to the gradient</value> public IMatrix Transform { get { return handler.GetTransform(this); } set { handler.SetTransform(this, value); } } /// <summary> /// Gets or sets the wrap mode for the gradient /// </summary> /// <value>The wrap mode for the gradient</value> public GradientWrapMode Wrap { get { return handler.GetGradientWrap(this); } set { handler.SetGradientWrap(this, value); } } #region Handler /// <summary> /// Handler interface for the <see cref="LinearGradientBrush"/> /// </summary> /// <copyright>(c) 2012-2014 by Curtis Wensley</copyright> /// <license type="BSD-3">See LICENSE for full terms</license> public new interface IHandler : Brush.IHandler { /// <summary> /// Creates a linear gradient brush /// </summary> /// <param name="startColor">Start color.</param> /// <param name="endColor">End color.</param> /// <param name="startPoint">Start point.</param> /// <param name="endPoint">End point.</param> /// <returns>ControlObject for the brush</returns> object Create(Color startColor, Color endColor, PointF startPoint, PointF endPoint); /// <summary> /// Create the specified rectangle, startColor, endColor and angle. /// </summary> /// <param name="rectangle">Rectangle.</param> /// <param name="startColor">Start color.</param> /// <param name="endColor">End color.</param> /// <param name="angle">Angle.</param> /// <returns>ControlObject for the brush</returns> object Create(RectangleF rectangle, Color startColor, Color endColor, float angle); /// <summary> /// Gets the transform for the specified brush /// </summary> /// <returns>The current transform for the specified brush</returns> /// <param name="widget">Brush to get the transform</param> IMatrix GetTransform(LinearGradientBrush widget); /// <summary> /// Sets the transform for the specified brush /// </summary> /// <param name="widget">Brush to set the transform</param> /// <param name="transform">Transform to set to the brush</param> void SetTransform(LinearGradientBrush widget, IMatrix transform); /// <summary> /// Gets the gradient wrap mode /// </summary> /// <returns>The gradient wrap mode for the brush</returns> /// <param name="widget">Brush to get the gradient wrap mode</param> GradientWrapMode GetGradientWrap(LinearGradientBrush widget); /// <summary> /// Sets the gradient wrap mode /// </summary> /// <param name="widget">Brush to set the wrap mode</param> /// <param name="gradientWrap">Gradient wrap mode to set</param> void SetGradientWrap(LinearGradientBrush widget, GradientWrapMode gradientWrap); } #endregion } }
34.386364
162
0.683245
[ "BSD-3-Clause" ]
AkiSakurai/Eto
src/Eto/Drawing/LinearGradientBrush.cs
6,052
C#
using System; using System.Collections.Generic; using Itinero.Transit.Data; using Itinero.Transit.Data.Core; using Itinero.Transit.Data.Synchronization; using Itinero.Transit.Utils; namespace Itinero.Transit.Api.Logic.Importance { public class ImportanceCounter : ISynchronizationPolicy { public uint Frequency { get; } private string _state = ""; private ulong _nowScanning; public ImportanceCounter(uint frequency = 24 * 60 * 60) { Frequency = frequency; } public void Run(DateTime triggerDate, TransitDbUpdater db) { var frequencies = new Dictionary<StopId, uint>(); // Count how many connections depart at the given station _state = "Scanning connections, currently at: "; var enumerator = db.TransitDb.Latest.ConnectionsDb; foreach (var connection in enumerator) { _nowScanning = connection.DepartureTime; if (connection.CanGetOn()) { IncreaseCount(frequencies, connection.DepartureStop); } if (connection.CanGetOff()) { IncreaseCount(frequencies, connection.ArrivalStop); } } _state = "Converting internal IDs into URIs"; _nowScanning = 0; var stopsReader = db.TransitDb.Latest.StopsDb; var importances = new Dictionary<string, uint>(); // Translate internal ids to URI's foreach (var (id, importance) in frequencies) { var stop = stopsReader.Get(id); importances[stop.GlobalId] = importance; } State.GlobalState.ImportancesInternal = frequencies; State.GlobalState.Importances = importances; _state = "Done"; } // ReSharper disable once InconsistentNaming private static void IncreaseCount<K>(IDictionary<K, uint> dict, K key) { if (!dict.ContainsKey(key)) { dict.Add(key, 1); } else { dict[key] += 1; } } public override string ToString() { var date = _nowScanning == 0 ? "" : $"{_nowScanning.FromUnixTime():O}"; return $"Importance counter. {_state} {date}"; } } }
30.085366
83
0.549655
[ "MIT" ]
anyways-open/itinero-transit-server
src/Itinero.Transit.Api/Logic/Importance/ImportanceCounter.cs
2,467
C#
using System; using System.Collections.Generic; namespace IListExtension { internal sealed class FunctorComparer<T> : IComparer<T> { Comparison<T> comparison; public FunctorComparer(Comparison<T> comparison) { this.comparison = comparison; } public int Compare(T x, T y) { return comparison(x, y); } } }
20
59
0.5825
[ "MIT" ]
Emilien-M/IListExtension
src/IListExtension/FunctorComparer.cs
400
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.Network.V20180401 { public static class GetPublicIPAddress { /// <summary> /// Public IP address resource. /// </summary> public static Task<GetPublicIPAddressResult> InvokeAsync(GetPublicIPAddressArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetPublicIPAddressResult>("azure-nextgen:network/v20180401:getPublicIPAddress", args ?? new GetPublicIPAddressArgs(), options.WithVersion()); } public sealed class GetPublicIPAddressArgs : Pulumi.InvokeArgs { /// <summary> /// Expands referenced resources. /// </summary> [Input("expand")] public string? Expand { get; set; } /// <summary> /// The name of the subnet. /// </summary> [Input("publicIpAddressName", required: true)] public string PublicIpAddressName { get; set; } = null!; /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public string ResourceGroupName { get; set; } = null!; public GetPublicIPAddressArgs() { } } [OutputType] public sealed class GetPublicIPAddressResult { /// <summary> /// The FQDN of the DNS record associated with the public IP address. /// </summary> public readonly Outputs.PublicIPAddressDnsSettingsResponse? DnsSettings; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> public readonly string? Etag; /// <summary> /// Resource ID. /// </summary> public readonly string? Id; /// <summary> /// The idle timeout of the public IP address. /// </summary> public readonly int? IdleTimeoutInMinutes; /// <summary> /// The IP address associated with the public IP address resource. /// </summary> public readonly string? IpAddress; /// <summary> /// The IP configuration associated with the public IP address. /// </summary> public readonly Outputs.IPConfigurationResponse IpConfiguration; /// <summary> /// The list of tags associated with the public IP address. /// </summary> public readonly ImmutableArray<Outputs.IpTagResponse> IpTags; /// <summary> /// Resource location. /// </summary> public readonly string? Location; /// <summary> /// Resource name. /// </summary> public readonly string Name; /// <summary> /// The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. /// </summary> public readonly string? ProvisioningState; /// <summary> /// The public IP address version. Possible values are: 'IPv4' and 'IPv6'. /// </summary> public readonly string? PublicIPAddressVersion; /// <summary> /// The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. /// </summary> public readonly string? PublicIPAllocationMethod; /// <summary> /// The resource GUID property of the public IP resource. /// </summary> public readonly string? ResourceGuid; /// <summary> /// The public IP address SKU. /// </summary> public readonly Outputs.PublicIPAddressSkuResponse? Sku; /// <summary> /// Resource tags. /// </summary> public readonly ImmutableDictionary<string, string>? Tags; /// <summary> /// Resource type. /// </summary> public readonly string Type; /// <summary> /// A list of availability zones denoting the IP allocated for the resource needs to come from. /// </summary> public readonly ImmutableArray<string> Zones; [OutputConstructor] private GetPublicIPAddressResult( Outputs.PublicIPAddressDnsSettingsResponse? dnsSettings, string? etag, string? id, int? idleTimeoutInMinutes, string? ipAddress, Outputs.IPConfigurationResponse ipConfiguration, ImmutableArray<Outputs.IpTagResponse> ipTags, string? location, string name, string? provisioningState, string? publicIPAddressVersion, string? publicIPAllocationMethod, string? resourceGuid, Outputs.PublicIPAddressSkuResponse? sku, ImmutableDictionary<string, string>? tags, string type, ImmutableArray<string> zones) { DnsSettings = dnsSettings; Etag = etag; Id = id; IdleTimeoutInMinutes = idleTimeoutInMinutes; IpAddress = ipAddress; IpConfiguration = ipConfiguration; IpTags = ipTags; Location = location; Name = name; ProvisioningState = provisioningState; PublicIPAddressVersion = publicIPAddressVersion; PublicIPAllocationMethod = publicIPAllocationMethod; ResourceGuid = resourceGuid; Sku = sku; Tags = tags; Type = type; Zones = zones; } } }
32.829545
195
0.59242
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/Network/V20180401/GetPublicIPAddress.cs
5,778
C#
using Mobile_RSS_Reader.UI.ViewModels; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace Mobile_RSS_Reader.UI.Views { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class HomePage : ContentPage { private readonly HomePageViewModel _model; public HomePage(HomePageViewModel model) { _model = model; InitializeComponent(); BindingContext = _model; } void Handle_ItemTapped(object sender, ItemTappedEventArgs e) => ((ListView) sender).SelectedItem = null; async void Handle_ItemSelected(object sender, SelectedItemChangedEventArgs e) { if (e.SelectedItem == null) return; await _model.HandleItemSelectedAsync(e.SelectedItem as HomePageViewModel.FeedPresentationModel); //Deselect Item ((ListView) sender).SelectedItem = null; } } }
26.527778
108
0.645026
[ "MIT" ]
viktor-zaika/Mobile-RSS-Reader
Mobile-RSS-Reader/Mobile_RSS_Reader/UI/Views/HomePage.xaml.cs
957
C#
using UnityEngine; using System.Collections; using EPPZ.Geometry; using EPPZ.Lines; public class TestScene_01_Controller : MonoBehaviour { // 01 Polygon-segment intersection public Material polygonMaterial; public Material passingMaterial; public PolygonSource polygonSource; public SegmentSource segmentSourceA; public SegmentSource segmentSourceB; public PolygonLineRenderer polygonRenderer; public SegmentLineRenderer segmentRendererA; public SegmentLineRenderer segmentRendererB; private Polygon polygon { get { return polygonSource.polygon; } } private Segment segment_a { get { return segmentSourceA.segment; } } private Segment segment_b { get { return segmentSourceB.segment; } } void Update() { RenderTestResult(SegmentIntersectingTest()); } bool SegmentIntersectingTest() { return ( polygon.IsIntersectingWithSegment(segment_a) || polygon.IsIntersectingWithSegment(segment_b) ); } void RenderTestResult(bool testResult) { // Set corresponding materials. Material currentMaterial = (testResult) ? passingMaterial : polygonMaterial; polygonRenderer.lineColor = currentMaterial.color; segmentRendererA.lineColor = currentMaterial.color; segmentRendererB.lineColor = currentMaterial.color; } }
24.686275
78
0.792693
[ "MIT" ]
eppz/Deprecated.Unity.Library.eppz
Geometry/Scenes/Controllers/TestScene_01_Controller.cs
1,261
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.Linq.Expressions; using System.Reflection; namespace System.Linq { internal static class CachedReflectionInfo { private static MethodInfo s_Aggregate_TSource_2; public static MethodInfo Aggregate_TSource_2(Type TSource) => (s_Aggregate_TSource_2 ?? (s_Aggregate_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Aggregate_TSource_TAccumulate_3; public static MethodInfo Aggregate_TSource_TAccumulate_3(Type TSource, Type TAccumulate) => (s_Aggregate_TSource_TAccumulate_3 ?? (s_Aggregate_TSource_TAccumulate_3 = new Func<IQueryable<object>, object, Expression<Func<object, object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TAccumulate); private static MethodInfo s_Aggregate_TSource_TAccumulate_TResult_4; public static MethodInfo Aggregate_TSource_TAccumulate_TResult_4(Type TSource, Type TAccumulate, Type TResult) => (s_Aggregate_TSource_TAccumulate_TResult_4 ?? (s_Aggregate_TSource_TAccumulate_TResult_4 = new Func<IQueryable<object>, object, Expression<Func<object, object, object>>, Expression<Func<object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TAccumulate, TResult); private static MethodInfo s_All_TSource_2; public static MethodInfo All_TSource_2(Type TSource) => (s_All_TSource_2 ?? (s_All_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, bool>(Queryable.All).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Any_TSource_1; public static MethodInfo Any_TSource_1(Type TSource) => (s_Any_TSource_1 ?? (s_Any_TSource_1 = new Func<IQueryable<object>, bool>(Queryable.Any).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Any_TSource_2; public static MethodInfo Any_TSource_2(Type TSource) => (s_Any_TSource_2 ?? (s_Any_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, bool>(Queryable.Any).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_Int32_1; public static MethodInfo Average_Int32_1 => s_Average_Int32_1 ?? (s_Average_Int32_1 = new Func<IQueryable<int>, double>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_NullableInt32_1; public static MethodInfo Average_NullableInt32_1 => s_Average_NullableInt32_1 ?? (s_Average_NullableInt32_1 = new Func<IQueryable<int?>, double?>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_Int64_1; public static MethodInfo Average_Int64_1 => s_Average_Int64_1 ?? (s_Average_Int64_1 = new Func<IQueryable<long>, double>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_NullableInt64_1; public static MethodInfo Average_NullableInt64_1 => s_Average_NullableInt64_1 ?? (s_Average_NullableInt64_1 = new Func<IQueryable<long?>, double?>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_Single_1; public static MethodInfo Average_Single_1 => s_Average_Single_1 ?? (s_Average_Single_1 = new Func<IQueryable<float>, float>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_NullableSingle_1; public static MethodInfo Average_NullableSingle_1 => s_Average_NullableSingle_1 ?? (s_Average_NullableSingle_1 = new Func<IQueryable<float?>, float?>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_Double_1; public static MethodInfo Average_Double_1 => s_Average_Double_1 ?? (s_Average_Double_1 = new Func<IQueryable<double>, double>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_NullableDouble_1; public static MethodInfo Average_NullableDouble_1 => s_Average_NullableDouble_1 ?? (s_Average_NullableDouble_1 = new Func<IQueryable<double?>, double?>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_Decimal_1; public static MethodInfo Average_Decimal_1 => s_Average_Decimal_1 ?? (s_Average_Decimal_1 = new Func<IQueryable<decimal>, decimal>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_NullableDecimal_1; public static MethodInfo Average_NullableDecimal_1 => s_Average_NullableDecimal_1 ?? (s_Average_NullableDecimal_1 = new Func<IQueryable<decimal?>, decimal?>(Queryable.Average).GetMethodInfo()); private static MethodInfo s_Average_Int32_TSource_2; public static MethodInfo Average_Int32_TSource_2(Type TSource) => (s_Average_Int32_TSource_2 ?? (s_Average_Int32_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_NullableInt32_TSource_2; public static MethodInfo Average_NullableInt32_TSource_2(Type TSource) => (s_Average_NullableInt32_TSource_2 ?? (s_Average_NullableInt32_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_Single_TSource_2; public static MethodInfo Average_Single_TSource_2(Type TSource) => (s_Average_Single_TSource_2 ?? (s_Average_Single_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, float>>, float>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_NullableSingle_TSource_2; public static MethodInfo Average_NullableSingle_TSource_2(Type TSource) => (s_Average_NullableSingle_TSource_2 ?? (s_Average_NullableSingle_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, float?>>, float?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_Int64_TSource_2; public static MethodInfo Average_Int64_TSource_2(Type TSource) => (s_Average_Int64_TSource_2 ?? (s_Average_Int64_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, long>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_NullableInt64_TSource_2; public static MethodInfo Average_NullableInt64_TSource_2(Type TSource) => (s_Average_NullableInt64_TSource_2 ?? (s_Average_NullableInt64_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, long?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_Double_TSource_2; public static MethodInfo Average_Double_TSource_2(Type TSource) => (s_Average_Double_TSource_2 ?? (s_Average_Double_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, double>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_NullableDouble_TSource_2; public static MethodInfo Average_NullableDouble_TSource_2(Type TSource) => (s_Average_NullableDouble_TSource_2 ?? (s_Average_NullableDouble_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, double?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_Decimal_TSource_2; public static MethodInfo Average_Decimal_TSource_2(Type TSource) => (s_Average_Decimal_TSource_2 ?? (s_Average_Decimal_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, decimal>>, decimal>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Average_NullableDecimal_TSource_2; public static MethodInfo Average_NullableDecimal_TSource_2(Type TSource) => (s_Average_NullableDecimal_TSource_2 ?? (s_Average_NullableDecimal_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, decimal?>>, decimal?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Cast_TResult_1; public static MethodInfo Cast_TResult_1(Type TResult) => (s_Cast_TResult_1 ?? (s_Cast_TResult_1 = new Func<IQueryable, IQueryable<object>>(Queryable.Cast<object>).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TResult); private static MethodInfo s_Concat_TSource_2; public static MethodInfo Concat_TSource_2(Type TSource) => (s_Concat_TSource_2 ?? (s_Concat_TSource_2 = new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Concat).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Contains_TSource_2; public static MethodInfo Contains_TSource_2(Type TSource) => (s_Contains_TSource_2 ?? (s_Contains_TSource_2 = new Func<IQueryable<object>, object, bool>(Queryable.Contains).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Contains_TSource_3; public static MethodInfo Contains_TSource_3(Type TSource) => (s_Contains_TSource_3 ?? (s_Contains_TSource_3 = new Func<IQueryable<object>, object, IEqualityComparer<object>, bool>(Queryable.Contains).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Count_TSource_1; public static MethodInfo Count_TSource_1(Type TSource) => (s_Count_TSource_1 ?? (s_Count_TSource_1 = new Func<IQueryable<object>, int>(Queryable.Count).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Count_TSource_2; public static MethodInfo Count_TSource_2(Type TSource) => (s_Count_TSource_2 ?? (s_Count_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, int>(Queryable.Count).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_DefaultIfEmpty_TSource_1; public static MethodInfo DefaultIfEmpty_TSource_1(Type TSource) => (s_DefaultIfEmpty_TSource_1 ?? (s_DefaultIfEmpty_TSource_1 = new Func<IQueryable<object>, IQueryable<object>>(Queryable.DefaultIfEmpty).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_DefaultIfEmpty_TSource_2; public static MethodInfo DefaultIfEmpty_TSource_2(Type TSource) => (s_DefaultIfEmpty_TSource_2 ?? (s_DefaultIfEmpty_TSource_2 = new Func<IQueryable<object>, object, IQueryable<object>>(Queryable.DefaultIfEmpty).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Distinct_TSource_1; public static MethodInfo Distinct_TSource_1(Type TSource) => (s_Distinct_TSource_1 ?? (s_Distinct_TSource_1 = new Func<IQueryable<object>, IQueryable<object>>(Queryable.Distinct).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Distinct_TSource_2; public static MethodInfo Distinct_TSource_2(Type TSource) => (s_Distinct_TSource_2 ?? (s_Distinct_TSource_2 = new Func<IQueryable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Distinct).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_ElementAt_TSource_2; public static MethodInfo ElementAt_TSource_2(Type TSource) => (s_ElementAt_TSource_2 ?? (s_ElementAt_TSource_2 = new Func<IQueryable<object>, int, object>(Queryable.ElementAt).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_ElementAtOrDefault_TSource_2; public static MethodInfo ElementAtOrDefault_TSource_2(Type TSource) => (s_ElementAtOrDefault_TSource_2 ?? (s_ElementAtOrDefault_TSource_2 = new Func<IQueryable<object>, int, object>(Queryable.ElementAtOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Except_TSource_2; public static MethodInfo Except_TSource_2(Type TSource) => (s_Except_TSource_2 ?? (s_Except_TSource_2 = new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Except).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Except_TSource_3; public static MethodInfo Except_TSource_3(Type TSource) => (s_Except_TSource_3 ?? (s_Except_TSource_3 = new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Except).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_First_TSource_1; public static MethodInfo First_TSource_1(Type TSource) => (s_First_TSource_1 ?? (s_First_TSource_1 = new Func<IQueryable<object>, object>(Queryable.First).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_First_TSource_2; public static MethodInfo First_TSource_2(Type TSource) => (s_First_TSource_2 ?? (s_First_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.First).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_FirstOrDefault_TSource_1; public static MethodInfo FirstOrDefault_TSource_1(Type TSource) => (s_FirstOrDefault_TSource_1 ?? (s_FirstOrDefault_TSource_1 = new Func<IQueryable<object>, object>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_FirstOrDefault_TSource_2; public static MethodInfo FirstOrDefault_TSource_2(Type TSource) => (s_FirstOrDefault_TSource_2 ?? (s_FirstOrDefault_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_GroupBy_TSource_TKey_2; public static MethodInfo GroupBy_TSource_TKey_2(Type TSource, Type TKey) => (s_GroupBy_TSource_TKey_2 ?? (s_GroupBy_TSource_TKey_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_GroupBy_TSource_TKey_3; public static MethodInfo GroupBy_TSource_TKey_3(Type TSource, Type TKey) => (s_GroupBy_TSource_TKey_3 ?? (s_GroupBy_TSource_TKey_3 = new Func<IQueryable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_GroupBy_TSource_TKey_TElement_3; public static MethodInfo GroupBy_TSource_TKey_TElement_3(Type TSource, Type TKey, Type TElement) => (s_GroupBy_TSource_TKey_TElement_3 ?? (s_GroupBy_TSource_TKey_TElement_3 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TElement); private static MethodInfo s_GroupBy_TSource_TKey_TElement_4; public static MethodInfo GroupBy_TSource_TKey_TElement_4(Type TSource, Type TKey, Type TElement) => (s_GroupBy_TSource_TKey_TElement_4 ?? (s_GroupBy_TSource_TKey_TElement_4 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TElement); private static MethodInfo s_GroupBy_TSource_TKey_TResult_3; public static MethodInfo GroupBy_TSource_TKey_TResult_3(Type TSource, Type TKey, Type TResult) => (s_GroupBy_TSource_TKey_TResult_3 ?? (s_GroupBy_TSource_TKey_TResult_3 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TResult); private static MethodInfo s_GroupBy_TSource_TKey_TResult_4; public static MethodInfo GroupBy_TSource_TKey_TResult_4(Type TSource, Type TKey, Type TResult) => (s_GroupBy_TSource_TKey_TResult_4 ?? (s_GroupBy_TSource_TKey_TResult_4 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TResult); private static MethodInfo s_GroupBy_TSource_TKey_TElement_TResult_4; public static MethodInfo GroupBy_TSource_TKey_TElement_TResult_4(Type TSource, Type TKey, Type TElement, Type TResult) => (s_GroupBy_TSource_TKey_TElement_TResult_4 ?? (s_GroupBy_TSource_TKey_TElement_TResult_4 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TElement, TResult); private static MethodInfo s_GroupBy_TSource_TKey_TElement_TResult_5; public static MethodInfo GroupBy_TSource_TKey_TElement_TResult_5(Type TSource, Type TKey, Type TElement, Type TResult) => (s_GroupBy_TSource_TKey_TElement_TResult_5 ?? (s_GroupBy_TSource_TKey_TElement_TResult_5 = new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey, TElement, TResult); private static MethodInfo s_GroupJoin_TOuter_TInner_TKey_TResult_5; public static MethodInfo GroupJoin_TOuter_TInner_TKey_TResult_5(Type TOuter, Type TInner, Type TKey, Type TResult) => (s_GroupJoin_TOuter_TInner_TKey_TResult_5 ?? (s_GroupJoin_TOuter_TInner_TKey_TResult_5 = new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupJoin).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TOuter, TInner, TKey, TResult); private static MethodInfo s_GroupJoin_TOuter_TInner_TKey_TResult_6; public static MethodInfo GroupJoin_TOuter_TInner_TKey_TResult_6(Type TOuter, Type TInner, Type TKey, Type TResult) => (s_GroupJoin_TOuter_TInner_TKey_TResult_6 ?? (s_GroupJoin_TOuter_TInner_TKey_TResult_6 = new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupJoin).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TOuter, TInner, TKey, TResult); private static MethodInfo s_Intersect_TSource_2; public static MethodInfo Intersect_TSource_2(Type TSource) => (s_Intersect_TSource_2 ?? (s_Intersect_TSource_2 = new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Intersect).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Intersect_TSource_3; public static MethodInfo Intersect_TSource_3(Type TSource) => (s_Intersect_TSource_3 ?? (s_Intersect_TSource_3 = new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Intersect).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Join_TOuter_TInner_TKey_TResult_5; public static MethodInfo Join_TOuter_TInner_TKey_TResult_5(Type TOuter, Type TInner, Type TKey, Type TResult) => (s_Join_TOuter_TInner_TKey_TResult_5 ?? (s_Join_TOuter_TInner_TKey_TResult_5 = new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.Join).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TOuter, TInner, TKey, TResult); private static MethodInfo s_Join_TOuter_TInner_TKey_TResult_6; public static MethodInfo Join_TOuter_TInner_TKey_TResult_6(Type TOuter, Type TInner, Type TKey, Type TResult) => (s_Join_TOuter_TInner_TKey_TResult_6 ?? (s_Join_TOuter_TInner_TKey_TResult_6 = new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Join).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TOuter, TInner, TKey, TResult); private static MethodInfo s_Last_TSource_1; public static MethodInfo Last_TSource_1(Type TSource) => (s_Last_TSource_1 ?? (s_Last_TSource_1 = new Func<IQueryable<object>, object>(Queryable.Last).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Last_TSource_2; public static MethodInfo Last_TSource_2(Type TSource) => (s_Last_TSource_2 ?? (s_Last_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.Last).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_LastOrDefault_TSource_1; public static MethodInfo LastOrDefault_TSource_1(Type TSource) => (s_LastOrDefault_TSource_1 ?? (s_LastOrDefault_TSource_1 = new Func<IQueryable<object>, object>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_LastOrDefault_TSource_2; public static MethodInfo LastOrDefault_TSource_2(Type TSource) => (s_LastOrDefault_TSource_2 ?? (s_LastOrDefault_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_LongCount_TSource_1; public static MethodInfo LongCount_TSource_1(Type TSource) => (s_LongCount_TSource_1 ?? (s_LongCount_TSource_1 = new Func<IQueryable<object>, long>(Queryable.LongCount).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_LongCount_TSource_2; public static MethodInfo LongCount_TSource_2(Type TSource) => (s_LongCount_TSource_2 ?? (s_LongCount_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, long>(Queryable.LongCount).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Max_TSource_1; public static MethodInfo Max_TSource_1(Type TSource) => (s_Max_TSource_1 ?? (s_Max_TSource_1 = new Func<IQueryable<object>, object>(Queryable.Max).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Max_TSource_TResult_2; public static MethodInfo Max_TSource_TResult_2(Type TSource, Type TResult) => (s_Max_TSource_TResult_2 ?? (s_Max_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, object>(Queryable.Max).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_Min_TSource_1; public static MethodInfo Min_TSource_1(Type TSource) => (s_Min_TSource_1 ?? (s_Min_TSource_1 = new Func<IQueryable<object>, object>(Queryable.Min).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Min_TSource_TResult_2; public static MethodInfo Min_TSource_TResult_2(Type TSource, Type TResult) => (s_Min_TSource_TResult_2 ?? (s_Min_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, object>(Queryable.Min).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_OfType_TResult_1; public static MethodInfo OfType_TResult_1(Type TResult) => (s_OfType_TResult_1 ?? (s_OfType_TResult_1 = new Func<IQueryable, IQueryable<object>>(Queryable.OfType<object>).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TResult); private static MethodInfo s_OrderBy_TSource_TKey_2; public static MethodInfo OrderBy_TSource_TKey_2(Type TSource, Type TKey) => (s_OrderBy_TSource_TKey_2 ?? (s_OrderBy_TSource_TKey_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.OrderBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_OrderBy_TSource_TKey_3; public static MethodInfo OrderBy_TSource_TKey_3(Type TSource, Type TKey) => (s_OrderBy_TSource_TKey_3 ?? (s_OrderBy_TSource_TKey_3 = new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.OrderBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_OrderByDescending_TSource_TKey_2; public static MethodInfo OrderByDescending_TSource_TKey_2(Type TSource, Type TKey) => (s_OrderByDescending_TSource_TKey_2 ?? (s_OrderByDescending_TSource_TKey_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.OrderByDescending).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_OrderByDescending_TSource_TKey_3; public static MethodInfo OrderByDescending_TSource_TKey_3(Type TSource, Type TKey) => (s_OrderByDescending_TSource_TKey_3 ?? (s_OrderByDescending_TSource_TKey_3 = new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.OrderByDescending).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_Reverse_TSource_1; public static MethodInfo Reverse_TSource_1(Type TSource) => (s_Reverse_TSource_1 ?? (s_Reverse_TSource_1 = new Func<IQueryable<object>, IQueryable<object>>(Queryable.Reverse).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Select_TSource_TResult_2; public static MethodInfo Select_TSource_TResult_2(Type TSource, Type TResult) => (s_Select_TSource_TResult_2 ?? (s_Select_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.Select).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_Select_Index_TSource_TResult_2; public static MethodInfo Select_Index_TSource_TResult_2(Type TSource, Type TResult) => (s_Select_Index_TSource_TResult_2 ?? (s_Select_Index_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, int, object>>, IQueryable<object>>(Queryable.Select).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_SelectMany_TSource_TResult_2; public static MethodInfo SelectMany_TSource_TResult_2(Type TSource, Type TResult) => (s_SelectMany_TSource_TResult_2 ?? (s_SelectMany_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, IEnumerable<object>>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_SelectMany_Index_TSource_TResult_2; public static MethodInfo SelectMany_Index_TSource_TResult_2(Type TSource, Type TResult) => (s_SelectMany_Index_TSource_TResult_2 ?? (s_SelectMany_Index_TSource_TResult_2 = new Func<IQueryable<object>, Expression<Func<object, int, IEnumerable<object>>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TResult); private static MethodInfo s_SelectMany_Index_TSource_TCollection_TResult_3; public static MethodInfo SelectMany_Index_TSource_TCollection_TResult_3(Type TSource, Type TCollection, Type TResult) => (s_SelectMany_Index_TSource_TCollection_TResult_3 ?? (s_SelectMany_Index_TSource_TCollection_TResult_3 = new Func<IQueryable<object>, Expression<Func<object, int, IEnumerable<object>>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TCollection, TResult); private static MethodInfo s_SelectMany_TSource_TCollection_TResult_3; public static MethodInfo SelectMany_TSource_TCollection_TResult_3(Type TSource, Type TCollection, Type TResult) => (s_SelectMany_TSource_TCollection_TResult_3 ?? (s_SelectMany_TSource_TCollection_TResult_3 = new Func<IQueryable<object>, Expression<Func<object, IEnumerable<object>>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TCollection, TResult); private static MethodInfo s_SequenceEqual_TSource_2; public static MethodInfo SequenceEqual_TSource_2(Type TSource) => (s_SequenceEqual_TSource_2 ?? (s_SequenceEqual_TSource_2 = new Func<IQueryable<object>, IEnumerable<object>, bool>(Queryable.SequenceEqual).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_SequenceEqual_TSource_3; public static MethodInfo SequenceEqual_TSource_3(Type TSource) => (s_SequenceEqual_TSource_3 ?? (s_SequenceEqual_TSource_3 = new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, bool>(Queryable.SequenceEqual).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Single_TSource_1; public static MethodInfo Single_TSource_1(Type TSource) => (s_Single_TSource_1 ?? (s_Single_TSource_1 = new Func<IQueryable<object>, object>(Queryable.Single).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Single_TSource_2; public static MethodInfo Single_TSource_2(Type TSource) => (s_Single_TSource_2 ?? (s_Single_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.Single).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_SingleOrDefault_TSource_1; public static MethodInfo SingleOrDefault_TSource_1(Type TSource) => (s_SingleOrDefault_TSource_1 ?? (s_SingleOrDefault_TSource_1 = new Func<IQueryable<object>, object>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_SingleOrDefault_TSource_2; public static MethodInfo SingleOrDefault_TSource_2(Type TSource) => (s_SingleOrDefault_TSource_2 ?? (s_SingleOrDefault_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Skip_TSource_2; public static MethodInfo Skip_TSource_2(Type TSource) => (s_Skip_TSource_2 ?? (s_Skip_TSource_2 = new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.Skip).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_SkipWhile_TSource_2; public static MethodInfo SkipWhile_TSource_2(Type TSource) => (s_SkipWhile_TSource_2 ?? (s_SkipWhile_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.SkipWhile).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_SkipWhile_Index_TSource_2; public static MethodInfo SkipWhile_Index_TSource_2(Type TSource) => (s_SkipWhile_Index_TSource_2 ?? (s_SkipWhile_Index_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.SkipWhile).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Int32_1; public static MethodInfo Sum_Int32_1 => s_Sum_Int32_1 ?? (s_Sum_Int32_1 = new Func<IQueryable<int>, int>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableInt32_1; public static MethodInfo Sum_NullableInt32_1 => s_Sum_NullableInt32_1 ?? (s_Sum_NullableInt32_1 = new Func<IQueryable<int?>, int?>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_Int64_1; public static MethodInfo Sum_Int64_1 => s_Sum_Int64_1 ?? (s_Sum_Int64_1 = new Func<IQueryable<long>, long>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableInt64_1; public static MethodInfo Sum_NullableInt64_1 => s_Sum_NullableInt64_1 ?? (s_Sum_NullableInt64_1 = new Func<IQueryable<long?>, long?>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_Single_1; public static MethodInfo Sum_Single_1 => s_Sum_Single_1 ?? (s_Sum_Single_1 = new Func<IQueryable<float>, float>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableSingle_1; public static MethodInfo Sum_NullableSingle_1 => s_Sum_NullableSingle_1 ?? (s_Sum_NullableSingle_1 = new Func<IQueryable<float?>, float?>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_Double_1; public static MethodInfo Sum_Double_1 => s_Sum_Double_1 ?? (s_Sum_Double_1 = new Func<IQueryable<double>, double>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableDouble_1; public static MethodInfo Sum_NullableDouble_1 => s_Sum_NullableDouble_1 ?? (s_Sum_NullableDouble_1 = new Func<IQueryable<double?>, double?>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_Decimal_1; public static MethodInfo Sum_Decimal_1 => s_Sum_Decimal_1 ?? (s_Sum_Decimal_1 = new Func<IQueryable<decimal>, decimal>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableDecimal_1; public static MethodInfo Sum_NullableDecimal_1 => s_Sum_NullableDecimal_1 ?? (s_Sum_NullableDecimal_1 = new Func<IQueryable<decimal?>, decimal?>(Queryable.Sum).GetMethodInfo()); private static MethodInfo s_Sum_NullableDecimal_TSource_2; public static MethodInfo Sum_NullableDecimal_TSource_2(Type TSource) => (s_Sum_NullableDecimal_TSource_2 ?? (s_Sum_NullableDecimal_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, decimal?>>, decimal?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Int32_TSource_2; public static MethodInfo Sum_Int32_TSource_2(Type TSource) => (s_Sum_Int32_TSource_2 ?? (s_Sum_Int32_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int>>, int>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_NullableInt32_TSource_2; public static MethodInfo Sum_NullableInt32_TSource_2(Type TSource) => (s_Sum_NullableInt32_TSource_2 ?? (s_Sum_NullableInt32_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int?>>, int?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Int64_TSource_2; public static MethodInfo Sum_Int64_TSource_2(Type TSource) => (s_Sum_Int64_TSource_2 ?? (s_Sum_Int64_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, long>>, long>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_NullableInt64_TSource_2; public static MethodInfo Sum_NullableInt64_TSource_2(Type TSource) => (s_Sum_NullableInt64_TSource_2 ?? (s_Sum_NullableInt64_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, long?>>, long?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Single_TSource_2; public static MethodInfo Sum_Single_TSource_2(Type TSource) => (s_Sum_Single_TSource_2 ?? (s_Sum_Single_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, float>>, float>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_NullableSingle_TSource_2; public static MethodInfo Sum_NullableSingle_TSource_2(Type TSource) => (s_Sum_NullableSingle_TSource_2 ?? (s_Sum_NullableSingle_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, float?>>, float?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Double_TSource_2; public static MethodInfo Sum_Double_TSource_2(Type TSource) => (s_Sum_Double_TSource_2 ?? (s_Sum_Double_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, double>>, double>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_NullableDouble_TSource_2; public static MethodInfo Sum_NullableDouble_TSource_2(Type TSource) => (s_Sum_NullableDouble_TSource_2 ?? (s_Sum_NullableDouble_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, double?>>, double?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Sum_Decimal_TSource_2; public static MethodInfo Sum_Decimal_TSource_2(Type TSource) => (s_Sum_Decimal_TSource_2 ?? (s_Sum_Decimal_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, decimal>>, decimal>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Take_TSource_2; public static MethodInfo Take_TSource_2(Type TSource) => (s_Take_TSource_2 ?? (s_Take_TSource_2 = new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.Take).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_TakeWhile_TSource_2; public static MethodInfo TakeWhile_TSource_2(Type TSource) => (s_TakeWhile_TSource_2 ?? (s_TakeWhile_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.TakeWhile).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_TakeWhile_Index_TSource_2; public static MethodInfo TakeWhile_Index_TSource_2(Type TSource) => (s_TakeWhile_Index_TSource_2 ?? (s_TakeWhile_Index_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.TakeWhile).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_ThenBy_TSource_TKey_2; public static MethodInfo ThenBy_TSource_TKey_2(Type TSource, Type TKey) => (s_ThenBy_TSource_TKey_2 ?? (s_ThenBy_TSource_TKey_2 = new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.ThenBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_ThenBy_TSource_TKey_3; public static MethodInfo ThenBy_TSource_TKey_3(Type TSource, Type TKey) => (s_ThenBy_TSource_TKey_3 ?? (s_ThenBy_TSource_TKey_3 = new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.ThenBy).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_ThenByDescending_TSource_TKey_2; public static MethodInfo ThenByDescending_TSource_TKey_2(Type TSource, Type TKey) => (s_ThenByDescending_TSource_TKey_2 ?? (s_ThenByDescending_TSource_TKey_2 = new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.ThenByDescending).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_ThenByDescending_TSource_TKey_3; public static MethodInfo ThenByDescending_TSource_TKey_3(Type TSource, Type TKey) => (s_ThenByDescending_TSource_TKey_3 ?? (s_ThenByDescending_TSource_TKey_3 = new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.ThenByDescending).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource, TKey); private static MethodInfo s_Union_TSource_2; public static MethodInfo Union_TSource_2(Type TSource) => (s_Union_TSource_2 ?? (s_Union_TSource_2 = new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Union).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Union_TSource_3; public static MethodInfo Union_TSource_3(Type TSource) => (s_Union_TSource_3 ?? (s_Union_TSource_3 = new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Union).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Where_TSource_2; public static MethodInfo Where_TSource_2(Type TSource) => (s_Where_TSource_2 ?? (s_Where_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.Where).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Where_Index_TSource_2; public static MethodInfo Where_Index_TSource_2(Type TSource) => (s_Where_Index_TSource_2 ?? (s_Where_Index_TSource_2 = new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.Where).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Zip_TFirst_TSecond_2; public static MethodInfo Zip_TFirst_TSecond_2(Type TFirst, Type TSecond) => (s_Zip_TFirst_TSecond_2 ?? (s_Zip_TFirst_TSecond_2 = new Func<IQueryable<object>, IEnumerable<object>, IQueryable<(object, object)>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TFirst, TSecond); private static MethodInfo s_Zip_TFirst_TSecond_TResult_3; public static MethodInfo Zip_TFirst_TSecond_TResult_3(Type TFirst, Type TSecond, Type TResult) => (s_Zip_TFirst_TSecond_TResult_3 ?? (s_Zip_TFirst_TSecond_TResult_3 = new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TFirst, TSecond, TResult); private static MethodInfo s_SkipLast_TSource_2; public static MethodInfo SkipLast_TSource_2(Type TSource) => (s_SkipLast_TSource_2 ?? (s_SkipLast_TSource_2 = new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.SkipLast).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_TakeLast_TSource_2; public static MethodInfo TakeLast_TSource_2(Type TSource) => (s_TakeLast_TSource_2 ?? (s_TakeLast_TSource_2 = new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.TakeLast).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Append_TSource_2; public static MethodInfo Append_TSource_2(Type TSource) => (s_Append_TSource_2 ?? (s_Append_TSource_2 = new Func<IQueryable<object>, object, IQueryable<object>>(Queryable.Append).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); private static MethodInfo s_Prepend_TSource_2; public static MethodInfo Prepend_TSource_2(Type TSource) => (s_Prepend_TSource_2 ?? (s_Prepend_TSource_2 = new Func<IQueryable<object>, object, IQueryable<object>>(Queryable.Prepend).GetMethodInfo().GetGenericMethodDefinition())) .MakeGenericMethod(TSource); } }
57.606613
344
0.718196
[ "MIT" ]
939481896/dotnet-corefx
src/System.Linq.Queryable/src/System/Linq/CachedReflection.cs
50,523
C#
// *********************************************************************** // Copyright (c) 2008 Charlie Poole // // 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; namespace NUnit.Framework.Constraints { /// <summary> /// ThrowsConstraint is used to test the exception thrown by /// a delegate by applying a constraint to it. /// </summary> public class ThrowsConstraint : PrefixConstraint { private Exception caughtException; /// <summary> /// Initializes a new instance of the <see cref="T:ThrowsConstraint"/> class, /// using a constraint to be applied to the exception. /// </summary> /// <param name="baseConstraint">A constraint to apply to the caught exception.</param> public ThrowsConstraint(Constraint baseConstraint) : base(baseConstraint) { } /// <summary> /// Get the actual exception thrown - used by Assert.Throws. /// </summary> public Exception ActualException { get { return caughtException; } } #region Constraint Overrides /// <summary> /// Executes the code of the delegate and captures any exception. /// If a non-null base constraint was provided, it applies that /// constraint to the exception. /// </summary> /// <param name="actual">A delegate representing the code to be tested</param> /// <returns>True if an exception is thrown and the constraint succeeds, otherwise false</returns> public override bool Matches(object actual) { TestDelegate code = actual as TestDelegate; if (code == null) throw new ArgumentException( string.Format("The actual value must be a TestDelegate but was {0}", actual.GetType().Name), "actual"); caughtException = null; try { code(); } catch (Exception ex) { caughtException = ex; } bool hasSucceeded = caughtException != null && (baseConstraint == null || baseConstraint.Matches(caughtException)); return hasSucceeded; } #if true /// <summary> /// Converts an ActualValueDelegate to a TestDelegate /// before calling the primary overload. /// </summary> /// <param name="del"></param> /// <returns></returns> public override bool Matches(ActualValueDelegate del) { TestDelegate testDelegate = new TestDelegate(delegate { del(); }); return Matches((object)testDelegate); } #endif /// <summary> /// Write the constraint description to a MessageWriter /// </summary> /// <param name="writer">The writer on which the description is displayed</param> public override void WriteDescriptionTo(MessageWriter writer) { if (baseConstraint == null) writer.WritePredicate("an exception"); else baseConstraint.WriteDescriptionTo(writer); } /// <summary> /// Write the actual value for a failing constraint test to a /// MessageWriter. The default implementation simply writes /// the raw value of actual, leaving it to the writer to /// perform any formatting. /// </summary> /// <param name="writer">The writer on which the actual value is displayed</param> public override void WriteActualValueTo(MessageWriter writer) { if (caughtException == null) writer.Write("no exception thrown"); else if (baseConstraint != null) baseConstraint.WriteActualValueTo(writer); else writer.WriteActualValue(caughtException); } #endregion /// <summary> /// Returns the string representation of this constraint /// </summary> protected override string GetStringRepresentation() { if (baseConstraint == null) return "<throws>"; return base.GetStringRepresentation(); } } }
38.3
123
0.599403
[ "Apache-2.0" ]
Hitcents/iOS4Unity
Assets/NUnitLite/NUnitLite-0.7.0/Constraints/ThrowsConstraint.cs
5,362
C#
// 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 System; using System.Net; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; using Thrift.Transports.Client; namespace Thrift.Transports.Server { // ReSharper disable once InconsistentNaming public class TTlsServerSocketTransport : TServerTransport { private readonly RemoteCertificateValidationCallback _clientCertValidator; private readonly int _clientTimeout = 0; private readonly LocalCertificateSelectionCallback _localCertificateSelectionCallback; private readonly int _port; private readonly X509Certificate2 _serverCertificate; private readonly SslProtocols _sslProtocols; private readonly bool _useBufferedSockets; private TcpListener _server; public TTlsServerSocketTransport(int port, X509Certificate2 certificate) : this(port, false, certificate) { } public TTlsServerSocketTransport( int port, bool useBufferedSockets, X509Certificate2 certificate, RemoteCertificateValidationCallback clientCertValidator = null, LocalCertificateSelectionCallback localCertificateSelectionCallback = null, SslProtocols sslProtocols = SslProtocols.Tls12) { if (!certificate.HasPrivateKey) { throw new TTransportException(TTransportException.ExceptionType.Unknown, "Your server-certificate needs to have a private key"); } _port = port; _serverCertificate = certificate; _useBufferedSockets = useBufferedSockets; _clientCertValidator = clientCertValidator; _localCertificateSelectionCallback = localCertificateSelectionCallback; _sslProtocols = sslProtocols; try { // Create server socket _server = new TcpListener(IPAddress.Any, _port); _server.Server.NoDelay = true; } catch (Exception) { _server = null; throw new TTransportException($"Could not create ServerSocket on port {port}."); } } public override void Listen() { // Make sure accept is not blocking if (_server != null) { try { _server.Start(); } catch (SocketException sx) { throw new TTransportException($"Could not accept on listening socket: {sx.Message}"); } } } public override bool IsClientPending() { return _server.Pending(); } protected override async Task<TClientTransport> AcceptImplementationAsync(CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) { return await Task.FromCanceled<TClientTransport>(cancellationToken); } if (_server == null) { throw new TTransportException(TTransportException.ExceptionType.NotOpen, "No underlying server socket."); } try { var client = await _server.AcceptTcpClientAsync(); client.SendTimeout = client.ReceiveTimeout = _clientTimeout; //wrap the client in an SSL Socket passing in the SSL cert var tTlsSocket = new TTlsSocketClientTransport(client, _serverCertificate, true, _clientCertValidator, _localCertificateSelectionCallback, _sslProtocols); await tTlsSocket.SetupTlsAsync(); if (_useBufferedSockets) { var trans = new TBufferedClientTransport(tTlsSocket); return trans; } return tTlsSocket; } catch (Exception ex) { throw new TTransportException(ex.ToString()); } } public override void Close() { if (_server != null) { try { _server.Stop(); } catch (Exception ex) { throw new TTransportException($"WARNING: Could not close server socket: {ex}"); } _server = null; } } } }
35.070513
121
0.599525
[ "MIT" ]
0x0L/parquet-dotnet
src/Thrift/Transports/Server/TTlsServerSocketTransport.cs
5,471
C#
using System; using System.Xml.Serialization; namespace Aop.Api.Domain { /// <summary> /// AlipayDataIotdataAnomalydetectionBaiVerifyModel Data Structure. /// </summary> [Serializable] public class AlipayDataIotdataAnomalydetectionBaiVerifyModel : AopObject { /// <summary> /// base64编码的视频帧数据,表示当前帧 /// </summary> [XmlElement("current_frame")] public string CurrentFrame { get; set; } /// <summary> /// Unix时间戳,单位秒,current_frame的产生时间 /// </summary> [XmlElement("current_time")] public long CurrentTime { get; set; } /// <summary> /// base64编码视频帧数据 /// </summary> [XmlElement("previous_frame")] public string PreviousFrame { get; set; } /// <summary> /// Unix时间戳,单位秒,previous_frame的产生时间 /// </summary> [XmlElement("previous_time")] public long PreviousTime { get; set; } /// <summary> /// 调用方保证唯一,表示监测异常事件的id /// </summary> [XmlElement("session_id")] public string SessionId { get; set; } } }
26.162791
76
0.572444
[ "Apache-2.0" ]
Varorbc/alipay-sdk-net-all
AlipaySDKNet/Domain/AlipayDataIotdataAnomalydetectionBaiVerifyModel.cs
1,253
C#
// Copyright (c) Isaiah Williams. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Store.PartnerCenter { using System; /// <summary> /// Holds common partner component properties and behavior. All components should inherit from this class. /// </summary> /// <typeparam name="TContext">The context object type.</typeparam> internal abstract class BasePartnerComponent<TContext> : IPartnerComponent<TContext> where TContext : class { /// <summary> /// Initializes a new instance of the <see cref="BasePartnerComponent" /> class. /// </summary> /// <param name="rootPartnerOperations">The root partner operations that created this component.</param> /// <param name="componentContext">A component context object to work with.</param> protected BasePartnerComponent(IPartner rootPartnerOperations, TContext componentContext = null) { Partner = rootPartnerOperations ?? throw new ArgumentNullException(nameof(rootPartnerOperations)); Context = componentContext; } /// <summary> /// Gets a reference to the partner operations instance that generated this component. /// </summary> public IPartner Partner { get; } /// <summary> /// Gets the component context object. /// </summary> public TContext Context { get; } } }
42.742857
112
0.668449
[ "MIT" ]
erickbp/partner-center-dotnet
src/PartnerCenter/BasePartnerComponent.cs
1,498
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("BinarySearch")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BinarySearch")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("99632309-e6b8-44b9-b835-31b5c77795b2")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.621622
84
0.747845
[ "MIT" ]
ztimofeev/Programming_Fundamentals_SoftUni-repo
Ext_7.ArrayAndListAlgorithms/BinarySearch/Properties/AssemblyInfo.cs
1,395
C#
// Copyright 2020 Energinet DataHub A/S // // Licensed under the Apache License, Version 2.0 (the "License2"); // 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.Threading.Tasks; using Energinet.DataHub.MeteringPoints.Contracts; using Energinet.DataHub.MeteringPoints.Infrastructure.Transport; using Energinet.DataHub.MeteringPoints.Infrastructure.Transport.Protobuf.Integration; using Energinet.DataHub.MeteringPoints.IntegrationTests.Send; using FluentAssertions; using Microsoft.Extensions.DependencyInjection; using SimpleInjector; using SimpleInjector.Lifestyles; using Xunit; using MasterDataDocument = Energinet.DataHub.MeteringPoints.Application.MarketDocuments.MasterDataDocument; namespace Energinet.DataHub.MeteringPoints.IntegrationTests { public class TransportTests { [Fact] public async Task Send_and_receive_must_result_in_same_transmitted_values() { const string? expectedGsrnNumber = "123"; byte[]? bytes; // Send setup await using var sendingContainer = new Container(); sendingContainer.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); sendingContainer.Register<InProcessChannel>(Lifestyle.Singleton); sendingContainer.Register<Dispatcher>(Lifestyle.Transient); sendingContainer.SendProtobuf<MeteringPointEnvelope>(); sendingContainer.Verify(); // Send scope await using (AsyncScopedLifestyle.BeginScope(sendingContainer)) { var messageDispatcher = sendingContainer.GetRequiredService<Dispatcher>(); var outboundMessage = new MasterDataDocument { GsrnNumber = expectedGsrnNumber, }; await messageDispatcher.DispatchAsync(outboundMessage).ConfigureAwait(false); var channel = sendingContainer.GetRequiredService<InProcessChannel>(); // The wire bytes = channel.GetWrittenBytes(); } // Receive setup await using var receivingContainer = new Container(); receivingContainer.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); receivingContainer.ReceiveProtobuf<MeteringPointEnvelope>( config => config .FromOneOf(envelope => envelope.MeteringPointMessagesCase) .WithParser(() => MeteringPointEnvelope.Parser)); receivingContainer.Verify(); // Receive scope await using var scope = AsyncScopedLifestyle.BeginScope(receivingContainer); var messageExtractor = receivingContainer.GetRequiredService<MessageExtractor>(); var message = await messageExtractor.ExtractAsync(bytes).ConfigureAwait(false); message.Should().BeOfType<MasterDataDocument>(); } } }
43.779221
107
0.692969
[ "Apache-2.0" ]
Energinet-DataHub/geh-metering-point
source/Energinet.DataHub.MeteringPoints.IntegrationTests/TransportTests.cs
3,373
C#
 // ---------------------------------------------------------------------------------- // // Copyright Microsoft 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.Management.Automation; using Microsoft.Azure.Management.Network; using MNM = Microsoft.Azure.Management.Network.Models; using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; namespace Microsoft.Azure.Commands.Network { [Cmdlet(VerbsCommon.Remove, "AzureRmPublicIpAddress")] public class RemoveAzurePublicIpAddressCommand : PublicIpAddressBaseCmdlet { [Alias("ResourceName")] [Parameter( Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name.")] [ValidateNotNullOrEmpty] public virtual string Name { get; set; } [Parameter( Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [ResourceGroupCompleter] [ValidateNotNullOrEmpty] public virtual string ResourceGroupName { get; set; } [Parameter( Mandatory = false, HelpMessage = "Do not ask for confirmation.")] public SwitchParameter Force { get; set; } [Parameter(Mandatory = false)] public SwitchParameter PassThru { get; set; } public override void ExecuteCmdlet() { base.ExecuteCmdlet(); ConfirmAction( Force.IsPresent, string.Format(Microsoft.Azure.Commands.Network.Properties.Resources.RemovingResource, Name), Microsoft.Azure.Commands.Network.Properties.Resources.RemoveResourceMessage, Name, () => this.PublicIpAddressClient.Delete(this.ResourceGroupName, this.Name)); if (PassThru) { WriteObject(true); } } } }
37.285714
109
0.597701
[ "MIT" ]
AzureDataBox/azure-powershell
src/ResourceManager/Network/Stack/Commands.Network/PublicIpAddress/RemoveAzurePublicIpAddressCommand.cs
2,543
C#
using System; using OpenTK.Graphics.OpenGL; using OpenTKGLUT; using System.Drawing; namespace Dibuixos.GameObjects { public class TitleFontStrokeRender : Core.IRenderFrame { public float X { get; set; } public float Y { get; set; } public float Width { get; set; } public float Height { get; set; } public string Title { get; set; } public int Font { get; set; } private float mX; private float mY; private float mScale; #region IRenderFrame implementation public void GLInit() { var w = GLUT.glutStrokeLengthf(Font, Title); var h = Core.GLUtil.StrokeHeight(Font, Title); var pScaleX = Width / w; var pScaleY = Height / h; var pScale = Math.Min(pScaleX, pScaleY); var ws = w * pScale; var hs = h * pScale; mX = (Width - ws) / 2.0f; mY = Height-(GLUT.glutStrokeHeight(Font)-(Core.GLUtil.StrokeHeightFree(Font)/2.0f))*pScale -((Height - hs) / 2.0f); mScale = pScale; } public void RenderFrame(OpenTK.FrameEventArgs e) { GL.PushMatrix(); GL.Translate(mX, mY, 0); GL.Scale(mScale, mScale, 0); GLUT.glutStrokeString(GLUT.GLUT_STROKE_ROMAN, Title); GL.PopMatrix(); } public void GLDone() { } #endregion } }
26.6
127
0.544087
[ "Apache-2.0" ]
bugbit/mathematical-drawings
OpenTK/Dibuixos/Dibuixos/Dibuixos/GameObjects/TitleFontStrokeRender.cs
1,465
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.IO; using System.Linq; using System.Net.Http; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; using Xunit; namespace System.Net.Tests { public class HttpRequestStreamTests : IDisposable { private HttpListenerFactory _factory; private HttpListener _listener; private GetContextHelper _helper; public HttpRequestStreamTests() { _factory = new HttpListenerFactory(); _listener = _factory.GetListener(); _helper = new GetContextHelper(_listener, _factory.ListeningUrl); } public void Dispose() { _factory.Dispose(); _helper.Dispose(); } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true, "")] [InlineData(false, "")] [InlineData(true, "Non-Empty")] [InlineData(false, "Non-Empty")] public async Task Read_FullLengthAsynchronous_Success(bool transferEncodingChunked, string text) { byte[] expected = Encoding.UTF8.GetBytes(text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(text)); HttpListenerContext context = await contextTask; if (transferEncodingChunked) { Assert.Equal(-1, context.Request.ContentLength64); Assert.Equal("chunked", context.Request.Headers["Transfer-Encoding"]); } else { Assert.Equal(expected.Length, context.Request.ContentLength64); Assert.Null(context.Request.Headers["Transfer-Encoding"]); } byte[] buffer = new byte[expected.Length]; int bytesRead = await context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length); Assert.Equal(expected.Length, bytesRead); Assert.Equal(expected, buffer); // Subsequent reads don't do anything. Assert.Equal(0, await context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length)); Assert.Equal(expected, buffer); context.Response.Close(); using (HttpResponseMessage response = await clientTask) { Assert.Equal(200, (int)response.StatusCode); } } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true, "")] [InlineData(false, "")] [InlineData(true, "Non-Empty")] [InlineData(false, "Non-Empty")] public async Task Read_FullLengthAsynchronous_PadBuffer_Success(bool transferEncodingChunked, string text) { byte[] expected = Encoding.UTF8.GetBytes(text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(text)); HttpListenerContext context = await contextTask; if (transferEncodingChunked) { Assert.Equal(-1, context.Request.ContentLength64); Assert.Equal("chunked", context.Request.Headers["Transfer-Encoding"]); } else { Assert.Equal(expected.Length, context.Request.ContentLength64); Assert.Null(context.Request.Headers["Transfer-Encoding"]); } const int pad = 128; // Add padding at beginning and end to test for correct offset/size handling byte[] buffer = new byte[pad + expected.Length + pad]; int bytesRead = await context.Request.InputStream.ReadAsync(buffer, pad, expected.Length); Assert.Equal(expected.Length, bytesRead); Assert.Equal(expected, buffer.Skip(pad).Take(bytesRead)); // Subsequent reads don't do anything. Assert.Equal(0, await context.Request.InputStream.ReadAsync(buffer, pad, 1)); context.Response.Close(); using (HttpResponseMessage response = await clientTask) { Assert.Equal(200, (int)response.StatusCode); } } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true, "")] [InlineData(false, "")] [InlineData(true, "Non-Empty")] [InlineData(false, "Non-Empty")] public async Task Read_FullLengthSynchronous_Success(bool transferEncodingChunked, string text) { byte[] expected = Encoding.UTF8.GetBytes(text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(text)); HttpListenerContext context = await contextTask; if (transferEncodingChunked) { Assert.Equal(-1, context.Request.ContentLength64); Assert.Equal("chunked", context.Request.Headers["Transfer-Encoding"]); } else { Assert.Equal(expected.Length, context.Request.ContentLength64); Assert.Null(context.Request.Headers["Transfer-Encoding"]); } byte[] buffer = new byte[expected.Length]; int bytesRead = context.Request.InputStream.Read(buffer, 0, buffer.Length); Assert.Equal(expected.Length, bytesRead); Assert.Equal(expected, buffer); // Subsequent reads don't do anything. Assert.Equal(0, context.Request.InputStream.Read(buffer, 0, buffer.Length)); Assert.Equal(expected, buffer); context.Response.Close(); using (HttpResponseMessage response = await clientTask) { Assert.Equal(200, (int)response.StatusCode); } } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true)] [InlineData(false)] public async Task Read_LargeLengthAsynchronous_Success(bool transferEncodingChunked) { var rand = new Random(42); byte[] expected = Enumerable .Range(0, 128*1024 + 1) // More than 128kb .Select(_ => (byte)('a' + rand.Next(0, 26))) .ToArray(); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new ByteArrayContent(expected)); HttpListenerContext context = await contextTask; // If the size is greater than 128K, then we limit the size, and have to do multiple reads on // Windows, which uses http.sys internally. byte[] buffer = new byte[expected.Length]; int totalRead = 0; while (totalRead < expected.Length) { int bytesRead = await context.Request.InputStream.ReadAsync(buffer, totalRead, expected.Length - totalRead); Assert.InRange(bytesRead, 1, expected.Length - totalRead); totalRead += bytesRead; } // Subsequent reads don't do anything. Assert.Equal(0, await context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length)); Assert.Equal(expected, buffer); context.Response.Close(); } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true)] [InlineData(false)] public async Task Read_LargeLengthSynchronous_Success(bool transferEncodingChunked) { var rand = new Random(42); byte[] expected = Enumerable .Range(0, 128 * 1024 + 1) // More than 128kb .Select(_ => (byte)('a' + rand.Next(0, 26))) .ToArray(); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new ByteArrayContent(expected)); HttpListenerContext context = await contextTask; // If the size is greater than 128K, then we limit the size, and have to do multiple reads on // Windows, which uses http.sys internally. byte[] buffer = new byte[expected.Length]; int totalRead = 0; while (totalRead < expected.Length) { int bytesRead = context.Request.InputStream.Read(buffer, totalRead, expected.Length - totalRead); Assert.InRange(bytesRead, 1, expected.Length - totalRead); totalRead += bytesRead; } // Subsequent reads don't do anything. Assert.Equal(0, context.Request.InputStream.Read(buffer, 0, buffer.Length)); Assert.Equal(expected, buffer); context.Response.Close(); } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true)] [InlineData(false)] public async Task Read_TooMuchAsynchronous_Success(bool transferEncodingChunked) { const string Text = "Some-String"; byte[] expected = Encoding.UTF8.GetBytes(Text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(Text)); HttpListenerContext context = await contextTask; byte[] buffer = new byte[expected.Length + 5]; int bytesRead = await context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length); Assert.Equal(expected.Length, bytesRead); Assert.Equal(expected.Concat(new byte[5]), buffer); context.Response.Close(); } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true)] [InlineData(false)] public async Task Read_TooMuchSynchronous_Success(bool transferEncodingChunked) { const string Text = "Some-String"; byte[] expected = Encoding.UTF8.GetBytes(Text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(Text)); HttpListenerContext context = await contextTask; byte[] buffer = new byte[expected.Length + 5]; int bytesRead = context.Request.InputStream.Read(buffer, 0, buffer.Length); Assert.Equal(expected.Length, bytesRead); Assert.Equal(expected.Concat(new byte[5]), buffer); context.Response.Close(); } } [ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] [InlineData(true)] [InlineData(false)] public async Task Read_NotEnoughThenCloseAsynchronous_Success(bool transferEncodingChunked) { const string Text = "Some-String"; byte[] expected = Encoding.UTF8.GetBytes(Text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(Text)); HttpListenerContext context = await contextTask; byte[] buffer = new byte[expected.Length - 5]; int bytesRead = await context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length); Assert.Equal(buffer.Length, bytesRead); context.Response.Close(); } } [Theory] [InlineData(true)] [InlineData(false)] public async Task Read_Disposed_ReturnsZero(bool transferEncodingChunked) { const string Text = "Some-String"; int bufferSize = Encoding.UTF8.GetByteCount(Text); Task<HttpListenerContext> contextTask = _listener.GetContextAsync(); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.TransferEncodingChunked = transferEncodingChunked; Task<HttpResponseMessage> clientTask = client.PostAsync(_factory.ListeningUrl, new StringContent(Text)); HttpListenerContext context = await contextTask; context.Request.InputStream.Close(); byte[] buffer = new byte[bufferSize]; Assert.Equal(0, context.Request.InputStream.Read(buffer, 0, buffer.Length)); Assert.Equal(new byte[bufferSize], buffer); IAsyncResult result = context.Request.InputStream.BeginRead(buffer, 0, buffer.Length, null, null); Assert.Equal(0, context.Request.InputStream.EndRead(result)); Assert.Equal(new byte[bufferSize], buffer); context.Response.Close(); } } [Fact] public async Task CanSeek_Get_ReturnsFalse() { HttpListenerRequest response = await _helper.GetRequest(chunked: true); using (Stream inputStream = response.InputStream) { Assert.False(inputStream.CanSeek); Assert.Throws<NotSupportedException>(() => inputStream.Length); Assert.Throws<NotSupportedException>(() => inputStream.SetLength(1)); Assert.Throws<NotSupportedException>(() => inputStream.Position); Assert.Throws<NotSupportedException>(() => inputStream.Position = 1); Assert.Throws<NotSupportedException>(() => inputStream.Seek(0, SeekOrigin.Begin)); } } [Fact] public async Task CanRead_Get_ReturnsTrue() { HttpListenerRequest request = await _helper.GetRequest(chunked: true); using (Stream inputStream = request.InputStream) { Assert.True(inputStream.CanRead); } } [Fact] public async Task CanWrite_Get_ReturnsFalse() { HttpListenerRequest request = await _helper.GetRequest(chunked: true); using (Stream inputStream = request.InputStream) { Assert.False(inputStream.CanWrite); Assert.Throws<InvalidOperationException>(() => inputStream.Write(new byte[0], 0, 0)); await Assert.ThrowsAsync<InvalidOperationException>(() => inputStream.WriteAsync(new byte[0], 0, 0)); Assert.Throws<InvalidOperationException>(() => inputStream.EndWrite(null)); // Flushing the output stream is a no-op. inputStream.Flush(); Assert.Equal(Task.CompletedTask, inputStream.FlushAsync(CancellationToken.None)); } } [Theory] [InlineData(true)] [InlineData(false)] public async Task Read_NullBuffer_ThrowsArgumentNullException(bool chunked) { HttpListenerRequest request = await _helper.GetRequest(chunked); using (Stream inputStream = request.InputStream) { AssertExtensions.Throws<ArgumentNullException>("buffer", () => inputStream.Read(null, 0, 0)); await Assert.ThrowsAsync<ArgumentNullException>("buffer", () => inputStream.ReadAsync(null, 0, 0)); } } [Theory] [InlineData(-1, true)] [InlineData(3, true)] [InlineData(-1, false)] [InlineData(3, false)] public async Task Read_InvalidOffset_ThrowsArgumentOutOfRangeException(int offset, bool chunked) { HttpListenerRequest request = await _helper.GetRequest(chunked); using (Stream inputStream = request.InputStream) { AssertExtensions.Throws<ArgumentOutOfRangeException>("offset", () => inputStream.Read(new byte[2], offset, 0)); await Assert.ThrowsAsync<ArgumentOutOfRangeException>("offset", () => inputStream.ReadAsync(new byte[2], offset, 0)); } } [Theory] [InlineData(0, 3, true)] [InlineData(1, 2, true)] [InlineData(2, 1, true)] [InlineData(0, 3, false)] [InlineData(1, 2, false)] [InlineData(2, 1, false)] public async Task Read_InvalidOffsetSize_ThrowsArgumentOutOfRangeException(int offset, int size, bool chunked) { HttpListenerRequest request = await _helper.GetRequest(chunked); using (Stream inputStream = request.InputStream) { AssertExtensions.Throws<ArgumentOutOfRangeException>("size", () => inputStream.Read(new byte[2], offset, size)); await Assert.ThrowsAsync<ArgumentOutOfRangeException>("size", () => inputStream.ReadAsync(new byte[2], offset, size)); } } [Theory] [InlineData(true)] [InlineData(false)] public async Task EndRead_NullAsyncResult_ThrowsArgumentNullException(bool chunked) { HttpListenerRequest request = await _helper.GetRequest(chunked); using (Stream inputStream = request.InputStream) { AssertExtensions.Throws<ArgumentNullException>("asyncResult", () => inputStream.EndRead(null)); } } [Theory] [InlineData(true)] [InlineData(false)] public async Task EndRead_InvalidAsyncResult_ThrowsArgumentException(bool chunked) { HttpListenerRequest request1 = await _helper.GetRequest(chunked); HttpListenerRequest request2 = await _helper.GetRequest(chunked); using (Stream inputStream1 = request1.InputStream) using (Stream inputStream2 = request2.InputStream) { IAsyncResult beginReadResult = inputStream1.BeginRead(new byte[0], 0, 0, null, null); AssertExtensions.Throws<ArgumentException>("asyncResult", () => inputStream2.EndRead(new CustomAsyncResult())); AssertExtensions.Throws<ArgumentException>("asyncResult", () => inputStream2.EndRead(beginReadResult)); } } [Theory] [InlineData(true)] [InlineData(false)] public async Task EndRead_CalledTwice_ThrowsInvalidOperationException(bool chunked) { HttpListenerRequest request = await _helper.GetRequest(chunked); using (Stream inputStream = request.InputStream) { IAsyncResult beginReadResult = inputStream.BeginRead(new byte[0], 0, 0, null, null); inputStream.EndRead(beginReadResult); Assert.Throws<InvalidOperationException>(() => inputStream.EndRead(beginReadResult)); } } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] public async Task Read_FromClosedConnectionAsynchronously_ThrowsHttpListenerException() { const string Text = "Some-String"; byte[] expected = Encoding.UTF8.GetBytes(Text); using (Socket client = _factory.GetConnectedSocket()) { // Send a header to the HttpListener to give it a context. // Note: It's important here that we don't send the content. // If the content is missing, then the HttpListener needs // to get the content. However, the socket has been closed // before the reading of the content, so reading should fail. client.Send(_factory.GetContent(RequestTypes.POST, Text, headerOnly: true)); HttpListenerContext context = await _listener.GetContextAsync(); // Disconnect the Socket from the HttpListener. Helpers.WaitForSocketShutdown(client); // Reading from a closed connection should fail. byte[] buffer = new byte[expected.Length]; await Assert.ThrowsAsync<HttpListenerException>(() => context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length)); await Assert.ThrowsAsync<HttpListenerException>(() => context.Request.InputStream.ReadAsync(buffer, 0, buffer.Length)); } } [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotOneCoreUAP))] public async Task Read_FromClosedConnectionSynchronously_ThrowsHttpListenerException() { const string Text = "Some-String"; byte[] expected = Encoding.UTF8.GetBytes(Text); using (Socket client = _factory.GetConnectedSocket()) { // Send a header to the HttpListener to give it a context. // Note: It's important here that we don't send the content. // If the content is missing, then the HttpListener needs // to get the content. However, the socket has been closed // before the reading of the content, so reading should fail. client.Send(_factory.GetContent(RequestTypes.POST, Text, headerOnly: true)); HttpListenerContext context = await _listener.GetContextAsync(); // Disconnect the Socket from the HttpListener. Helpers.WaitForSocketShutdown(client); // Reading from a closed connection should fail. byte[] buffer = new byte[expected.Length]; Assert.Throws<HttpListenerException>(() => context.Request.InputStream.Read(buffer, 0, buffer.Length)); Assert.Throws<HttpListenerException>(() => context.Request.InputStream.Read(buffer, 0, buffer.Length)); } } } }
45.182156
135
0.603999
[ "MIT" ]
JetBrains/corefx
src/System.Net.HttpListener/tests/HttpRequestStreamTests.cs
24,308
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: IStreamRequestBuilder.cs.tt namespace Microsoft.Graph { using System.Collections.Generic; /// <summary> /// The interface IServiceUpdateMessageAttachmentsArchiveRequestBuilder. /// </summary> public partial interface IServiceUpdateMessageAttachmentsArchiveRequestBuilder { /// <summary> /// Builds the request. /// </summary> /// <param name="options">The query and header options for the request.</param> /// <returns>The built request.</returns> IServiceUpdateMessageAttachmentsArchiveRequest Request(IEnumerable<Option> options = null); } }
39.481481
153
0.597561
[ "MIT" ]
ScriptBox99/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Generated/requests/IServiceUpdateMessageAttachmentsArchiveRequestBuilder.cs
1,066
C#
using Amazon.Lambda; using Amazon.Lambda.Core; using Amazon.Lambda.SQSEvents; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Api { public class NotificationProcessor { public string FunctionHandler(SQSEvent sQSEvent,ILambdaContext lambdaContext) { lambdaContext.Logger.Log("Consumer called with the message"); return "hello World"; } } }
23
85
0.704348
[ "Apache-2.0" ]
satish860/Notify
notify/src/Api/NotificationProcessor.cs
462
C#
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; namespace StringToStringAnalyzer { [DiagnosticAnalyzer(LanguageNames.CSharp)] public class StringToStringAnalyzerAnalyzer : DiagnosticAnalyzer { public const string DiagnosticId = "StringToStringAnalyzer"; // You can change these strings in the Resources.resx file. If you do not want your analyzer to be localize-able, you can use regular strings for Title and MessageFormat. // See https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Localizing%20Analyzers.md for more on localization private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.AnalyzerTitle), Resources.ResourceManager, typeof(Resources)); private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(Resources.AnalyzerMessageFormat), Resources.ResourceManager, typeof(Resources)); private static readonly LocalizableString Description = new LocalizableResourceString(nameof(Resources.AnalyzerDescription), Resources.ResourceManager, typeof(Resources)); private const string Category = "Naming"; private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } } public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.InvocationExpression); } private static void AnalyzeNode(SyntaxNodeAnalysisContext context) { if (context.Node.IsKind(SyntaxKind.InvocationExpression)) { InvocationExpressionSyntax invocation = (InvocationExpressionSyntax)context.Node; MemberAccessExpressionSyntax memberAccess = invocation.Expression as MemberAccessExpressionSyntax; //only member access expressions if (memberAccess == null) { return; } var parent = memberAccess.ChildNodes().First(); //this is the to string function if (memberAccess.Name.Identifier.ValueText != "ToString") { return; } var type = context.SemanticModel.GetTypeInfo(parent); if (type.Type.SpecialType != SpecialType.System_String) { return; } context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation(), parent.ToString())); } } } }
44.378788
200
0.724138
[ "MIT" ]
t-johnson/StringToStringAnalyzer
StringToStringAnalyzer/StringToStringAnalyzer/DiagnosticAnalyzer.cs
2,929
C#
using Basket.Api.GrpcServices; using Basket.Api.Repositories; using Discount.Grpc.Protos; using MassTransit; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.OpenApi.Models; using System; namespace Basket.Api { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { //Redis Configuration services.AddStackExchangeRedisCache(options => { options.Configuration = Configuration.GetValue<string>("CacheSettings:ConnectionString"); }); //General Configuration services.AddScoped<IBasketRepository, BasketRepository>(); services.AddAutoMapper(typeof(Startup)); // Grpc Configuration services.AddGrpcClient<DiscountProtoService.DiscountProtoServiceClient> (o => o.Address = new Uri(Configuration["GrpcSettings:DiscountUrl"])); services.AddScoped<DiscountGrpcService>(); //MassTransit RabbitMQ Configuration services.AddMassTransit(config=> { config.UsingRabbitMq((ctx, cfg) => { cfg.Host(Configuration.GetValue<string>("EventBusSettings:HostAddress")); }); }); services.AddMassTransitHostedService(); services.AddControllers(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "Basket.Api", Version = "v1" }); }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Basket.Api v1")); } app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } }
33.0375
106
0.602346
[ "MIT" ]
IslamHelmy2030/AspnetMicroservices
src/Services/Basket/Basket.Api/Startup.cs
2,643
C#
// https://docs.microsoft.com/en-us/visualstudio/modeling/t4-include-directive?view=vs-2017 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using Microsoft.Bot.Builder.Solutions.Responses; namespace PhoneSkill.Responses.Main { /// <summary> /// Contains bot responses. /// </summary> public class PhoneMainResponses : IResponseIdCollection { // Generated accessors public const string WelcomeMessage = "WelcomeMessage"; public const string HelpMessage = "HelpMessage"; public const string GreetingMessage = "GreetingMessage"; public const string GoodbyeMessage = "GoodbyeMessage"; public const string LogOut = "LogOut"; public const string FeatureNotAvailable = "FeatureNotAvailable"; public const string CancelMessage = "CancelMessage"; } }
38.26087
92
0.710227
[ "MIT" ]
Damarus999/botframework-solutions
skills/src/csharp/phoneskill/phoneskill/Responses/Main/PhoneMainResponses.cs
882
C#
using NetOffice.Attributes; namespace NetOffice.OutlookApi.Enums { /// <summary> /// SupportByVersion Outlook 12, 14, 15, 16 /// </summary> ///<remarks> MSDN Online Documentation: http://msdn.microsoft.com/en-us/en-us/library/office/ff869338.aspx </remarks> [SupportByVersion("Outlook", 12, 14, 15, 16)] [EntityType(EntityType.IsEnum)] public enum OlRuleExecuteOption { /// <summary> /// SupportByVersion Outlook 12, 14, 15, 16 /// </summary> /// <remarks>0</remarks> [SupportByVersion("Outlook", 12, 14, 15, 16)] olRuleExecuteAllMessages = 0, /// <summary> /// SupportByVersion Outlook 12, 14, 15, 16 /// </summary> /// <remarks>1</remarks> [SupportByVersion("Outlook", 12, 14, 15, 16)] olRuleExecuteReadMessages = 1, /// <summary> /// SupportByVersion Outlook 12, 14, 15, 16 /// </summary> /// <remarks>2</remarks> [SupportByVersion("Outlook", 12, 14, 15, 16)] olRuleExecuteUnreadMessages = 2 } }
32.757576
121
0.582794
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
ehsan2022002/VirastarE
Office/Outlook/Enums/OlRuleExecuteOption.cs
1,083
C#
namespace MusicHub.Data { public static class Configuration { public static string ConnectionString = @"Server=PIROMAN\SQLEXPRESS2019;Database=MusicHub;Trusted_Connection=True"; } }
23.777778
87
0.700935
[ "MIT" ]
pirocorp/Databases-Advanced---Entity-Framework
14. Exams/C# DB Advanced Exam Retake - 18 Apr 2019/MusicHub/Data/Configuration.cs
216
C#
// // Copyright (c) Antmicro // Copyright (c) Realtime Embedded // // This file is part of the Emul8 project. // Full license details are defined in the 'LICENSE' file. // using System; using Emul8.Peripherals; namespace Emul8.Peripherals.Input { public interface IInputDevice : IPeripheral { } }
17.277778
58
0.70418
[ "MIT" ]
AntonKrug/emul8-modded
Emulator/Main/Peripherals/Input/IInputDevice.cs
311
C#
// Copyright 2020 New Relic, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 using System; using System.Collections.Generic; using NewRelic.Core.Logging; using NewRelic.SystemExtensions.Collections.Generic; namespace NewRelic.Agent.Core.Commands { public class ThreadProfilerCommandArgs { public const float MinimumSamplingFrequencySeconds = 0.1F; // 1/10 of a second public const float MinimumSamplingDurationSeconds = 120; // 2 minutes public const float MaximumSamplingFrequencySeconds = 60; // 1 minute public const float MaximumSamplingDurationSeconds = 86400; // 24 hours public const float DefaultSamplingFrequencySeconds = MinimumSamplingDurationSeconds; public const float DefaultSamplingDurationSeconds = MinimumSamplingDurationSeconds; // 2 minutes public readonly int ProfileId; public readonly uint Frequency; public readonly uint Duration; public readonly bool ReportData; public ThreadProfilerCommandArgs(IDictionary<string, object> arguments) { var profileId = arguments.GetValueOrDefault("profile_id"); if (profileId != null) int.TryParse(profileId.ToString(), out ProfileId); Frequency = ParseFloatArgument(arguments, "sample_period", DefaultSamplingFrequencySeconds, MinimumSamplingFrequencySeconds, MaximumSamplingFrequencySeconds); Duration = ParseFloatArgument(arguments, "duration", DefaultSamplingDurationSeconds, MinimumSamplingDurationSeconds, MaximumSamplingDurationSeconds); ReportData = ParseBooleanArgument(arguments, "report_data", true); } private uint ParseFloatArgument(IDictionary<string, object> arguments, string argumentName, float defaultValue, float minValue, float maxValue) { object value; if (!arguments.TryGetValue(argumentName, out value) || value == null) return (uint)defaultValue * 1000; float parsedValue; if (!float.TryParse(value.ToString(), out parsedValue)) return (uint)defaultValue * 1000; try { if (parsedValue == 0) parsedValue = defaultValue; else if (parsedValue < minValue) parsedValue = minValue; else if (parsedValue > maxValue) parsedValue = maxValue; return (uint)(parsedValue * 1000); } catch (OverflowException) { Log.DebugFormat("Received a sample_period value with start_profiler command that caused an overflow converting to milliseconds. value = {0}", parsedValue); return (uint)maxValue * 1000; } } private bool ParseBooleanArgument(IDictionary<string, object> arguments, string argumentName, bool defaultValue) { var value = arguments.GetValueOrDefault(argumentName); if (value == null) return defaultValue; bool result; if (!bool.TryParse(value.ToString(), out result)) return defaultValue; return result; } } }
40
171
0.644207
[ "Apache-2.0" ]
JoshuaColeman/newrelic-dotnet-agent
src/Agent/NewRelic/Agent/Core/NewRelic.Agent.Core.Commands/ThreadProfilerCommandArgs.cs
3,280
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace ColorWars.ViewModels.Account { public class ExternalLoginConfirmationViewModel { [Required] [EmailAddress] public string Email { get; set; } } }
20.9375
51
0.725373
[ "MIT" ]
DiglidiDudeNG/ColorWars
ViewModels/Account/ExternalLoginConfirmationViewModel.cs
337
C#
using System; using Assertion; using Lemonad.ErrorHandling.Extensions; using Xunit; namespace Lemonad.ErrorHandling.Unit.Maybe.Tests { public class FlattenTests { [Fact] public void Flattening_From_String_Maybe_With_No_Value_To_Maybe_Int_With_No_Value__Expects_String_Maybe_With_Value() { ErrorHandling.Maybe.None<string>().AssertNone().Flatten(x => 2.ToMaybeNone().AssertNone()).AssertNone(); } [Fact] public void Flattening_From_String_Maybe_With_No_Value_To_Maybe_Int_With_Value__Expects_String_Maybe_With_Value() { ErrorHandling.Maybe.None<string>().Flatten(x => ErrorHandling.Maybe.Value(2).AssertValue(2)).AssertNone(); } [Fact] public void Flattening_From_String_Maybe_With_Value_To_Maybe_Int_With_No_Value__Expects_String_Maybe_With_Value() { ErrorHandling.Maybe.Value("hello") .Flatten(x => 2.ToMaybeNone().AssertNone()) .AssertNone(); } [Fact] public void Flattening_From_String_Maybe_With_Value_To_Maybe_Int_With_Value__Expects_String_Maybe_With_Value() { const string input = "hello"; ErrorHandling.Maybe.Value(input) .Flatten(x => ErrorHandling.Maybe.Value(2).AssertValue(2)) .AssertValue(input); } [Fact] public void Passing_Null_Selector_Throws() => Assert.Throws<ArgumentNullException>(AssertionUtilities.SelectorName, () => ErrorHandling.Maybe.Value(2).Flatten((Func<int, IMaybe<int>>) null)); } }
39.047619
118
0.659146
[ "MIT" ]
inputfalken/Lemonad
test/Lemonad.ErrorHandling.Unit/Maybe.Tests/FlattenTests.cs
1,642
C#
using System.Globalization; using System.Resources; using System.Threading; namespace dCForm.Util.Xsd { internal sealed class Res { internal const string Logo = "Logo"; internal const string HelpDescription = "HelpDescription"; internal const string HelpUsage = "HelpUsage"; internal const string HelpOptions = "HelpOptions"; internal const string HelpClasses = "HelpClasses"; internal const string HelpDataset = "HelpDataset"; internal const string HelpElement = "HelpElement"; internal const string HelpFields = "HelpFields"; internal const string HelpOrder = "HelpOrder"; internal const string HelpEnableDataBinding = "HelpEnableDataBinding"; internal const string HelpEnableLinqDataSet = "HelpEnableLinqDataSet"; internal const string HelpLanguage = "HelpLanguage"; internal const string HelpNamespace = "HelpNamespace"; internal const string HelpNoLogo = "HelpNoLogo"; internal const string HelpOut = "HelpOut"; internal const string HelpType = "HelpType"; internal const string HelpUri = "HelpUri"; internal const string HelpAdvanced = "HelpAdvanced"; internal const string HelpParameters = "HelpParameters"; internal const string HelpArguments = "HelpArguments"; internal const string HelpArgumentsDescription = "HelpArgumentsDescription"; internal const string MoreHelp = "MoreHelp"; internal const string Error = "Error"; internal const string ErrInvalidArgument = "ErrInvalidArgument"; internal const string ErrLanguage = "ErrLanguage"; internal const string ErrCodeDomProvider = "ErrCodeDomProvider"; internal const string ErrLoadAssembly = "ErrLoadAssembly"; internal const string ErrUnknownNodeType = "ErrUnknownNodeType"; internal const string ErrInputFileTypes = "ErrInputFileTypes"; internal const string ErrClassOrDataset = "ErrClassOrDataset"; internal const string ErrGeneral = "ErrGeneral"; internal const string ErrGenerateDataSetClass = "ErrGenerateDataSetClass"; internal const string ErrGenerateClassesForSchema = "ErrGenerateClassesForSchema"; internal const string Warning = "Warning"; internal const string UnhandledNode = "UnhandledNode"; internal const string FileNotFound = "FileNotFound"; internal const string SchemaValidationWarning = "SchemaValidationWarning"; internal const string SchemaValidationWarningDetails = "SchemaValidationWarningDetails"; internal const string SchemaValidationWarningDetailsSource = "SchemaValidationWarningDetailsSource"; internal const string NoClassesGenerated = "NoClassesGenerated"; internal const string NoTypesGenerated = "NoTypesGenerated"; internal const string SchemaValidationError = "SchemaValidationError"; internal const string XsdParametersValidationError = "XsdParametersValidationError"; internal const string ErrorPosition = "ErrorPosition"; internal const string MultipleFilesFoundMatchingInclude4 = "MultipleFilesFoundMatchingInclude4"; internal const string InfoWrittingFile = "InfoWrittingFile"; internal const string InfoVersionComment = "InfoVersionComment"; private static Res loader; private readonly ResourceManager resources; private static CultureInfo Culture { get { return null; } } public static ResourceManager Resources { get { return GetLoader().resources; } } internal Res() { resources = new ResourceManager("XsdRes", GetType().Assembly); } private static Res GetLoader() { if (loader == null) { Res value = new Res(); Interlocked.CompareExchange(ref loader, value, null); } return loader; } public static string GetString(string name, params object[] args) { return name; Res res = GetLoader(); if (res == null) return null; string @string = res.resources.GetString(name, Culture); if (args != null && args.Length > 0) { for (int i = 0; i < args.Length; i++) { string text = args[i] as string; if (text != null && text.Length > 1024) args[i] = text.Substring(0, 1021) + "..."; } return string.Format(CultureInfo.CurrentCulture, @string, args); } return @string; } public static string GetString(string name) { Res res = GetLoader(); if (res == null) return null; return name; //res.resources.GetString(name, Res.Culture); } public static string GetString(string name, out bool usedFallback) { usedFallback = false; return GetString(name); } public static object GetObject(string name) { Res res = GetLoader(); if (res == null) return null; return res.resources.GetObject(name, Culture); } } }
30.441989
108
0.620508
[ "Apache-2.0" ]
superbee66/dcForm
dcForm/Util/Xsd/Res.cs
5,510
C#
using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace CSharpier { public partial class Printer { private Doc PrintBaseTypeDeclarationSyntax( BaseTypeDeclarationSyntax node) { ParameterListSyntax? parameterList = null; TypeParameterListSyntax? typeParameterList = null; var constraintClauses = Enumerable.Empty<TypeParameterConstraintClauseSyntax>(); var hasMembers = false; SyntaxToken? keyword = null; Doc members = Doc.Null; SyntaxToken? semicolonToken = null; if (node is TypeDeclarationSyntax typeDeclarationSyntax) { typeParameterList = typeDeclarationSyntax.TypeParameterList; constraintClauses = typeDeclarationSyntax.ConstraintClauses; hasMembers = typeDeclarationSyntax.Members.Count > 0; if (typeDeclarationSyntax.Members.Count > 0) { members = Indent( HardLine, Join( HardLine, typeDeclarationSyntax.Members.Select(this.Print) ) ); } if (node is ClassDeclarationSyntax classDeclarationSyntax) { keyword = classDeclarationSyntax.Keyword; } else if ( node is StructDeclarationSyntax structDeclarationSyntax ) { keyword = structDeclarationSyntax.Keyword; } else if ( node is InterfaceDeclarationSyntax interfaceDeclarationSyntax ) { keyword = interfaceDeclarationSyntax.Keyword; } else if ( node is RecordDeclarationSyntax recordDeclarationSyntax ) { keyword = recordDeclarationSyntax.Keyword; parameterList = recordDeclarationSyntax.ParameterList; } semicolonToken = typeDeclarationSyntax.SemicolonToken; } else if (node is EnumDeclarationSyntax enumDeclarationSyntax) { members = Indent( HardLine, this.PrintSeparatedSyntaxList( enumDeclarationSyntax.Members, this.PrintEnumMemberDeclarationSyntax, HardLine ) ); hasMembers = enumDeclarationSyntax.Members.Count > 0; keyword = enumDeclarationSyntax.EnumKeyword; semicolonToken = enumDeclarationSyntax.SemicolonToken; } var parts = new Parts(); parts.Push(this.PrintExtraNewLines(node)); parts.Push(this.PrintAttributeLists(node, node.AttributeLists)); parts.Push(this.PrintModifiers(node.Modifiers)); if (keyword != null) { parts.Push(this.PrintSyntaxToken(keyword.Value, " ")); } parts.Push(this.PrintSyntaxToken(node.Identifier)); if (parameterList != null) { parts.Push(this.PrintParameterListSyntax(parameterList)); } if (typeParameterList != null) { parts.Push( this.PrintTypeParameterListSyntax(typeParameterList) ); } if (node.BaseList != null) { parts.Push(this.PrintBaseListSyntax(node.BaseList)); } parts.Push(this.PrintConstraintClauses(node, constraintClauses)); if (hasMembers) { parts.Push( HardLine, this.PrintSyntaxToken(node.OpenBraceToken), members, HardLine, this.PrintSyntaxToken(node.CloseBraceToken) ); } else if (node.OpenBraceToken.Kind() != SyntaxKind.None) { parts.Push( " ", this.PrintSyntaxToken(node.OpenBraceToken), " ", this.PrintSyntaxToken(node.CloseBraceToken) ); } if (semicolonToken.HasValue) { parts.Push(this.PrintSyntaxToken(semicolonToken.Value)); } return Concat(parts); } } }
35.058824
92
0.505453
[ "MIT" ]
askazakov/csharpier
Src/CSharpier/PrinterHelpers/BaseTypeDeclarationSyntax.cs
4,768
C#
/* * 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 System.Collections.Generic; using Aliyun.Acs.Core; namespace Aliyun.Acs.imm.Model.V20170906 { public class CreateDocIndexTaskResponse : AcsResponse { private string requestId; private string taskId; private string status; private string createTime; public string RequestId { get { return requestId; } set { requestId = value; } } public string TaskId { get { return taskId; } set { taskId = value; } } public string Status { get { return status; } set { status = value; } } public string CreateTime { get { return createTime; } set { createTime = value; } } } }
18.694118
63
0.647577
[ "Apache-2.0" ]
AxiosCros/aliyun-openapi-net-sdk
aliyun-net-sdk-imm/Imm/Model/V20170906/CreateDocIndexTaskResponse.cs
1,589
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/d2d1helper.h in the Windows SDK for Windows 10.0.19041.0 // Original source is Copyright © Microsoft. All rights reserved. using System; namespace TerraFX.Interop { public partial struct D2D_SIZE_U : IEquatable<D2D_SIZE_U> { public D2D_SIZE_U([NativeTypeName("UINT32")] uint width = 0, [NativeTypeName("UINT32")] uint height = 0) { this.width = width; this.height = height; } public static bool operator ==([NativeTypeName("const D2D1_SIZE_U &")] in D2D_SIZE_U l, [NativeTypeName("const D2D1_SIZE_U &")] in D2D_SIZE_U r) { return l.width == r.width && l.height == r.height; } public static bool operator !=([NativeTypeName("const D2D1_SIZE_U &")] in D2D_SIZE_U l, [NativeTypeName("const D2D1_SIZE_U &")] in D2D_SIZE_U r) { return !(l == r); } public bool Equals(D2D_SIZE_U other) => this == other; public override bool Equals(object? obj) => (obj is D2D_SIZE_U other) && this == other; public override int GetHashCode() => HashCode.Combine(width, height); } }
36.8
152
0.643634
[ "MIT" ]
Ethereal77/terrafx.interop.windows
sources/Interop/Windows/um/dcommon/D2D_SIZE_U.Manual.cs
1,290
C#
#region Copyright (c) 2006-2019 nHydrate.org, All Rights Reserved // -------------------------------------------------------------------------- * // NHYDRATE.ORG * // Copyright (c) 2006-2019 All Rights reserved * // * // * // Permission is hereby granted, free of charge, to any person obtaining a * // copy of this software and associated documentation files (the "Software"), * // to deal in the Software without restriction, including without limitation * // the rights to use, copy, modify, merge, publish, distribute, sublicense, * // and/or sell copies of the Software, and to permit persons to whom the * // Software is furnished to do so, subject to the following conditions: * // * // The above copyright notice and this permission notice shall be included * // in all copies or substantial portions of the Software. * // * // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * // -------------------------------------------------------------------------- * #endregion using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using nHydrate.Generator.Common.Util; using nHydrate.DslPackage.Objects; using nHydrate.Generator.Common.GeneratorFramework; namespace nHydrate.DslPackage.Forms { internal partial class RegistrationForm : Form { public RegistrationForm() { InitializeComponent(); this.SetupScreen(); #region Add Countries cboCountry.Items.Add("(Choose One)"); cboCountry.Items.Add("Afghanistan"); cboCountry.Items.Add("Albania"); cboCountry.Items.Add("Algeria"); cboCountry.Items.Add("American Samoa"); cboCountry.Items.Add("Andorra"); cboCountry.Items.Add("Angola"); cboCountry.Items.Add("Anguilla"); cboCountry.Items.Add("Antigua and Barbuda"); cboCountry.Items.Add("Argentina"); cboCountry.Items.Add("Armenia"); cboCountry.Items.Add("Aruba"); cboCountry.Items.Add("Australia"); cboCountry.Items.Add("Austria"); cboCountry.Items.Add("Azerbaijan"); cboCountry.Items.Add("Bahamas"); cboCountry.Items.Add("Bahrain"); cboCountry.Items.Add("Bahrain"); cboCountry.Items.Add("Bangladesh"); cboCountry.Items.Add("Barbados"); cboCountry.Items.Add("Belarus"); cboCountry.Items.Add("Belgium"); cboCountry.Items.Add("Belize"); cboCountry.Items.Add("Benin"); cboCountry.Items.Add("Bermuda"); cboCountry.Items.Add("Bhutan"); cboCountry.Items.Add("Bolivia"); cboCountry.Items.Add("Bosnia"); cboCountry.Items.Add("Botswana"); cboCountry.Items.Add("Brazil"); cboCountry.Items.Add("British Virgin Islands"); cboCountry.Items.Add("Brunei"); cboCountry.Items.Add("Bulgaria"); cboCountry.Items.Add("Burkina Faso"); cboCountry.Items.Add("Burundi"); cboCountry.Items.Add("Cambodia"); cboCountry.Items.Add("Cameroon"); cboCountry.Items.Add("Canada"); cboCountry.Items.Add("Cape Verde"); cboCountry.Items.Add("Cayman Islands"); cboCountry.Items.Add("Central African Republic"); cboCountry.Items.Add("Chad"); cboCountry.Items.Add("Chile"); cboCountry.Items.Add("China"); cboCountry.Items.Add("Colombia"); cboCountry.Items.Add("Comoros"); cboCountry.Items.Add("Costa Rica"); cboCountry.Items.Add("Cote d'Ivoire"); cboCountry.Items.Add("Croatia"); cboCountry.Items.Add("Cuba"); cboCountry.Items.Add("Cyprus"); cboCountry.Items.Add("Cyprus"); cboCountry.Items.Add("Czech Republic"); cboCountry.Items.Add("Democratic Republic of the Congo"); cboCountry.Items.Add("Denmark"); cboCountry.Items.Add("Djibouti"); cboCountry.Items.Add("Dominica"); cboCountry.Items.Add("Dominican Republic"); cboCountry.Items.Add("East Timor"); cboCountry.Items.Add("Ecuador"); cboCountry.Items.Add("Egypt"); cboCountry.Items.Add("Egypt"); cboCountry.Items.Add("El Salvador"); cboCountry.Items.Add("Equatorial Guinea"); cboCountry.Items.Add("Eritrea"); cboCountry.Items.Add("Estonia"); cboCountry.Items.Add("Ethiopia"); cboCountry.Items.Add("Falkland Islands"); cboCountry.Items.Add("Fiji"); cboCountry.Items.Add("Finland"); cboCountry.Items.Add("France"); cboCountry.Items.Add("French Guiana"); cboCountry.Items.Add("French Polynesia"); cboCountry.Items.Add("Gabon"); cboCountry.Items.Add("Gambia"); cboCountry.Items.Add("Georgia"); cboCountry.Items.Add("Germany"); cboCountry.Items.Add("Ghana"); cboCountry.Items.Add("Gibraltar"); cboCountry.Items.Add("Greece"); cboCountry.Items.Add("Greenland"); cboCountry.Items.Add("Grenada"); cboCountry.Items.Add("Guadeloupe"); cboCountry.Items.Add("Guam"); cboCountry.Items.Add("Guatemala"); cboCountry.Items.Add("Guinea"); cboCountry.Items.Add("Guinea-Bissau"); cboCountry.Items.Add("Guyana"); cboCountry.Items.Add("Haiti"); cboCountry.Items.Add("Honduras"); cboCountry.Items.Add("Hungary"); cboCountry.Items.Add("Iceland"); cboCountry.Items.Add("India"); cboCountry.Items.Add("Indonesia"); cboCountry.Items.Add("Iran"); cboCountry.Items.Add("Iraq"); cboCountry.Items.Add("Ireland"); cboCountry.Items.Add("Israel"); cboCountry.Items.Add("Italy"); cboCountry.Items.Add("Jamaica"); cboCountry.Items.Add("Japan"); cboCountry.Items.Add("Jordan"); cboCountry.Items.Add("Kazakhstan"); cboCountry.Items.Add("Kenya"); cboCountry.Items.Add("Kiribati"); cboCountry.Items.Add("Kosovo"); cboCountry.Items.Add("Kuwait"); cboCountry.Items.Add("Kyrgyzstan"); cboCountry.Items.Add("Laos"); cboCountry.Items.Add("Latvia"); cboCountry.Items.Add("Lebanon"); cboCountry.Items.Add("Lesotho"); cboCountry.Items.Add("Liberia"); cboCountry.Items.Add("Libya"); cboCountry.Items.Add("Liechtenstein"); cboCountry.Items.Add("Lithuania"); cboCountry.Items.Add("Luxembourg"); cboCountry.Items.Add("Macau"); cboCountry.Items.Add("Macedonia"); cboCountry.Items.Add("Madagascar"); cboCountry.Items.Add("Malawi"); cboCountry.Items.Add("Malaysia"); cboCountry.Items.Add("Maldives"); cboCountry.Items.Add("Mali"); cboCountry.Items.Add("Malta"); cboCountry.Items.Add("Marshall Islands"); cboCountry.Items.Add("Martinique"); cboCountry.Items.Add("Mauritania"); cboCountry.Items.Add("Mauritius"); cboCountry.Items.Add("Mexico"); cboCountry.Items.Add("Mexico"); cboCountry.Items.Add("Micronesia"); cboCountry.Items.Add("Moldova"); cboCountry.Items.Add("Monaco"); cboCountry.Items.Add("Mongolia"); cboCountry.Items.Add("Montenegro"); cboCountry.Items.Add("Montserrat"); cboCountry.Items.Add("Morocco"); cboCountry.Items.Add("Mozambique"); cboCountry.Items.Add("Myanmar"); cboCountry.Items.Add("Namibia"); cboCountry.Items.Add("Nauru"); cboCountry.Items.Add("Nepal"); cboCountry.Items.Add("Netherlands"); cboCountry.Items.Add("Netherlands Antilles"); cboCountry.Items.Add("New Caledonia"); cboCountry.Items.Add("New Zealand"); cboCountry.Items.Add("Nicaragua"); cboCountry.Items.Add("Niger"); cboCountry.Items.Add("Nigeria"); cboCountry.Items.Add("North Korea"); cboCountry.Items.Add("Northern Mariana Islands"); cboCountry.Items.Add("Norway"); cboCountry.Items.Add("Oman"); cboCountry.Items.Add("Pakistan"); cboCountry.Items.Add("Palau"); cboCountry.Items.Add("Palestine"); cboCountry.Items.Add("Panama"); cboCountry.Items.Add("Papua New Guinea"); cboCountry.Items.Add("Paraguay"); cboCountry.Items.Add("Peru"); cboCountry.Items.Add("Philippines"); cboCountry.Items.Add("Pitcairn Islands"); cboCountry.Items.Add("Poland"); cboCountry.Items.Add("Portugal"); cboCountry.Items.Add("Puerto Rico"); cboCountry.Items.Add("Qatar"); cboCountry.Items.Add("Republic of the Congo"); cboCountry.Items.Add("Romania"); cboCountry.Items.Add("Russia"); cboCountry.Items.Add("Rwanda"); cboCountry.Items.Add("San Marino"); cboCountry.Items.Add("Sao Tome and Principe"); cboCountry.Items.Add("Saudi Arabia"); cboCountry.Items.Add("Senegal"); cboCountry.Items.Add("Serbia"); cboCountry.Items.Add("Seychelles"); cboCountry.Items.Add("Sierra Leone"); cboCountry.Items.Add("Singapore"); cboCountry.Items.Add("Slovakia"); cboCountry.Items.Add("Slovenia"); cboCountry.Items.Add("Solomon Islands"); cboCountry.Items.Add("Somalia"); cboCountry.Items.Add("South Africa"); cboCountry.Items.Add("South Korea"); cboCountry.Items.Add("Spain"); cboCountry.Items.Add("Sri Lanka"); cboCountry.Items.Add("St. Kitts and Nevis"); cboCountry.Items.Add("St. Lucia"); cboCountry.Items.Add("St. Vincent and the Grenadines"); cboCountry.Items.Add("Sudan"); cboCountry.Items.Add("Suriname"); cboCountry.Items.Add("Swaziland"); cboCountry.Items.Add("Sweden"); cboCountry.Items.Add("Switzerland"); cboCountry.Items.Add("Syria"); cboCountry.Items.Add("Taiwan"); cboCountry.Items.Add("Tajikistan"); cboCountry.Items.Add("Tanzania"); cboCountry.Items.Add("Thailand"); cboCountry.Items.Add("Tibet"); cboCountry.Items.Add("Togo"); cboCountry.Items.Add("Tonga"); cboCountry.Items.Add("Trinidad and Tobago"); cboCountry.Items.Add("Tunisia"); cboCountry.Items.Add("Turkey"); cboCountry.Items.Add("Turkey"); cboCountry.Items.Add("Turkey"); cboCountry.Items.Add("Turkmenistan"); cboCountry.Items.Add("Turks and Caicos Islands"); cboCountry.Items.Add("Tuvalu"); cboCountry.Items.Add("U.S. Virgin Islands"); cboCountry.Items.Add("Uganda"); cboCountry.Items.Add("Ukraine"); cboCountry.Items.Add("United Arab Emirates"); cboCountry.Items.Add("United Kingdom"); cboCountry.Items.Add("United States"); cboCountry.Items.Add("Uruguay"); cboCountry.Items.Add("Uzbekistan"); cboCountry.Items.Add("Vanuatu"); cboCountry.Items.Add("Venezuela"); cboCountry.Items.Add("Vietnam"); cboCountry.Items.Add("Western Sahara"); cboCountry.Items.Add("Western Samoa"); cboCountry.Items.Add("Yemen"); cboCountry.Items.Add("Zambia"); cboCountry.Items.Add("Zimbabwe"); cboCountry.SelectedIndex = 0; #endregion } private void cmdOK_Click(object sender, System.EventArgs e) { txtFirstName.Text = txtFirstName.Text.Trim(); txtLastName.Text = txtLastName.Text.Trim(); txtEmail.Text = txtEmail.Text.Trim(); txtPassword.Text = txtPassword.Text.Trim(); if (txtFirstName.Text == string.Empty) { MessageBox.Show("The first name is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (txtLastName.Text == string.Empty) { MessageBox.Show("The last name is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (cboCountry.SelectedIndex == 0) { MessageBox.Show("The country is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (txtEmail.Text == string.Empty) { MessageBox.Show("The email is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (txtPassword.Text == string.Empty) { MessageBox.Show("The password is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (txtPassword.Text != txtVerify.Text) { MessageBox.Show("The password must be verified.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var message = string.Empty; nHydrate.Generator.Common.nhydrateservice.MainService service = null; try { service = new nHydrate.Generator.Common.nhydrateservice.MainService(); service.Url = VersionHelper.SERVICE_URL; var document = new XmlDocument(); document.LoadXml("<a></a>"); XmlHelper.AddElement(document.DocumentElement, "firstname", txtFirstName.Text); XmlHelper.AddElement(document.DocumentElement, "lastname", txtLastName.Text); XmlHelper.AddElement(document.DocumentElement, "city", txtCity.Text); XmlHelper.AddElement(document.DocumentElement, "region", txtRegion.Text); XmlHelper.AddElement(document.DocumentElement, "postcode", txtPostalCode.Text); XmlHelper.AddElement(document.DocumentElement, "country", cboCountry.SelectedItem.ToString()); XmlHelper.AddElement(document.DocumentElement, "email", txtEmail.Text); XmlHelper.AddElement(document.DocumentElement, "premiumkey", txtPremium.Text); XmlHelper.AddElement(document.DocumentElement, "password", txtPassword.Text); XmlHelper.AddElement(document.DocumentElement, "machinekey", SecurityHelper.GetMachineID()); XmlHelper.AddElement(document.DocumentElement, "version", VersionHelper.GetCurrentVersion()); XmlHelper.AddElement(document.DocumentElement, "allowstats", chkStat.Checked.ToString().ToLower()); message = service.RegisterUser2(document.OuterXml); } catch (Exception ex) { MessageBox.Show("There was an error trying to register. Please visit the main nHydrate site to register: https://github.com/nHydrate/nHydrate.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!string.IsNullOrEmpty(message)) { MessageBox.Show(message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var key = string.Empty; try { key = service.GetKey(txtEmail.Text); } catch (Exception ex) { MessageBox.Show("There was an error trying to retrieve the key. Please visit the main nHydrate site to register: https://github.com/nHydrate/nHydrate.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //Validate premium key AddinAppData.Instance.PremiumValidated = false; if (!string.IsNullOrEmpty(txtPremium.Text)) { var result = service.VerifyPremiumKey(txtEmail.Text, txtPassword.Text, SecurityHelper.GetMachineID(), txtPremium.Text); if (string.IsNullOrEmpty(result)) { AddinAppData.Instance.PremiumValidated = true; MessageBox.Show("The premium key has been verified and applied. All application features have been enabled.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { //Display the reason for the error MessageBox.Show("An error has occurred while verifing your premium key. The failure reason is listed below.\n\n'" + result + "'", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } AddinAppData.Instance.Key = key; AddinAppData.Instance.PremiumKey = txtPremium.Text; AddinAppData.Instance.AllowStats = chkStat.Checked; AddinAppData.Instance.Save(); this.DialogResult = DialogResult.OK; this.Close(); } private void cmdCancel_Click(object sender, System.EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } private void cmdLogin_Click(object sender, System.EventArgs e) { try { nHydrate.Generator.Common.nhydrateservice.MainService service = null; service = new nHydrate.Generator.Common.nhydrateservice.MainService(); service.Url = VersionHelper.SERVICE_URL; if (service.AuthenticateUser2(txtLoginEMail.Text, txtLoginPassword.Text, SecurityHelper.GetMachineID())) { AddinAppData.Instance.PremiumValidated = false; if (!string.IsNullOrEmpty(txtPremium.Text)) { var result = service.VerifyPremiumKey(txtLoginEMail.Text, txtLoginPassword.Text, SecurityHelper.GetMachineID(), txtPremium.Text); if (string.IsNullOrEmpty(result)) { AddinAppData.Instance.PremiumValidated = true; MessageBox.Show("The premium key has been verified and applied. All application features have been enabled.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { //Display the reason for the error MessageBox.Show("An error has occurred while verifing your premium key. The failure reason is listed below.\n\n'" + result + "'", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } MessageBox.Show("The login has been validated. Your machine has been verified.", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); service.ResetStatistics(txtLoginEMail.Text, chkStat.Checked); var key = service.GetKey(txtLoginEMail.Text); AddinAppData.Instance.Key = key; AddinAppData.Instance.PremiumKey = txtPremium.Text; AddinAppData.Instance.AllowStats = chkStat.Checked; AddinAppData.Instance.Save(); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("The login could not be validated.", "Invalid Login!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("There was an error trying to register. Please visit the main nHydrate site to register: http://www.nHydrate.org.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } private void optLogin_CheckedChanged(object sender, System.EventArgs e) { this.SetupScreen(); } private void optRegistration_CheckedChanged(object sender, System.EventArgs e) { this.SetupScreen(); } private void SetupScreen() { grpLogin.Location = grpRegister.Location; grpLogin.Width = grpRegister.Width; grpLogin.Visible = optLogin.Checked; grpRegister.Visible = !optLogin.Checked; } private void pictureBox1_Click(object sender, System.EventArgs e) { System.Diagnostics.Process.Start("http://www.linkedin.com/groups?gid=2401073"); } private void pictureBox2_Click(object sender, System.EventArgs e) { System.Diagnostics.Process.Start("https://github.com/nHydrate/nHydrate"); } } }
48.411765
224
0.554808
[ "MIT" ]
mtgibbs/nHydrate
Source/nHydrate.DslPackage/Forms/RegistrationForm.cs
23,044
C#
using EDlib.Platform; using System; using System.Runtime.Serialization; namespace EDlib { /// <summary>Represents errors from an API.</summary> [Preserve(AllMembers = true)] [Serializable] public class APIException : Exception { /// <summary>The error code from the API if available.</summary> public int? StatusCode { get; } /// <summary>Initializes a new instance of the <see cref="APIException" /> class.</summary> public APIException() { } /// <summary>Initializes a new instance of the <see cref="APIException" /> class with a specified error message.</summary> /// <param name="message">The message that describes the error.</param> public APIException(string message) : base(message) { } /// <summary>Initializes a new instance of the <see cref="APIException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary> /// <param name="message">The error message that explains the reason for the exception.</param> /// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param> public APIException(string message, Exception innerException) : base(message, innerException) { } /// <summary>Initializes a new instance of the <see cref="APIException" /> class with serialised data.</summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo">SerializationInfo</see> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext">StreamingContext</see> that contains contextual information about the source or destination.</param> protected APIException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// <summary>Initializes a new instance of the <see cref="APIException" /> class with a specified error message and error code.</summary> /// <param name="message">The message that describes the error.</param> /// <param name="code">The error code from the API.</param> public APIException(string message, int? code) : base(message) { StatusCode = code; } /// <summary>Initializes a new instance of the <see cref="APIException" /> class with a specified error message, error code and a reference to the inner exception that is the cause of this exception.</summary> /// <param name="message">The error message that explains the reason for the exception.</param> /// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param> /// <param name="code">The error code from the API.</param> public APIException(string message, Exception innerException, int? code) : base(message, innerException) { StatusCode = code; } } }
62.52
217
0.692258
[ "MIT" ]
irongut/EDlib
src/EDlib/Exceptions/APIException.cs
3,128
C#
using System; using System.Runtime.InteropServices; using System.Security; namespace NitraLibSodium { public unsafe partial class Utils { public partial struct __Internal { [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_memzero")] internal static extern void SodiumMemzero(global::System.IntPtr pnt, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_stackzero")] internal static extern void SodiumStackzero(ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_memcmp")] internal static extern int SodiumMemcmp(global::System.IntPtr b1_, global::System.IntPtr b2_, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_compare")] internal static extern int SodiumCompare(byte* b1_, byte* b2_, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_is_zero")] internal static extern int SodiumIsZero(byte* n, ulong nlen); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_increment")] internal static extern void SodiumIncrement(byte* n, ulong nlen); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_add")] internal static extern void SodiumAdd(byte* a, byte* b, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_bin2hex")] internal static extern sbyte* SodiumBin2hex(sbyte* hex, ulong hex_maxlen, byte* bin, ulong bin_len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_hex2bin")] internal static extern int SodiumHex2bin(byte* bin, ulong bin_maxlen, [MarshalAs(UnmanagedType.LPStr)] string hex, ulong hex_len, [MarshalAs(UnmanagedType.LPStr)] string ignore, ulong* bin_len, sbyte** hex_end); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_base64_encoded_len")] internal static extern ulong SodiumBase64EncodedLen(ulong bin_len, int variant); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_bin2base64")] internal static extern sbyte* SodiumBin2base64(sbyte* b64, ulong b64_maxlen, byte* bin, ulong bin_len, int variant); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_base642bin")] internal static extern int SodiumBase642bin(byte* bin, ulong bin_maxlen, [MarshalAs(UnmanagedType.LPStr)] string b64, ulong b64_len, [MarshalAs(UnmanagedType.LPStr)] string ignore, ulong* bin_len, sbyte** b64_end, int variant); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_mlock")] internal static extern int SodiumMlock(global::System.IntPtr addr, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_munlock")] internal static extern int SodiumMunlock(global::System.IntPtr addr, ulong len); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_malloc")] internal static extern global::System.IntPtr SodiumMalloc(ulong size); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_allocarray")] internal static extern global::System.IntPtr SodiumAllocarray(ulong count, ulong size); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_free")] internal static extern void SodiumFree(global::System.IntPtr ptr); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_mprotect_noaccess")] internal static extern int SodiumMprotectNoaccess(global::System.IntPtr ptr); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_mprotect_readonly")] internal static extern int SodiumMprotectReadonly(global::System.IntPtr ptr); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_mprotect_readwrite")] internal static extern int SodiumMprotectReadwrite(global::System.IntPtr ptr); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_pad")] internal static extern int SodiumPad(ulong* padded_buflen_p, byte* buf, ulong unpadded_buflen, ulong blocksize, ulong max_buflen); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "sodium_unpad")] internal static extern int SodiumUnpad(ulong* unpadded_buflen_p, byte* buf, ulong padded_buflen, ulong blocksize); [SuppressUnmanagedCodeSecurity] [DllImport("libsodium", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl, EntryPoint = "_sodium_alloc_init")] internal static extern int SodiumAllocInit(); } public static void SodiumMemzero(global::System.IntPtr pnt, ulong len) { __Internal.SodiumMemzero(pnt, len); } public static void SodiumStackzero(ulong len) { __Internal.SodiumStackzero(len); } public static int SodiumMemcmp(global::System.IntPtr b1_, global::System.IntPtr b2_, ulong len) { var __ret = __Internal.SodiumMemcmp(b1_, b2_, len); return __ret; } public static int SodiumCompare(byte[] b1_, byte[] b2_, ulong len) { var __ret = __Internal.SodiumCompare(MarshalHelper.ByteArrayToIntPtr(b1_), MarshalHelper.ByteArrayToIntPtr(b2_), len); return __ret; } public static int SodiumIsZero(byte[] n, ulong nlen) { var __ret = __Internal.SodiumIsZero(MarshalHelper.ByteArrayToIntPtr(n), nlen); return __ret; } public static void SodiumIncrement(byte[] n, ulong nlen) { __Internal.SodiumIncrement(MarshalHelper.ByteArrayToIntPtr(n), nlen); } public static void SodiumAdd(byte[] a, byte[] b, ulong len) { __Internal.SodiumAdd(MarshalHelper.ByteArrayToIntPtr(a), MarshalHelper.ByteArrayToIntPtr(b), len); } public static sbyte* SodiumBin2hex(sbyte[] hex, ulong hex_maxlen, byte[] bin, ulong bin_len) { var __ret = __Internal.SodiumBin2hex(MarshalHelper.SByteArrayToIntPtr(hex), hex_maxlen, MarshalHelper.ByteArrayToIntPtr(bin), bin_len); return __ret; } public static int SodiumHex2bin(byte[] bin, ulong bin_maxlen, string hex, ulong hex_len, string ignore, ref ulong bin_len, sbyte[] hex_end) { fixed (ulong* __refParamPtr5 = &bin_len) { var __arg5 = __refParamPtr5; var __ret = __Internal.SodiumHex2bin(MarshalHelper.ByteArrayToIntPtr(bin), bin_maxlen, hex, hex_len, ignore, __arg5, MarshalHelper.SByteArrayToDoubleIntPtr(hex_end)); return __ret; } } public static ulong SodiumBase64EncodedLen(ulong bin_len, int variant) { var __ret = __Internal.SodiumBase64EncodedLen(bin_len, variant); return __ret; } public static sbyte* SodiumBin2base64(sbyte[] b64, ulong b64_maxlen, byte[] bin, ulong bin_len, int variant) { var __ret = __Internal.SodiumBin2base64(MarshalHelper.SByteArrayToIntPtr(b64), b64_maxlen, MarshalHelper.ByteArrayToIntPtr(bin), bin_len, variant); return __ret; } public static int SodiumBase642bin(byte[] bin, ulong bin_maxlen, string b64, ulong b64_len, string ignore, ref ulong bin_len, sbyte[] b64_end, int variant) { fixed (ulong* __refParamPtr5 = &bin_len) { var __arg5 = __refParamPtr5; var __ret = __Internal.SodiumBase642bin(MarshalHelper.ByteArrayToIntPtr(bin), bin_maxlen, b64, b64_len, ignore, __arg5, MarshalHelper.SByteArrayToDoubleIntPtr(b64_end), variant); return __ret; } } public static int SodiumMlock(global::System.IntPtr addr, ulong len) { var __ret = __Internal.SodiumMlock(addr, len); return __ret; } public static int SodiumMunlock(global::System.IntPtr addr, ulong len) { var __ret = __Internal.SodiumMunlock(addr, len); return __ret; } public static global::System.IntPtr SodiumMalloc(ulong size) { var __ret = __Internal.SodiumMalloc(size); return __ret; } public static global::System.IntPtr SodiumAllocarray(ulong count, ulong size) { var __ret = __Internal.SodiumAllocarray(count, size); return __ret; } public static void SodiumFree(global::System.IntPtr ptr) { __Internal.SodiumFree(ptr); } public static int SodiumMprotectNoaccess(global::System.IntPtr ptr) { var __ret = __Internal.SodiumMprotectNoaccess(ptr); return __ret; } public static int SodiumMprotectReadonly(global::System.IntPtr ptr) { var __ret = __Internal.SodiumMprotectReadonly(ptr); return __ret; } public static int SodiumMprotectReadwrite(global::System.IntPtr ptr) { var __ret = __Internal.SodiumMprotectReadwrite(ptr); return __ret; } public static int SodiumPad(ref ulong padded_buflen_p, byte[] buf, ulong unpadded_buflen, ulong blocksize, ulong max_buflen) { fixed (ulong* __refParamPtr0 = &padded_buflen_p) { var __arg0 = __refParamPtr0; var __ret = __Internal.SodiumPad(__arg0, MarshalHelper.ByteArrayToIntPtr(buf), unpadded_buflen, blocksize, max_buflen); return __ret; } } public static int SodiumUnpad(ref ulong unpadded_buflen_p, byte[] buf, ulong padded_buflen, ulong blocksize) { fixed (ulong* __refParamPtr0 = &unpadded_buflen_p) { var __arg0 = __refParamPtr0; var __ret = __Internal.SodiumUnpad(__arg0, MarshalHelper.ByteArrayToIntPtr(buf), padded_buflen, blocksize); return __ret; } } public static int SodiumAllocInit() { var __ret = __Internal.SodiumAllocInit(); return __ret; } } }
48.743682
240
0.643164
[ "MIT" ]
nitrachain/NitraLibSodium
NitraLibSodium/Utils.cs
13,504
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace src.Controllers { [ApiController] [Route("[controller]")] public class WeatherForecastController : ControllerBase { private static readonly string[] Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; private readonly ILogger<WeatherForecastController> _logger; public WeatherForecastController(ILogger<WeatherForecastController> logger) { _logger = logger; } [HttpGet] public IEnumerable<WeatherForecast> Get() { var rng = new Random(); return Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), TemperatureC = rng.Next(-20, 55), Summary = Summaries[rng.Next(Summaries.Length)] }) .ToArray(); } } }
29.35
111
0.577513
[ "MIT" ]
robertoosantos/ConfigurableAPI
src/Controllers/WeatherForecastController.cs
1,176
C#
/* Copyright (C) 2008, 2009 Siarhei Novik (snovik@gmail.com) This file is part of QLNet Project https://github.com/amaggiulli/qlnet QLNet is free software: you can redistribute it and/or modify it under the terms of the QLNet license. You should have received a copy of the license along with this program; if not, license is available at <https://github.com/amaggiulli/QLNet/blob/develop/LICENSE>. QLNet is a based on QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ The QuantLib license is available online at http://quantlib.org/license.shtml. 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 license for more details. */ using System; using System.Collections.Generic; namespace QLNet { //! %Forward-rate term structure /*! This abstract class acts as an adapter to YieldTermStructure allowing the programmer to implement only the <tt>forwardImpl(Time)</tt> method in derived classes. Zero yields and discounts are calculated from forwards. Forward rates are assumed to be annual continuous compounding. \ingroup yieldtermstructures */ public abstract class ForwardRateStructure : YieldTermStructure { #region Constructors protected ForwardRateStructure(DayCounter dc = null, List<Handle<Quote>> jumps = null, List<Date> jumpDates = null) : base(dc, jumps, jumpDates) {} protected ForwardRateStructure(Date refDate, Calendar cal = null, DayCounter dc = null, List<Handle<Quote>> jumps = null, List<Date> jumpDates = null) : base(refDate, cal, dc, jumps, jumpDates) {} protected ForwardRateStructure(int settlDays, Calendar cal, DayCounter dc = null, List<Handle<Quote>> jumps = null, List<Date> jumpDates = null) : base(settlDays, cal, dc, jumps, jumpDates) {} #endregion #region Calculations // These methods must be implemented in derived classes to // perform the actual calculations. When they are called, // range check has already been performed; therefore, they // must assume that extrapolation is required. //! instantaneous forward-rate calculation protected abstract double forwardImpl(double s); /*! Returns the zero yield rate for the given date calculating it from the instantaneous forward rate \f$ f(t) \f$ as \f[ z(t) = \int_0^t f(\tau) d\tau \f] \warning This default implementation uses an highly inefficient and possibly wildly inaccurate numerical integration. Derived classes should override it if a more efficient implementation is available. */ protected virtual double zeroYieldImpl(double t) { if (t.IsEqual(0.0)) return forwardImpl(0.0); // implement smarter integration if plan to use the following code double sum = 0.5 * forwardImpl(0.0); int N = 1000; double dt = t / N; for (double i = dt; i < t; i += dt) sum += forwardImpl(i); sum += 0.5 * forwardImpl(t); return (sum * dt / t); } #endregion #region YieldTermStructure implementation /*! Returns the discount factor for the given date calculating it from the zero rate as \f$ d(t) = \exp \left( -z(t) t \right) \f$ */ protected override double discountImpl(double t) { if (t.IsEqual(0.0)) // this acts as a safe guard in cases where return 1.0; // zeroYieldImpl(0.0) would throw. double r = zeroYieldImpl(t); return Math.Exp(-r * t); } #endregion } }
37.584906
99
0.643323
[ "BSD-3-Clause" ]
SalmonTie/QLNet
src/QLNet/Termstructures/Yield/ForwardStructure.cs
3,986
C#
namespace SyncPro { using System; public enum TriggerScheduleInterval { Undefined, Hourly, Daily, Weekly, Monthly } [Flags] public enum WeeklyDays { None = 0x00, Sunday = 0x01, Monday = 0x02, Tuesday = 0x04, Wednesday = 0x08, Thursday = 0x10, Friday = 0x20, Saturday = 0x40, All = WeeklyDays.Sunday | WeeklyDays.Monday | WeeklyDays.Tuesday | WeeklyDays.Wednesday | WeeklyDays.Thursday | WeeklyDays.Friday | WeeklyDays.Saturday } }
20.827586
78
0.541391
[ "MIT" ]
HighEncryption/SyncPro
SyncPro.Core/TriggerScheduleInterval.cs
604
C#
#pragma checksum "C:\git\NoteSystem\NetNotes.Ui.Blazor\Pages\Index.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0470d0a31d8e01cd88a6803e26589b23f5a818a9" // <auto-generated/> #pragma warning disable 1591 #pragma warning disable 0414 #pragma warning disable 0649 #pragma warning disable 0169 namespace NetNotes.Ui.Blazor.Pages { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; #nullable restore #line 1 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using System.Net.Http; #line default #line hidden #nullable disable #nullable restore #line 2 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.AspNetCore.Authorization; #line default #line hidden #nullable disable #nullable restore #line 3 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.AspNetCore.Components.Authorization; #line default #line hidden #nullable disable #nullable restore #line 4 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.AspNetCore.Components.Forms; #line default #line hidden #nullable disable #nullable restore #line 5 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.AspNetCore.Components.Routing; #line default #line hidden #nullable disable #nullable restore #line 6 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.AspNetCore.Components.Web; #line default #line hidden #nullable disable #nullable restore #line 7 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using Microsoft.JSInterop; #line default #line hidden #nullable disable #nullable restore #line 8 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.Ui.Blazor; #line default #line hidden #nullable disable #nullable restore #line 9 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.Ui.Blazor.Shared; #line default #line hidden #nullable disable #nullable restore #line 10 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.RazorComponents.Library; #line default #line hidden #nullable disable #nullable restore #line 11 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.Business; #line default #line hidden #nullable disable #nullable restore #line 12 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.Business.Elements; #line default #line hidden #nullable disable #nullable restore #line 13 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using NetNotes.Business.Elements.Interfaces; #line default #line hidden #nullable disable #nullable restore #line 14 "C:\git\NoteSystem\NetNotes.Ui.Blazor\_Imports.razor" using System.Drawing; #line default #line hidden #nullable disable [Microsoft.AspNetCore.Components.RouteAttribute("/")] public partial class Index : Microsoft.AspNetCore.Components.ComponentBase { #pragma warning disable 1998 protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { } #pragma warning restore 1998 #nullable restore #line 10 "C:\git\NoteSystem\NetNotes.Ui.Blazor\Pages\Index.razor" [Parameter] public string MusicString { get; set; } private Score _displayScore; protected override void OnAfterRender(bool firstRender) { base.OnAfterRender(firstRender); if (_displayScore == null) { _displayScore = ScoreReader.ParseFile("laetatus_sum.xml"); StateHasChanged(); } } #line default #line hidden #nullable disable [global::Microsoft.AspNetCore.Components.InjectAttribute] private MusicXmlScoreReader ScoreReader { get; set; } } } #pragma warning restore 1591
25.823129
157
0.76765
[ "MIT" ]
TimPurdum/NetNotes
NetNotes.Ui.Blazor/obj/Debug/netcoreapp3.1/RazorDeclaration/Pages/Index.razor.g.cs
3,796
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SoundEffect : MonoBehaviour { public AudioSource click; public AudioSource error; public AudioSource quiz; public enum SOUND_TYPE { PICK, ERROR, QUIZ }; public bool enable; // Start is called before the first frame update void Start() { enable = true; } // Update is called once per frame void Update() { } public void SetActive(bool active) { enable = active; } public void Play(SOUND_TYPE st) { if (!enable) return; switch (st) { case SOUND_TYPE.PICK: //if(!click.isPlaying) click.Play(); break; case SOUND_TYPE.ERROR: error.Play(); break; case SOUND_TYPE.QUIZ: quiz.Play(); break; default: Debug.LogError("Unkown sound type"); break; } } }
20.980392
52
0.514019
[ "BSD-3-Clause" ]
huzhanbo1996/The-Rocket-Launch-Eve
Assets/SoundEffect.cs
1,072
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 sagemaker-2017-07-24.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.SageMaker.Model { /// <summary> /// This is the response object from the DescribeTrial operation. /// </summary> public partial class DescribeTrialResponse : AmazonWebServiceResponse { private UserContext _createdBy; private DateTime? _creationTime; private string _displayName; private string _experimentName; private UserContext _lastModifiedBy; private DateTime? _lastModifiedTime; private TrialSource _source; private string _trialArn; private string _trialName; /// <summary> /// Gets and sets the property CreatedBy. /// <para> /// Who created the trial. /// </para> /// </summary> public UserContext CreatedBy { get { return this._createdBy; } set { this._createdBy = value; } } // Check to see if CreatedBy property is set internal bool IsSetCreatedBy() { return this._createdBy != null; } /// <summary> /// Gets and sets the property CreationTime. /// <para> /// When the trial was created. /// </para> /// </summary> public DateTime CreationTime { get { return this._creationTime.GetValueOrDefault(); } set { this._creationTime = value; } } // Check to see if CreationTime property is set internal bool IsSetCreationTime() { return this._creationTime.HasValue; } /// <summary> /// Gets and sets the property DisplayName. /// <para> /// The name of the trial as displayed. If <code>DisplayName</code> isn't specified, <code>TrialName</code> /// is displayed. /// </para> /// </summary> [AWSProperty(Min=1, Max=82)] public string DisplayName { get { return this._displayName; } set { this._displayName = value; } } // Check to see if DisplayName property is set internal bool IsSetDisplayName() { return this._displayName != null; } /// <summary> /// Gets and sets the property ExperimentName. /// <para> /// The name of the experiment the trial is part of. /// </para> /// </summary> [AWSProperty(Min=1, Max=82)] public string ExperimentName { get { return this._experimentName; } set { this._experimentName = value; } } // Check to see if ExperimentName property is set internal bool IsSetExperimentName() { return this._experimentName != null; } /// <summary> /// Gets and sets the property LastModifiedBy. /// <para> /// Who last modified the trial. /// </para> /// </summary> public UserContext LastModifiedBy { get { return this._lastModifiedBy; } set { this._lastModifiedBy = value; } } // Check to see if LastModifiedBy property is set internal bool IsSetLastModifiedBy() { return this._lastModifiedBy != null; } /// <summary> /// Gets and sets the property LastModifiedTime. /// <para> /// When the trial was last modified. /// </para> /// </summary> public DateTime LastModifiedTime { get { return this._lastModifiedTime.GetValueOrDefault(); } set { this._lastModifiedTime = value; } } // Check to see if LastModifiedTime property is set internal bool IsSetLastModifiedTime() { return this._lastModifiedTime.HasValue; } /// <summary> /// Gets and sets the property Source. /// <para> /// The Amazon Resource Name (ARN) of the source and, optionally, the job type. /// </para> /// </summary> public TrialSource Source { get { return this._source; } set { this._source = value; } } // Check to see if Source property is set internal bool IsSetSource() { return this._source != null; } /// <summary> /// Gets and sets the property TrialArn. /// <para> /// The Amazon Resource Name (ARN) of the trial. /// </para> /// </summary> [AWSProperty(Max=256)] public string TrialArn { get { return this._trialArn; } set { this._trialArn = value; } } // Check to see if TrialArn property is set internal bool IsSetTrialArn() { return this._trialArn != null; } /// <summary> /// Gets and sets the property TrialName. /// <para> /// The name of the trial. /// </para> /// </summary> [AWSProperty(Min=1, Max=82)] public string TrialName { get { return this._trialName; } set { this._trialName = value; } } // Check to see if TrialName property is set internal bool IsSetTrialName() { return this._trialName != null; } } }
29.200935
115
0.556569
[ "Apache-2.0" ]
Singh400/aws-sdk-net
sdk/src/Services/SageMaker/Generated/Model/DescribeTrialResponse.cs
6,249
C#
namespace Pegasus.DataStore.Documents { public class Vehicle : DocumentBase { public string Tsp { get; set; } // Transport service provider public string Vin { get; set; } // Vehicle identification number public VehicleDetails Details { get; set; } public Seat[] Seats { get; set; } } public class VehicleDetails { public string Make { get; set; } public string Model { get; set; } public string Year { get; set; } } }
29.411765
72
0.606
[ "MIT" ]
SatyKrish/Pegasus.Web
src/Pegasus/Pegasus.DataStore/Documents/Vehicle.cs
502
C#
using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.UI; using UI.Animation; namespace UI.InputTools { [RequireComponent(typeof(AnimatedScale), typeof(Button))] public class ExtendedButton : BaseExtendedSelectable<Button>, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler, IBeginDragHandler, IEndDragHandler, IDragHandler { [Header("Visuals")] [SerializeField] private AnimationCurve downCurve; [SerializeField] private AnimationCurve upCurve; private AnimatedScale _animScale; private Vector3 _desiredShrinkScale; private bool _hovering = false; [Header("Audio")] [SerializeField] private AudioClip _downClip; public AudioClip DownClip { get { return _downClip; } set { _downClip = value; } } [SerializeField] private AudioClip _releaseClip; public AudioClip UpClip { get { return _releaseClip; } set { _releaseClip = value; } } [Header("Actions")] public UnityEvent onPointerDown; public UnityEvent onPointerUp; /// <summary> /// A static reference is used to make sure only the most recently clicked button's callback /// is actually invoked after the animation delay /// </summary> private static Button _lastButtonClicked; public UnityEvent onClick { get { return Selectable.onClick; } } private UnityEvent _callback; private void Start() { _animScale = _animScale == null ? GetComponent<AnimatedScale>() : _animScale; _desiredShrinkScale = _animScale.newScale; _animScale.SetCurve(downCurve); Selectable.enabled = false; } protected override void OnEnableImplementation() { _animScale = _animScale == null ? GetComponent<AnimatedScale>() : _animScale; _animScale.SetCurve(downCurve); Selectable.enabled = false; } protected override void UpdateImplementation(){} public void OnPointerClick(PointerEventData data) { } public void OnPointerDown(PointerEventData data) { if(Selectable.IsInteractable()) { //data.Use(); _animScale.StopAnimation(); _animScale.SetCurve(downCurve); _animScale.newScale = _desiredShrinkScale; _animScale.StartAnimation(); // SoundManager.Instance.PlaySoundEffect(_downClip); if(onPointerDown != null) { onPointerDown.Invoke(); } } } public void OnPointerUp(PointerEventData data) { if(Selectable.IsInteractable()) { _lastButtonClicked = Selectable; // SoundManager.Instance.PlaySoundEffect(_releaseClip); // if we release our cursor elsewhere, we probably didnt mean to click, so we shouldn't do the callback // callback is also a member variable so that we don't execute like ten of them if you mash the button _callback = (_hovering) ? Selectable.onClick : null; _animScale.StopAnimation(); _animScale.SetCurve(upCurve); _animScale.newScale = Vector3.one; _animScale.StartAnimation(() => { if(_callback != null && _lastButtonClicked.Equals(Selectable) && Selectable.image.raycastTarget) { if(onPointerUp != null) { onPointerUp.Invoke(); } _callback.Invoke(); } _callback = null; }); } } public void OnPointerEnter(PointerEventData data) { _hovering = true; } public void OnPointerExit(PointerEventData data) { _hovering = false; } public void OnDrag(PointerEventData eventData) { } public void OnEndDrag(PointerEventData eventData) { } public void OnBeginDrag(PointerEventData eventData) { } } }
30.765101
221
0.557592
[ "MIT" ]
FomTarro/vts-heartrate
Assets/UI/Scripts/Animations/ExtendedButton.cs
4,586
C#
/* * TileDB Storage Platform API * * TileDB Storage Platform REST API * * The version of the OpenAPI document: 2.2.19 * * Generated by: https://github.com/openapitools/openapi-generator.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using TileDB.Cloud.Rest.Api; using TileDB.Cloud.Rest.Model; using TileDB.Cloud.Rest.Client; using System.Reflection; using Newtonsoft.Json; namespace TileDB.Cloud.Rest.Test { /// <summary> /// Class for testing AttributeBufferHeader /// </summary> /// <remarks> /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). /// Please update the test case below to test the model. /// </remarks> public class AttributeBufferHeaderTests { // TODO uncomment below to declare an instance variable for AttributeBufferHeader //private AttributeBufferHeader instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of AttributeBufferHeader //instance = new AttributeBufferHeader(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of AttributeBufferHeader /// </summary> [Test] public void AttributeBufferHeaderInstanceTest() { // TODO uncomment below to test "IsInstanceOf" AttributeBufferHeader //Assert.IsInstanceOf(typeof(AttributeBufferHeader), instance); } /// <summary> /// Test the property 'Name' /// </summary> [Test] public void NameTest() { // TODO unit test for the property 'Name' } /// <summary> /// Test the property 'FixedLenBufferSizeInBytes' /// </summary> [Test] public void FixedLenBufferSizeInBytesTest() { // TODO unit test for the property 'FixedLenBufferSizeInBytes' } /// <summary> /// Test the property 'VarLenBufferSizeInBytes' /// </summary> [Test] public void VarLenBufferSizeInBytesTest() { // TODO unit test for the property 'VarLenBufferSizeInBytes' } } }
25.854167
99
0.59589
[ "MIT" ]
TileDB-Inc/TileDB-Cloud-CSharp
TileDB.Cloud.Rest/src/TileDB.Cloud.Rest.Test/Model/AttributeBufferHeaderTests.cs
2,482
C#
namespace Mindstorms.Core.Music._434 { public class Gisz7 : Note { public Gisz7(NoteType noteType = NoteType.Quarter) : base(noteType) { Name = "G#7/Ab7"; Frequency = 3277.13; WaveLength = 10.53; } } }
21.076923
75
0.525547
[ "MIT" ]
Mortens4444/LegoMindstromsEV3
Mindstorms.Core/Music/434/Gisz7.cs
274
C#
using Furion.ConfigurableOptions; namespace ApiTemplApiProject.CoreOptions { /// <summary> /// 刷新令牌设置 /// </summary> public sealed class RefreshTokenSettingOptions : IConfigurableOptions { /// <summary> /// 令牌过期时间(分钟) /// </summary> public int ExpiredTime { get; set; } = 43200; } }
21.3125
73
0.59824
[ "MIT" ]
LeoXionggg/SeaCodeLib
csharp/ProjectTemplate/ApiFurionTempl/ApiTemplApiProject.Core/Options/RefreshTokenSettingOptions.cs
375
C#
/* This file is a part of JustLogic product which is distributed under the BSD 3-clause "New" or "Revised" License Copyright (c) 2015. All rights reserved. Authors: Vladyslav Taranov. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of JustLogic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using JustLogic.Core; using System.Collections.Generic; using UnityEngine; [UnitMenu("Color/Op Addition")] [UnitFriendlyName("Color.Op Addition")] [UnitUsage(typeof(Color), HideExpressionInActionsList = true)] public class JLColorOpAddition : JLExpression { [Parameter(ExpressionType = typeof(Color))] public JLExpression A; [Parameter(ExpressionType = typeof(Color))] public JLExpression B; public override object GetAnyResult(IExecutionContext context) { return A.GetResult<Color>(context) + B.GetResult<Color>(context); } }
39.607143
79
0.775473
[ "BSD-3-Clause" ]
AqlaSolutions/JustLogic
Assets/JustLogicUnits/Generated/Color/JLColorOpAddition.cs
2,218
C#
using System.Collections.Generic; using RazzleServer.DataProvider.References; namespace RazzleServer.DataProvider.Cache { public sealed class CachedMobs { public Dictionary<int, MobReference> Data { get; set; } = new Dictionary<int, MobReference>(); } }
25.090909
102
0.731884
[ "MIT" ]
Bia10/RazzleServer
RazzleServer.DataProvider/Cache/CachedMobs.cs
278
C#
using UnityEngine; using System.Collections; public class bedController : MonoBehaviour { // Use this for initialization public Collider playerCollider; void OnTriggerEnter(Collider other) { if ( other.tag == "Player" ) { EventManager.TriggerEvent("SleepUI"); EventManager.TriggerEvent ("Pause"); } } }
20.125
44
0.726708
[ "MIT" ]
BigBroken/sLord
Assets/Scripts/GameObjects/bedController.cs
324
C#
// Copyright (c) 2020-2021 Ubisoft Entertainment // // 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 Sharpmake.Generators; using Sharpmake.Generators.FastBuild; using Sharpmake.Generators.VisualStudio; namespace Sharpmake { public static partial class Apple { [PlatformImplementation(Platform.ios, typeof(IPlatformDescriptor), typeof(IFastBuildCompilerSettings), typeof(IPlatformBff), typeof(IClangPlatformBff), typeof(IPlatformVcxproj), typeof(Project.Configuration.IConfigurationTasks))] public sealed partial class iOsPlatform : BaseApplePlatform { public override Platform SharpmakePlatform => Platform.ios; #region IPlatformDescriptor implementation. public override string SimplePlatformString => "iOS"; #endregion public override string BffPlatformDefine => "_IOS"; public override string CConfigName(Configuration conf) { return ".iosConfig"; } public override string CppConfigName(Configuration conf) { return ".iosppConfig"; } protected override void WriteCompilerExtraOptionsGeneral(IFileGenerator generator) { base.WriteCompilerExtraOptionsGeneral(generator); generator.Write(_compilerExtraOptionsGeneral); } public override void SelectCompilerOptions(IGenerationContext context) { base.SelectCompilerOptions(context); var options = context.Options; var cmdLineOptions = context.CommandLineOptions; var conf = context.Configuration; // Sysroot options["SDKRoot"] = "iphoneos"; cmdLineOptions["SDKRoot"] = $"-isysroot {XCodeDeveloperFolder}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"; Options.XCode.Compiler.SDKRoot customSdkRoot = Options.GetObject<Options.XCode.Compiler.SDKRoot>(conf); if (customSdkRoot != null) { options["SDKRoot"] = customSdkRoot.Value; cmdLineOptions["SDKRoot"] = $"-isysroot {customSdkRoot.Value}"; } // Target options["MacOSDeploymentTarget"] = FileGeneratorUtilities.RemoveLineTag; Options.XCode.Compiler.IPhoneOSDeploymentTarget iosDeploymentTarget = Options.GetObject<Options.XCode.Compiler.IPhoneOSDeploymentTarget>(conf); if (iosDeploymentTarget != null) { options["IPhoneOSDeploymentTarget"] = iosDeploymentTarget.MinimumVersion; cmdLineOptions["IPhoneOSDeploymentTarget"] = $"-target arm64-apple-ios{iosDeploymentTarget.MinimumVersion}"; } else { options["IPhoneOSDeploymentTarget"] = FileGeneratorUtilities.RemoveLineTag; cmdLineOptions["IPhoneOSDeploymentTarget"] = FileGeneratorUtilities.RemoveLineTag; } } public override void SelectLinkerOptions(IGenerationContext context) { base.SelectLinkerOptions(context); var options = context.Options; var cmdLineOptions = context.CommandLineOptions; var conf = context.Configuration; // Sysroot cmdLineOptions["SysLibRoot"] = $"-syslibroot {XCodeDeveloperFolder}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"; Options.XCode.Compiler.SDKRoot customSdkRoot = Options.GetObject<Options.XCode.Compiler.SDKRoot>(conf); if (customSdkRoot != null) cmdLineOptions["SysLibRoot"] = $"-isysroot {customSdkRoot.Value}"; } } } }
41.766355
159
0.624077
[ "Apache-2.0" ]
Cheaterdev/Sharpmake
Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/iOsPlatform.cs
4,469
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; namespace Azure.Analytics.Purview.Catalog { /// <summary> The PurviewTypes service client. </summary> public partial class PurviewTypes { /// <summary> The HTTP pipeline for sending and receiving REST requests and responses. </summary> public virtual HttpPipeline Pipeline { get; } private readonly string[] AuthorizationScopes = { "https://purview.azure.net/.default" }; private readonly TokenCredential _tokenCredential; private Uri endpoint; private readonly string apiVersion; private readonly ClientDiagnostics _clientDiagnostics; /// <summary> Initializes a new instance of PurviewTypes for mocking. </summary> protected PurviewTypes() { } /// <summary> Get the classification definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the classification. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetClassificationDefByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetClassificationDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetClassificationDefByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the classification definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the classification. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetClassificationDefByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetClassificationDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetClassificationDefByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetClassificationDefByGuid"/> and <see cref="GetClassificationDefByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the classification. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetClassificationDefByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/classificationdef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the classification definition by its name (unique). </summary> /// <param name="name"> The name of the classification. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetClassificationDefByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetClassificationDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetClassificationDefByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the classification definition by its name (unique). </summary> /// <param name="name"> The name of the classification. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetClassificationDefByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetClassificationDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetClassificationDefByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetClassificationDefByName"/> and <see cref="GetClassificationDefByNameAsync"/> operations. </summary> /// <param name="name"> The name of the classification. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetClassificationDefByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/classificationdef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the Entity definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the entity. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetEntityDefinitionByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEntityDefinitionByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEntityDefinitionByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the Entity definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the entity. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetEntityDefinitionByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEntityDefinitionByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEntityDefinitionByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetEntityDefinitionByGuid"/> and <see cref="GetEntityDefinitionByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the entity. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetEntityDefinitionByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/entitydef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the entity definition by its name (unique). </summary> /// <param name="name"> The name of the entity. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetEntityDefinitionByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEntityDefinitionByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEntityDefinitionByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the entity definition by its name (unique). </summary> /// <param name="name"> The name of the entity. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetEntityDefinitionByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEntityDefinitionByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEntityDefinitionByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetEntityDefinitionByName"/> and <see cref="GetEntityDefinitionByNameAsync"/> operations. </summary> /// <param name="name"> The name of the entity. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetEntityDefinitionByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/entitydef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the enum definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the enum. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetEnumDefByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEnumDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEnumDefByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the enum definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the enum. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetEnumDefByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEnumDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEnumDefByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetEnumDefByGuid"/> and <see cref="GetEnumDefByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the enum. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetEnumDefByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/enumdef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the enum definition by its name (unique). </summary> /// <param name="name"> The name of the enum. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetEnumDefByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEnumDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEnumDefByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the enum definition by its name (unique). </summary> /// <param name="name"> The name of the enum. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetEnumDefByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetEnumDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetEnumDefByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetEnumDefByName"/> and <see cref="GetEnumDefByNameAsync"/> operations. </summary> /// <param name="name"> The name of the enum. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetEnumDefByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/enumdef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the relationship definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the relationship. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetRelationshipDefByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetRelationshipDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetRelationshipDefByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the relationship definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the relationship. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetRelationshipDefByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetRelationshipDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetRelationshipDefByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetRelationshipDefByGuid"/> and <see cref="GetRelationshipDefByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the relationship. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetRelationshipDefByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/relationshipdef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the relationship definition by its name (unique). </summary> /// <param name="name"> The name of the relationship. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetRelationshipDefByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetRelationshipDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetRelationshipDefByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the relationship definition by its name (unique). </summary> /// <param name="name"> The name of the relationship. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetRelationshipDefByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetRelationshipDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetRelationshipDefByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetRelationshipDefByName"/> and <see cref="GetRelationshipDefByNameAsync"/> operations. </summary> /// <param name="name"> The name of the relationship. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetRelationshipDefByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/relationshipdef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the struct definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the struct. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetStructDefByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetStructDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetStructDefByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the struct definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the struct. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetStructDefByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetStructDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetStructDefByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetStructDefByGuid"/> and <see cref="GetStructDefByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the struct. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetStructDefByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/structdef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the struct definition by its name (unique). </summary> /// <param name="name"> The name of the struct. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetStructDefByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetStructDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetStructDefByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the struct definition by its name (unique). </summary> /// <param name="name"> The name of the struct. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetStructDefByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetStructDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetStructDefByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetStructDefByName"/> and <see cref="GetStructDefByNameAsync"/> operations. </summary> /// <param name="name"> The name of the struct. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetStructDefByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/structdef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the type definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetTypeDefinitionByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the type definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetTypeDefinitionByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetTypeDefinitionByGuid"/> and <see cref="GetTypeDefinitionByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the type. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetTypeDefinitionByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedef/guid/", false); uri.AppendPath(guid, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the type definition by its name (unique). </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetTypeDefinitionByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the type definition by its name (unique). </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetTypeDefinitionByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetTypeDefinitionByName"/> and <see cref="GetTypeDefinitionByNameAsync"/> operations. </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetTypeDefinitionByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedef/name/", false); uri.AppendPath(name, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Delete API for type identified by its name. </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> DeleteTypeByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateDeleteTypeByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.DeleteTypeByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 204: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Delete API for type identified by its name. </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response DeleteTypeByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateDeleteTypeByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.DeleteTypeByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 204: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="DeleteTypeByName"/> and <see cref="DeleteTypeByNameAsync"/> operations. </summary> /// <param name="name"> The name of the type. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateDeleteTypeByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedef/name/", false); uri.AppendPath(name, true); request.Uri = uri; return message; } /// <summary> Get all type definitions in Atlas in bulk. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetAllTypeDefinitionsAsync(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetAllTypeDefinitionsRequest(includeTermTemplate, type, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetAllTypeDefinitions"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get all type definitions in Atlas in bulk. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetAllTypeDefinitions(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetAllTypeDefinitionsRequest(includeTermTemplate, type, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetAllTypeDefinitions"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetAllTypeDefinitions"/> and <see cref="GetAllTypeDefinitionsAsync"/> operations. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetAllTypeDefinitionsRequest(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedefs", false); if (includeTermTemplate != null) { uri.AppendQuery("includeTermTemplate", includeTermTemplate.Value, true); } if (type != null) { uri.AppendQuery("type", type, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> /// Create all atlas type definitions in bulk, only new definitions will be created. /// Any changes to the existing definitions will be discarded. /// </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> CreateTypeDefinitionsAsync(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateCreateTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.CreateTypeDefinitions"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> /// Create all atlas type definitions in bulk, only new definitions will be created. /// Any changes to the existing definitions will be discarded. /// </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response CreateTypeDefinitions(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateCreateTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.CreateTypeDefinitions"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="CreateTypeDefinitions"/> and <see cref="CreateTypeDefinitionsAsync"/> operations. </summary> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateCreateTypeDefinitionsRequest(RequestContent requestBody, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedefs", false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); request.Content = requestBody; return message; } /// <summary> Update all types in bulk, changes detected in the type definitions would be persisted. </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> UpdateAtlasTypeDefinitionsAsync(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateUpdateAtlasTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.UpdateAtlasTypeDefinitions"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Update all types in bulk, changes detected in the type definitions would be persisted. </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response UpdateAtlasTypeDefinitions(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateUpdateAtlasTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.UpdateAtlasTypeDefinitions"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="UpdateAtlasTypeDefinitions"/> and <see cref="UpdateAtlasTypeDefinitionsAsync"/> operations. </summary> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateUpdateAtlasTypeDefinitionsRequest(RequestContent requestBody, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedefs", false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); request.Content = requestBody; return message; } /// <summary> Delete API for all types in bulk. </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> DeleteTypeDefinitionsAsync(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateDeleteTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.DeleteTypeDefinitions"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 204: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Delete API for all types in bulk. </summary> /// <remarks> /// Schema for <c>Request Body</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>classificationDefs</term> /// <term>AtlasClassificationDef[]</term> /// <term></term> /// <term> An array of classification definitions. </term> /// </item> /// <item> /// <term>entityDefs</term> /// <term>AtlasEntityDef[]</term> /// <term></term> /// <term> An array of entity definitions. </term> /// </item> /// <item> /// <term>enumDefs</term> /// <term>AtlasEnumDef[]</term> /// <term></term> /// <term> An array of enum definitions. </term> /// </item> /// <item> /// <term>relationshipDefs</term> /// <term>AtlasRelationshipDef[]</term> /// <term></term> /// <term> An array of relationship definitions. </term> /// </item> /// <item> /// <term>structDefs</term> /// <term>AtlasStructDef[]</term> /// <term></term> /// <term> An array of struct definitions. </term> /// </item> /// <item> /// <term>termTemplateDefs</term> /// <term>TermTemplateDef[]</term> /// <term></term> /// <term> An array of term template definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasClassificationDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>entityTypes</term> /// <term>string[]</term> /// <term></term> /// <term> /// Specifying a list of entityType names in the classificationDef, ensures that classifications can /// only be applied to those entityTypes. /// &lt;ul&gt; /// &lt;li&gt;Any subtypes of the entity types inherit the restriction&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes inherit the parents entityTypes restrictions&lt;/li&gt; /// &lt;li&gt;Any classificationDef subtypes can further restrict the parents entityTypes restrictions by specifying a subset of the entityTypes&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are no parent restrictions means there are no restrictions&lt;/li&gt; /// &lt;li&gt;An empty entityTypes list when there are parent restrictions means that the subtype picks up the parents restrictions&lt;/li&gt; /// &lt;li&gt;If a list of entityTypes are supplied, where one inherits from another, this will be rejected. This should encourage cleaner classificationsDefs&lt;/li&gt; /// &lt;/ul&gt;. /// </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// </list> /// Schema for <c>AtlasEntityDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>subTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of sub types. </term> /// </item> /// <item> /// <term>superTypes</term> /// <term>string[]</term> /// <term></term> /// <term> An array of super types. </term> /// </item> /// <item> /// <term>relationshipAttributeDefs</term> /// <term>AtlasRelationshipAttributeDef[]</term> /// <term></term> /// <term> An array of relationship attributes. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value. </term> /// </item> /// <item> /// <term>elementDefs</term> /// <term>AtlasEnumElementDef[]</term> /// <term></term> /// <term> An array of enum element definitions. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>endDef1</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>endDef2</term> /// <term>AtlasRelationshipEndDef</term> /// <term></term> /// <term> /// The relationshipEndDef represents an end of the relationship. The end of the relationship is defined by a type, an /// attribute name, cardinality and whether it is the container end of the relationship. /// </term> /// </item> /// <item> /// <term>relationshipCategory</term> /// <term>&quot;ASSOCIATION&quot; | &quot;AGGREGATION&quot; | &quot;COMPOSITION&quot;</term> /// <term></term> /// <term> /// The Relationship category determines the style of relationship around containment and lifecycle. /// UML terminology is used for the values. /// &lt;p&gt; /// ASSOCIATION is a relationship with no containment. &lt;br&gt; /// COMPOSITION and AGGREGATION are containment relationships. /// &lt;p&gt; /// The difference being in the lifecycles of the container and its children. In the COMPOSITION case, /// the children cannot exist without the container. For AGGREGATION, the life cycles /// of the container and children are totally independent. /// </term> /// </item> /// <item> /// <term>relationshipLabel</term> /// <term>string</term> /// <term></term> /// <term> The label of the relationship. </term> /// </item> /// </list> /// Schema for <c>AtlasStructDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// </list> /// Schema for <c>TermTemplateDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>attributeDefs</term> /// <term>AtlasAttributeDef[]</term> /// <term></term> /// <term> An array of attribute definitions. </term> /// </item> /// <item> /// <term>category</term> /// <term>&quot;PRIMITIVE&quot; | &quot;OBJECT_ID_TYPE&quot; | &quot;ENUM&quot; | &quot;STRUCT&quot; | &quot;CLASSIFICATION&quot; | &quot;ENTITY&quot; | &quot;ARRAY&quot; | &quot;MAP&quot; | &quot;RELATIONSHIP&quot; | &quot;TERM_TEMPLATE&quot;</term> /// <term></term> /// <term> The enum of type category. </term> /// </item> /// <item> /// <term>createTime</term> /// <term>number</term> /// <term></term> /// <term> The created time of the record. </term> /// </item> /// <item> /// <term>createdBy</term> /// <term>string</term> /// <term></term> /// <term> The user who created the record. </term> /// </item> /// <item> /// <term>dateFormatter</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the type definition. </term> /// </item> /// <item> /// <term>guid</term> /// <term>string</term> /// <term></term> /// <term> The GUID of the type definition. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the type definition. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the type definition. </term> /// </item> /// <item> /// <term>serviceType</term> /// <term>string</term> /// <term></term> /// <term> The service type. </term> /// </item> /// <item> /// <term>typeVersion</term> /// <term>string</term> /// <term></term> /// <term> The version of the type. </term> /// </item> /// <item> /// <term>updateTime</term> /// <term>number</term> /// <term></term> /// <term> The update time of the record. </term> /// </item> /// <item> /// <term>updatedBy</term> /// <term>string</term> /// <term></term> /// <term> The user who updated the record. </term> /// </item> /// <item> /// <term>version</term> /// <term>number</term> /// <term></term> /// <term> The version of the record. </term> /// </item> /// <item> /// <term>lastModifiedTS</term> /// <term>string</term> /// <term></term> /// <term> ETag for concurrency control. </term> /// </item> /// </list> /// Schema for <c>DateFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available locales. </term> /// </item> /// <item> /// <term>calendar</term> /// <term>number</term> /// <term></term> /// <term></term> /// </item> /// <item> /// <term>dateInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>dateTimeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>instance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>lenient</term> /// <term>boolean</term> /// <term></term> /// <term> Determines the leniency of the date format. </term> /// </item> /// <item> /// <term>numberFormat</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>timeInstance</term> /// <term>DateFormat</term> /// <term></term> /// <term> The date format. </term> /// </item> /// <item> /// <term>timeZone</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipEndDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the relationship end definition. </term> /// </item> /// <item> /// <term>isContainer</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is container. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship end definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the relationship end. </term> /// </item> /// </list> /// Schema for <c>AtlasAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// </list> /// Schema for <c>NumberFormat</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>availableLocales</term> /// <term>string[]</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>currency</term> /// <term>string</term> /// <term></term> /// <term> The currency. </term> /// </item> /// <item> /// <term>currencyInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>groupingUsed</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if grouping is used. </term> /// </item> /// <item> /// <term>instance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>integerInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>maximumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of fraction digits. </term> /// </item> /// <item> /// <term>maximumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The maximum of integer digits. </term> /// </item> /// <item> /// <term>minimumFractionDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of fraction digits. </term> /// </item> /// <item> /// <term>minimumIntegerDigits</term> /// <term>number</term> /// <term></term> /// <term> The minimum of integer digits. </term> /// </item> /// <item> /// <term>numberInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>parseIntegerOnly</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if only integer is parsed. </term> /// </item> /// <item> /// <term>percentInstance</term> /// <term>NumberFormat</term> /// <term></term> /// <term> The number format. </term> /// </item> /// <item> /// <term>roundingMode</term> /// <term>&quot;UP&quot; | &quot;DOWN&quot; | &quot;CEILING&quot; | &quot;FLOOR&quot; | &quot;HALF_UP&quot; | &quot;HALF_DOWN&quot; | &quot;HALF_EVEN&quot; | &quot;UNNECESSARY&quot;</term> /// <term></term> /// <term> The enum of rounding mode. </term> /// </item> /// </list> /// Schema for <c>TimeZone</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>dstSavings</term> /// <term>number</term> /// <term></term> /// <term> The value of the daylight saving time. </term> /// </item> /// <item> /// <term>id</term> /// <term>string</term> /// <term></term> /// <term> The ID of the timezone. </term> /// </item> /// <item> /// <term>availableIds</term> /// <term>string[]</term> /// <term></term> /// <term> An array of available IDs. </term> /// </item> /// <item> /// <term>default</term> /// <term>TimeZone</term> /// <term></term> /// <term> The timezone information. </term> /// </item> /// <item> /// <term>displayName</term> /// <term>string</term> /// <term></term> /// <term> The display name of the timezone. </term> /// </item> /// <item> /// <term>rawOffset</term> /// <term>number</term> /// <term></term> /// <term> The raw offset of the timezone. </term> /// </item> /// </list> /// Schema for <c>AtlasRelationshipAttributeDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>cardinality</term> /// <term>&quot;SINGLE&quot; | &quot;LIST&quot; | &quot;SET&quot;</term> /// <term></term> /// <term> single-valued attribute or multi-valued attribute. </term> /// </item> /// <item> /// <term>constraints</term> /// <term>AtlasConstraintDef[]</term> /// <term></term> /// <term> An array of constraints. </term> /// </item> /// <item> /// <term>defaultValue</term> /// <term>string</term> /// <term></term> /// <term> The default value of the attribute. </term> /// </item> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the attribute. </term> /// </item> /// <item> /// <term>includeInNotification</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is included in notification. </term> /// </item> /// <item> /// <term>isIndexable</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is indexable. </term> /// </item> /// <item> /// <term>isOptional</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is optional. </term> /// </item> /// <item> /// <term>isUnique</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it unique. </term> /// </item> /// <item> /// <term>name</term> /// <term>string</term> /// <term></term> /// <term> The name of the attribute. </term> /// </item> /// <item> /// <term>options</term> /// <term>Dictionary&lt;string, string&gt;</term> /// <term></term> /// <term> The options for the attribute. </term> /// </item> /// <item> /// <term>typeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the type. </term> /// </item> /// <item> /// <term>valuesMaxCount</term> /// <term>number</term> /// <term></term> /// <term> The maximum count of the values. </term> /// </item> /// <item> /// <term>valuesMinCount</term> /// <term>number</term> /// <term></term> /// <term> The minimum count of the values. </term> /// </item> /// <item> /// <term>isLegacyAttribute</term> /// <term>boolean</term> /// <term></term> /// <term> Determines if it is a legacy attribute. </term> /// </item> /// <item> /// <term>relationshipTypeName</term> /// <term>string</term> /// <term></term> /// <term> The name of the relationship type. </term> /// </item> /// </list> /// Schema for <c>AtlasEnumElementDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>description</term> /// <term>string</term> /// <term></term> /// <term> The description of the enum element definition. </term> /// </item> /// <item> /// <term>ordinal</term> /// <term>number</term> /// <term></term> /// <term> The ordinal of the enum element definition. </term> /// </item> /// <item> /// <term>value</term> /// <term>string</term> /// <term></term> /// <term> The value of the enum element definition. </term> /// </item> /// </list> /// Schema for <c>AtlasConstraintDef</c>: /// <list type="table"> /// <listeader> /// <term>Name</term> /// <term>Type</term> /// <term>Required</term> /// <term>Description</term> /// </listeader> /// <item> /// <term>params</term> /// <term>Dictionary&lt;string, AnyObject&gt;</term> /// <term></term> /// <term> The parameters of the constraint definition. </term> /// </item> /// <item> /// <term>type</term> /// <term>string</term> /// <term></term> /// <term> The type of the constraint. </term> /// </item> /// </list> /// </remarks> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response DeleteTypeDefinitions(RequestContent requestBody, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateDeleteTypeDefinitionsRequest(requestBody, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.DeleteTypeDefinitions"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 204: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="DeleteTypeDefinitions"/> and <see cref="DeleteTypeDefinitionsAsync"/> operations. </summary> /// <param name="requestBody"> The request body. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateDeleteTypeDefinitionsRequest(RequestContent requestBody, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedefs", false); request.Uri = uri; request.Headers.Add("Content-Type", "application/json"); request.Content = requestBody; return message; } /// <summary> List all type definitions returned as a list of minimal information header. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetTypeDefinitionHeadersAsync(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionHeadersRequest(includeTermTemplate, type, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionHeaders"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> List all type definitions returned as a list of minimal information header. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetTypeDefinitionHeaders(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTypeDefinitionHeadersRequest(includeTermTemplate, type, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTypeDefinitionHeaders"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetTypeDefinitionHeaders"/> and <see cref="GetTypeDefinitionHeadersAsync"/> operations. </summary> /// <param name="includeTermTemplate"> /// Whether include termtemplatedef when return all typedefs. /// This is always true when search filter type=term_template. /// </param> /// <param name="type"> Typedef name as search filter when get typedefs. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetTypeDefinitionHeadersRequest(bool? includeTermTemplate = null, string type = null, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/atlas/v2/types/typedefs/headers", false); if (includeTermTemplate != null) { uri.AppendQuery("includeTermTemplate", includeTermTemplate.Value, true); } if (type != null) { uri.AppendQuery("type", type, true); } request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the term template definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the term template. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetTermTemplateDefByGuidAsync(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTermTemplateDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTermTemplateDefByGuid"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the term template definition for the given GUID. </summary> /// <param name="guid"> The globally unique identifier of the term template. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetTermTemplateDefByGuid(string guid, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTermTemplateDefByGuidRequest(guid, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTermTemplateDefByGuid"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetTermTemplateDefByGuid"/> and <see cref="GetTermTemplateDefByGuidAsync"/> operations. </summary> /// <param name="guid"> The globally unique identifier of the term template. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetTermTemplateDefByGuidRequest(string guid, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/types/termtemplatedef/guid/", false); uri.AppendPath(guid, true); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } /// <summary> Get the term template definition by its name (unique). </summary> /// <param name="name"> The name of the term template. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual async Task<Response> GetTermTemplateDefByNameAsync(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTermTemplateDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTermTemplateDefByName"); scope.Start(); try { await Pipeline.SendAsync(message, requestOptions.CancellationToken).ConfigureAwait(false); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Get the term template definition by its name (unique). </summary> /// <param name="name"> The name of the term template. </param> /// <param name="requestOptions"> The request options. </param> #pragma warning disable AZC0002 public virtual Response GetTermTemplateDefByName(string name, RequestOptions requestOptions = null) #pragma warning restore AZC0002 { requestOptions ??= new RequestOptions(); HttpMessage message = CreateGetTermTemplateDefByNameRequest(name, requestOptions); if (requestOptions.PerCallPolicy != null) { message.SetProperty("RequestOptionsPerCallPolicyCallback", requestOptions.PerCallPolicy); } using var scope = _clientDiagnostics.CreateScope("PurviewTypes.GetTermTemplateDefByName"); scope.Start(); try { Pipeline.Send(message, requestOptions.CancellationToken); if (requestOptions.StatusOption == ResponseStatusOption.Default) { switch (message.Response.Status) { case 200: return message.Response; default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } } else { return message.Response; } } catch (Exception e) { scope.Failed(e); throw; } } /// <summary> Create Request for <see cref="GetTermTemplateDefByName"/> and <see cref="GetTermTemplateDefByNameAsync"/> operations. </summary> /// <param name="name"> The name of the term template. </param> /// <param name="requestOptions"> The request options. </param> private HttpMessage CreateGetTermTemplateDefByNameRequest(string name, RequestOptions requestOptions = null) { var message = Pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(endpoint); uri.AppendRaw("/api", false); uri.AppendPath("/types/termtemplatedef/name/", false); uri.AppendPath(name, true); uri.AppendQuery("api-version", apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); return message; } } }
39.165058
262
0.451422
[ "MIT" ]
AME-Redmond/azure-sdk-for-net
sdk/purview/Azure.Analytics.Purview.Catalog/src/Generated/PurviewTypes.cs
365,175
C#
using System; using System.Collections.Generic; namespace JakePerry { public static class AssignValueUtility { /// <summary> /// Assign a value <paramref name="newValue"/> to a variable referenced via <paramref name="currentValue"/> /// and get a boolean indicating whether the variable value was changed. /// </summary> /// <typeparam name="T">The generic type.</typeparam> /// <param name="currentValue">A reference to the variable to be assigned to.</param> /// <param name="newValue">The new value to assign.</param> /// <param name="comparer">A comparer by which to check if both values are equal.</param> /// <returns> /// <see langword="false"/> if <paramref name="currentValue"/> is already equal /// to <paramref name="newValue"/>; otherwise, <see langword="true"/>. /// </returns> public static bool Set<T>(ref T currentValue, T newValue, IEqualityComparer<T> comparer) { _ = comparer ?? throw new ArgumentNullException(nameof(comparer)); // If both values are equal (value is not changing), return false. if (comparer.Equals(currentValue, newValue)) return false; // The value has changed, set it and return true. currentValue = newValue; return true; } /// <inheritdoc cref="Set{T}(ref T, T, IEqualityComparer{T})"/> public static bool SetValueType<T>(ref T currentValue, T newValue) where T : struct { // Use default comparer for value types. var comparer = EqualityComparer<T>.Default; return Set(ref currentValue, newValue, comparer); } /// <inheritdoc cref="Set{T}(ref T, T, IEqualityComparer{T})"/> public static bool SetReferenceType<T>(ref T currentValue, T newValue) where T : class { // Use the default object comparer so as to only check if the reference has changed. var comparer = EqualityComparer<object>.Default; return Set(ref currentValue, newValue, comparer); } } }
41.519231
115
0.611394
[ "MIT" ]
nandos13/JakePerry.Common
JakePerry.Common/AssignValueUtility.cs
2,161
C#
using Microsoft.Win32; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Windows; namespace RisenautEditor { class FileService : IFileService { private Window owner; public FileService(Window owner) { this.owner = owner; } public GameFile OpenGame() { var dlg = new OpenFileDialog(); dlg.CheckFileExists = true; dlg.DefaultExt = "fil"; dlg.DereferenceLinks = true; dlg.Filter = "Agat files (*.fil)|*.fil|All files|*.*"; dlg.Multiselect = false; bool? result = dlg.ShowDialog(owner); if (!result.HasValue || !(bool)result) { return null; } try { return new GameFile(dlg.FileName); } catch (Exception e) { MessageBox.Show(owner, e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return null; } } public bool SaveGame(GameFile game) { try { game.Save(game.FileName); return true; } catch (Exception e) { MessageBox.Show(owner, e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return false; } } public bool SaveGameAs(GameFile game) { var dlg = new SaveFileDialog(); dlg.DefaultExt = "fil"; dlg.DereferenceLinks = true; dlg.Filter = "Agat files (*.fil)|*.fil|All files|*.*"; dlg.FileName = game.FileName; bool? result = dlg.ShowDialog(owner); if (!result.HasValue || !(bool)result) { return false; } try { game.Save(dlg.FileName); return true; } catch (Exception e) { MessageBox.Show(owner, e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return false; } } public bool QueryGameModified(GameFile game) { string message = "Do you want to save changes to " + Path.GetFileName(game.FileName) + "?"; MessageBoxResult result = MessageBox.Show( message, "Game Modified", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); switch (result) { case MessageBoxResult.Yes: return SaveGame(game); case MessageBoxResult.No: return true; } return false; } } }
28.784314
104
0.470708
[ "MIT" ]
snake-scaly/risenaut-editor
RisenautEditor/FileService.cs
2,938
C#