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
// Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Apis.Storage.v1.Data; using System.Threading; using System.Threading.Tasks; using static Google.Apis.Storage.v1.BucketsResource; namespace Google.Cloud.Storage.V1 { public partial class StorageClientImpl { /// <inheritdoc /> public override Policy GetBucketIamPolicy(string bucket, GetBucketIamPolicyOptions options = null) => CreateGetBucketIamPolicyRequest(bucket, options).Execute(); /// <inheritdoc /> public override Task<Policy> GetBucketIamPolicyAsync(string bucket, GetBucketIamPolicyOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) => CreateGetBucketIamPolicyRequest(bucket, options).ExecuteAsync(cancellationToken); private GetIamPolicyRequest CreateGetBucketIamPolicyRequest(string bucket, GetBucketIamPolicyOptions options) { ValidateBucketName(bucket); var bucketEntity = new Bucket { Name = bucket }; var request = Service.Buckets.GetIamPolicy(bucket); request.ModifyRequest += _versionHeaderAction; options?.ModifyRequest(request); return request; } } }
41.953488
186
0.721175
[ "Apache-2.0" ]
Acidburn0zzz/google-cloud-dotnet
apis/Google.Cloud.Storage.V1/Google.Cloud.Storage.V1/StorageClientImpl.GetBucketIamPolicy.cs
1,806
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. namespace System.Threading.Tests { public class AclTests { protected string GetRandomName() { return Guid.NewGuid().ToString("N"); } } }
26
71
0.661538
[ "MIT" ]
06needhamt/runtime
src/libraries/System.Threading.AccessControl/tests/AclTests.cs
392
C#
//------------------------------------------------------------------------------ // <auto-generated> // Este código fue generado por una herramienta. // Versión del motor en tiempo de ejecución:2.0.50727.4952 // // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si // se vuelve a generar el código. // </auto-generated> //------------------------------------------------------------------------------ namespace Sliding_Puzzle.Properties { using System; /// <summary> /// Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc. /// </summary> // StronglyTypedResourceBuilder generó automáticamente esta clase // a través de una herramienta como ResGen o Visual Studio. // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen // con la opción /str o vuelva a generar su proyecto de VS. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sliding_Puzzle.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las /// búsquedas de recursos mediante esta clase de recurso con establecimiento inflexible de tipos. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static System.Drawing.Bitmap arrow_down { get { object obj = ResourceManager.GetObject("arrow_down", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap arrow_left { get { object obj = ResourceManager.GetObject("arrow_left", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap arrow_right { get { object obj = ResourceManager.GetObject("arrow_right", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap arrow_up { get { object obj = ResourceManager.GetObject("arrow_up", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_BackGroundMenu { get { object obj = ResourceManager.GetObject("metal_BackGroundMenu", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_BackGroundStatus { get { object obj = ResourceManager.GetObject("metal_BackGroundStatus", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img1 { get { object obj = ResourceManager.GetObject("metal_img1", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img10 { get { object obj = ResourceManager.GetObject("metal_img10", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img11 { get { object obj = ResourceManager.GetObject("metal_img11", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img12 { get { object obj = ResourceManager.GetObject("metal_img12", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img13 { get { object obj = ResourceManager.GetObject("metal_img13", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img14 { get { object obj = ResourceManager.GetObject("metal_img14", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img15 { get { object obj = ResourceManager.GetObject("metal_img15", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img16 { get { object obj = ResourceManager.GetObject("metal_img16", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img17 { get { object obj = ResourceManager.GetObject("metal_img17", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img18 { get { object obj = ResourceManager.GetObject("metal_img18", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img19 { get { object obj = ResourceManager.GetObject("metal_img19", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img2 { get { object obj = ResourceManager.GetObject("metal_img2", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img20 { get { object obj = ResourceManager.GetObject("metal_img20", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img21 { get { object obj = ResourceManager.GetObject("metal_img21", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img22 { get { object obj = ResourceManager.GetObject("metal_img22", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img23 { get { object obj = ResourceManager.GetObject("metal_img23", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img24 { get { object obj = ResourceManager.GetObject("metal_img24", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img25 { get { object obj = ResourceManager.GetObject("metal_img25", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img3 { get { object obj = ResourceManager.GetObject("metal_img3", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img4 { get { object obj = ResourceManager.GetObject("metal_img4", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img5 { get { object obj = ResourceManager.GetObject("metal_img5", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img6 { get { object obj = ResourceManager.GetObject("metal_img6", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img7 { get { object obj = ResourceManager.GetObject("metal_img7", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img8 { get { object obj = ResourceManager.GetObject("metal_img8", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_img9 { get { object obj = ResourceManager.GetObject("metal_img9", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_imgEmpty { get { object obj = ResourceManager.GetObject("metal_imgEmpty", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap metal_TexturaFondo { get { object obj = ResourceManager.GetObject("metal_TexturaFondo", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_BackGroundMenu { get { object obj = ResourceManager.GetObject("wood_BackGroundMenu", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_BackGroundStatus { get { object obj = ResourceManager.GetObject("wood_BackGroundStatus", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img1 { get { object obj = ResourceManager.GetObject("wood_img1", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img10 { get { object obj = ResourceManager.GetObject("wood_img10", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img11 { get { object obj = ResourceManager.GetObject("wood_img11", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img12 { get { object obj = ResourceManager.GetObject("wood_img12", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img13 { get { object obj = ResourceManager.GetObject("wood_img13", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img14 { get { object obj = ResourceManager.GetObject("wood_img14", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img15 { get { object obj = ResourceManager.GetObject("wood_img15", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img16 { get { object obj = ResourceManager.GetObject("wood_img16", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img17 { get { object obj = ResourceManager.GetObject("wood_img17", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img18 { get { object obj = ResourceManager.GetObject("wood_img18", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img19 { get { object obj = ResourceManager.GetObject("wood_img19", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img2 { get { object obj = ResourceManager.GetObject("wood_img2", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img20 { get { object obj = ResourceManager.GetObject("wood_img20", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img21 { get { object obj = ResourceManager.GetObject("wood_img21", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img22 { get { object obj = ResourceManager.GetObject("wood_img22", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img23 { get { object obj = ResourceManager.GetObject("wood_img23", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img24 { get { object obj = ResourceManager.GetObject("wood_img24", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img25 { get { object obj = ResourceManager.GetObject("wood_img25", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img3 { get { object obj = ResourceManager.GetObject("wood_img3", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img4 { get { object obj = ResourceManager.GetObject("wood_img4", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img5 { get { object obj = ResourceManager.GetObject("wood_img5", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img6 { get { object obj = ResourceManager.GetObject("wood_img6", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img7 { get { object obj = ResourceManager.GetObject("wood_img7", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img8 { get { object obj = ResourceManager.GetObject("wood_img8", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_img9 { get { object obj = ResourceManager.GetObject("wood_img9", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_imgEmpty { get { object obj = ResourceManager.GetObject("wood_imgEmpty", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } internal static System.Drawing.Bitmap wood_TexturaFondo { get { object obj = ResourceManager.GetObject("wood_TexturaFondo", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } } }
37.664659
180
0.544597
[ "MIT" ]
im-noob/6th-sem-ai
AI2/Sliding Puzzle with picture too/Backup/Sliding Puzzle/Properties/Resources.Designer.cs
18,772
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace R1Engine.Jade { // TODO: Use similar system to AI_Links - this array is probably different for other games public enum MDF_ModifierType_Montreal : int { None = -1, GEO_ModifierSnap = 0, GEO_ModifierOnduleTonCorps = 1, GAO_ModifierExplode = 2, GAO_ModifierLegLink = 3, GEO_ModifierMorphing = 4, GAO_ModifierSemiLookAt = 5, GAO_ModifierShadow = 6, GAO_ModifierSpecialLookAt = 7, GEN_ModifierSound = 8, GAO_ModifierXMEN = 9, GAO_ModifierXMEC = 10, SPG_Modifier = 11, GEO_ModifierSymetrie = 12, GAO_ModifierROTR = 13, GAO_ModifierSNAKE = 14, DARE_ModifierSound = 15, GEN_ModifierSoundFx = 16, PROTEX_Modifier = 17, GAO_ModifierSoftBody = 18, GAO_ModifierSpring = 19, GAO_ModifierRope = 20, WATER3D_Modifier = 21, GAO_ModifierRotC = 22, GAO_ModifierBeamGen = 23, Disturber_Modifier = 24, GAO_ModifierAnimIK = 25, GAO_ModifierAnimatedScale = 26, GAO_ModifierWind = 27, GAO_ModifierSfx = 28, GEO_ModifierBridge = 29, GEO_ModifierMeshToParticles = 30, GAO_ModifierVirtualAnim = 31, Halo_Modifier = 32, GAO_ModifierTree = 33, GAO_ModifierPlant = 34, GAO_ModifierVoiceManager = 35, // Introduced after PoP:SoT GAO_ModifierSectorisationElement = 36, GAO_ModifierAnimatedMaterial = 37, GAO_ModifierRotationPaste = 38, Ambiance_Modifier = 39, AmbianceLinker_Modifier = 40, AmbiancePocket_Modifier = 41, GAO_ModifierPendula = 42, GAO_ModifierTranslationPaste = 43, GAO_ModifierAnimatedPAG = 44, GAO_ModifierAnimatedGAO = 45, GAO_ModifierEyeTrail = 46, // Found in Spree GAO_ModifierCharacterFX = 47, GAO_ModifierEcharpe = 48, // Added in T2T GAO_ModifierSoftBodyColl = 49, // Added in T2T GAO_ModifierBeamCutter = 50, // Added in TMNT GAO_ModifierMotionBlur = 51, GAO_ModifierAlphaFade = 52, GAO_ModifierAlphaOccluder = 53, GAO_ModifierInteractivePlant = 54, SPG2_Modifier = 55, FakeHDR_Modifier = 56, DARE_ModifierSoundVolumetric = 57, ProjectiveShadowProjector_Modifier = 58, ProjectiveShadowCaster_Modifier = 59, MUSIC_CONTAINER_ModifierSound = 60, Reflector_Modifier = 62, Fur_Modifier = 63, Outline_Modifier = 64, FaceFx_Modifier = 65, } }
28.37037
91
0.755875
[ "MIT" ]
Adsolution/Ray1Map
Assets/Scripts/DataTypes/Jade/MDF/MDF_ModifierType_Montreal.cs
2,300
C#
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; using BrWebHost.Models.Entities; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using SharpBroadlink; using SharpBroadlink.Devices; namespace BrWebHost.Models.Stores { public class ControlSetStore : IDisposable { private static IServiceProvider Provider; public static void SetServiceProvider(IServiceProvider provider) { ControlSetStore.Provider = provider; } public static void ReleaseServiceProvider() { ControlSetStore.Provider = null; } private Dbc _dbc; public ControlSetStore( [FromServices] Dbc dbc ) { Xb.Util.Out("ControlSetStore.Constructor"); this._dbc = dbc; } public async Task<bool> EnsureBrControlSets(IEnumerable<BrDevice> brDevices) { Xb.Util.Out("ControlSetStore.EnsureBrControlSets"); // Broadlinkデバイス自体を示すControlSetを取得 var brCss = await this._dbc.ControlSets .Where(cs => !cs.IsTemplate && cs.OperationType == OperationType.BroadlinkDevice) .ToArrayAsync(); var changed = false; var count = 0; foreach (var brd in brDevices) { try { // 自身を示すControlSetを取得 var brcs = brCss.FirstOrDefault(b => b.BrDeviceId == brd.Id); // 既にControlSet登録済みなら、なにもしない。 if (brcs != null) continue; // 自身を示すControlSetを生成する。 ControlSet cset = null; if (brd.SbDevice is Rm2Pro) cset = await this.EnsureControlSetRm2Pro(); else if (brd.SbDevice is Rm) cset = await this.EnsureControlSetRm(); else if (brd.SbDevice is A1) cset = await this.EnsureControlSetA1(); else if (brd.SbDevice is Sp1) cset = await this.EnsureControlSetSp1(); else if (brd.SbDevice is Sp2) cset = await this.EnsureControlSetSp2(); else if (brd.SbDevice is S1c) cset = await this.EnsureControlSetS1c(); //else if (brd.SbDevice is Sc1) // cset = await this.EnsureControlSetSc1(); else if (brd.SbDevice is Dooya) cset = await this.EnsureControlSetDooya(); else if (brd.SbDevice is Hysen) cset = await this.EnsureControlSetHysen(); else if (brd.SbDevice is Mp1) cset = await this.EnsureControlSetMp1(); else cset = await this.EnsureControlSetAny(); cset.OperationType = OperationType.BroadlinkDevice; cset.BrDeviceId = brd.Id; // EntityをDbcに追加 Xb.Util.Out($"ControlSetStore.EnsureBrControlSets - Add new ControlSet {cset.Name} - {brd.DeviceType}[{brd.IpAddressString}]"); this._dbc.ControlSets.Add(cset); changed = true; count++; } catch (Exception ex) { Xb.Util.Out(ex); } } if (changed) { Xb.Util.Out($"ControlSetStore.EnsureBrControlSets - Found {count} Device"); await this._dbc.SaveChangesAsync(); } else { Xb.Util.Out($"ControlSetStore.EnsureBrControlSets - Already Ensured"); } return true; } private async Task<ControlSet> EnsureControlSetRm2Pro() { var cset = await this.GetNewByTemplate(Template.SingleControl); cset.Controls[0].Name = "Temp."; cset.Name = "Rm2Pro"; cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = false; cset.IsTogglable = false; return cset; } private async Task<ControlSet> EnsureControlSetRm() { var cset = await this.GetNewByTemplate(Template.NoControl); cset.Name = "Rm"; cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = false; cset.IsTogglable = false; return cset; } private async Task<ControlSet> EnsureControlSetA1() { var cset = await this.GetNewByTemplate(Template.A1Sensor); cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = true; cset.IsTogglable = false; return cset; } private async Task<ControlSet> EnsureControlSetSp1() { var cset = await this.GetNewByTemplate(Template.Sp1Switch); cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = false; cset.IsTogglable = true; return cset; } private async Task<ControlSet> EnsureControlSetSp2() { var cset = await this.GetNewByTemplate(Template.Sp2Switch); cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = true; cset.IsTogglable = true; return cset; } private async Task<ControlSet> EnsureControlSetS1c() { var cset = await this.GetNewByTemplate(Template.NoControl); cset.Name = "S1C"; cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = false; cset.IsTogglable = false; // TODO: 実装するぞ実装するぞ実装するぞ //var a = 1; // 実装するぞ実装するぞ実装するぞ... return cset; } //private async Task<ControlSet> EnsureControlSetSc1() //{ // return true; //} private async Task<ControlSet> EnsureControlSetDooya() { // Dooyaカーテンほしいれす(^q^ var cset = await this.EnsureControlSetAny(); cset.Name = "Dooya"; return cset; } private async Task<ControlSet> EnsureControlSetHysen() { // Hysenコントローラほしいれす(^q^ var cset = await this.EnsureControlSetAny(); cset.Name = "Hysen"; return cset; } private async Task<ControlSet> EnsureControlSetMp1() { // Mp1マルチタップほしいれす(^q^ var cset = await this.EnsureControlSetAny(); cset.Name = "MP1"; return cset; } private async Task<ControlSet> EnsureControlSetAny() { // なんか知らんデバイス var cset = await this.GetNewByTemplate(Template.NoControl); cset.Name = ""; cset.OperationType = OperationType.BroadlinkDevice; cset.IsMainPanelReady = false; cset.IsTogglable = false; return cset; } private async Task<ControlSet> GetNewByTemplate(Template template) { var tplCset = await this._dbc.ControlSets .Include(c => c.Controls) .Where(c => (c.Id == (int)template)) .FirstOrDefaultAsync(); var cset = new ControlSet(); cset.Name = tplCset.Name; cset.BrDeviceId = tplCset.BrDeviceId; cset.IconUrl = tplCset.IconUrl; cset.Color = tplCset.Color; cset.Order = tplCset.Order; cset.ToggleState = tplCset.ToggleState; cset.IsMainPanelReady = tplCset.IsMainPanelReady; cset.IsTogglable = tplCset.IsTogglable; cset.OperationType = tplCset.OperationType; cset.IsTemplate = false; cset.Controls = new List<Control>(); foreach (var tplControl in tplCset.Controls) { var control = new Control(); control.ControlSetId = cset.Id; control.Name = tplControl.Name; control.PositionLeft = tplControl.PositionLeft; control.PositionTop = tplControl.PositionTop; control.Color = tplControl.Color; control.IconUrl = tplControl.IconUrl; control.Code = tplControl.Code; control.IsAssignToggleOn = tplControl.IsAssignToggleOn; control.IsAssignToggleOff = tplControl.IsAssignToggleOff; cset.Controls.Add(control); } return cset; } public async Task<Error[]> Exec(Control control) { var errors = new List<Error>(); if (control == null) { errors.Add(new Error() { Name = "ControlId", Message = "ControlSetStore.Exec: Control Not Found." }); return errors.ToArray(); } var controlSet = await this._dbc.ControlSets .SingleOrDefaultAsync(e => e.Id == control.ControlSetId); if (controlSet == null) { errors.Add(new Error() { Name = "ControlSetId", Message = $"ControlSetStore.Exec: ControlSet Not Found[{control.ControlSetId}]" }); return errors.ToArray(); } using (var serviceScope = ControlSetStore.Provider.GetRequiredService<IServiceScopeFactory>().CreateScope()) { // デモモードのときは実行せず正常終了する。 // デモモードでないときだけ実行。 if (!Program.IsDemoMode) { switch (controlSet.OperationType) { case OperationType.RemoteControl: try { var device = await this.GetBrDevice(controlSet.BrDeviceId); if (device == null) { errors.Add(new Error() { Name = "BrDeviceId", Message = $"ControlSetStore.Exec[RemoteControl]: Broadlink Device Not Found[{controlSet.BrDeviceId}]" }); break; } var rm = (Rm)device.SbDevice; var pBytes = Signals.String2ProntoBytes(control.Code); var result = await rm.SendPronto(pBytes); if (result == false) { errors.Add(new Error() { Name = "Code", Message = "ControlSetStore.Exec[RemoteControl]: Code Exec Failure." }); break; } } catch (Exception ex) { errors.Add(new Error() { Name = "Code", Message = $"ControlSetStore.Exec[RemoteControl]: {ex.Message} / {ex.StackTrace}" }); break; } break; case OperationType.BroadlinkDevice: try { var device = await this.GetBrDevice(controlSet.BrDeviceId); if (device == null) { errors.Add(new Error() { Name = "BrDeviceId", Message = $"ControlSetStore.Exec[BroadlinkDevice]: Broadlink Device Not Found[{controlSet.BrDeviceId}]" }); break; } var brErrors = await this.ExecBrDevice(control, device); if (brErrors.Length > 0) { errors.AddRange(brErrors); break; } } catch (Exception ex) { errors.Add(new Error() { Name = "Unexpected", Message = $"ControlSetStore.Exec[BroadlinkDevice]: {ex.Message} / {ex.StackTrace}" }); break; } break; case OperationType.WakeOnLan: try { using (var wolStore = serviceScope.ServiceProvider.GetService<WolStore>()) { var res = await wolStore.Exec(control.Code); if (res == false) { errors.Add(new Error() { Name = "Code", Message = "Broadlink Device Not Found." }); break; } } } catch (Exception ex) { errors.Add(new Error() { Name = "Unexpected", Message = $"ControlSetStore.Exec[WakeOnLan]: {ex.Message} / {ex.StackTrace}" }); break; } break; case OperationType.Script: try { using (var scriptStore = serviceScope.ServiceProvider.GetService<ScriptStore>()) { var res = await scriptStore.Exec(control.Code); if (!res.IsSucceeded) { errors.Add(new Error() { Name = "Code", Message = $"ControlSetStore.Exec[WakeOnLan]: {res.Result}" }); break; } } } catch (Exception ex) { errors.Add(new Error() { Name = "Unexpected", Message = $"ControlSetStore.Exec[Script]: {ex.Message} / {ex.StackTrace}" }); break; } break; case OperationType.RemoteHost: try { using (var rhStore = serviceScope.ServiceProvider.GetService<RemoteHostStore>()) { Script script; try { script = JsonConvert.DeserializeObject<Script>(control.Code); } catch (Exception) { errors.Add(new Error() { Name = "Code", Message = "ControlSetStore.Exec[RemoteHost]: Remote Script Not Recognize." }); break; } var res = await rhStore.Exec(script); if (!res.IsSucceeded) { errors.Add(new Error() { Name = "Code", Message = $"ControlSetStore.Exec[RemoteHost]: {res.Result}" }); break; } } } catch (Exception ex) { errors.Add(new Error() { Name = "Unexpected", Message = $"ControlSetStore.Exec[RemoteHost]: {ex.Message} / {ex.StackTrace}" }); break; } break; case OperationType.Scene: default: // ここにはこないはず。 throw new Exception("なんでやー"); } } if ( errors.Count <= 0 && (control.IsAssignToggleOn || control.IsAssignToggleOff) ) { var isChanged = false; if (control.IsAssignToggleOn && control.IsAssignToggleOff ) { // トグルOn/Off両方アサインされているとき // 何もしない。 } else if (control.IsAssignToggleOn) { // トグルOnのみアサインされているとき isChanged = true; controlSet.ToggleState = true; } else if (control.IsAssignToggleOff) { // トグルOffのみアサインされているとき isChanged = true; controlSet.ToggleState = false; } else { // ここには来ないはず。 throw new Exception("なんでやー"); } if (isChanged) { using (var dbc = serviceScope.ServiceProvider.GetService<Dbc>()) { dbc.Entry(controlSet).State = EntityState.Modified; await dbc.SaveChangesAsync(); } } } } return errors.ToArray(); } private async Task<Error[]> ExecBrDevice(Control control, BrDevice device) { var errors = new List<Error>(); using (var serviceScope = ControlSetStore.Provider.GetRequiredService<IServiceScopeFactory>().CreateScope()) { switch (device.DeviceType) { case DeviceType.Sp2: using (var sp2Store = serviceScope.ServiceProvider.GetService<Sp2Store>()) { var sp2Status = await sp2Store.GetStatus(device.Id); switch (control.Code) { case "PowerOn": sp2Status.Power = true; break; case "PowerOff": sp2Status.Power = false; break; case "LightOn": sp2Status.NightLight = true; break; case "LightOff": sp2Status.NightLight = false; break; default: throw new Exception("ここにはこないはず"); } var res = await sp2Store.SetStatus(device.Id, sp2Status); if (res == false) { errors.Add(new Error() { Name = "Code", Message = "ControlSetStore.ExecBrDevice[Sp2]: Sp2 Switch Set Failure." }); break; } } break; case DeviceType.A1: using (var a1Store = serviceScope.ServiceProvider.GetService<A1Store>()) { try { // 値を取得して何をするでもない。 await a1Store.GetValues(device.Id); } catch (Exception ex) { errors.Add(new Error() { Name = "Code", Message = "ControlSetStore.ExecBrDevice[A1]: A1 Sensor Get Value Failure: " + ex.Message }); break; } } break; case DeviceType.S1c: case DeviceType.Sp1: case DeviceType.Rm: case DeviceType.Rm2Pro: case DeviceType.Dooya: case DeviceType.Hysen: case DeviceType.Mp1: case DeviceType.Unknown: default: break; } } return errors.ToArray(); } private async Task<BrDevice> GetBrDevice(int? id) { using (var serviceScope = ControlSetStore.Provider.GetRequiredService<IServiceScopeFactory>().CreateScope()) using (var brStore = serviceScope.ServiceProvider.GetService<BrDeviceStore>()) { return await brStore.Get((int)id); } } #region IDisposable Support private bool IsDisposed = false; // 重複する呼び出しを検出するには protected virtual void Dispose(bool disposing) { if (!IsDisposed) { if (disposing) { this._dbc.Dispose(); this._dbc = null; } // TODO: アンマネージド リソース (アンマネージド オブジェクト) を解放し、下のファイナライザーをオーバーライドします。 // TODO: 大きなフィールドを null に設定します。 IsDisposed = true; } } // このコードは、破棄可能なパターンを正しく実装できるように追加されました。 public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } #endregion } }
38.429457
147
0.390406
[ "MIT" ]
ume05rw/BrWebHost
BrWebHost/Models/Stores/ControlSetStore.cs
25,553
C#
using System; using Microsoft.AspNetCore.Mvc; using RecipeApplication.Models; namespace RecipeApplication.Controllers { [Route("api/recipe")] [ValidateModel, HandleException, FeatureEnabled(IsEnabled = true)] public class RecipeApiController : Controller { public RecipeService _service; public RecipeApiController(RecipeService service) { _service = service; } [HttpGet("{id}"), EnsureRecipeExists, AddLastModifedHeader] public IActionResult Get(int id) { var detail = _service.GetRecipeDetail(id); return Ok(detail); } [HttpPost("{id}"), EnsureRecipeExists, RequireIpAddress] public IActionResult Edit(int id, [FromBody] UpdateRecipeCommand command) { _service.UpdateRecipe(command); return Ok(); } } }
26.848485
81
0.634312
[ "MIT" ]
AnzhelikaKravchuk/asp-dot-net-core-in-action
chapter13/1.1/RecipeApplication/RecipeApplication/Controllers/RecipeApiController.cs
888
C#
using System; using MikhailKhalizev.Processor.x86.BinToCSharp; namespace MikhailKhalizev.Max.Program { public partial class RawProgram { [MethodInfo("0x1019_0008-9909")] public void /* sys_mve */ Method_1019_0008() { ii(0x1019_0008, 2); mov(ah, bl); /* mov ah, bl */ } } }
24.666667
88
0.545946
[ "Apache-2.0" ]
mikhail-khalizev/max
source/MikhailKhalizev.Max/source/Program/Auto/z-1019-0008-sys-mve.cs
370
C#
using Newtonsoft.Json; using System; using System.Collections.Generic; namespace VkApi.Wrapper.Objects { public class PhotosPhotoUploadResponse { ///<summary> /// Album ID ///</summary> [JsonProperty("aid")] public int Aid { get; set; } ///<summary> /// Uploading hash ///</summary> [JsonProperty("hash")] public String Hash { get; set; } ///<summary> /// Uploaded photos data ///</summary> [JsonProperty("photos_list")] public String PhotosList { get; set; } ///<summary> /// Upload server number ///</summary> [JsonProperty("server")] public int Server { get; set; } } }
22.666667
46
0.529412
[ "MIT" ]
FrediKats/VkLibrary
VkApi.Wrapper/Objects/Photos/PhotosPhotoUploadResponse.cs
748
C#
using Character.Display; namespace Character.Physical.Proficiencies { public class Shortsword : ProficiencyBase, IProficiency, IEquateableProficiency { public Shortsword():base(new TextObj("Shortsword")){} public ITextObj Name() => ProficiencyName; } }
25.636364
83
0.719858
[ "MIT" ]
MyTurnyet/CharacterBuilder
Character/Physical/Proficiencies/Shortsword.cs
282
C#
using System; using System.Windows.Forms; using WallStreet.Models; using WallStreet.Services.AccountServices; using WallStreet.Services.UserServices; namespace WallStreet.Forms { public partial class SettingsForm : Form { private readonly User user; private readonly IUserService userService = new UserService(); private readonly IAccountService accountService = new AccountService(); public SettingsForm(int accountId) { user = userService.Get(accountId); InitializeComponent(); } private void btnLogout_Click(object sender, EventArgs e) { this.Hide(); var loginForm = new LoginForm(); loginForm.Closed += (s, args) => this.Close(); loginForm.Show(); } private void btnResetAccount_Click(object sender, EventArgs e) { accountService.Delete(user.AccountId); userService.Delete(user.AccountId); this.Hide(); var registerForm = new RegisterForm(); registerForm.Closed += (s, args) => this.Close(); registerForm.Show(); } private void btnSaveGame_Click(object sender, EventArgs e) { MessageBox.Show("Game saved successfully!"); } } }
29.444444
79
0.609811
[ "MIT" ]
mmivanova/wall-street-game
WallStreet/WallStreet/Forms/SettingsForm.cs
1,327
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Snaker.Game.Data { /// <summary> /// 定义游戏单局中可能的玩家操作 /// </summary> public static class GameVKey { /// <summary> /// X方向移动 /// </summary> public const int MoveX = 11; /// <summary> /// Y方向移动 /// </summary> public const int MoveY = 12; /// <summary> /// 加速移动 /// </summary> public const int SpeedUp = 1; /// <summary> /// 在单局中创建一个玩家 /// </summary> public const int CreatePlayer = 20; } }
17.805556
43
0.4961
[ "MIT" ]
U3DC/Snaker
Assets/Snaker/Game/Data/GameVKey.cs
715
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ZoomTiledSpectrograms.cs" company="QutEcoacoustics"> // All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group). // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace AudioAnalysisTools.LongDurationSpectrograms.Zooming { using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Globalization; using System.IO; using System.Linq; using Acoustics.Shared; using Acoustics.Shared.ConfigFile; using Acoustics.Shared.Contracts; using Indices; using log4net; using TileImage; using TowseyLibrary; using Zio; using SpectrogramType = LongDurationSpectrograms.SpectrogramType; public static class ZoomTiledSpectrograms { private const double XNominalUnitScale = 60.0; private static readonly ILog Log = LogManager.GetLogger(nameof(ZoomTiledSpectrograms)); /// <summary> /// THIS IS ENTRY METHOD FOR TILING SPECTROGRAMS. /// </summary> public static void DrawTiles( AnalysisIoInputDirectory io, ZoomParameters common, string analysisTag) { Log.Info("Begin Draw Super Tiles"); Contract.Requires(common != null, "common can not be null"); Contract.Requires(common.SpectrogramZoomingConfig != null, "SpectrogramZoomingConfig can not be null"); var zoomConfig = common.SpectrogramZoomingConfig; LdSpectrogramConfig ldsConfig = common.SpectrogramZoomingConfig.LdSpectrogramConfig; var distributions = common.IndexDistributions; var indexGenerationData = common.IndexGenerationData; var indexProperties = zoomConfig.IndexProperties; string fileStem = common.OriginalBasename; // scales for false color index spectrograms images in seconds per pixel. double[] indexScales = zoomConfig.SpectralIndexScale; // default scales for standard (FFT) spectrograms in seconds per pixel. double[] standardScales = zoomConfig.SpectralFrameScale; ValidateScales(indexScales, indexGenerationData.IndexCalculationDuration.TotalSeconds); var shouldRenderStandardScale = !standardScales.IsNullOrEmpty(); if (!shouldRenderStandardScale) { Log.Warn("Standard spectrograms will not be rendered"); } var allImageScales = indexScales.Concat(standardScales).ToArray(); Log.Info("Tiling at scales: " + allImageScales.ToCommaSeparatedList()); // determine what naming format to use for tiles var (namingPattern, alignmentPadding) = GetTilingProfile( common, zoomConfig, indexGenerationData, indexScales.Max()); // pad out image so it produces a whole number of tiles // this solves the asymmetric right padding of short audio files // var paddedWidth = (int)(Math.Ceiling(zoomConfig.TileWidth / xNominalUnitScale) * xNominalUnitScale); // create a new tiler // pass it scales for x and y-axis // also pass it unit scale relations (between unit scale and unit height/width) to use as a reference point var tiler = new Tiler( io.OutputBase, namingPattern, xScales: new SortedSet<double>(allImageScales), xUnitScale: XNominalUnitScale, unitWidth: 1440, yScales: new SortedSet<double>(allImageScales.Select(x => 1.0)), yUnitScale: 1.0, unitHeight: namingPattern.TileHeight); // TODO: this loads all spectra, even ones we don't need... var (spectra, filteredIndexProperties) = LoadSpectra(io, analysisTag, fileStem, indexProperties); // false color index tiles GenerateIndexSpectrogramTiles( indexScales, ldsConfig, filteredIndexProperties, zoomConfig, spectra, indexGenerationData, fileStem, namingPattern, tiler, alignmentPadding); // standard fft frame spectrograms if (shouldRenderStandardScale) { GenerateStandardSpectrogramTiles( spectra, indexGenerationData, ldsConfig, filteredIndexProperties, zoomConfig, standardScales, fileStem, namingPattern, tiler, alignmentPadding); } Log.Success("Tiling complete"); } private static void ValidateScales(double[] indexScales, double dataScale) { if (indexScales.IsNullOrEmpty()) { throw new InvalidScaleException( $"{nameof(SpectrogramZoomingConfig.SpectralIndexScale)} is null or empty " + " we need at least some scales to render zooming spectrograms"); } foreach (var scale in indexScales) { var rawScalingFactor = scale / dataScale; int scalingFactor = (int)Math.Round(rawScalingFactor); Contract.Requires<InvalidScaleException>( Math.Abs(scalingFactor - rawScalingFactor) < 0.0000001, $"Index scales must be integer factors of the data scale `{dataScale}` - provided scale `{scale}` was not valid"); if (scalingFactor < 1) { throw new InvalidScaleException( "Index scale ratio to index calculation duration must be >=1 but was instead " + scalingFactor.ToString()); } } } private static void GenerateStandardSpectrogramTiles( Dictionary<string, double[,]> spectra, IndexGenerationData indexGeneration, LdSpectrogramConfig ldsConfig, Dictionary<string, IndexProperties> filteredIndexProperties, SpectrogramZoomingConfig zoomConfig, double[] standardScales, string fileStem, TilingProfile namingPattern, Tiler tiler, TimeSpan alignmentPadding) { Log.Info("START DRAWING ZOOMED-IN FRAME SPECTROGRAMS"); TimeSpan dataDuration = TimeSpan.FromTicks(spectra["POW"].GetLength(1) * indexGeneration.IndexCalculationDuration.Ticks); TimeSpan duration = indexGeneration.RecordingDuration; Contract.Requires( (dataDuration - duration).Absolute() < indexGeneration.IndexCalculationDuration, "The expected amount of data was not supplied"); var minuteCount = (int)Math.Ceiling(dataDuration.TotalMinutes); // window the standard spectrogram generation so that we can provide adjacent supertiles to the // tiler, so that bordering / overlapping tiles (for cases where tile size != multiple of supertile size) // don't render partial tiles (i.e. bad/partial rendering of image) // this is the function generator // use of Lazy means results will only be evaluated once // and only when needed. This is useful for sliding window. Lazy<TimeOffsetSingleLayerSuperTile[]> GenerateStandardSpectrogramGenerator(int minuteToLoad) { return new Lazy<TimeOffsetSingleLayerSuperTile[]>( () => { Log.Info("Starting generation for minute: " + minuteToLoad); var superTilingResults = DrawSuperTilesFromSingleFrameSpectrogram( null /*inputDirectory*/, //TODO:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ldsConfig, filteredIndexProperties, zoomConfig, minuteToLoad, standardScales, fileStem, indexGeneration, namingPattern.ChromeOption, alignmentPadding); return superTilingResults; }); } Lazy<TimeOffsetSingleLayerSuperTile[]> previous = null; Lazy<TimeOffsetSingleLayerSuperTile[]> current = null; Lazy<TimeOffsetSingleLayerSuperTile[]> next = null; for (int minute = 0; minute < minuteCount; minute++) { Log.Trace("Starting loop for minute" + minute); // shift each value back previous = current; current = next ?? GenerateStandardSpectrogramGenerator(minute); next = minute + 1 < minuteCount ? GenerateStandardSpectrogramGenerator(minute + 1) : null; // for each scale level of the results for (int i = 0; i < current.Value.Length; i++) { // finally tile the output Log.Debug("Begin tile production for minute: " + minute); tiler.Tile(previous?.Value[i], current.Value[i], next?.Value[i]); Log.Debug("Begin tile production for minute: " + minute); } } } /// <summary> /// Derives false colour varying-resolution multi-index spectrograms from provided spectral indices. /// </summary> private static void GenerateIndexSpectrogramTiles(double[] indexScales, LdSpectrogramConfig ldsConfig, Dictionary<string, IndexProperties> filteredIndexProperties, SpectrogramZoomingConfig zoomConfig, Dictionary<string, double[,]> spectra, IndexGenerationData indexGenerationData, string fileStem, TilingProfile tilingProfile, Tiler tiler, TimeSpan alignmentPadding) { // TOP MOST ZOOMED-OUT IMAGES Log.Info("Begin drawwing zooming indec spectrograms"); foreach (double scale in indexScales) { Log.Info("Starting scale: " + scale); if (indexGenerationData.RecordingDuration.TotalSeconds < scale) { Log.Warn($"Skipping scale step {scale} because recording duration ({indexGenerationData.RecordingDuration}) is less than 1px of scale"); continue; } // TODO: eventual optimisation, remove concept of super tiles // TODO: optimisation, cache aggregation layers (currently every layer is reaggregated from base level) TimeSpan imageScale = TimeSpan.FromSeconds(scale); var superTiles = DrawSuperTilesAtScaleFromIndexSpectrograms( ldsConfig, filteredIndexProperties, zoomConfig, imageScale, spectra, indexGenerationData, fileStem, tilingProfile.ChromeOption, alignmentPadding); // tile images as we go Log.Debug("Writing index tiles for " + scale); tiler.TileMany(superTiles); Log.Debug("Completed writing index tiles for " + scale); } } private static (TilingProfile Profile, TimeSpan padding) GetTilingProfile( ZoomParameters common, SpectrogramZoomingConfig zoomConfig, IndexGenerationData indexGeneration, double maxScale) { TilingProfile namingPattern; TimeSpan padding; switch (zoomConfig.TilingProfile) { case nameof(PanoJsTilingProfile): namingPattern = new PanoJsTilingProfile(); padding = TimeSpan.Zero; if (zoomConfig.TileWidth != namingPattern.TileWidth) { throw new ConfigFileException( "TileWidth must match the default PanoJS TileWidth of " + namingPattern.TileWidth); } break; case nameof(AbsoluteDateTilingProfile): // Zooming spectrograms use multiple color profiles at different levels // therefore unable to set a useful tag (like ACI-ENT-EVN). if (indexGeneration.RecordingStartDate != null) { var recordingStartDate = (DateTimeOffset)indexGeneration.RecordingStartDate; var tilingStartDate = GetPreviousTileBoundary( zoomConfig.TileWidth, maxScale, recordingStartDate); padding = recordingStartDate - tilingStartDate; // if we're not writing tiles to disk, omit the basename because whatever the container format is // it will have the base name attached namingPattern = new AbsoluteDateTilingProfile( common.OmitBasename ? string.Empty : common.OriginalBasename, "BLENDED.Tile", tilingStartDate, indexGeneration.FrameLength / 2, zoomConfig.TileWidth); } else { throw new ArgumentNullException( nameof(zoomConfig.TilingProfile), "`RecordingStateDate` from the `IndexGenerationData.json` cannot be null when `AbsoluteDateTilingProfile` specified"); } break; default: throw new ConfigFileException( $"The {nameof(zoomConfig.TilingProfile)} configuration property was set to an unsupported value - no profile known by that name"); } Log.Info($"Tiling had a left padding duration of {padding} to align tiles"); Log.Info( $"Tiling using {namingPattern.GetType().Name}, Tile Width: {namingPattern.TileWidth}, Height: {namingPattern.TileHeight}"); return (namingPattern, padding); } private static (Dictionary<string, double[,]>, Dictionary<string, IndexProperties>) LoadSpectra( AnalysisIoInputDirectory io, string analysisTag, string fileStem, Dictionary<string, IndexProperties> indexProperties) { indexProperties = InitialiseIndexProperties.FilterIndexPropertiesForSpectralOnly(indexProperties); string[] keys = indexProperties.Keys.ToArray(); Dictionary<string, double[,]> spectra = IndexMatrices.ReadSpectralIndices( io.InputBase, fileStem, analysisTag, keys); return (spectra, indexProperties); } public static DateTimeOffset GetPreviousTileBoundary(int tileWidth, double scale, DateTimeOffset recordingStartDate) { // if recording does not start on an absolutely aligned tile boundary, then we align it. // "midnight" is 00:00 UTC - that way all recordings have a common tiling start point var utcDate = recordingStartDate.UtcDateTime; var utcMidnight = recordingStartDate.Date; var delta = utcDate - utcMidnight; var tileDuration = scale * tileWidth; var numberOfTilesBeforeStartDate = Math.Floor(delta.TotalSeconds / tileDuration); var paddingDuration = TimeSpan.FromSeconds(numberOfTilesBeforeStartDate * tileDuration); var previous = new DateTimeOffset(utcMidnight + paddingDuration, TimeSpan.Zero); return previous; } /// <summary> /// THis method is a way of getting the acoustic index data at 0.2 second resolution to have some influence on the /// frame spectrograms at 0.02s resolution. /// We cannot assume that the two matrices will have the same number of columns i.e. same temporal duration. /// The frame data has been padded to one minute duration. But the last index matrix will probably NOT be the full one /// minute duration. /// Therefore assume that indexData matrix will be shorter and take its column count. /// </summary> public static void CombineFrameDataWithIndexData( double[,] frameData, double[,] indexData, double frameWt, double indexWt) { int rowCount = frameData.GetLength(0); // number of rows should be same in both matrices int colCount = indexData.GetLength(1); // number of column will possibly be fewer in the indexData matrix. for (int c = 0; c < colCount; c++) { for (int r = 0; r < rowCount; r++) { frameData[r, c] = (indexWt * indexData[r, c]) + (frameWt * Math.Sqrt(frameData[r, c])); } } // end all rows } public static Image DrawFrameSpectrogramAtScale( LdSpectrogramConfig config, SpectrogramZoomingConfig zoomingConfig, TimeSpan startTimeOfData, TimeSpan frameScale, double[,] frameData, IndexGenerationData indexGeneration, ImageChrome chromeOption) { // TODO: the following normalisation bounds could be passed instead of using hard coded. double min = zoomingConfig.LowerNormalizationBoundForDecibelSpectrograms; double max = zoomingConfig.UpperNormalizationBoundForDecibelSpectrograms; //need to correctly orient the matrix for this method frameData = MatrixTools.MatrixRotate90Clockwise(frameData); // Get an unchromed image Image spectrogramImage = ZoomFocusedSpectrograms.DrawStandardSpectrogramInFalseColour(frameData); if (chromeOption == ImageChrome.Without) { return spectrogramImage; } int nyquist = indexGeneration.SampleRateResampled / 2; int herzInterval = 1000; string title = $"ZOOM SCALE={frameScale.TotalMilliseconds}ms/pixel "; Image titleBar = ZoomFocusedSpectrograms.DrawTitleBarOfZoomSpectrogram(title, spectrogramImage.Width); spectrogramImage = ZoomFocusedSpectrograms.FrameZoomSpectrogram( spectrogramImage, titleBar, startTimeOfData, frameScale, config.XAxisTicInterval, nyquist, herzInterval); return spectrogramImage; } /// <summary> /// Draws FC index spectrograms for an entire row /// </summary> public static TimeOffsetSingleLayerSuperTile[] DrawSuperTilesAtScaleFromIndexSpectrograms( LdSpectrogramConfig analysisConfig, Dictionary<string, IndexProperties> indexProperties, SpectrogramZoomingConfig zoomingConfig, TimeSpan imageScale, Dictionary<string, double[,]> spectra, IndexGenerationData indexGeneration, string basename, ImageChrome chromeOption, TimeSpan alignmentPadding) { Contract.Requires(!spectra.IsNullOrEmpty(), "ERROR: NO SPECTRAL DATA SUPPLIED"); // calculate source data duration from column count of arbitrary matrix TimeSpan dataScale = indexGeneration.IndexCalculationDuration; double[,] matrix = spectra.First().Value; TimeSpan sourceDataDuration = TimeSpan.FromSeconds(matrix.GetLength(1) * dataScale.TotalSeconds); int tileWidth = zoomingConfig.TileWidth; int superTileWidth = zoomingConfig.SuperTileWidthDefault(); var superTileCount = (int)Math.Ceiling(zoomingConfig.SuperTileCount(sourceDataDuration, imageScale.TotalSeconds)); TimeSpan superTileDuration = TimeSpan.FromTicks(superTileWidth * imageScale.Ticks); // initialize the image array to return var superTiles = new TimeOffsetSingleLayerSuperTile[superTileCount]; // sometimes the whole recording is not analyzed. In this case, jump the time index forward. TimeSpan startTime = indexGeneration.AnalysisStartOffset; // start the loop for (int t = 0; t < superTileCount; t++) { Image image = DrawOneScaledIndexSpectrogramTile( analysisConfig, indexGeneration, indexProperties, startTime, dataScale, imageScale, superTileWidth, spectra, basename, chromeOption); superTiles[t] = new TimeOffsetSingleLayerSuperTile( durationToPreviousTileBoundaryAtUnitScale: alignmentPadding, spectrogramType: SpectrogramType.Index, scale: imageScale, image: image, timeOffset: startTime); startTime += superTileDuration; if (startTime > sourceDataDuration) { break; } } return superTiles; } public static Image DrawOneScaledIndexSpectrogramTile( LdSpectrogramConfig config, IndexGenerationData indexGenerationData, Dictionary<string, IndexProperties> indexProperties, TimeSpan startTime, TimeSpan dataScale, TimeSpan imageScale, int superTileImageWidth, Dictionary<string, double[,]> spectra, string basename, ImageChrome chromeOption) { Contract.Requires(!spectra.IsNullOrEmpty()); // calculate data duration from column count of abitrary matrix var matrix = spectra.First().Value; int columnCount = matrix.GetLength(1); TimeSpan dataDuration = TimeSpan.FromSeconds(columnCount * dataScale.TotalSeconds); var analysisStartTime = indexGenerationData.RecordingStartDate.Value.TimeOfDay.Add(indexGenerationData.AnalysisStartOffset); TimeSpan offsetTime = TimeSpan.Zero; TimeSpan imageDuration = TimeSpan.FromTicks(superTileImageWidth * imageScale.Ticks); TimeSpan halfImageDuration = TimeSpan.FromTicks(superTileImageWidth * imageScale.Ticks / 2); if (startTime < TimeSpan.Zero) { offsetTime = TimeSpan.Zero - startTime; startTime = TimeSpan.Zero; } TimeSpan endTime = startTime + imageDuration; if (endTime > dataDuration) { endTime = dataDuration; } // get the plain unchromed spectrogram Image ldSpectrogram = ZoomCommon.DrawIndexSpectrogramCommon( config, indexGenerationData, indexProperties, startTime, endTime, dataScale, imageScale, superTileImageWidth, spectra, basename); if (chromeOption == ImageChrome.Without) { return ldSpectrogram; } Graphics g2 = Graphics.FromImage(ldSpectrogram); int nyquist = 22050 / 2; if (indexGenerationData.SampleRateResampled > 0) { nyquist = indexGenerationData.SampleRateResampled / 2; } int hertzInterval = 1000; if (config != null) { hertzInterval = config.YAxisTicInterval; } string title = $"ZOOM SCALE={imageScale.TotalSeconds}s/pixel"; Image titleBar = ZoomFocusedSpectrograms.DrawTitleBarOfZoomSpectrogram(title, ldSpectrogram.Width); startTime += analysisStartTime; ldSpectrogram = ZoomFocusedSpectrograms.FrameZoomSpectrogram( ldSpectrogram, titleBar, startTime, imageScale, config.XAxisTicInterval, nyquist, hertzInterval); // create the base image Image image = new Bitmap(ldSpectrogram.Width, ldSpectrogram.Height); Graphics g1 = Graphics.FromImage(image); g1.Clear(Color.DarkGray); var xOffset = (int)(offsetTime.Ticks / imageScale.Ticks); g1.DrawImage(ldSpectrogram, xOffset, 0); return image; } /// <summary> /// Assume that we are processing data for one minute only. /// From this one minute of data, we produce images at three scales. /// A one minute recording framed at 20ms should yield 3000 frames. /// But to achieve this where sr= 22050 and frameSize=512, we need an overlap of 71 samples. /// Consequently only 2999 frames returned per minute. /// Therefore have to pad end to get 3000 frames. /// </summary> public static TimeOffsetSingleLayerSuperTile[] DrawSuperTilesFromSingleFrameSpectrogram(DirectoryInfo dataDir, LdSpectrogramConfig analysisConfig, Dictionary<string, IndexProperties> indexProperties, SpectrogramZoomingConfig zoomingConfig, int minute, double[] imageScales, string basename, IndexGenerationData indexGeneration, ImageChrome chromeOption, TimeSpan alignmentPadding) { string fileStem = basename; // string analysisType = analysisConfig.AnalysisType; TimeSpan indexScale = indexGeneration.IndexCalculationDuration; TimeSpan frameScale = TimeSpan.FromSeconds(zoomingConfig.SpectralFrameDuration); var expectedDataDurationInSeconds = (int)indexGeneration.MaximumSegmentDuration.Value.TotalSeconds; var expectedFrameCount = (int)Math.Round(expectedDataDurationInSeconds / zoomingConfig.SpectralFrameDuration); string fileName = fileStem + "_" + minute + "min.csv"; string csvPath = Path.Combine(dataDir.FullName, fileName); bool skipHeader = true; bool skipFirstColumn = true; // read spectrogram into a list of frames List<double[]> frameList = CsvTools.ReadCSVFileOfDoubles(csvPath, skipHeader, skipFirstColumn); if (frameList == null) { LoggedConsole.WriteErrorLine( "WARNING: METHOD DrawSuperTilesFromSingleFrameSpectrogram(): NO SPECTRAL DATA SUPPLIED"); return null; } PadEndOfListOfFrames(frameList, expectedFrameCount); TrimEndOfListOfFrames(frameList, expectedFrameCount); //// frame count will be one less than expected for the recording segment because of frame overlap //// Therefore pad the end of the list of frames with the last frame. // int frameDiscrepancy = expectedFrameCount - frameList.Count; // if (frameDiscrepancy > 0) // { // double[] frame = frameList[frameList.Count - 1]; // for (int d = 0; d < frameDiscrepancy; d++) // { // frameList.Add(frame); // } // } var frameData = new TemporalMatrix("rows", MatrixTools.ConvertList2Matrix(frameList), frameScale); frameData.SwapTemporalDimension(); // so the two data matrices have the same temporal dimension TimeSpan startTime = indexGeneration.AnalysisStartOffset; // default = zero minute of day i.e. midnight TimeSpan startTimeOfData = startTime + TimeSpan.FromMinutes(minute); var str = new TimeOffsetSingleLayerSuperTile[imageScales.Length]; // make the images for (int scale = 0; scale < imageScales.Length; scale++) { TimeSpan imageScale = TimeSpan.FromSeconds(imageScales[scale]); var compressionFactor = (int)Math.Round(imageScale.TotalMilliseconds / frameData.DataScale.TotalMilliseconds); double columnDuration = imageScale.TotalSeconds; // int expectedFrameCount = (int)Math.Round(expectedDataDurationInSeconds / columnDuration); // ############## RESEARCH CHOICE HERE >>>> compress spectrograms to correct scale using either max or average // Average appears to offer better contrast. // double[,] data = frameData.CompressMatrixInTemporalDirectionByTakingMax(imageScale); double[,] data = frameData.CompressMatrixInTemporalDirectionByTakingAverage(imageScale); Image spectrogramImage = DrawFrameSpectrogramAtScale( analysisConfig, zoomingConfig, startTimeOfData, imageScale, data, indexGeneration, chromeOption); str[scale] = new TimeOffsetSingleLayerSuperTile( alignmentPadding, SpectrogramType.Frame, imageScale, spectrogramImage, startTimeOfData); } return str; } /// <summary> /// THis method pads the end of a list of frames read from a csv file. /// The frame count will be one less than expected for the recording segment because of frame overlap /// Therefore pad the end of the list of frames with the last frame. /// </summary> public static void PadEndOfListOfFrames(List<double[]> frameList, int expectedFrameCount) { int frameDiscrepancy = expectedFrameCount - frameList.Count; if (frameDiscrepancy > 0) { double[] frame = frameList[frameList.Count - 1]; for (int d = 0; d < frameDiscrepancy; d++) { frameList.Add(frame); } } } /// <summary> /// THis method trims the end of a list of frames read from a csv file. /// Sometimes inaccuracies in cutting audio produced frame counts that are too long. /// Therefore too many columns are rendered. Simply remove the end frames and issue a warning. /// TODO: a better solution would be to interpolate the extra frames... but too hard at the moment. /// </summary> public static void TrimEndOfListOfFrames(List<double[]> frameList, int expectedFrameCount) { int frameDiscrepancy = frameList.Count - expectedFrameCount; if (frameDiscrepancy > 0) { frameList.RemoveRange(frameList.Count - frameDiscrepancy, frameDiscrepancy); Log.Warn(frameDiscrepancy + " frames were trimmed from a frame spectrogram"); } } } }
45.179272
388
0.579887
[ "Apache-2.0" ]
stewartmacdonald/audio-analysis
src/AudioAnalysisTools/LongDurationSpectrograms/Zooming/ZoomTiledSpectrograms.cs
32,260
C#
namespace Coevent.Dal.Configuration; using Coevent.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; public class EventOccurrenceConfiguration : AuditColumnsConfiguration<EventOccurrence> { protected override void OnConfigure(EntityTypeBuilder<EventOccurrence> builder) { builder.ToTable("EventOccurrences"); builder.HasKey(m => m.Id); builder.Property(m => m.Id).ValueGeneratedOnAdd(); builder.Property(m => m.Name).IsRequired().HasMaxLength(100); builder.Property(m => m.Description).IsRequired(false).HasMaxLength(2000); builder.Property(m => m.EventId).IsRequired(); builder.Property(m => m.IsDisabled).IsRequired(); builder.Property(m => m.Status).IsRequired(); builder.Property(m => m.StartOn).IsRequired().HasColumnType("DATETIME2"); builder.Property(m => m.EndOn).IsRequired().HasColumnType("DATETIME2"); builder.Property(m => m.DisplayOrder).IsRequired(); builder.HasOne(m => m.Event).WithMany(m => m.Occurrences).HasForeignKey(m => m.EventId).OnDelete(DeleteBehavior.Cascade); } }
44.384615
129
0.709705
[ "Apache-2.0" ]
FosolSolutions/coevent
api/libs/dal/configuration/EventOccurrenceConfiguration.cs
1,154
C#
using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace aws { [JsiiByValue(fqn: "aws.GlueCatalogTableStorageDescriptorSkewedInfo")] public class GlueCatalogTableStorageDescriptorSkewedInfo : aws.IGlueCatalogTableStorageDescriptorSkewedInfo { [JsiiOptional] [JsiiProperty(name: "skewedColumnNames", typeJson: "{\"collection\":{\"elementtype\":{\"primitive\":\"string\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public string[]? SkewedColumnNames { get; set; } [JsiiOptional] [JsiiProperty(name: "skewedColumnValueLocationMaps", typeJson: "{\"collection\":{\"elementtype\":{\"primitive\":\"string\"},\"kind\":\"map\"}}", isOptional: true, isOverride: true)] public System.Collections.Generic.IDictionary<string, string>? SkewedColumnValueLocationMaps { get; set; } [JsiiOptional] [JsiiProperty(name: "skewedColumnValues", typeJson: "{\"collection\":{\"elementtype\":{\"primitive\":\"string\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public string[]? SkewedColumnValues { get; set; } } }
36.257143
189
0.620173
[ "MIT" ]
scottenriquez/cdktf-alpha-csharp-testing
resources/.gen/aws/aws/GlueCatalogTableStorageDescriptorSkewedInfo.cs
1,269
C#
using System.Collections.Generic; using System.Text.RegularExpressions; namespace TerritoryTools.Entities.AddressParsers { public class PostalCodeFinder : Finder { public PostalCodeFinder(AddressParseContainer container) : base(container) { possibleMatches = new List<AddressPartResult>(); } private List<AddressPartResult> possibleMatches; protected override void FindPossibleMatch(AddressPartResult result) { if (IsAPossibleMatch(result)) { possibleMatches.Add(result); } } protected override bool PossibleMatchesWereFound() { return possibleMatches.Count > 0; } protected override void FindMatch() { foreach(var postalCode in possibleMatches) { FindMatchIn(postalCode); } } private void FindMatchIn(AddressPartResult postalCode) { if (IsInCorrectLocation(postalCode)) { FindAndMatchLength(postalCode); } } private void FindAndMatchLength(AddressPartResult postalCode) { if (IsNormalLength(postalCode)) { container.ParsedAddress.PostalCode = postalCode; } else if (HasZipExt(postalCode)) { SetPostalCodeAndExt(postalCode); } else { var message = "PostalCode wrong length: " + postalCode.Value; throw new AddressParsingException(message); } } private void SetPostalCodeAndExt(AddressPartResult postalCode) { var firstHalf = new AddressPartResult() { Value = postalCode.Value.Substring(0, 5), Index = postalCode.Index, }; var secondHalf = new AddressPartResult() { Value = postalCode.Value.Substring(6, 4), Index = postalCode.Index, }; container.ParsedAddress.PostalCode = firstHalf; container.ParsedAddress.PostalCodeExt = secondHalf; } private static bool IsNormalLength(AddressPartResult postalCode) { return postalCode.Value.Length == 5; } private static bool HasZipExt(AddressPartResult postalCode) { return postalCode.Value.Length == 10; } private bool IsInCorrectLocation(AddressPartResult part) { return part.IsAfter(parsedAddress.StreetType) && (parsedAddress.UnitType.IsNotSet() || part.IsAtLeastNAfter(2, parsedAddress.UnitType)); } private bool IsAPossibleMatch(AddressPartResult result) { return IsPostalCodeFormat(result.Value); } public bool IsPostalCodeFormat(string value) { return Regex.IsMatch( value, @"^((\d{5,})|(\d{5,})-(\d{4,}))$", RegexOptions.IgnoreCase); } } }
28.648649
77
0.548428
[ "MIT" ]
territorytools/territory-tools
Common/AddressParser/PostalCodeFinder.cs
3,182
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ public partial class CMSModules_Membership_Pages_Users_General_User_Online { /// <summary> /// pnlUsers control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Panel pnlUsers; /// <summary> /// ucDisabledModule control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMSAdminControls_Basic_DisabledModuleInfo ucDisabledModule; /// <summary> /// gridElem control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::CMSAdminControls_UI_UniGrid_UniGrid gridElem; /// <summary> /// lblGeneralInfo control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblGeneralInfo; }
33.04
82
0.565981
[ "MIT" ]
CMeeg/kentico-contrib
src/CMS/CMSModules/Membership/Pages/Users/General/User_Online.aspx.designer.cs
1,654
C#
using yozepi.Retry.Runners; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace yozepi.Retry.Builders { public class TaskRetryBuilder<T>: BaseAsyncBuilder { public Task<T> Go() { return Go(CancellationToken.None); } public async Task<T> Go(CancellationToken cancellationToken) { await RunAsync(cancellationToken); return (Winner as TaskRunner<T>).Result; } } }
21.5
68
0.652952
[ "Apache-2.0" ]
yozepi/Retry
yozepi.TryIt.PCL/Builders/Task_T_RetryBuilder.cs
561
C#
// ================================================================================================================================ // File: ObservationCamera.cs // Description: Handles the controls and status of the servers observation camera // Author: Harley Laurie https://www.github.com/Swaelo/ // ================================================================================================================================ using System.Numerics; using ContentRenderer; using ServerUtilities; using Server.Enums; using Server.Logging; namespace Server.Logic { public class ObservationCamera { public Camera SceneCamera = null; public CameraMoveSpeedState CameraSpeedState = CameraMoveSpeedState.Regular; private bool CameraLock = false; public void SetCamera(GameLoop Loop) { SceneCamera = Loop.Camera; } public void PositionCamera(Vector3 Position) { SceneCamera.Position = Position; } public void FaceCamera(float Yaw, float Pitch) { SceneCamera.Yaw = Yaw; SceneCamera.Pitch = Pitch; } public void MoveCamera(Controls UserControls, Input UserInput, float DeltaTime) { var CameraOffset = new Vector3(); if (UserControls.MoveForward.IsDown(UserInput)) CameraOffset += SceneCamera.Forward; if (UserControls.MoveBackward.IsDown(UserInput)) CameraOffset += SceneCamera.Backward; if (UserControls.MoveLeft.IsDown(UserInput)) CameraOffset += SceneCamera.Left; if (UserControls.MoveRight.IsDown(UserInput)) CameraOffset += SceneCamera.Right; if (UserControls.MoveUp.IsDown(UserInput)) CameraOffset += SceneCamera.Up; if (UserControls.MoveDown.IsDown(UserInput)) CameraOffset += SceneCamera.Down; CameraLock = UserControls.RMB.IsDown(UserInput); //Only update the camera position if its to be moved past a minimum distance float CameraMovement = CameraOffset.Length(); if (CameraMovement > 1e-7f) { //Get the current camera movement speed float CameraMoveSpeed = 0; switch (CameraSpeedState) { case CameraMoveSpeedState.Slow: CameraMoveSpeed = UserControls.CameraSlowMoveSpeed; break; case CameraMoveSpeedState.Regular: CameraMoveSpeed = UserControls.CameraMoveSpeed; break; case CameraMoveSpeedState.Fast: CameraMoveSpeed = UserControls.CameraFastMoveSpeed; break; } //Keep the movement speed framerate independant CameraOffset *= DeltaTime * CameraMoveSpeed / CameraMovement; } else CameraOffset = new Vector3(); //Update the cameras position SceneCamera.Position += CameraOffset; //Use the mouse to turn the camera when the RMB is held down if (CameraLock) { var Delta = UserInput.MouseDelta; if (Delta.X != 0 || Delta.Y != 0) { SceneCamera.Yaw += Delta.X * UserControls.MouseSensitivity; SceneCamera.Pitch += Delta.Y * UserControls.MouseSensitivity; } } } public void UpdateCamera(Controls UserControls, Input UserInput, float DeltaTime) { //Adjust camera movement speed with the scrollwheel if (UserControls.MoveFaster.WasTriggered(UserInput)) { switch (CameraSpeedState) { case CameraMoveSpeedState.Slow: CameraSpeedState = CameraMoveSpeedState.Regular; break; case CameraMoveSpeedState.Regular: CameraSpeedState = CameraMoveSpeedState.Fast; break; } } if (UserControls.MoveSlower.WasTriggered(UserInput)) { switch (CameraSpeedState) { case CameraMoveSpeedState.Regular: CameraSpeedState = CameraMoveSpeedState.Slow; break; case CameraMoveSpeedState.Fast: CameraSpeedState = CameraMoveSpeedState.Regular; break; } } //Move camera around the world with WASD MoveCamera(UserControls, UserInput, DeltaTime); } } }
38.84127
132
0.518799
[ "MIT" ]
Swaelo/mmo-server-2.0
Server/Logic/ObservationCamera.cs
4,896
C#
using System.Collections.Generic; using FluentValidation; using FluentValidation.Results; namespace CoreSharp.Validation.Tests.Models { public class GenericChildParent { public List<GenericChildChild> Children { get; set; } = new List<GenericChildChild>(); public GenericChildChild Relation { get; set; } } public abstract class GenericChildChild { public string Name { get; set; } } public class ConcreteGenericChildChild : GenericChildChild { } public class ConcreteGenericChildChild2 : GenericChildChild { } public class GenericChildParentValidator : Validator<GenericChildParent> { public GenericChildParentValidator(IValidator<GenericChildChild> childValidator) { RuleForEach(o => o.Children).SetValidator(childValidator); RuleFor(o => o.Relation).SetValidator(childValidator); } } public class GenericChildDomainValidator<TChild> : AbstractDomainValidator<GenericChildParent, TChild> where TChild : GenericChildChild { public override IEnumerable<ValidationFailure> Validate(TChild child, ValidationContext context) { if (child.Name == "Invalid") { yield return Failure("Invalid name", context); } yield return string.IsNullOrEmpty(child.Name) ? Failure(o => o.Name, "Should not be empty", context) : Success; } public override bool CanValidate(TChild child, ValidationContext context) { return true; } } }
28.446429
139
0.6629
[ "MIT" ]
cime/CoreSharp
CoreSharp.Validation.Tests/Models/GenericChildModel.cs
1,595
C#
/* Copyright 2013-present MongoDB Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.IO; using FluentAssertions; using Xunit; namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders { public class KillCursorsMessageBinaryEncoderTests { #region static // static fields private static readonly long[] __cursorIds = new[] { 2L }; private static readonly MessageEncoderSettings __messageEncoderSettings = new MessageEncoderSettings(); private static readonly int __requestId = 1; private static readonly KillCursorsMessage __testMessage; private static readonly byte[] __testMessageBytes; // static constructor static KillCursorsMessageBinaryEncoderTests() { __testMessage = new KillCursorsMessage(__requestId, __cursorIds); __testMessageBytes = new byte[] { 0, 0, 0, 0, // messageLength 1, 0, 0, 0, // requestId 0, 0, 0, 0, // responseTo 215, 7, 0, 0, // opcode = 2007 0, 0, 0, 0, // reserved 1, 0, 0, 0, // numberOfCursorIds 2, 0, 0, 0, 0, 0, 0, 0 // cursorIds[0] }; __testMessageBytes[0] = (byte)__testMessageBytes.Length; } #endregion [Fact] public void Constructor_should_not_throw_if_stream_is_not_null() { using (var stream = new MemoryStream()) { Action action = () => new KillCursorsMessageBinaryEncoder(stream, __messageEncoderSettings); action.ShouldNotThrow(); } } [Fact] public void Constructor_should_throw_if_stream_is_null() { Action action = () => new KillCursorsMessageBinaryEncoder(null, __messageEncoderSettings); action.ShouldThrow<ArgumentNullException>(); } [Fact] public void ReadMessage_should_read_a_message() { using (var stream = new MemoryStream(__testMessageBytes)) { var subject = new KillCursorsMessageBinaryEncoder(stream, __messageEncoderSettings); var message = subject.ReadMessage(); message.CursorIds.Should().Equal(__cursorIds); message.RequestId.Should().Be(__testMessage.RequestId); } } [Fact] public void ReadMessage_should_throw_when_opcode_is_invalid() { var bytes = (byte[])__testMessageBytes.Clone(); bytes[12]++; using (var stream = new MemoryStream(bytes)) { var subject = new KillCursorsMessageBinaryEncoder(stream, __messageEncoderSettings); var exception = Record.Exception(() => subject.ReadMessage()); exception.Should().BeOfType<FormatException>(); exception.Message.Should().Be("KillCursors message opcode is not OP_KILL_CURSORS."); } } [Fact] public void WriteMessage_should_throw_if_message_is_null() { using (var stream = new MemoryStream()) { var subject = new KillCursorsMessageBinaryEncoder(stream, __messageEncoderSettings); Action action = () => subject.WriteMessage(null); action.ShouldThrow<ArgumentNullException>(); } } [Fact] public void WriteMessage_should_write_a_message() { using (var stream = new MemoryStream()) { var subject = new KillCursorsMessageBinaryEncoder(stream, __messageEncoderSettings); subject.WriteMessage(__testMessage); var bytes = stream.ToArray(); bytes.Should().Equal(__testMessageBytes); } } } }
36.783333
111
0.607839
[ "Apache-2.0" ]
Anarh2404/mongo-csharp-driver
tests/MongoDB.Driver.Core.Tests/Core/WireProtocol/Messages/Encoders/BinaryEncoders/KillCursorsMessageBinaryEncoderTests.cs
4,416
C#
using System; using System.Collections.Generic; using System.Text; namespace Surging.Tools.Cli.Internal { public interface ITransportMessageCodecFactory { /// <summary> /// 获取编码器。 /// </summary> /// <returns>编码器实例。</returns> ITransportMessageEncoder GetEncoder(); /// <summary> /// 获取解码器。 /// </summary> /// <returns>解码器实例。</returns> ITransportMessageDecoder GetDecoder(); } }
21.454545
50
0.582627
[ "MIT" ]
JohnZhaoXiaoHu/surging
src/Surging.Tools/Surging.Tools.Cli/Internal/ITransportMessageCodecFactory.cs
522
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("ParseServerConsole")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ParseServerConsole")] [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("a4a92af4-fee8-4178-9525-9f5f4fb0645a")] // 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.081081
84
0.747339
[ "MIT" ]
thewizster/parse-server-console
ParseServerConsole/Properties/AssemblyInfo.cs
1,412
C#
// <auto-generated> // Generated by the protocol buffer compiler. DO NOT EDIT! // source: POGOProtos/Settings/InventorySettings.proto // </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace POGOProtos.Settings { /// <summary>Holder for reflection information generated from POGOProtos/Settings/InventorySettings.proto</summary> public static partial class InventorySettingsReflection { #region Descriptor /// <summary>File descriptor for POGOProtos/Settings/InventorySettings.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; static InventorySettingsReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CitQT0dPUHJvdG9zL1NldHRpbmdzL0ludmVudG9yeVNldHRpbmdzLnByb3Rv", "EhNQT0dPUHJvdG9zLlNldHRpbmdzIoABChFJbnZlbnRvcnlTZXR0aW5ncxIT", "CgttYXhfcG9rZW1vbhgBIAEoBRIVCg1tYXhfYmFnX2l0ZW1zGAIgASgFEhQK", "DGJhc2VfcG9rZW1vbhgDIAEoBRIWCg5iYXNlX2JhZ19pdGVtcxgEIAEoBRIR", "CgliYXNlX2VnZ3MYBSABKAViBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::POGOProtos.Settings.InventorySettings), global::POGOProtos.Settings.InventorySettings.Parser, new[]{ "MaxPokemon", "MaxBagItems", "BasePokemon", "BaseBagItems", "BaseEggs" }, null, null, null) })); } #endregion } #region Messages public sealed partial class InventorySettings : pb::IMessage<InventorySettings> { private static readonly pb::MessageParser<InventorySettings> _parser = new pb::MessageParser<InventorySettings>(() => new InventorySettings()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<InventorySettings> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::POGOProtos.Settings.InventorySettingsReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public InventorySettings() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public InventorySettings(InventorySettings other) : this() { maxPokemon_ = other.maxPokemon_; maxBagItems_ = other.maxBagItems_; basePokemon_ = other.basePokemon_; baseBagItems_ = other.baseBagItems_; baseEggs_ = other.baseEggs_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public InventorySettings Clone() { return new InventorySettings(this); } /// <summary>Field number for the "max_pokemon" field.</summary> public const int MaxPokemonFieldNumber = 1; private int maxPokemon_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int MaxPokemon { get { return maxPokemon_; } set { maxPokemon_ = value; } } /// <summary>Field number for the "max_bag_items" field.</summary> public const int MaxBagItemsFieldNumber = 2; private int maxBagItems_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int MaxBagItems { get { return maxBagItems_; } set { maxBagItems_ = value; } } /// <summary>Field number for the "base_pokemon" field.</summary> public const int BasePokemonFieldNumber = 3; private int basePokemon_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BasePokemon { get { return basePokemon_; } set { basePokemon_ = value; } } /// <summary>Field number for the "base_bag_items" field.</summary> public const int BaseBagItemsFieldNumber = 4; private int baseBagItems_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BaseBagItems { get { return baseBagItems_; } set { baseBagItems_ = value; } } /// <summary>Field number for the "base_eggs" field.</summary> public const int BaseEggsFieldNumber = 5; private int baseEggs_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BaseEggs { get { return baseEggs_; } set { baseEggs_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as InventorySettings); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(InventorySettings other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (MaxPokemon != other.MaxPokemon) return false; if (MaxBagItems != other.MaxBagItems) return false; if (BasePokemon != other.BasePokemon) return false; if (BaseBagItems != other.BaseBagItems) return false; if (BaseEggs != other.BaseEggs) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (MaxPokemon != 0) hash ^= MaxPokemon.GetHashCode(); if (MaxBagItems != 0) hash ^= MaxBagItems.GetHashCode(); if (BasePokemon != 0) hash ^= BasePokemon.GetHashCode(); if (BaseBagItems != 0) hash ^= BaseBagItems.GetHashCode(); if (BaseEggs != 0) hash ^= BaseEggs.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (MaxPokemon != 0) { output.WriteRawTag(8); output.WriteInt32(MaxPokemon); } if (MaxBagItems != 0) { output.WriteRawTag(16); output.WriteInt32(MaxBagItems); } if (BasePokemon != 0) { output.WriteRawTag(24); output.WriteInt32(BasePokemon); } if (BaseBagItems != 0) { output.WriteRawTag(32); output.WriteInt32(BaseBagItems); } if (BaseEggs != 0) { output.WriteRawTag(40); output.WriteInt32(BaseEggs); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (MaxPokemon != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxPokemon); } if (MaxBagItems != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxBagItems); } if (BasePokemon != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(BasePokemon); } if (BaseBagItems != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(BaseBagItems); } if (BaseEggs != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(BaseEggs); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(InventorySettings other) { if (other == null) { return; } if (other.MaxPokemon != 0) { MaxPokemon = other.MaxPokemon; } if (other.MaxBagItems != 0) { MaxBagItems = other.MaxBagItems; } if (other.BasePokemon != 0) { BasePokemon = other.BasePokemon; } if (other.BaseBagItems != 0) { BaseBagItems = other.BaseBagItems; } if (other.BaseEggs != 0) { BaseEggs = other.BaseEggs; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { MaxPokemon = input.ReadInt32(); break; } case 16: { MaxBagItems = input.ReadInt32(); break; } case 24: { BasePokemon = input.ReadInt32(); break; } case 32: { BaseBagItems = input.ReadInt32(); break; } case 40: { BaseEggs = input.ReadInt32(); break; } } } } } #endregion } #endregion Designer generated code
33.520833
249
0.654237
[ "MIT" ]
Necrobot-Private/POGOProtos
Settings/InventorySettings.g.cs
9,654
C#
using System; using System.Reflection; using System.Threading.Tasks; using EventStore.ClientAPI; using Marketplace.Domain.ClassifiedAds; using Marketplace.Framework; using Marketplace.Infrastructure; using Marketplace.Infrastructure.EventStore; using Marketplace.Infrastructure.JsonNet; using Marketplace.Infrastructure.Purgomalum; using Marketplace.Infrastructure.RavenDB; using Marketplace.Modules.ClassifiedAds; using Marketplace.Modules.ClassifiedAds.Projections; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Raven.Client.Documents; using Raven.Client.Documents.Indexes; using Raven.Client.Documents.Session; using Raven.Client.ServerWide; using Raven.Client.ServerWide.Operations; using Swashbuckle.AspNetCore.Swagger; using static System.Environment; namespace Marketplace { public class Startup { static readonly Serilog.ILogger Log = Serilog.Log.ForContext<Startup>(); public Startup(IHostingEnvironment environment, IConfiguration configuration) { Environment = environment; Configuration = configuration; } IConfiguration Configuration { get; } IHostingEnvironment Environment { get; } public void ConfigureServices(IServiceCollection services) => ConfigureServicesAsync(services).GetAwaiter().GetResult(); async Task ConfigureServicesAsync(IServiceCollection services) { var gesConnection = EventStoreConnection.Create( Configuration["EventStore:ConnectionString"], ConnectionSettings.Create().KeepReconnecting(), Environment.ApplicationName); gesConnection.Connected += (sender, args) => Log.Information("Connection to {endpoint} event store established.", args.RemoteEndPoint); await gesConnection.ConnectAsync(); var serializer = new JsonNetSerializer(); var typeMapper = new TypeMapper() .Map<Events.V1.ClassifiedAdRegistered>("Marketplace.V1.ClassifiedAdRegistered") .Map<Events.V1.ClassifiedAdTitleChanged>("Marketplace.V1.ClassifiedAdTitleChanged") .Map<Events.V1.ClassifiedAdTextChanged>("Marketplace.V1.ClassifiedAdTextUpdated") .Map<Events.V1.ClassifiedAdPriceChanged>("Marketplace.V1.ClassifiedAdPriceChanged") .Map<Events.V1.ClassifiedAdPublished>("Marketplace.V1.ClassifiedAdPublished") .Map<Events.V1.ClassifiedAdSold>("Marketplace.V1.ClassifiedAdMarkedAsSold") .Map<Events.V1.ClassifiedAdRemoved>("Marketplace.V1.ClassifiedAdRemoved"); var aggregateStore = new GesAggregateStore( (type, id) => $"{type.Name}-{id}", gesConnection, serializer, typeMapper); var purgomalumClient = new PurgomalumClient(); services.AddSingleton(new ClassifiedAdsApplicationService( aggregateStore, () => DateTimeOffset.UtcNow, text => purgomalumClient.CheckForProfanity(text))); var documentStore = ConfigureRaven(); IAsyncDocumentSession GetSession() => documentStore.OpenAsyncSession(); services.AddSingleton<Func<IAsyncDocumentSession>>(GetSession); services.AddSingleton(new ClassifiedAdsQueryService(GetSession)); await ProjectionManager.With .Connection(gesConnection) .Serializer(serializer) .TypeMapper(typeMapper) .CheckpointStore(new RavenCheckpointStore(GetSession)) .Projections( new SoldClassifiedAdsProjection(GetSession), new AvailableClassifiedAdsProjection(GetSession)) .Activate(); services.AddMvc(); services.AddSwaggerGen(c => { c.IncludeXmlComments($"{CurrentDirectory}/Marketplace.xml"); c.SwaggerDoc( $"v{Configuration["Swagger:Version"]}", new Info { Title = Configuration["Swagger:Title"], Version = $"v{Configuration["Swagger:Version"]}" }); }); } public void Configure(IApplicationBuilder app, IHostingEnvironment environment) { app.UseExceptionMiddleware(); app.UseMvcWithDefaultRoute(); app.UseSwagger(); app.UseSwaggerUI(options => options.SwaggerEndpoint( Configuration["Swagger:Endpoint:Url"], Configuration["Swagger:Endpoint:Name"])); } IDocumentStore ConfigureRaven() { var store = new DocumentStore { Urls = new[] {Configuration["RavenDb:Url"]}, Database = Configuration["RavenDb:Database"] }; if (Environment.IsDevelopment()) store.OnBeforeQuery += (_, args) => args.QueryCustomization .WaitForNonStaleResults() .AfterQueryExecuted(result => { Log.ForContext("SourceContext", "Raven").Debug("{index} took {duration}", result.IndexName, result.DurationInMs); }); try { store.Initialize(); Log.Information("Connection to {url} document store established.", store.Urls[0]); } catch (Exception ex) { throw new ApplicationException( $"Failed to establish connection to \"{store.Urls[0]}\" document store!" + $"Please check if https is properly configured in order to use the certificate.", ex); } try { var record = store.Maintenance.Server.Send(new GetDatabaseRecordOperation(store.Database)); if (record == null) { store.Maintenance.Server .Send(new CreateDatabaseOperation(new DatabaseRecord(store.Database))); Log.Debug("{database} document store database created.", store.Database); } } catch (Exception ex) { throw new ApplicationException( $"Failed to ensure that \"{store.Database}\" document store database exists!", ex); } try { IndexCreation.CreateIndexes(Assembly.GetExecutingAssembly(), store); Log.Information("{database} document store database indexes created or updated.", store.Database); } catch (Exception ex) { throw new ApplicationException($"Failed to create or update \"{store.Database}\" document store database indexes!", ex); } return store; } } }
39.758427
137
0.608591
[ "Apache-2.0" ]
UbiquitousAS/WorkshopEventSourcing
src/Marketplace/Startup.cs
7,081
C#
/**************************************************************************** * Copyright 2019 Nreal Techonology Limited. All rights reserved. * * This file is part of NRSDK. * * https://www.nreal.ai/ * *****************************************************************************/ using System.Collections; using UnityEngine; namespace NRKernal.NRExamples { /// <summary> An ensure slam tracking mode. </summary> public class EnsureSlamTrackingMode : MonoBehaviour { /// <summary> Type of the tracking. </summary> [SerializeField] private NRHMDPoseTracker.TrackingType m_TrackingType = NRHMDPoseTracker.TrackingType.Tracking6Dof; /// <summary> Starts this object. </summary> void Start() { StartCoroutine(EnsureTrackingType(m_TrackingType)); } private IEnumerator EnsureTrackingType(NRHMDPoseTracker.TrackingType type) { WaitForEndOfFrame waitForEndOfFrame = new WaitForEndOfFrame(); if (m_TrackingType == NRHMDPoseTracker.TrackingType.Tracking0Dof && NRSessionManager.Instance.NRHMDPoseTracker.TrackingMode != m_TrackingType) { while (!NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo0Dof(null)) { yield return waitForEndOfFrame; } } else if (m_TrackingType == NRHMDPoseTracker.TrackingType.Tracking3Dof && NRSessionManager.Instance.NRHMDPoseTracker.TrackingMode != m_TrackingType) { while (!NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo3Dof(null)) { yield return waitForEndOfFrame; } } else if (m_TrackingType == NRHMDPoseTracker.TrackingType.Tracking6Dof && NRSessionManager.Instance.NRHMDPoseTracker.TrackingMode != m_TrackingType) { while (!NRSessionManager.Instance.NRHMDPoseTracker.ChangeTo6Dof(null)) { yield return waitForEndOfFrame; } } } } }
47.703704
160
0.473602
[ "MIT" ]
NoxDecima/MR-Dashboard
Assets/NRSDK/Demos/HelloMR/Scripts/EnsureSlamTrackingMode.cs
2,578
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; using System.Threading; using System.Threading.Tasks; using CouchDB.Driver; using CouchDB.Driver.Indexes; using CouchDB.Driver.Options; using CouchDB.Driver.Types; using Flurl.Http.Configuration; using M5x.Schemas; using Serilog; namespace M5x.DEC.Infra.CouchDb { public class CouchStateStore<TStateModel,TId> : ICouchStore<TStateModel> where TId: IAggregateID where TStateModel : IStateEntity<TId> { private readonly ICouchClient _clt; private readonly ILogger _logger; private ICouchDatabase<CDoc<TStateModel>> _cachedDb; public CouchStateStore(ICouchClient client, ILogger logger) { _clt = client; _logger = logger; } public CouchStateStore(string dbName, string connectionString, Action<CouchOptionsBuilder> couchSettingsFunc, Action<ClientFlurlHttpSettings> flurlSettingsFunc) { _clt = new CouchClient(couchSettingsFunc); } private string DbName => GetDbName(); public ICouchDatabase<CouchUser> UsersDb => GetUsersDb(); public ICouchDatabase<CDoc<TStateModel>> Db => GetDb(DbName).Result; public async Task<TStateModel> AddOrUpdateAsync(TStateModel entity, bool batch=false, bool withConflicts=false, CancellationToken cancellationToken=default(CancellationToken)) { TStateModel res; var doc = CreateCDoc(entity); try { var oldDoc = await Db.FindAsync(doc.Id, withConflicts, cancellationToken); if (oldDoc != null) { if(oldDoc.Rev!=entity.Prev) { doc.Rev = oldDoc.Rev; } } doc = await Db.AddOrUpdateAsync(doc,batch,cancellationToken); res = doc.Data; res.Prev = doc.Rev; } catch (Exception e) { _logger?.Error(JsonSerializer.Serialize(e.AsApiError())); throw; } return res; } public async Task<TStateModel> GetByIdAsync(string id) { var doc = await Db.FindAsync(id); return doc == null ? default : doc.Data; } public async Task<IEnumerable<TStateModel>> RetrieveRecent(int pageNumber, int pageSize) { var index = await Db.CreateIndexAsync( "recent", builder => { builder.IndexByDescending(d => d.TimeStamp); }, new IndexOptions() { DesignDocument = "default", Partitioned = false }); return Db.OrderByDescending(d => d.TimeStamp) .Skip(pageSize * (pageNumber - 1)) .Take(pageSize) .Select(x => x.Data) .ToArray(); } private string GetDbName() { var atts = (DbNameAttribute[]) typeof(TStateModel).GetCustomAttributes(typeof(DbNameAttribute), true); if (atts.Length == 0) throw new Exception($"Attribute [DbName] is missing on {typeof(TStateModel)}"); return atts[0].DbName; } public async Task<ICouchDatabase<CDoc<TStateModel>>> GetDb(string dbName) { if (_cachedDb != null) return _cachedDb; _cachedDb = await _clt.GetOrCreateDatabaseAsync<CDoc<TStateModel>>(dbName); return _cachedDb; } protected CDoc<TStateModel> CreateCDoc(TStateModel model) { return new() { Id = model.AggregateId.Value, Rev = model.Prev, Data = model, TimeStamp = DateTime.UtcNow }; } private ICouchDatabase<CouchUser> GetUsersDb() { try { return _clt.GetUsersDatabase(); } catch (Exception e) { Console.WriteLine(e); throw; } } } }
31.813433
183
0.546094
[ "MIT" ]
rgfaber/m5x-sdk
src/obsolete/M5x.DEC.Infra/CouchDb/CouchStateStore.cs
4,263
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ReadOnlyText.cs" company="Sitecore A/S"> // Copyright (C) 2013 by Sitecore A/S // </copyright> // <summary> // Present ReadOnly field type. // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace Sitecore.MediaFramework.UI.FieldTypes { using System; using Sitecore.Shell.Applications.ContentEditor; using Sitecore.Web.UI.HtmlControls; /// <summary> /// Present ReadOnly field type. /// </summary> public class ReadOnlyText : Edit, IContentField { public ReadOnlyText() { base.Class = "scContentControl"; base.Activation = true; } public string GetValue() { return this.Value; } public void SetValue(string value) { this.Value = value; } protected override void OnPreRender(EventArgs e) { this.ReadOnly = true; this.Background = "Transparent"; base.OnPreRender(e); } } }
25.822222
121
0.481928
[ "Apache-2.0" ]
BrightcoveOS/Sitecore-8.x-Media-Framework-2.x-Connector
src/Sitecore.MediaFramework/UI/FieldTypes/ReadOnlyText.cs
1,164
C#
using System; using System.Collections.Generic; using Elasticsearch.Net; using Nest; using Tests.Framework; using Tests.Framework.Integration; using Xunit; namespace Tests.Indices.AliasManagement.PutAlias { [Collection(IntegrationContext.Indexing)] public class PutAliasApiTests : ApiIntegrationTestBase<IPutAliasResponse, IPutAliasRequest, PutAliasDescriptor, PutAliasRequest> { protected override void BeforeAllCalls(IElasticClient client, IDictionary<ClientMethod, string> values) { foreach (var index in values.Values) client.CreateIndex(index); } public PutAliasApiTests(IndexingCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.PutAlias(CallIsolatedValue, CallIsolatedValue + "-alias"), fluentAsync: (client, f) => client.PutAliasAsync(CallIsolatedValue, CallIsolatedValue + "-alias"), request: (client, r) => client.PutAlias(r), requestAsync: (client, r) => client.PutAliasAsync(r) ); protected override bool ExpectIsValid => true; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.PUT; protected override string UrlPath => $"/{CallIsolatedValue}/_alias/{CallIsolatedValue + "-alias"}"; protected override bool SupportsDeserialization => false; protected override Func<PutAliasDescriptor, IPutAliasRequest> Fluent => null; protected override PutAliasRequest Initializer => new PutAliasRequest(CallIsolatedValue, CallIsolatedValue + "-alias"); } }
41.157895
129
0.776854
[ "Apache-2.0" ]
RossLieberman/NEST
src/Tests/Indices/AliasManagement/PutAlias/PutAliasApiTests.cs
1,566
C#
using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; namespace MindMapEditor { public class DragSelection : MonoBehaviour { private LineRenderer lineRenderer; private DragRectDrawer dragRectDrawer; private bool isFirstClick = true; private void Start() { lineRenderer = GetComponent<LineRenderer>(); dragRectDrawer = new DragRectDrawer(lineRenderer); } private void Update() { bool isDraw = Input.GetKey(KeyCode.Mouse0) && UserData.Instance.ToolMode == ToolMode.Selection && !Toolbar.Instance.IsMouseOnToolbar; if (isDraw) { if (isFirstClick) // so that the selection box is only drawable starting from outside of a box { if (!Boxes.Instance.IsMouseOnAnyBox()) { dragRectDrawer.DrawRect(isDraw, false); isFirstClick = false; } } else { dragRectDrawer.DrawRect(isDraw, false); } } else { dragRectDrawer.DrawRect(false, false); // force reset the drawer isFirstClick = true; } } } }
29.956522
145
0.523948
[ "MIT" ]
palapapa/MindMapEditor
Assets/Scripts/DragSelection.cs
1,380
C#
namespace EnvDTE { public interface ToolBox { DTE DTE { get; } Window Parent { get; } ToolBoxTab ActiveTab { get; } ToolBoxTabs ToolBoxTabs { get; } } }
18
40
0.545455
[ "Apache-2.0" ]
JetBrains/JetBrains.EnvDTE
EnvDTE.Interfaces/ToolBox.cs
200
C#
using System.Diagnostics; namespace Gst.Tests { public abstract class BaseTest { public BaseTest() { Gstreamer.Init(); } public void PrintLine(object line) { Debug.WriteLine(line); } } }
16.058824
42
0.512821
[ "MIT" ]
ismaildurmaz/gstreamer-sharp
src/gstreamer-sharp/Tests/BaseTest.cs
275
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("JKLog")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("JKLog")] [assembly: AssemblyCopyright("Copyright © 2016 Joni Kukko")] [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("351f1c33-494a-478f-83e9-715cb86650ff")] // 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.648649
84
0.743719
[ "MIT" ]
JoniKukko/JKLog
JKLog/JKLog/Properties/AssemblyInfo.cs
1,396
C#
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ namespace Microsoft.Azure.IIoT.Net.Scanner { using Serilog; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; /// <summary> /// Scans port ranges /// </summary> public sealed class PortScanner : IScanner { /// <summary> /// Number of items scanned /// </summary> public int ScanCount => _scanCount; /// <summary> /// Number of active probes /// </summary> public int ActiveProbes => _active; /// <summary> /// Create scanner with default port probe /// </summary> /// <param name="logger"></param> /// <param name="source"></param> /// <param name="target"></param> /// <param name="ct"></param> public PortScanner(ILogger logger, IEnumerable<IPEndPoint> source, Action<IPEndPoint> target, CancellationToken ct) : this(logger, source, target, null, ct) { } /// <summary> /// Create scanner /// </summary> /// <param name="logger"></param> /// <param name="source"></param> /// <param name="target"></param> /// <param name="portProbe"></param> /// <param name="ct"></param> public PortScanner(ILogger logger, IEnumerable<IPEndPoint> source, Action<IPEndPoint> target, IPortProbe portProbe, CancellationToken ct) : this(logger, source, target, portProbe, null, null, null, ct) { } /// <summary> /// Create scanner /// </summary> /// <param name="logger"></param> /// <param name="source"></param> /// <param name="target"></param> /// <param name="portProbe"></param> /// <param name="maxProbeCount"></param> /// <param name="minProbePercent"></param> /// <param name="timeout"></param> /// <param name="ct"></param> public PortScanner(ILogger logger, IEnumerable<IPEndPoint> source, Action<IPEndPoint> target, IPortProbe portProbe, int? maxProbeCount, int? minProbePercent, TimeSpan? timeout, CancellationToken ct) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _source = source?.GetEnumerator() ?? throw new ArgumentNullException(nameof(source)); _target = target ?? throw new ArgumentNullException(nameof(target)); _maxProbeCount = maxProbeCount ?? kDefaultMaxProbeCount; _minProbeCount = (int)(_maxProbeCount * ((minProbePercent ?? kDefaultMinProbePercent) / 100.0)); _timeout = timeout ?? kDefaultProbeTimeout; _portProbe = portProbe ?? new NullPortProbe(); _requeued = new ConcurrentQueue<IPEndPoint>(); _rand = new Random(); _probePool = LinqEx .Repeat(i => new ConnectProbe(this, i), _maxProbeCount) .ToList(); _cts = new CancellationTokenSource(); ct.Register(_cts.Cancel); _completion = new TaskCompletionSource<bool>(); _active = _maxProbeCount; foreach (var probe in _probePool) { probe.Start(); } } /// <summary> /// Scan completed /// </summary> public Task Completion => _completion.Task; /// <summary> /// Dispose scanner /// </summary> public void Dispose() { // Kill producer _cts.Cancel(); // Clean up all probes _active = 0; foreach (var probe in _probePool) { probe.Dispose(); } _probePool.Clear(); _completion.TrySetCanceled(); _cts.Dispose(); } /// <summary> /// Return next from source. /// </summary> private bool Next(out IPEndPoint ep) { if (_cts.IsCancellationRequested) { ep = null; return false; } lock (_source) { if (!_source.MoveNext()) { ep = null; return false; } ep = _source.Current; } return true; } /// <summary> /// Exit probe and if last propagate target complete /// </summary> private void OnProbeExit() { if (0 == Interlocked.Decrement(ref _active)) { // All probes drained - propagate target complete... if (_cts.IsCancellationRequested) { _completion.TrySetCanceled(); } else { _completion.TrySetResult(true); } } } /// <summary> /// Returns probe timeout in milliseconds but with entropy /// </summary> private int ProbeTimeoutInMilliseconds => _rand.Next( (int)(_timeout.TotalMilliseconds * 0.7), (int)(_timeout.TotalMilliseconds * 1.5)); /// <summary> /// Port connect probe /// </summary> private sealed class ConnectProbe : BaseConnectProbe { /// <summary> /// Create probe /// </summary> /// <param name="scanner"></param> /// <param name="index"></param> public ConnectProbe(PortScanner scanner, int index) : base(index, scanner._portProbe.Create(), scanner._logger) { _scanner = scanner; } /// <summary> /// Get next endpoint /// </summary> /// <param name="ep"></param> /// <param name="timeout"></param> /// <returns></returns> protected override bool Next(out IPEndPoint ep, out int timeout) { if (!_scanner.Next(out ep)) { timeout = 0; return false; } timeout = _scanner.ProbeTimeoutInMilliseconds; Interlocked.Increment(ref _scanner._scanCount); return true; } /// <summary> /// Called on error /// </summary> /// <returns></returns> protected override bool ShouldGiveUp() { return _scanner._active > _scanner._minProbeCount; } /// <summary> /// Called when endpoint probe failed for some reason /// </summary> /// <param name="ep"></param> protected override void OnFail(IPEndPoint ep) { _scanner._requeued.Enqueue(ep); Interlocked.Decrement(ref _scanner._scanCount); } /// <summary> /// Called on success /// </summary> /// <param name="ep"></param> protected override void OnSuccess(IPEndPoint ep) { _scanner._target(ep); } /// <summary> /// Called when probe terminates /// </summary> protected override void OnExit() { _scanner.OnProbeExit(); } private readonly PortScanner _scanner; } /// <summary> /// Null port probe /// </summary> private class NullPortProbe : IAsyncProbe, IPortProbe { /// <inheritdoc /> public bool CompleteAsync(int index, SocketAsyncEventArgs arg, out bool ok, out int timeout) { ok = true; timeout = 0; return true; } /// <inheritdoc /> public void Dispose() { } /// <inheritdoc /> public bool Reset() { return false; } /// <inheritdoc /> public IAsyncProbe Create() { return this; } } /// <summary> /// Max number of connect probes. On Windows, up to 5000 the performance /// improvement is linear, e.g. all ports on a Windows PC are scanned in /// around 16 seconds. /// </summary> private const int kDefaultMaxProbeCount = 1000; /// <summary> /// By default ensure at least 80% probes are going. /// </summary> private const int kDefaultMinProbePercent = 80; private static readonly TimeSpan kDefaultProbeTimeout = TimeSpan.FromSeconds(5); private readonly ConcurrentQueue<IPEndPoint> _requeued; private readonly IEnumerator<IPEndPoint> _source; private readonly TaskCompletionSource<bool> _completion; private readonly List<ConnectProbe> _probePool; private readonly Action<IPEndPoint> _target; private readonly int _maxProbeCount; private readonly int _minProbeCount; private readonly TimeSpan _timeout; private readonly CancellationTokenSource _cts; private readonly Random _rand; private readonly IPortProbe _portProbe; private readonly ILogger _logger; private int _active; private int _scanCount; } }
34.494662
99
0.518209
[ "MIT" ]
TheWaywardHayward/Industrial-IoT
common/src/Microsoft.Azure.IIoT.Net.Scan/src/Port/PortScanner.cs
9,693
C#
/* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (C) 2011 Michael Möller <mmoeller@openhardwaremonitor.org> */ using System; using System.Collections.Generic; using System.Windows.Forms; using OpenHardwareMonitor.Utilities; namespace OpenHardwareMonitor.GUI { public class UserRadioGroup { private string name; private int value; private MenuItem[] menuItems = null; private ToolStripMenuItem[] toolStripMenuItems = null; private int ItemCount { get { if (menuItems != null) return menuItems.Length; else if (toolStripMenuItems != null) return toolStripMenuItems.Length; else return -1; } } private event EventHandler changed; private PersistentSettings settings; public UserRadioGroup(string name, int value, MenuItem[] menuItems, PersistentSettings settings) { this.settings = settings; this.name = name; if (name != null) this.value = settings.GetValue(name, value); else this.value = value; this.menuItems = menuItems; this.value = Math.Max(Math.Min(this.value, menuItems.Length - 1), 0); for (int i = 0; i < this.menuItems.Length; i++) { this.menuItems[i].Checked = i == this.value; int index = i; this.menuItems[i].Click += delegate(object sender, EventArgs e) { this.Value = index; }; } } private void SetMenuItemChecked(int index, bool value) { if (this.menuItems != null) this.menuItems[index].Checked = value; else if (this.toolStripMenuItems != null) this.toolStripMenuItems[index].Checked = value; } public UserRadioGroup(string name, int value, ToolStripMenuItem[] toolStripMenuItems, PersistentSettings settings) { this.settings = settings; this.name = name; if (name != null) this.value = settings.GetValue(name, value); else this.value = value; this.toolStripMenuItems = toolStripMenuItems; this.value = Math.Max(Math.Min(this.value, toolStripMenuItems.Length - 1), 0); for (int i = 0; i < this.toolStripMenuItems.Length; i++) { SetMenuItemChecked(i, i == this.value); int index = i; this.toolStripMenuItems[i].Click += delegate (object sender, EventArgs e) { this.Value = index; }; } } public int Value { get { return value; } set { if (this.value != value) { this.value = value; if (this.name != null) settings.SetValue(name, value); for (int i = 0; i < this.ItemCount; i++) SetMenuItemChecked(i, i == value); if (changed != null) changed(this, null); } } } public event EventHandler Changed { add { changed += value; if (changed != null) changed(this, null); } remove { changed -= value; } } } }
30.491228
122
0.546893
[ "MIT" ]
manicken/FanController
OpenHardwareMonitorControl/GUI/UserRadioGroup.cs
3,479
C#
namespace LRS.NET.Core.Extensions { using System.Linq; using CuttingEdge.Conditions; using Dnum; public static class EnumExtensions { public static int GetLowerBound<TEnum>() where TEnum : struct { Condition.Requires(typeof (TEnum)).Evaluate(t => t.IsEnum); var values = Dnum<TEnum>.GetValues(); return values.First(); } public static int GetUpperBound<TEnum>() where TEnum : struct { Condition.Requires(typeof (TEnum)).Evaluate(t => t.IsEnum); var values = Dnum<TEnum>.GetValues(); return values.Last(); } } }
21.96
65
0.697632
[ "MIT" ]
m-sadegh-sh/LRS.NET
src/LRS.NET.Core/Extensions/EnumExtensions.cs
549
C#
namespace Nager.Country.Currencies { /// <summary> /// Gnf Currency /// </summary> public class GnfCurrency : ICurrency { ///<inheritdoc/> public string Symbol => "FG"; ///<inheritdoc/> public string Singular => null; ///<inheritdoc/> public string Plural => null; ///<inheritdoc/> public string IsoCode => "GNF"; ///<inheritdoc/> public string NumericCode => "324"; ///<inheritdoc/> public string Name => "Guinean franc"; } }
20.444444
46
0.523551
[ "MIT" ]
OpenBoxLab/Nager.Country
src/Nager.Country/Currencies/GnfCurrency.cs
552
C#
using System.Collections.Generic; namespace AvaloniaStyles.Utils { internal static class ListExtensions { public static void OverrideWith<T>(this IList<T> that, IList<T> with) { int i = 0; foreach (var r in with) { if (i < that.Count) that[i] = r; else that.Add(r); i++; } while (that.Count > i) { that.RemoveAt(that.Count - 1); } } } }
22.48
77
0.414591
[ "Unlicense" ]
BAndysc/WoWDatabaseEditor
AvaloniaStyles/Utils/ListExtensions.cs
562
C#
namespace CalcModels { public interface IBetonService { IBetonModel[] GetList(); string[] GetNameList(); IBetonModel GetNew(string name); } }
19.777778
40
0.61236
[ "MIT" ]
mikara89/EuroCodeCalculator
CalcModels/Abstract/IBetonService.cs
180
C#
using System; using UnityEngine; using UnityEngine.UI; using Assets.Scripts.Networking; namespace Assets.Scripts.UI { class LobbyPlayerTeamPin : MonoBehaviour { Image image; LobbyPlayer lobbyPlayer; void Start() { image = GetComponent<Image>(); lobbyPlayer = GetComponentInParent<LobbyPlayer>(); } void FixedUpdate() { image.color = lobbyPlayer.team.color; } } }
21.857143
62
0.616558
[ "MIT" ]
phBirais/flamewars
source/Assets/Scripts/UI/LobbyPlayer/LobbyPlayerTeamPin.cs
461
C#
// Lucene version compatibility level 4.8.1 using YAF.Lucene.Net.Analysis.Core; using YAF.Lucene.Net.Analysis.En; using YAF.Lucene.Net.Analysis.Standard; using YAF.Lucene.Net.Analysis.Tr; using YAF.Lucene.Net.Analysis.Util; using YAF.Lucene.Net.Util; using System; using System.IO; namespace YAF.Lucene.Net.Analysis.Snowball { /* * 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. */ /// <summary> /// Filters <see cref="StandardTokenizer"/> with <see cref="StandardFilter"/>, /// <see cref="LowerCaseFilter"/>, <see cref="StopFilter"/> and <see cref="SnowballFilter"/>. /// /// Available stemmers are listed in org.tartarus.snowball.ext. The name of a /// stemmer is the part of the class name before "Stemmer", e.g., the stemmer in /// <see cref="Tartarus.Snowball.Ext.EnglishStemmer"/> is named "English". /// /// <para><b>NOTE</b>: This class uses the same <see cref="LuceneVersion"/> /// dependent settings as <see cref="StandardAnalyzer"/>, with the following addition: /// <list type="bullet"> /// <item><description> As of 3.1, uses <see cref="TurkishLowerCaseFilter"/> for Turkish language.</description></item> /// </list> /// </para> </summary> /// @deprecated (3.1) Use the language-specific analyzer in modules/analysis instead. /// This analyzer will be removed in Lucene 5.0 [Obsolete("(3.1) Use the language-specific analyzer in modules/analysis instead. This analyzer will be removed in Lucene 5.0.")] public sealed class SnowballAnalyzer : Analyzer { private string name; private CharArraySet stopSet; private readonly LuceneVersion matchVersion; /// <summary> /// Builds the named analyzer with no stop words. </summary> public SnowballAnalyzer(LuceneVersion matchVersion, string name) { this.name = name; this.matchVersion = matchVersion; } /// <summary> /// Builds the named analyzer with the given stop words. </summary> public SnowballAnalyzer(LuceneVersion matchVersion, string name, CharArraySet stopWords) : this(matchVersion, name) { stopSet = CharArraySet.UnmodifiableSet(CharArraySet.Copy(matchVersion, stopWords)); } /// <summary> /// Constructs a <see cref="StandardTokenizer"/> filtered by a /// <see cref="StandardFilter"/>, a <see cref="LowerCaseFilter"/>, a <see cref="StopFilter"/>, /// and a <see cref="SnowballFilter"/> /// </summary> protected internal override TokenStreamComponents CreateComponents(string fieldName, TextReader reader) { Tokenizer tokenizer = new StandardTokenizer(matchVersion, reader); TokenStream result = new StandardFilter(matchVersion, tokenizer); // remove the possessive 's for english stemmers if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && (name.Equals("English", StringComparison.Ordinal) || name.Equals("Porter", StringComparison.Ordinal) || name.Equals("Lovins", StringComparison.Ordinal))) { result = new EnglishPossessiveFilter(result); } // Use a special lowercase filter for turkish, the stemmer expects it. if (matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) && name.Equals("Turkish", StringComparison.Ordinal)) { result = new TurkishLowerCaseFilter(result); } else { result = new LowerCaseFilter(matchVersion, result); } if (stopSet != null) { result = new StopFilter(matchVersion, result, stopSet); } result = new SnowballFilter(result, name); return new TokenStreamComponents(tokenizer, result); } } }
48.282828
221
0.636611
[ "Apache-2.0" ]
10by10pixel/YAFNET
yafsrc/Lucene.Net/Lucene.Net.Analysis.Common/Analysis/Snowball/SnowballAnalyzer.cs
4,682
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("MCV_Plugin_forVCas")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MCV_Plugin_forVCas")] [assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから // 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります [assembly: Guid("852ecbe3-ede9-43eb-b128-b896ef675c8a")] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // Revision // // すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます // 以下のように '*' を使用します: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
29.702703
56
0.750682
[ "MIT" ]
chinng-inta/comment_viewer_plugin
MCV_Plugin_forVCas/MCV_Plugin_forVCas/Properties/AssemblyInfo.cs
1,684
C#
using System; using System.Text; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; namespace ShopManage.Web.Startup { public static class AuthConfigurer { public static void Configure(IServiceCollection services, IConfiguration configuration) { if (bool.Parse(configuration["Authentication:JwtBearer:IsEnabled"])) { services.AddAuthentication() .AddJwtBearer(options => { options.Audience = configuration["Authentication:JwtBearer:Audience"]; options.TokenValidationParameters = new TokenValidationParameters { // The signing key must match! ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(configuration["Authentication:JwtBearer:SecurityKey"])), // Validate the JWT Issuer (iss) claim ValidateIssuer = true, ValidIssuer = configuration["Authentication:JwtBearer:Issuer"], // Validate the JWT Audience (aud) claim ValidateAudience = true, ValidAudience = configuration["Authentication:JwtBearer:Audience"], // Validate the token expiry ValidateLifetime = true, // If you want to allow a certain amount of clock drift, set that here ClockSkew = TimeSpan.Zero }; }); } } } }
40.434783
152
0.524194
[ "MIT" ]
DSOY/ShopManage
aspnet-core/src/ShopManage.Web.Mvc/Startup/AuthConfigurer.cs
1,862
C#
using System; using System.Globalization; using Unicorn.Base; namespace Unicorn.Images { /// <summary> /// A source image that consists of a single colour. Also referred to as a "mock image" elsewhere. /// </summary> public class SingleColourSourceImage : ISourceImage { /// <summary> /// The colour of the image. /// </summary> public IColour ImageColour { get; private set; } /// <summary> /// Width of the image. This is only provided in order to set the aspect ratio, as a single-colour /// rectangle can be scaled to any size. /// </summary> public int DotWidth { get; private set; } /// <summary> /// Width of the image per its data stream. Single colour images are stored as a single pixel. /// </summary> public int RawDotWidth => 1; /// <summary> /// Height of the image. This is only provided in order to set the aspect ratio, as a single-colour /// rectangle can be scaled to any size. /// </summary> public int DotHeight { get; private set; } /// <summary> /// Width of the image per its data stream. Single colour images are stored as a single pixel. /// </summary> public int RawDotHeight => 1; /// <summary> /// Aspect ratio of the image (width divided by height). /// </summary> public double AspectRatio => (double)DotWidth / DotHeight; /// <summary> /// A string that uniquely identifies this image. /// </summary> public string Fingerprint => ImageColour.GetType().Name + "SSI" + ImageColour.GetHashCode().ToString(CultureInfo.InvariantCulture); /// <summary> /// Single colour images do not need to be rotated to any specific orientation. /// </summary> public RightAngleRotation DrawingRotation => RightAngleRotation.None; /// <summary> /// Property-setting constructor. /// </summary> /// <param name="colour">Colour of the image.</param> /// <param name="width">Width of the image.</param> /// <param name="height">Height of the image.</param> public SingleColourSourceImage(IColour colour, int width, int height) { if (colour is null) { throw new ArgumentNullException(nameof(colour)); } ImageColour = colour; DotWidth = width; DotHeight = height; } /// <summary> /// Construct an image with a 1:1 aspect ratio. /// </summary> /// <param name="colour">COlour of the image</param> public SingleColourSourceImage(IColour colour) : this(colour, 1, 1) { } } }
35.794872
139
0.582378
[ "MIT" ]
caitlinsalt/unicorn
src/Unicorn/Images/SingleColourSourceImage.cs
2,794
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Dfe.Spi.RatesAdapter.FunctionApp { using System; [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class HttpErrorMessages { private static System.Resources.ResourceManager resourceMan; private static System.Globalization.CultureInfo resourceCulture; [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal HttpErrorMessages() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Resources.ResourceManager ResourceManager { get { if (object.Equals(null, resourceMan)) { System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Dfe.Spi.RatesAdapter.FunctionApp.HttpErrorMessages", typeof(HttpErrorMessages).Assembly); resourceMan = temp; } return resourceMan; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] internal static System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static string _1 { get { return ResourceManager.GetString("_1", resourceCulture); } } internal static string _2 { get { return ResourceManager.GetString("_2", resourceCulture); } } internal static string _3 { get { return ResourceManager.GetString("_3", resourceCulture); } } internal static string _4 { get { return ResourceManager.GetString("_4", resourceCulture); } } internal static string _5 { get { return ResourceManager.GetString("_5", resourceCulture); } } internal static string _6 { get { return ResourceManager.GetString("_6", resourceCulture); } } internal static string _7 { get { return ResourceManager.GetString("_7", resourceCulture); } } internal static string _8 { get { return ResourceManager.GetString("_8", resourceCulture); } } internal static string _9 { get { return ResourceManager.GetString("_9", resourceCulture); } } } }
33.269231
187
0.539595
[ "MIT" ]
DFE-Digital/spi-rates-adapter
src/Dfe.Spi.RatesAdapter.FunctionApp/HttpErrorMessages.Designer.cs
3,462
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.UnitTests; using Xunit; namespace Microsoft.ApiDesignGuidelines.Analyzers.UnitTests { public class UseIntegralOrStringArgumentForIndexersTests : DiagnosticAnalyzerTestBase { protected override DiagnosticAnalyzer GetBasicDiagnosticAnalyzer() { return new UseIntegralOrStringArgumentForIndexersAnalyzer(); } protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer() { return new UseIntegralOrStringArgumentForIndexersAnalyzer(); } [Fact] public void TestBasicUseIntegralOrStringArgumentForIndexersWarning1() { VerifyBasic(@" Public Class Months Private month() As String = {""Jan"", ""Feb"", ""...""} Default ReadOnly Property Item(index As Float) As String Get Return month(index) End Get End Property End Class ", CreateBasicResult(4, 35)); } [Fact] public void TestBasicUseIntegralOrStringArgumentForIndexersNoWarning1() { VerifyBasic(@" Public Class Months Private month() As String = {""Jan"", ""Feb"", ""...""} Default ReadOnly Property Item(index As String) As String Get Return month(index) End Get End Property End Class "); } [Fact] public void TestCSharpUseIntegralOrStringArgumentForIndexersWarning1() { VerifyCSharp(@" public class Months { string[] month = new string[] {""Jan"", ""Feb"", ""...""}; public string this[char index] { get { return month[index]; } } }", CreateCSharpResult(5, 23)); } [Fact] public void TestCSharpUseIntegralOrStringArgumentForIndexersNoWarning1() { VerifyCSharp(@" public class Months { string[] month = new char[] {'J', 'F', 'M'}; public string this[int index] { get { return month[index]; } } }"); } private static DiagnosticResult CreateCSharpResult(int line, int col) { return GetCSharpResultAt(line, col, UseIntegralOrStringArgumentForIndexersAnalyzer.RuleId, MicrosoftApiDesignGuidelinesAnalyzersResources.UseIntegralOrStringArgumentForIndexersMessage); } private static DiagnosticResult CreateBasicResult(int line, int col) { return GetBasicResultAt(line, col, UseIntegralOrStringArgumentForIndexersAnalyzer.RuleId, MicrosoftApiDesignGuidelinesAnalyzersResources.UseIntegralOrStringArgumentForIndexersMessage); } } }
31.734043
197
0.61817
[ "Apache-2.0" ]
jcouv/roslyn-analyzers
src/Microsoft.ApiDesignGuidelines.Analyzers/UnitTests/UseIntegralOrStringArgumentForIndexersTests.cs
2,983
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Routing; namespace HelloWorldDialogs { public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); } } }
20.722222
65
0.707775
[ "MIT" ]
PacktPublishing/Building-Bots-with-Microsoft-Bot-Framework
Chapter02/HelloWorldDialogs/HelloWorldDialogs/Global.asax.cs
375
C#
using MidiPlayerTK; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; namespace MidiPlayerTK { public class MainMenu : MonoBehaviour { static private Texture buttonIconHome; static private Texture buttonIconMPTK; static private Texture buttonIconQuit; public void Awake() { } static public void Display(string title, CustomStyle myStyle) { GUILayout.BeginHorizontal(myStyle.BacgDemos); if (buttonIconHome == null) buttonIconHome = Resources.Load<Texture2D>("Textures/home"); if (buttonIconQuit == null) buttonIconQuit = Resources.Load<Texture2D>("Textures/quit"); if (buttonIconMPTK == null) buttonIconMPTK = Resources.Load<Texture2D>("Logo_MPTK"); if (GUILayout.Button(new GUIContent(buttonIconHome, "Go to main menu"), GUILayout.Width(60), GUILayout.Height(60))) for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++) if (SceneUtility.GetScenePathByBuildIndex(i).Contains("ScenesDemonstration")) { MidiPlayerGlobal.MPTK_Stop(); SceneManager.LoadScene(i, LoadSceneMode.Single); return; } GUILayout.Space(20); GUILayout.Label(title, myStyle.TitleLabel1, GUILayout.Height(60)); GUILayout.Space(20); if (GUILayout.Button(new GUIContent(buttonIconQuit, "Exit"), GUILayout.Width(60), GUILayout.Height(60))) MidiPlayerGlobal.MPTK_Quit(); if (GUILayout.Button(new GUIContent(buttonIconMPTK, "Go to web site"), GUILayout.Width(60), GUILayout.Height(60))) Application.OpenURL("https://paxstellar.fr/setup-mptk-quick-start-v2/"); GUILayout.EndHorizontal(); } public void GoToMainMenu() { for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++) { Debug.Log(SceneUtility.GetScenePathByBuildIndex(i)); if (SceneUtility.GetScenePathByBuildIndex(i).Contains("ScenesDemonstration")) { //Debug.Log(" load " + i + " " + SceneUtility.GetScenePathByBuildIndex(i)); SceneManager.LoadScene(i, LoadSceneMode.Single); return; } } //int index = SceneUtility.GetBuildIndexByScenePath(sceneMainMenu); //Debug.Log(sceneMainMenu + " " + index); //if (index < 0) //{ // Debug.LogWarning("To avoid interacting with your project, MPTK doesn't add MPTK scenes in the Build Settings."); // Debug.LogWarning("Add these scenes with “File/Build Settings” if you want a full functionality of the demonstrator."); //} //else // SceneManager.LoadScene(index, LoadSceneMode.Single); } } }
41.849315
136
0.596072
[ "MIT" ]
alkaitagi/SpaceSound
Assets/MidiPlayer/Scenes For Demo/Demos/Script/MainMenu.cs
3,061
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using Unity.Entities; [GenerateAuthoringComponent] public struct VertTag : IComponentData { }
17.5
38
0.822857
[ "MIT" ]
Patatobeurre/DOTSprototypeV3
Assets/Gestionnaire/ComponentData/Tag/Material/VertTag.cs
177
C#
//----------------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // // The MIT License (MIT) // // 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 PhotoSharingApp.Universal.Models; namespace PhotoSharingApp.Universal.ViewModels { /// <summary> /// The arguments that are passed to <see cref="UploadViewModel" /> /// for updating photo details. /// </summary> public class UploadViewModelEditPhotoArgs { /// <summary> /// Gets or sets the category. /// </summary> public Category Category { get; set; } /// <summary> /// Gets or sets the photo. /// </summary> public Photo Photo { get; set; } } }
42.4
86
0.633648
[ "MIT" ]
Bhaskers-Blu-Org2/Appsample-Photosharing
PhotoSharingApp/PhotoSharingApp.Universal/ViewModels/UploadViewModelEditPhotoArgs.cs
1,910
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Core2ViewComponent.Models.ManageViewModels { public class IndexViewModel { public string Username { get; set; } public bool IsEmailConfirmed { get; set; } [Required] [EmailAddress] public string Email { get; set; } [Phone] [Display(Name = "Phone number")] public string PhoneNumber { get; set; } public string StatusMessage { get; set; } } }
22.461538
52
0.65411
[ "MIT" ]
kalimist123/loginViewComponent
Core2ViewComponent/Core2ViewComponent/Models/ManageViewModels/IndexViewModel.cs
586
C#
using Blazored.Toast; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace BlazorChat.Client { public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add<App>("app"); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddBlazoredToast(); await builder.Build().RunAsync(); } } }
29.071429
124
0.713759
[ "MIT" ]
viktormark92/BlazorChat
BlazorChat/BlazorChat/Client/Program.cs
814
C#
using System.Collections.Generic; using Payments.Core.Domain; using Shouldly; using TestHelpers.Helpers; using Xunit; namespace Payments.Tests.DatabaseTests { [Trait("Category", "DatabaseTests")] public class PaymentEventTests { [Fact] public void TestAllFieldsInTheDatabaseHaveBeenTested() { #region Arrange var expectedFields = new List<NameAndType>(); expectedFields.Add(new NameAndType("Amount", "System.Decimal", new List<string>())); expectedFields.Add(new NameAndType("BillingCity", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)50)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing City\")]", })); expectedFields.Add(new NameAndType("BillingCompany", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)60)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Company\")]", })); expectedFields.Add(new NameAndType("BillingCountry", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)2)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Country\")]", })); expectedFields.Add(new NameAndType("BillingEmail", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)1500)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Email\")]", })); expectedFields.Add(new NameAndType("BillingFirstName", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)60)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing First Name\")]", })); expectedFields.Add(new NameAndType("BillingLastName", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)60)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Last Name\")]", })); expectedFields.Add(new NameAndType("BillingPhone", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)100)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Phone\")]", })); expectedFields.Add(new NameAndType("BillingPostalCode", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)10)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Postal Code\")]", })); expectedFields.Add(new NameAndType("BillingState", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)64)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing State\")]", })); expectedFields.Add(new NameAndType("BillingStreet1", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)400)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Street\")]", })); expectedFields.Add(new NameAndType("BillingStreet2", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)400)]", "[System.ComponentModel.DisplayNameAttribute(\"Billing Street 2\")]", })); expectedFields.Add(new NameAndType("CardExpiry", "System.Nullable`1[System.DateTime]", new List<string>())); expectedFields.Add(new NameAndType("CardNumber", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)20)]", })); expectedFields.Add(new NameAndType("CardType", "System.String", new List<string>{ "[System.ComponentModel.DataAnnotations.MaxLengthAttribute((Int32)3)]", })); expectedFields.Add(new NameAndType("Decision", "System.String", new List<string>())); expectedFields.Add(new NameAndType("Id", "System.Int32", new List<string>{ "[System.ComponentModel.DataAnnotations.KeyAttribute()]", })); expectedFields.Add(new NameAndType("Invoice", "Payments.Core.Domain.Invoice", new List<string>())); expectedFields.Add(new NameAndType("OccuredAt", "System.DateTime", new List<string>())); expectedFields.Add(new NameAndType("Processor", "System.String", new List<string>())); expectedFields.Add(new NameAndType("ProcessorId", "System.String", new List<string>())); expectedFields.Add(new NameAndType("ReturnedResults", "System.String", new List<string>{ "[Newtonsoft.Json.JsonIgnoreAttribute()]", })); #endregion Arrange AttributeAndFieldValidation.ValidateFieldsAndAttributes(expectedFields, typeof(PaymentEvent)); } [Fact] public void TestOccuredAtIsDefaulted() { // Arrange var paymentEvent = new PaymentEvent(); // Act // Assert paymentEvent.ShouldNotBeNull(); } } }
55.09
120
0.628971
[ "MIT" ]
ucdavis/payments
tests/Payments.Tests/DatabaseTests/PaymentEventTests.cs
5,509
C#
namespace MovieList.ViewModels.Forms.Base { public interface ISeriesComponentForm : IForm { SeriesFormViewModel Parent { get; } string Channel { get; set; } int SequenceNumber { get; set; } int GetNextYear(); } }
19.923077
49
0.621622
[ "MIT" ]
op07n/test20
MovieList.Core/ViewModels/Forms/Base/ISeriesComponentForm.cs
259
C#
using System.Threading.Tasks; using FluentAssertions; using NUnit.Framework; namespace Beeffective.Tests.Models.HoneycombModelTests { class AddCellAsync : TestFixture { [Test] public async Task Cells_Contain_AddedCellModel() { var addedCellModel = await Sut.AddCellAsync(CellModel1); Sut.Cells.Should().Contain(addedCellModel); } } }
23.764706
68
0.673267
[ "MIT" ]
PeterMilovcik/DoThis
Beeffective.Tests/Models/HoneycombModelTests/AddCellAsync.cs
406
C#
using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Abp.Localization; namespace MPACore.PhoneBook.Web.Views.Shared.Components.AccountLanguages { public class LanguageSelectionViewModel { public LanguageInfo CurrentLanguage { get; set; } public IReadOnlyList<LanguageInfo> Languages { get; set; } public PathString CurrentUrl { get; set; } } }
25.25
72
0.732673
[ "MIT" ]
52ABP/MPACore.PhoneBook
aspnet-core/src/MPACore.PhoneBook.Web.Mvc/Views/Shared/Components/AccountLanguages/LanguageSelectionViewModel.cs
406
C#
using System; using System.Collections.Generic; using System.Threading; namespace Amg.Build { interface IFileSystem { /// <summary> /// Copy a file. /// </summary> /// <param name="existingFileName">Name of the copy source file.</param> /// <param name="newFileName">Name of the copy destination file.</param> /// <param name="progress">To report progress information back to the caller. Can be null.</param> /// <param name="cancellationToken">To cancel the copy operation. When cancelled, the destination file will not exist.</param> /// <param name="options">Options for the copy operation.</param> void CopyFile( string existingFileName, string newFileName, IProgress<CopyFileProgress> progress = null, System.Threading.CancellationToken cancellationToken = new CancellationToken(), CopyFileOptions options = null); /// <summary> /// Returns information about a hard linked file. /// </summary> /// <param name="path"></param> /// <returns></returns> IHardLinkInfo GetHardLinkInfo(string path); /// <summary> /// Create a new hard link. /// </summary> /// Precondition: (existingFileName.IsFile &amp;&amp; !fileName.IsFile &amp;&amp; fileName.Parent.IsDirectory) /// Postcondition: (fileName.IsFile) /// Will throw an exception ? when fileName does not have the same root as existingFileName /// <param name="fileName">Path where the new hard link shall be created.</param> /// <param name="existingFileName">Existing file for which a hard link will be created.</param> void CreateHardLink(string fileName, string existingFileName); } }
43.142857
134
0.634658
[ "MIT" ]
ArminBecher/Amg.Build
src/Amg.Build/IFileSystem.cs
1,814
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("otvs")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("otvs")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("593d9ec3-1fd0-44d2-a3c8-7814cd41ec4c")] // 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.324324
84
0.742216
[ "Apache-2.0" ]
benma/opentxs
scripts/demo/vscsharp/otvs/Properties/AssemblyInfo.cs
1,384
C#
using System; using System.Windows.Input; using Xamarin.Forms; namespace BusPoa.ViewModels { public class AboutViewModel : BaseViewModel { public AboutViewModel() { Title = "About"; OpenWebCommand = new Command(() => Device.OpenUri(new Uri("https://xamarin.com/platform"))); } public ICommand OpenWebCommand { get; } } }
20.684211
104
0.613232
[ "MIT" ]
pedroca656/super-duper-umbrella
BusPoa/BusPoa/BusPoa/ViewModels/AboutViewModel.cs
395
C#
using System; using NUnit.Framework; namespace Lucene.Net.Attributes { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] public class NightlyAttribute : ExplicitAttribute { public NightlyAttribute() : base("Nightly") { } } }
24.466667
140
0.675749
[ "Apache-2.0" ]
SeanKilleen/lucenenet
src/Lucene.Net.TestFramework/Attributes/NightlyAttribute.cs
369
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using System.Threading; using WalletWasabi.Crypto; using WalletWasabi.Helpers; namespace WalletWasabi.Logging { public static class Logger { #region PropertiesAndMembers private static long On = 1; public static LogLevel MinimumLevel { get; private set; } = LogLevel.Critical; public static HashSet<LogMode> Modes { get; } = new HashSet<LogMode>(); public static string FilePath { get; private set; } = "Log.txt"; public static string EntrySeparator { get; private set; } = Environment.NewLine; /// <summary> /// You can use it to identify which software instance created a log entry. /// It gets created automatically, but you have to use it manually. /// </summary> public static Guid InstanceGuid { get; } = Guid.NewGuid(); private static int LoggingFailedCount = 0; private static readonly object Lock = new object(); /// <summary> /// KB /// </summary> public static long MaximumLogFileSize { get; private set; } = 10_000; // approx 10 MB #endregion PropertiesAndMembers #region Initializers /// <summary> /// Initializes the Logger with default values. /// If RELEASE then minlevel is info, and logs only to file. /// If DEBUG then minlevel is debug, and logs to file, debug and console. /// </summary> /// <param name="filePath"></param> public static void InitializeDefaults(string filePath) { SetFilePath(filePath); #if RELEASE SetMinimumLevel(LogLevel.Info); SetModes(LogMode.Console, LogMode.File); #else SetMinimumLevel(LogLevel.Debug); SetModes(LogMode.Debug, LogMode.Console, LogMode.File); #endif } public static void SetMinimumLevel(LogLevel level) => MinimumLevel = level; public static void SetModes(params LogMode[] modes) { if (Modes.Count != 0) { Modes.Clear(); } if (modes is null) { return; } foreach (var mode in modes) { Modes.Add(mode); } } public static void SetFilePath(string filePath) => FilePath = Guard.NotNullOrEmptyOrWhitespace(nameof(filePath), filePath, trim: true); public static void SetEntrySeparator(string entrySeparator) => EntrySeparator = Guard.NotNull(nameof(entrySeparator), entrySeparator); /// <summary> /// KB /// </summary> public static void SetMaximumLogFileSize(long sizeInKb) => MaximumLogFileSize = sizeInKb; #endregion Initializers #region Methods public static void TurnOff() => Interlocked.Exchange(ref On, 0); public static void TurnOn() => Interlocked.Exchange(ref On, 1); public static bool IsOn() => Interlocked.Read(ref On) == 1; #endregion Methods #region LoggingMethods #region GeneralLoggingMethods private static void Log(LogLevel level, string message, string category, int additionalEntrySeparators = 0, bool additionalEntrySeparatorsLogFileOnlyMode = true) { try { if (Modes.Count == 0 || !IsOn()) { return; } if (level < MinimumLevel) { return; } message = string.IsNullOrWhiteSpace(message) ? "" : message; category = string.IsNullOrWhiteSpace(category) ? "" : category; var messageBuilder = new StringBuilder(); messageBuilder.Append($"{DateTime.UtcNow.ToLocalTime():yyyy-MM-dd HH:mm:ss} {level.ToString().ToUpperInvariant()}"); if (message == "") { if (category == "") // If both empty. It probably never happens though. { messageBuilder.Append($"{EntrySeparator}"); } else // If only the message is empty. { messageBuilder.Append($" {category}{EntrySeparator}"); } } else { if (category == "") // If only the category is empty. { messageBuilder.Append($": {message}{EntrySeparator}"); } else // If none of them empty. { messageBuilder.Append($" {category}: {message}{EntrySeparator}"); } } var finalMessage = messageBuilder.ToString(); for (int i = 0; i < additionalEntrySeparators; i++) { messageBuilder.Insert(0, EntrySeparator); } var finalFileMessage = messageBuilder.ToString(); if (!additionalEntrySeparatorsLogFileOnlyMode) { finalMessage = finalFileMessage; } lock (Lock) { if (Modes.Contains(LogMode.Console)) { lock (Console.Out) { var color = Console.ForegroundColor; switch (level) { case LogLevel.Warning: color = ConsoleColor.Yellow; break; case LogLevel.Error: case LogLevel.Critical: color = ConsoleColor.Red; break; default: break; // Keep original color. } Console.ForegroundColor = color; Console.Write(finalMessage); Console.ResetColor(); } } if (Modes.Contains(LogMode.Console)) { Debug.Write(finalMessage); } if (!Modes.Contains(LogMode.File)) { return; } IoHelpers.EnsureContainingDirectoryExists(FilePath); if (File.Exists(FilePath)) { var sizeInBytes = new FileInfo(FilePath).Length; if (sizeInBytes > 1000 * MaximumLogFileSize) { File.Delete(FilePath); } } File.AppendAllText(FilePath, finalFileMessage); } } catch (Exception ex) { if (Interlocked.Increment(ref LoggingFailedCount) == 1) // If it only failed the first time, try log the failure. { LogDebug($"Logging failed: {ex}", $"{nameof(Logger)}.{nameof(Logging)}.{nameof(Logger)}"); } // If logging the failure is successful then clear the failure counter. // If it's not the first time the logging failed, then we do not try to log logging failure, so clear the failure counter. Interlocked.Exchange(ref LoggingFailedCount, 0); } } private static void Log(LogLevel level, string message, Type category) { if (category is null) { Log(level, message, ""); } else { Log(level, message, category.ToString()); } } private static void Log<T>(LogLevel level, string message) => Log(level, message, typeof(T).Name); #endregion GeneralLoggingMethods #region ExceptionLoggingMethods private static void Log(Exception ex, LogLevel level, string category = "") { Log(level, ExceptionToStringHandleNull(ex), category); } private static void Log<T>(Exception ex, LogLevel level) { Log<T>(level, ExceptionToStringHandleNull(ex)); } private static void Log(Exception ex, LogLevel level, Type category = null) { Log(level, ExceptionToStringHandleNull(ex), category); } private static string ExceptionToStringHandleNull(Exception ex) { return ex?.ToString() ?? "Exception was null."; } #endregion ExceptionLoggingMethods #region TraceLoggingMethods /// <summary> /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace<T>(string message) => Log<T>(LogLevel.Trace, message); /// <summary> /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace(string message, Type category) => Log(LogLevel.Trace, message, category); /// <summary> /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace(string message, string category = "") => Log(LogLevel.Trace, message, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Trace level. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace<T>(Exception ex) => Log<T>(ex, LogLevel.Trace); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Trace level. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace(Exception ex, Type category) => Log(ex, LogLevel.Trace, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Trace level. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogTrace(Exception ex, string category = "") => Log(ex, LogLevel.Trace, category); #endregion TraceLoggingMethods #region DebugLoggingMethods /// <summary> /// For information that has short-term usefulness during development and debugging. /// Example: "Entering method Configure with flag set to true." /// You typically would not enable Debug level logs in production unless you are troubleshooting, due to the high volume of logs. /// </summary> public static void LogDebug<T>(string message) => Log<T>(LogLevel.Debug, message); /// <summary> /// For information that has short-term usefulness during development and debugging. /// Example: "Entering method Configure with flag set to true." /// You typically would not enable Debug level logs in production unless you are troubleshooting, due to the high volume of logs. /// </summary> public static void LogDebug(string message, Type category) => Log(LogLevel.Debug, message, category); /// <summary> /// For information that has short-term usefulness during development and debugging. /// Example: "Entering method Configure with flag set to true." /// You typically would not enable Debug level logs in production unless you are troubleshooting, due to the high volume of logs. /// </summary> public static void LogDebug(string message, string category = "") => Log(LogLevel.Debug, message, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Debug level, if only Debug level logging is set. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogDebug<T>(Exception ex) => Log<T>(ex, LogLevel.Debug); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Debug level, if only Debug level logging is set. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogDebug(Exception ex, Type category = null) => Log(ex, LogLevel.Debug, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Debug level. /// /// For information that is valuable only to a developer debugging an issue. /// These messages may contain sensitive application data and so should not be enabled in a production environment. /// Example: "Credentials: {"User":"someuser", "Password":"P@ssword"}" /// </summary> public static void LogDebug(Exception ex, string category = "") => Log(ex, LogLevel.Debug, category); #endregion DebugLoggingMethods #region InfoLoggingMethods /// <summary> /// Logs software start with category InstanceGuid and insert three newlines. /// </summary> /// <param name="appName">The name of the app.</param> public static void LogStarting(string appName) => Log(LogLevel.Info, $"{appName} is starting...", category: InstanceGuid.ToString(), additionalEntrySeparators: 3, additionalEntrySeparatorsLogFileOnlyMode: true); /// <summary> /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// Example: "Request received for path /api/my-controller" /// </summary> public static void LogInfo<T>(string message) => Log<T>(LogLevel.Info, message); /// <summary> /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// Example: "Request received for path /api/my-controller" /// </summary> public static void LogInfo(string message, Type category) => Log(LogLevel.Info, message, category); /// <summary> /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// Example: "Request received for path /api/my-controller" /// </summary> public static void LogInfo(string message, string category = "") => Log(LogLevel.Info, message, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Info level. /// /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// Example: "Request received for path /api/my-controller" /// </summary> public static void LogInfo<T>(Exception ex) => Log<T>(ex, LogLevel.Info); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Info level. /// /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// </summary> public static void LogInfo(Exception ex, Type category = null) => Log(ex, LogLevel.Info, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Info level. /// /// For tracking the general flow of the application. /// These logs typically have some long-term value. /// </summary> public static void LogInfo(Exception ex, string category = "") => Log(ex, LogLevel.Info, category); #endregion InfoLoggingMethods #region WarningLoggingMethods /// <summary> /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning<T>(string message) => Log<T>(LogLevel.Warning, message); /// <summary> /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning(string message, Type category) => Log(LogLevel.Warning, message, category); /// <summary> /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning(string message, string category = "") => Log(LogLevel.Warning, message, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Warning level. /// /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning<T>(Exception ex) => Log<T>(ex, LogLevel.Warning); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Warning level. /// /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning(Exception ex, Type category = null) => Log(ex, LogLevel.Warning, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Warning level. /// /// For abnormal or unexpected events in the application flow. /// These may include errors or other conditions that do not cause the application to stop, but which may need to be investigated. /// Handled exceptions are a common place to use the Warning log level. /// Example: "FileNotFoundException for file quotes.txt." /// </summary> public static void LogWarning(Exception ex, string category = "") => Log(ex, LogLevel.Warning, category); #endregion WarningLoggingMethods #region ErrorLoggingMethods /// <summary> /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError<T>(string message) => Log<T>(LogLevel.Error, message); /// <summary> /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError(string message, Type category) => Log(LogLevel.Error, message, category); /// <summary> /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError(string message, string category = "") => Log(LogLevel.Error, message, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Error level. /// /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError<T>(Exception ex) => Log<T>(ex, LogLevel.Error); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Error level. /// /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError(Exception ex, Type category = null) => Log(ex, LogLevel.Error, category); /// <summary> /// Logs the <paramref name="ex"/>.ToString() at Error level. /// /// For errors and exceptions that cannot be handled. /// These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an application-wide failure. /// Example log message: "Cannot insert record due to duplicate key violation." /// </summary> public static void LogError(Exception ex, string category = "") => Log(ex, LogLevel.Error, category); #endregion ErrorLoggingMethods #region CriticalLoggingMethods /// <summary> /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical<T>(string message) => Log<T>(LogLevel.Critical, message); /// <summary> /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical(string message, Type category) => Log(LogLevel.Critical, message, category); /// <summary> /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical(string message, string category = "") => Log(LogLevel.Critical, message, category); /// <summary> /// Logs the <paramref name="ex"/>.Message at Critical level. /// /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical<T>(Exception ex) => Log<T>(ex, LogLevel.Critical); /// <summary> /// Logs the <paramref name="ex"/>.Message at Critical level. /// /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical(Exception ex, Type category = null) => Log(ex, LogLevel.Critical, category); /// <summary> /// Logs the <paramref name="ex"/>.Message at Critical level. /// /// For failures that require immediate attention. /// Examples: data loss scenarios, out of disk space. /// </summary> public static void LogCritical(Exception ex, string category = "") => Log(ex, LogLevel.Critical, category); #endregion CriticalLoggingMethods #endregion LoggingMethods } }
37.823129
213
0.694065
[ "MIT" ]
SeppPenner/WalletWasabi
WalletWasabi/Logging/Logger.cs
22,240
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("EmotivApI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EmotivApI")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("4576ca2e-53d8-4f4a-8dad-70246660820f")] // 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.459459
84
0.746753
[ "MIT" ]
Horopter/Network_Embedded_Applications-2018
Rover - Emotiv/Rover/Properties/AssemblyInfo.cs
1,389
C#
using System; using System.Collections.Generic; using System.Runtime.Serialization; using Hammock.Model; using Newtonsoft.Json; namespace TweetSharp { /// <summary> /// Denotes a list of user friends in a user stream. /// </summary> #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamFriends : TwitterStreamArtifact { private IEnumerable<long> _ids; [JsonProperty("friends")] public virtual IEnumerable<long> Ids { get { return _ids; } set { if (_ids == value) { return; } _ids = value; OnPropertyChanged("Ids"); } } } /// <summary> /// Denotes a <see cref="TwitterStatus" /> in a user stream. /// </summary> #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamStatus : TwitterStreamArtifact, ITweetable { private TwitterStatus _status; public virtual TwitterStatus Status { get { return _status; } set { if (_status == value) { return; } _status = value; OnPropertyChanged("Status"); } } public long Id { get { return Status.Id; } } public string Text { get { return Status.Text; } } public string TextAsHtml { get { return Status.TextAsHtml; } } public ITweeter Author { get { return Status.Author; } } public DateTime CreatedDate { get { return Status.CreatedDate; } } public TwitterEntities Entities { get { return Status.Entities; } } } #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamDirectMessage: TwitterStreamArtifact, ITweetable { private TwitterDirectMessage _dm; public virtual TwitterDirectMessage DirectMessage { get { return _dm; } set { if (_dm == value) { return; } _dm = value; OnPropertyChanged("DirectMessage"); } } public long Id { get { return DirectMessage.Id; } } public string Text { get { return DirectMessage.Text; } } public string TextAsHtml { get { return DirectMessage.TextAsHtml; } } public ITweeter Author { get { return DirectMessage.Author; } } public DateTime CreatedDate { get { return DirectMessage.CreatedDate; } } public TwitterEntities Entities { get { return DirectMessage.Entities; } } } /// <summary> /// Denotes a stream event, resulting from a user action. /// The source is always the initiating user, the target is always the affected user. /// </summary> #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamEventBase : TwitterStreamArtifact { [JsonProperty("source")] public virtual TwitterUser Source { get; set; } [JsonProperty("target")] public virtual TwitterUser Target { get; set; } [JsonProperty("event")] public virtual string Event { get; set; } [JsonProperty("created_at")] public virtual DateTime CreatedDate { get; set; } } // Denotes a status deleted on a timeline in a user stream. #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamDeleteStatus : TwitterStreamArtifact { public virtual int UserId { get; set; } public virtual long StatusId { get; set; } } // Denotes a status deleted on a timeline in a user stream. #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamDeleteDirectMessage : TwitterStreamArtifact { public virtual int UserId { get; set; } public virtual long DirectMessageId { get; set; } } /// <summary> /// Denotes a stream event, resulting from a user action; /// the source is always the initiating user, the target is always the affected user, and /// the target object depends on the initiating action: statuses, direct messages, and lists. /// </summary> public class TwitterUserStreamEvent : TwitterUserStreamEventBase { public virtual ITwitterModel TargetObject { get; set; } public TwitterUserStreamEvent(TwitterUserStreamEventBase @base) { Source = @base.Source; Target = @base.Target; Event = @base.Event; CreatedDate = @base.CreatedDate; RawSource = @base.RawSource; } } /// <summary> /// Denotes the end of a user stream /// </summary> #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterUserStreamEnd : TwitterStreamArtifact { } /// <summary> /// Denotes content surfaced in a stream /// </summary> #if !SILVERLIGHT [Serializable] #endif #if !Smartphone && !NET20 [DataContract] #endif public class TwitterStreamArtifact : PropertyChangedBase, ITwitterModel { public virtual string RawSource { get; set; } } }
23.623016
97
0.560222
[ "MIT" ]
DavidChristiansen/tweetsharp
src/net40/TweetSharp.Next/Model/TwitterUserStreams.cs
5,955
C#
// Shatter Toolkit // Copyright 2011 Gustav Olsson using System.Collections.Generic; using UnityEngine; public class MouseShatter : MonoBehaviour { public ShatterScheduler scheduler = null; public void Update() { if (Input.GetMouseButtonDown(0)) { RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit)) { if (scheduler != null) { scheduler.AddTask(new ShatterTask(hit.collider.gameObject, hit.point)); } else { hit.collider.SendMessage("Shatter", hit.point, SendMessageOptions.DontRequireReceiver); } } } } }
21.137931
92
0.698206
[ "MIT" ]
artemistint/KoronaKiru
Assets/Library/Shatter Toolkit/Helpers/Mouse/MouseShatter.cs
613
C#
using System.ComponentModel; namespace Merq { /// <summary> /// Marker interface for all generic command handlers, whether synchronous or asynchronous, /// allowing easy introspection of the generic <typeparam name="TCommand" /> if necessary. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] public interface IExecutableCommandHandler<in TCommand> : ICommandHandler where TCommand : IExecutable { } /// <summary> /// Marker interface for all generic command handlers that return values, whether synchronous or asynchronous, /// allowing easy introspection of the generic <typeparam name="TCommand" /> and <typeparamref name="TResult"/> /// if necessary. /// </summary> /// <typeparam name="TResult">The type of the command execution result.</typeparam> [EditorBrowsable(EditorBrowsableState.Never)] public interface IExecutableCommandHandler<in TCommand, out TResult> : IExecutableCommandHandler<TCommand> where TCommand : IExecutable<TResult> { } }
39.44
145
0.762677
[ "MIT" ]
MobileEssentials/Merq
src/Core/Merq/IExecutableCommandHandler.cs
988
C#
using System.Collections.Generic; using Assets.Scripts.Common.Windows; using UnityEngine; using YxFramwork.Common; using YxFramwork.ConstDefine; using YxFramwork.Controller; using YxFramwork.Manager; using YxFramwork.View; using com.yxixia.utile.YxDebug; namespace Assets.Scripts.Hall.View.AboutRoomWindows { /// <summary> /// 查找房间窗口 /// </summary> public class FindRoomWindow : YxNguiWindow { /// <summary> /// 房间id的Label /// </summary> [Tooltip("房间id的Label")] public UILabel RoomIdLabel; [Tooltip("由多个label组成的房间id,不包含RoomIdLabel属性")] public UILabel[] RoomIdMoreLabel; /// <summary> /// 房间id最大位数 /// </summary> [Tooltip("房间id最大位数")] public int MaxIdCount = 6; /// <summary> /// 查找消息窗口 /// </summary> [Tooltip("输入键")] public RoomInfoWindow RoominfoWindow; /// <summary> /// 房间id最大位数 /// </summary> [Tooltip("输入键")] public UIButton[] Keyboards; /// <summary> /// 标签默认索引 /// </summary> [Tooltip("默认标签选择")] public int TabDefaultIndex = -1; /// <summary> /// 需要显示房间信息 /// </summary> [Tooltip("需要显示房间信息")] public bool NeedRoomInfo = true; /// <summary> /// 自动查找 /// </summary> [Tooltip("自动查找")] public bool AutoFind = true; protected override void OnAwake() { base.OnAwake(); var count = Keyboards.Length; for (var i = 0; i < count; i++) { var btn = Keyboards[i]; if(btn==null)continue; UIEventListener.Get(btn.gameObject).onClick = OnClick; } } public void OnClick(GameObject go) { OnClickWithName(go.name); } public void OnClickWithName(string btnName) { switch (btnName) { case "del": Delete(); break; case "cle": Clear(); break; default: if (Input(btnName)&&AutoFind) { OnFindRoom(); } break; } } private int _curInputIndex; private void Delete() { if (RoomIdMoreLabel.Length > 0) { if (_curInputIndex > 0) { _curInputIndex--; var label = RoomIdMoreLabel[_curInputIndex]; label.text = ""; } return; } var cur = RoomIdLabel.text; if (cur.Length < 1) return; RoomIdLabel.text = cur.Remove(cur.Length - 1); } private void Clear() { if (RoomIdMoreLabel.Length > 0) { for (var i = 0; i < MaxIdCount; i++) { var label = RoomIdMoreLabel[i]; label.text = ""; _curInputIndex = 0; } return; } RoomIdLabel.text = ""; } private bool Input(string num) { if (RoomIdMoreLabel.Length > 0) { if (_curInputIndex >= MaxIdCount) return true; var label = RoomIdMoreLabel[_curInputIndex]; label.text = num; _curInputIndex++; return _curInputIndex >= MaxIdCount; } if (RoomIdLabel.text.Length >= MaxIdCount) return true; var roomId = string.Format("{0}{1}", RoomIdLabel.text, num); RoomIdLabel.text = roomId; return RoomIdLabel.text.Length >= MaxIdCount; } private string GetCurRoomId() { if (RoomIdMoreLabel.Length > 0) { var roomId = ""; for (var i = 0; i < MaxIdCount; i++) { roomId = string.Format("{0}{1}",roomId,RoomIdMoreLabel[i].text); } return roomId; } return RoomIdLabel.text; } public void OnClickWithInput() { var roomId = GetCurRoomId(); if (roomId.Length < MaxIdCount) return; OnFindRoom(); } private void OnFindRoom() { int roomType; var roomCId = GetCurRoomId(); if (!int.TryParse(roomCId, out roomType)) return; RoomListController.Instance.FindRoom(roomType, obj => { Clear(); var data = obj as IDictionary<string, object>; if (data == null) { YxMessageBox.Show("没有找到房间!!"); return; } var str = data.ContainsKey(RequestKey.KeyMessage)?data[RequestKey.KeyMessage]:null; if (str!=null) { YxMessageBox.Show(str.ToString()); return; } var rid = data["roomId"]; var roomId = int.Parse(rid.ToString()); YxDebug.LogError("加入房间的真实ID是" + roomId); if (roomId < 1) { YxMessageBox.Show("查找异常!"); return; } if (NeedRoomInfo && data.ContainsKey("users")) { var win = RoominfoWindow ?? CreateOtherWindow("RoomInfoWindow"); data["_roomShowId"]= roomType; win.UpdateView(data); return; } var gameKey = (string) (data.ContainsKey("gameKey") ? data["gameKey"]: App.GameKey); RoomListController.Instance.JoinFindRoom(roomId, gameKey); }); } public void OnOpenCreateWindow() { var win = YxWindowManager.OpenWindow("CreateRoomWindow", true); var createWin = (CreateRoomWindow)win; if (createWin == null) return; createWin.TabDefaultIndex = TabDefaultIndex; } } }
30.636792
104
0.445266
[ "MIT" ]
GEngine-JP/chessgame
Assets/Scripts/Hall/View/AboutRoomWindows/FindRoomWindow.cs
6,721
C#
using Prism; using Prism.DryIoc; using Prism.Ioc; using Prism.Plugin.Popups; using ProjetoCondominioSmart.ViewModels; using ProjetoCondominioSmart.ViewModels.Popup; using ProjetoCondominioSmart.Views; using ProjetoCondominioSmart.Views.Popup; using Xamarin.Forms; namespace ProjetoCondominioSmart { public partial class App : PrismApplication { //public App() : this(null) { } //public App(IPlatformInitializer initializer) : this(initializer, true) { } //public App(IPlatformInitializer initializer, bool setFormsDependencyResolver) : base(initializer, setFormsDependencyResolver) { } public App() : this(null) { } public App(IPlatformInitializer initializer) : this(initializer, true) { } public App(IPlatformInitializer initializer, bool setFormsDependencyResolver) : base(initializer, setFormsDependencyResolver) { } protected override async void OnInitialized() { InitializeComponent(); await NavigationService.NavigateAsync("LoginPage"); } protected override void RegisterTypes(IContainerRegistry containerRegistry) { containerRegistry.RegisterForNavigation<NavigationPage>(); containerRegistry.RegisterForNavigation<LoginPage, LoginViewModel>(); containerRegistry.RegisterPopupNavigationService(); containerRegistry.RegisterForNavigation<TestePage, TesteViewModel>(); containerRegistry.RegisterForNavigation<TestePopupPage, TestePopupViewModel>(); containerRegistry.RegisterForNavigation<ReclamacaoPage, ReclamacaoViewModel>(); } } }
29.542373
139
0.689616
[ "MIT" ]
WillBrigida/ProjetoCondominioSmart
ProjetoCondominioSmart/ProjetoCondominioSmart/App.xaml.cs
1,745
C#
using System.Runtime.InteropServices; namespace CssUI { [StructLayout(LayoutKind.Sequential, Pack = 1)] public readonly struct ReadOnlyRect4f { #region Properties public readonly double Top, Right, Bottom, Left; #endregion #region Constructor public ReadOnlyRect4f(int value) { Top = Right = Bottom = Left = value; } public ReadOnlyRect4f(double value) { Top = Right = Bottom = Left = value; } public ReadOnlyRect4f(int top, int right, int bottom, int left) { Top = top; Right = right; Bottom = bottom; Left = left; } public ReadOnlyRect4f(double top, double right, double bottom, double left) { Top = top; Right = right; Bottom = bottom; Left = left; } public ReadOnlyRect4f(in ReadOnlyRect4f Other) { Top = Other.Top; Right = Other.Right; Bottom = Other.Bottom; Left = Other.Left; } #endregion #region Equality public static bool operator ==(in ReadOnlyRect4f A, in ReadOnlyRect4f B) { if (ReferenceEquals(A, B)) return true; return (A.Top == B.Top) && (A.Right == B.Right) && (A.Bottom == B.Bottom) && (A.Left == B.Left); } public static bool operator !=(in ReadOnlyRect4f A, in ReadOnlyRect4f B) { if (ReferenceEquals(A, B)) return false; return !(A.Top == B.Top) || !(A.Right == B.Right) || !(A.Bottom == B.Bottom) || !(A.Left == B.Left); } public override bool Equals(object o) { return (o is ReadOnlyRect4f val && this == val); } public override int GetHashCode() { return System.HashCode.Combine(Top, Right, Bottom, Left); } public override string ToString() { return $"{GetType().Name}<{Top}, {Right}, {Bottom}, {Left}>"; } #endregion } }
26.358025
116
0.511007
[ "MIT" ]
dsisco11/CssUI
CssUI/CORE/Units/ReadOnly/ReadOnlyRect4f.cs
2,137
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 namespace DotNetNuke.UI.ControlPanel { using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Web; using System.Web.UI.WebControls; using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Content.Common; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Users; using DotNetNuke.Framework; using DotNetNuke.Instrumentation; using DotNetNuke.Security.Permissions; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Services.Personalization; using DotNetNuke.UI.Utilities; using DotNetNuke.Web.UI; using DotNetNuke.Web.UI.WebControls; using DotNetNuke.Web.UI.WebControls.Extensions; using Microsoft.Extensions.DependencyInjection; using Globals = DotNetNuke.Common.Globals; using PortalInfo = DotNetNuke.Entities.Portals.PortalInfo; using Reflection = DotNetNuke.Framework.Reflection; public partial class AddModule : UserControlBase, IDnnRibbonBarTool { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(AddModule)); private readonly INavigationManager _navigationManager; private bool _enabled = true; public AddModule() { this._navigationManager = Globals.DependencyProvider.GetRequiredService<INavigationManager>(); } public override bool Visible { get { return base.Visible && TabPermissionController.CanAddContentToPage(); } set { base.Visible = value; } } public bool Enabled { get { return this._enabled && this.CanAddModuleToPage(); } set { this._enabled = value; } } public string ToolName { get { return "QuickAddModule"; } set { throw new NotSupportedException("Set ToolName not supported"); } } /// <summary>Gets the currently-selected module.</summary> protected DesktopModuleInfo SelectedModule { get { if (this.AddExistingModule.Checked) { var tabId = -1; if (!string.IsNullOrEmpty(this.PageLst.SelectedValue)) { tabId = int.Parse(this.PageLst.SelectedValue); } if (tabId < 0) { tabId = PortalSettings.Current.ActiveTab.TabID; } if (!string.IsNullOrEmpty(this.ModuleLst.SelectedValue)) { var moduleId = int.Parse(this.ModuleLst.SelectedValue); if (moduleId >= 0) { return ModuleController.Instance.GetModule(moduleId, tabId, false).DesktopModule; } } } else { var portalId = -1; if (this.SiteListPanel.Visible) { portalId = int.Parse(this.SiteList.SelectedValue); } if (portalId < 0) { portalId = PortalSettings.Current.PortalId; } if (!string.IsNullOrEmpty(this.ModuleLst.SelectedValue)) { var moduleId = int.Parse(this.ModuleLst.SelectedValue); if (moduleId >= 0) { return DesktopModuleController.GetDesktopModule(moduleId, portalId); } } } return null; } } /// <summary> /// Gets return the <see cref="PortalSettings"/> for the selected portal (from the Site list), unless /// the site list is not visible or there are no other sites in our site group, in which case /// it returns the PortalSettings for the current portal. /// </summary> private PortalSettings SelectedPortalSettings { get { var portalSettings = PortalSettings.Current; try { if (this.SiteListPanel.Visible && this.SiteList.SelectedItem != null) { if (!string.IsNullOrEmpty(this.SiteList.SelectedItem.Value)) { var selectedPortalId = int.Parse(this.SiteList.SelectedItem.Value); if (this.PortalSettings.PortalId != selectedPortalId) { portalSettings = new PortalSettings(int.Parse(this.SiteList.SelectedItem.Value)); } } } } catch (Exception) { portalSettings = PortalSettings.Current; } return portalSettings; } } private string LocalResourceFile { get { return string.Format("{0}/{1}/{2}.ascx.resx", this.TemplateSourceDirectory, Localization.LocalResourceDirectory, this.GetType().BaseType.Name); } } public bool CanAddModuleToPage() { if (HttpContext.Current == null) { return false; } // If we are not in an edit page return string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["mid"]) && string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ctl"]); } protected void AddNewOrExisting_OnClick(object sender, EventArgs e) { this.LoadAllLists(); } protected void PaneLstSelectedIndexChanged(object sender, EventArgs e) { this.LoadPositionList(); this.LoadPaneModulesList(); } protected void PageLstSelectedIndexChanged(object sender, EventArgs e) { this.LoadModuleList(); } protected void PositionLstSelectedIndexChanged(object sender, EventArgs e) { this.PaneModulesLst.Enabled = this.PositionLst.SelectedValue == "ABOVE" || this.PositionLst.SelectedValue == "BELOW"; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Is there more than one site in this group? var multipleSites = this.GetCurrentPortalsGroup().Count() > 1; ClientAPI.RegisterClientVariable(this.Page, "moduleSharing", multipleSites.ToString().ToLowerInvariant(), true); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); this.cmdAddModule.Click += this.CmdAddModuleClick; this.AddNewModule.CheckedChanged += this.AddNewOrExisting_OnClick; this.AddExistingModule.CheckedChanged += this.AddNewOrExisting_OnClick; this.SiteList.SelectedIndexChanged += this.SiteList_SelectedIndexChanged; this.CategoryList.SelectedIndexChanged += this.CategoryListSelectedIndexChanged; this.PageLst.SelectedIndexChanged += this.PageLstSelectedIndexChanged; this.PaneLst.SelectedIndexChanged += this.PaneLstSelectedIndexChanged; this.PositionLst.SelectedIndexChanged += this.PositionLstSelectedIndexChanged; try { if (this.Visible) { this.cmdAddModule.Enabled = this.Enabled; this.AddExistingModule.Enabled = this.Enabled; this.AddNewModule.Enabled = this.Enabled; this.Title.Enabled = this.Enabled; this.PageLst.Enabled = this.Enabled; this.ModuleLst.Enabled = this.Enabled; this.VisibilityLst.Enabled = this.Enabled; this.PaneLst.Enabled = this.Enabled; this.PositionLst.Enabled = this.Enabled; this.PaneModulesLst.Enabled = this.Enabled; UserInfo objUser = UserController.Instance.GetCurrentUserInfo(); if (objUser != null) { if (objUser.IsSuperUser) { var objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); if (objModule != null) { var strURL = this._navigationManager.NavigateURL(objModule.TabID, true); this.hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; } else { this.hlMoreExtensions.Enabled = false; } this.hlMoreExtensions.Text = this.GetString("hlMoreExtensions"); this.hlMoreExtensions.Visible = true; } } } if (!this.IsPostBack && this.Visible && this.Enabled) { this.AddNewModule.Checked = true; this.LoadAllLists(); } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } } protected void CmdAddModuleClick(object sender, EventArgs e) { if (TabPermissionController.CanAddContentToPage() && this.CanAddModuleToPage()) { int permissionType; try { permissionType = int.Parse(this.VisibilityLst.SelectedValue); } catch (Exception exc) { Logger.Error(exc); permissionType = 0; } int position = -1; switch (this.PositionLst.SelectedValue) { case "TOP": position = 0; break; case "ABOVE": if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue)) { try { position = int.Parse(this.PaneModulesLst.SelectedValue) - 1; } catch (Exception exc) { Logger.Error(exc); position = -1; } } else { position = 0; } break; case "BELOW": if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue)) { try { position = int.Parse(this.PaneModulesLst.SelectedValue) + 1; } catch (Exception exc) { Logger.Error(exc); position = -1; } } else { position = -1; } break; case "BOTTOM": position = -1; break; } int moduleLstID; try { moduleLstID = int.Parse(this.ModuleLst.SelectedValue); } catch (Exception exc) { Logger.Error(exc); moduleLstID = -1; } if (moduleLstID > -1) { if (this.AddExistingModule.Checked) { int pageID; try { pageID = int.Parse(this.PageLst.SelectedValue); } catch (Exception exc) { Logger.Error(exc); pageID = -1; } if (pageID > -1) { this.DoAddExistingModule(moduleLstID, pageID, this.PaneLst.SelectedValue, position, string.Empty, this.chkCopyModule.Checked); } } else { DoAddNewModule(this.Title.Text, moduleLstID, this.PaneLst.SelectedValue, position, permissionType, string.Empty); } } // set view mode to edit after add module. if (Personalization.GetUserMode() != PortalSettings.Mode.Edit) { Personalization.SetProfile("Usability", "UserMode" + this.PortalSettings.PortalId, "EDIT"); } this.Response.Redirect(this.Request.RawUrl, true); } } protected string GetString(string key) { return Localization.GetString(key, this.LocalResourceFile); } private static ModulePermissionInfo AddModulePermission(ModuleInfo objModule, PermissionInfo permission, int roleId, int userId, bool allowAccess) { var objModulePermission = new ModulePermissionInfo { ModuleID = objModule.ModuleID, PermissionID = permission.PermissionID, RoleID = roleId, UserID = userId, PermissionKey = permission.PermissionKey, AllowAccess = allowAccess, }; // add the permission to the collection if (!objModule.ModulePermissions.Contains(objModulePermission)) { objModule.ModulePermissions.Add(objModulePermission); } return objModulePermission; } private static void SetCloneModuleContext(bool cloneModuleContext) { Thread.SetData( Thread.GetNamedDataSlot("CloneModuleContext"), cloneModuleContext ? bool.TrueString : bool.FalseString); } private static void DoAddNewModule(string title, int desktopModuleId, string paneName, int position, int permissionType, string align) { try { DesktopModuleInfo desktopModule; if (!DesktopModuleController.GetDesktopModules(PortalSettings.Current.PortalId).TryGetValue(desktopModuleId, out desktopModule)) { throw new ArgumentException("desktopModuleId"); } } catch (Exception ex) { Exceptions.LogException(ex); } foreach (ModuleDefinitionInfo objModuleDefinition in ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(desktopModuleId).Values) { var objModule = new ModuleInfo(); objModule.Initialize(PortalSettings.Current.ActiveTab.PortalID); objModule.PortalID = PortalSettings.Current.ActiveTab.PortalID; objModule.TabID = PortalSettings.Current.ActiveTab.TabID; objModule.ModuleOrder = position; objModule.ModuleTitle = string.IsNullOrEmpty(title) ? objModuleDefinition.FriendlyName : title; objModule.PaneName = paneName; objModule.ModuleDefID = objModuleDefinition.ModuleDefID; if (objModuleDefinition.DefaultCacheTime > 0) { objModule.CacheTime = objModuleDefinition.DefaultCacheTime; if (PortalSettings.Current.DefaultModuleId > Null.NullInteger && PortalSettings.Current.DefaultTabId > Null.NullInteger) { ModuleInfo defaultModule = ModuleController.Instance.GetModule(PortalSettings.Current.DefaultModuleId, PortalSettings.Current.DefaultTabId, true); if (defaultModule != null) { objModule.CacheTime = defaultModule.CacheTime; } } } ModuleController.Instance.InitialModulePermission(objModule, objModule.TabID, permissionType); if (PortalSettings.Current.ContentLocalizationEnabled) { Locale defaultLocale = LocaleController.Instance.GetDefaultLocale(PortalSettings.Current.PortalId); // check whether original tab is exists, if true then set culture code to default language, // otherwise set culture code to current. if (TabController.Instance.GetTabByCulture(objModule.TabID, PortalSettings.Current.PortalId, defaultLocale) != null) { objModule.CultureCode = defaultLocale.Code; } else { objModule.CultureCode = PortalSettings.Current.CultureCode; } } else { objModule.CultureCode = Null.NullString; } objModule.AllTabs = false; objModule.Alignment = align; ModuleController.Instance.AddModule(objModule); } } private static bool GetIsPortable(string moduleID, string tabID) { bool isPortable = false; int parsedModuleID; int parsedTabID; bool validModuleID = int.TryParse(moduleID, out parsedModuleID); bool validTabID = int.TryParse(tabID, out parsedTabID); if (validModuleID && validTabID) { ModuleInfo moduleInfo = ModuleController.Instance.GetModule(parsedModuleID, parsedTabID, false); if (moduleInfo != null) { DesktopModuleInfo moduleDesktopInfo = moduleInfo.DesktopModule; if (moduleDesktopInfo != null) { isPortable = moduleDesktopInfo.IsPortable; } } } return isPortable; } private void CmdConfirmAddModuleClick(object sender, EventArgs e) { this.CmdAddModuleClick(sender, e); } private void SiteList_SelectedIndexChanged(object sender, EventArgs e) { this.LoadModuleList(); this.LoadPageList(); } private void CategoryListSelectedIndexChanged(object sender, EventArgs e) { this.LoadModuleList(); } private void DoAddExistingModule(int moduleId, int tabId, string paneName, int position, string align, bool cloneModule) { ModuleInfo moduleInfo = ModuleController.Instance.GetModule(moduleId, tabId, false); int userID = -1; if (this.Request.IsAuthenticated) { UserInfo user = UserController.Instance.GetCurrentUserInfo(); if (user != null) { userID = user.UserID; } } if (moduleInfo != null) { // Is this from a site other than our own? (i.e., is the user requesting "module sharing"?) var remote = moduleInfo.PortalID != PortalSettings.Current.PortalId; if (remote) { switch (moduleInfo.DesktopModule.Shareable) { case ModuleSharing.Unsupported: // Should never happen since the module should not be listed in the first place. throw new ApplicationException(string.Format( "Module '{0}' does not support Shareable and should not be listed in Add Existing Module from a different source site", moduleInfo.DesktopModule.FriendlyName)); case ModuleSharing.Supported: break; default: case ModuleSharing.Unknown: break; } } // clone the module object ( to avoid creating an object reference to the data cache ) ModuleInfo newModule = moduleInfo.Clone(); newModule.UniqueId = Guid.NewGuid(); // Cloned Module requires a different uniqueID newModule.TabModuleID = Null.NullInteger; newModule.TabID = PortalSettings.Current.ActiveTab.TabID; newModule.ModuleOrder = position; newModule.PaneName = paneName; newModule.Alignment = align; if (cloneModule) { newModule.ModuleID = Null.NullInteger; // copy module settings and tab module settings newModule.ModuleSettings.Clear(); foreach (var key in moduleInfo.ModuleSettings.Keys) { newModule.ModuleSettings.Add(key, moduleInfo.ModuleSettings[key]); } newModule.TabModuleSettings.Clear(); foreach (var key in moduleInfo.TabModuleSettings.Keys) { newModule.TabModuleSettings.Add(key, moduleInfo.TabModuleSettings[key]); } // reset the module id newModule.ModuleID = ModuleController.Instance.AddModule(newModule); if (!string.IsNullOrEmpty(newModule.DesktopModule.BusinessControllerClass)) { object objObject = Reflection.CreateObject(newModule.DesktopModule.BusinessControllerClass, newModule.DesktopModule.BusinessControllerClass); if (objObject is IPortable) { try { SetCloneModuleContext(true); string content = Convert.ToString(((IPortable)objObject).ExportModule(moduleId)); if (!string.IsNullOrEmpty(content)) { ((IPortable)objObject).ImportModule(newModule.ModuleID, content, newModule.DesktopModule.Version, userID); } } finally { SetCloneModuleContext(false); } } } } else { // copy tab module settings newModule.TabModuleSettings.Clear(); foreach (var key in moduleInfo.TabModuleSettings.Keys) { newModule.TabModuleSettings.Add(key, moduleInfo.TabModuleSettings[key]); } ModuleController.Instance.AddModule(newModule); } if (remote) { // Ensure the Portal Admin has View rights var permissionController = new PermissionController(); ArrayList arrSystemModuleViewPermissions = permissionController.GetPermissionByCodeAndKey("SYSTEM_MODULE_DEFINITION", "VIEW"); AddModulePermission( newModule, (PermissionInfo)arrSystemModuleViewPermissions[0], PortalSettings.Current.AdministratorRoleId, Null.NullInteger, true); // Set PortalID correctly newModule.OwnerPortalID = newModule.PortalID; newModule.PortalID = PortalSettings.Current.PortalId; ModulePermissionController.SaveModulePermissions(newModule); } // Add Event Log EventLogController.Instance.AddLog(newModule, PortalSettings.Current, userID, string.Empty, EventLogController.EventLogType.MODULE_CREATED); } } private IEnumerable<PortalInfo> GetCurrentPortalsGroup() { var groups = PortalGroupController.Instance.GetPortalGroups().ToArray(); var result = (from @group in groups select PortalGroupController.Instance.GetPortalsByGroup(@group.PortalGroupId) into portals where portals.Any(x => x.PortalID == PortalSettings.Current.PortalId) select portals.ToArray()).FirstOrDefault(); // Are we in a group of one? if (result == null || result.Length == 0) { result = new[] { PortalController.Instance.GetPortal(PortalSettings.Current.PortalId) }; } return result; } private void LoadAllLists() { this.LoadSiteList(); this.LoadCategoryList(); this.LoadPageList(); this.LoadModuleList(); this.LoadVisibilityList(); this.LoadPaneList(); this.LoadPositionList(); this.LoadPaneModulesList(); } private void LoadCategoryList() { this.CategoryListPanel.Visible = !this.AddExistingModule.Checked; ITermController termController = Util.GetTermController(); this.CategoryList.DataSource = termController.GetTermsByVocabulary("Module_Categories").OrderBy(t => t.Weight).Where(t => t.Name != "< None >").ToList(); this.CategoryList.DataBind(); // CategoryList.Items.Add(new ListItem(Localization.GetString("AllCategories", LocalResourceFile), "All")); this.CategoryList.AddItem(Localization.GetString("AllCategories", this.LocalResourceFile), "All"); if (!this.IsPostBack) { this.CategoryList.Select("Common", false); } } private void LoadModuleList() { if (this.AddExistingModule.Checked) { // Get list of modules for the selected tab if (!string.IsNullOrEmpty(this.PageLst.SelectedValue)) { var tabId = int.Parse(this.PageLst.SelectedValue); if (tabId >= 0) { this.ModuleLst.BindTabModulesByTabID(tabId); } if (this.ModuleLst.ItemCount > 0) { this.chkCopyModule.Visible = true; this.SetCopyModuleMessage(GetIsPortable(this.ModuleLst.SelectedValue, this.PageLst.SelectedValue)); } } } else { this.ModuleLst.Filter = this.CategoryList.SelectedValue == "All" ? (kvp => true) : (Func<KeyValuePair<string, PortalDesktopModuleInfo>, bool>)(kvp => kvp.Value.DesktopModule.Category == this.CategoryList.SelectedValue); this.ModuleLst.BindAllPortalDesktopModules(); } this.ModuleLst.Enabled = this.ModuleLst.ItemCount > 0; } private void LoadPageList() { this.PageListPanel.Visible = this.AddExistingModule.Checked; this.TitlePanel.Enabled = !this.AddExistingModule.Checked; this.chkCopyModule.Visible = this.AddExistingModule.Checked; if (this.AddExistingModule.Checked) { this.chkCopyModule.Text = Localization.GetString("CopyModuleDefault.Text", this.LocalResourceFile); } var portalSettings = this.SelectedPortalSettings; this.PageLst.Items.Clear(); if (this.PageListPanel.Visible) { this.PageLst.DataValueField = "TabID"; this.PageLst.DataTextField = "IndentedTabName"; if (this.PortalSettings.PortalId == this.SelectedPortalSettings.PortalId) { this.PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, portalSettings.ActiveTab.TabID, true, string.Empty, true, false, false, false, true); } else { this.PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, Null.NullInteger, true, string.Empty, true, false, false, false, true); } this.PageLst.DataBind(); } } private void LoadPaneList() { this.PaneLst.Items.Clear(); this.PaneLst.DataSource = PortalSettings.Current.ActiveTab.Panes; this.PaneLst.DataBind(); if (PortalSettings.Current.ActiveTab.Panes.Contains(Globals.glbDefaultPane)) { this.PaneLst.SelectedValue = Globals.glbDefaultPane; } } private void LoadPaneModulesList() { var items = new Dictionary<string, string> { { string.Empty, string.Empty } }; foreach (ModuleInfo m in PortalSettings.Current.ActiveTab.Modules) { // if user is allowed to view module and module is not deleted if (ModulePermissionController.CanViewModule(m) && !m.IsDeleted) { // modules which are displayed on all tabs should not be displayed on the Admin or Super tabs if (!m.AllTabs || !PortalSettings.Current.ActiveTab.IsSuperTab) { if (m.PaneName == this.PaneLst.SelectedValue) { int moduleOrder = m.ModuleOrder; while (items.ContainsKey(moduleOrder.ToString()) || moduleOrder == 0) { moduleOrder++; } items.Add(moduleOrder.ToString(), m.ModuleTitle); } } } } this.PaneModulesLst.Enabled = true; this.PaneModulesLst.Items.Clear(); this.PaneModulesLst.DataValueField = "key"; this.PaneModulesLst.DataTextField = "value"; this.PaneModulesLst.DataSource = items; this.PaneModulesLst.DataBind(); if (this.PaneModulesLst.Items.Count <= 1) { var listItem = this.PositionLst.Items.FindByValue("ABOVE"); if (listItem != null) { this.PositionLst.Items.Remove(listItem); } listItem = this.PositionLst.Items.FindByValue("BELOW"); if (listItem != null) { this.PositionLst.Items.Remove(listItem); } this.PaneModulesLst.Enabled = false; } if (this.PositionLst.SelectedValue == "TOP" || this.PositionLst.SelectedValue == "BOTTOM") { this.PaneModulesLst.Enabled = false; } } private void LoadPositionList() { var items = new Dictionary<string, string> { { "TOP", this.GetString("Top") }, { "ABOVE", this.GetString("Above") }, { "BELOW", this.GetString("Below") }, { "BOTTOM", this.GetString("Bottom") }, }; this.PositionLst.Items.Clear(); this.PositionLst.DataValueField = "key"; this.PositionLst.DataTextField = "value"; this.PositionLst.DataSource = items; this.PositionLst.DataBind(); this.PositionLst.SelectedValue = "BOTTOM"; } private void LoadSiteList() { // Is there more than one site in this group? var multipleSites = this.GetCurrentPortalsGroup().Count() > 1; this.SiteListPanel.Visible = multipleSites && this.AddExistingModule.Checked; if (this.SiteListPanel.Visible) { // Get a list of portals in this SiteGroup. var portals = PortalController.Instance.GetPortals().Cast<PortalInfo>().ToArray(); this.SiteList.DataSource = portals.Select( x => new { Value = x.PortalID, Name = x.PortalName, GroupID = x.PortalGroupID }).ToList(); this.SiteList.DataTextField = "Name"; this.SiteList.DataValueField = "Value"; this.SiteList.DataBind(); } } private void LoadVisibilityList() { this.VisibilityLst.Enabled = !this.AddExistingModule.Checked; if (this.VisibilityLst.Enabled) { var items = new Dictionary<string, string> { { "0", this.GetString("PermissionView") }, { "1", this.GetString("PermissionEdit") } }; this.VisibilityLst.Items.Clear(); this.VisibilityLst.DataValueField = "key"; this.VisibilityLst.DataTextField = "value"; this.VisibilityLst.DataSource = items; this.VisibilityLst.DataBind(); } } private void SetCopyModuleMessage(bool isPortable) { if (isPortable) { this.chkCopyModule.Text = Localization.GetString("CopyModuleWcontent", this.LocalResourceFile); this.chkCopyModule.ToolTip = Localization.GetString("CopyModuleWcontent.ToolTip", this.LocalResourceFile); } else { this.chkCopyModule.Text = Localization.GetString("CopyModuleWOcontent", this.LocalResourceFile); this.chkCopyModule.ToolTip = Localization.GetString("CopyModuleWOcontent.ToolTip", this.LocalResourceFile); } } } }
40.407448
185
0.496043
[ "MIT" ]
Acidburn0zzz/Dnn.Platform
DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs
36,894
C#
namespace Kodekit.Features.Elements; public class Input : ISerializable { public Input() : base() { Font = new(); Padding = new(); Border = new(); } public Input(double? fontSize, string? fontWeight, double? verticalPadding, double? horizontalPadding, double? cornerRadius, double? borderWidth) : this() { Font = new(fontSize, fontWeight); Padding = new(horizontalPadding, verticalPadding); Border = new(borderWidth, cornerRadius); } public Font Font { get; set; } public Padding Padding { get; set; } public Border Border { get; set; } public Dictionary<string, string> Serialize() { return Font.Concat(Padding).Concat(Border); } }
25.862069
128
0.622667
[ "MIT" ]
sparc-coop/kodekit
Kodekit.Features/Elements/Inputs/Input.cs
752
C#
using System.Management.Automation; using System.Threading.Tasks; namespace psCheckPoint.Objects.Network { /// <api cmd="delete-network">Remove-CheckPointNetwork</api> /// <summary> /// <para type="synopsis">Delete existing Network using object name or uid.</para> /// <para type="description"></para> /// </summary> /// <example> /// <code> /// Remove-CheckPointNetwork -Name MyNetwork /// </code> /// </example> [Cmdlet(VerbsCommon.Remove, "CheckPointNetwork")] public class RemoveCheckPointNetwork : RemoveCheckPointObject { #region Properties /// <summary> /// <para type="description">Network object, name or UID.</para> /// </summary> [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, ValueFromRemainingArguments = true)] [Alias("Name", "UID")] public PSObject Network { get => Object; set => Object = value; } /// <inheritdoc /> protected override string InputName => nameof(Network); #endregion Properties #region Methods /// <inheritdoc /> protected override Task Remove(string value) => Session.DeleteNetwork(value, Ignore, cancellationToken: CancelProcessToken); #endregion Methods } }
32.925
139
0.64161
[ "Apache-2.0" ]
DWOF/psCheckPoint
psCheckPoint/Objects/Network/RemoveCheckPointNetwork.cs
1,319
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Ship { namespace TIEAggressor { public class SienarSpecialist : TIEAggressor { public SienarSpecialist() : base() { PilotName = "Sienar Specialist"; PilotSkill = 2; Cost = 17; } } } }
19.75
52
0.526582
[ "MIT" ]
borkin8r/FlyCasual
Assets/Scripts/Model/Ships/TIE Aggressor/SienarSpecialist.cs
397
C#
namespace Serenity.Services { public enum ColumnSelection { List = 0, KeyOnly = 1, Details = 2, } }
15.111111
31
0.522059
[ "MIT" ]
davidzhang9990/SimpleProject
Serenity.Data/Mapping/ColumnSelection.cs
138
C#
using System; using System.Globalization; using System.Linq; using System.Reflection; using Unity.Builder; using Unity.Exceptions; using Unity.Injection; using Unity.Lifetime; using Unity.Policy; using Unity.Registration; using Unity.Resolution; namespace Unity.Strategies { /// <summary> /// A <see cref="BuilderStrategy"/> that will look for a build plan /// in the current context. If it exists, it invokes it, otherwise /// it creates one and stores it for later, and invokes it. /// </summary> public class BuildPlanStrategy : BuilderStrategy { #region Registration and Analysis public override bool RequiredToBuildType(IUnityContainer container, Type type, InternalRegistration registration, params InjectionMember[] injectionMembers) { // Require Re-Resolve if no injectors specified registration.BuildRequired = (injectionMembers?.Any(m => m.BuildRequired) ?? false) || registration is ContainerRegistration cr && cr.LifetimeManager is PerResolveLifetimeManager; return true; } #endregion #region BuilderStrategy /// <summary> /// Called during the chain of responsibility for a build operation. /// </summary> /// <param name="context">The context for the operation.</param> public override void PreBuildUp(ref BuilderContext context) { // Get resolver if already created var resolver = context.Registration.Get<ResolveDelegate<BuilderContext>>() ?? (ResolveDelegate<BuilderContext>) GetGeneric(ref context, typeof(ResolveDelegate<BuilderContext>)); if (null == resolver) { // Check if can create at all #if NETCOREAPP1_0 || NETSTANDARD1_0 if (!(context.Registration is ContainerRegistration) && context.RegistrationType.GetTypeInfo().IsGenericTypeDefinition) #else if (!(context.Registration is ContainerRegistration) && context.RegistrationType.IsGenericTypeDefinition) #endif { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "The type {0} is an open generic type. An open generic type cannot be resolved.", context.RegistrationType.FullName), new InvalidRegistrationException()); } else if (context.Type.IsArray && context.Type.GetArrayRank() > 1) { var message = $"Invalid array {context.Type}. Only arrays of rank 1 are supported"; throw new ArgumentException(message, new InvalidRegistrationException()); } // Get resolver factory var factory = context.Registration.Get<ResolveDelegateFactory>() ?? (ResolveDelegateFactory)( context.Get(context.Type, UnityContainer.All, typeof(ResolveDelegateFactory)) ?? GetGeneric(ref context, typeof(ResolveDelegateFactory)) ?? context.Get(null, null, typeof(ResolveDelegateFactory))); // Create plan if (null != factory) { resolver = factory(ref context); context.Registration.Set(typeof(ResolveDelegate<BuilderContext>), resolver); context.Existing = resolver(ref context); } else throw new ResolutionFailedException(context.Type, context.Name, $"Failed to find Resolve Delegate Factory for Type {context.Type}"); } else { // Plan has been already created, just build the object context.Existing = resolver(ref context); } } #endregion #region Implementation protected static TPolicyInterface Get_Policy<TPolicyInterface>(ref BuilderContext context, Type type, string name) { return (TPolicyInterface)(GetGeneric(ref context, typeof(TPolicyInterface), type, name) ?? context.Get(null, null, typeof(TPolicyInterface))); // Nothing! Get Default } protected static object GetGeneric(ref BuilderContext context, Type policyInterface) { if (context.Registration is ContainerRegistration registration && null != context.Type) { // Check if generic #if NETCOREAPP1_0 || NETSTANDARD1_0 if (context.Type.GetTypeInfo().IsGenericType) #else if (context.Type.IsGenericType) #endif { var newType = context.Type.GetGenericTypeDefinition(); return context.Get(newType, context.Name, policyInterface) ?? context.Get(newType, UnityContainer.All, policyInterface); } } else { // Check if generic #if NETCOREAPP1_0 || NETSTANDARD1_0 if (context.RegistrationType.GetTypeInfo().IsGenericType) #else if (context.RegistrationType.IsGenericType) #endif { var newType = context.RegistrationType.GetGenericTypeDefinition(); return context.Get(newType, context.Name, policyInterface) ?? context.Get(newType, UnityContainer.All, policyInterface); } } return null; } protected static object GetGeneric(ref BuilderContext context, Type policyInterface, Type type, string name) { // Check if generic #if NETCOREAPP1_0 || NETSTANDARD1_0 if (type.GetTypeInfo().IsGenericType) #else if (type.IsGenericType) #endif { var newType = type.GetGenericTypeDefinition(); return context.Get(newType, name, policyInterface) ?? context.Get(newType, UnityContainer.All, policyInterface); } return null; } #endregion } }
39.624204
164
0.59058
[ "Apache-2.0" ]
Eragra3/container
src/Strategies/BuildPlanStrategy.cs
6,221
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 wafv2-2019-07-29.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.WAFV2.Model { /// <summary> /// A version of the named managed rule group, that the rule group's vendor publishes /// for use by customers. /// /// <note> /// <para> /// This is intended for use only by vendors of managed rule sets. Vendors are Amazon /// Web Services and Marketplace sellers. /// </para> /// /// <para> /// Vendors, you can use the managed rule set APIs to provide controlled rollout of your /// versioned managed rule group offerings for your customers. The APIs are <code>ListManagedRuleSets</code>, /// <code>GetManagedRuleSet</code>, <code>PutManagedRuleSetVersions</code>, and <code>UpdateManagedRuleSetVersionExpiryDate</code>. /// </para> /// </note> /// </summary> public partial class VersionToPublish { private string _associatedRuleGroupArn; private int? _forecastedLifetime; /// <summary> /// Gets and sets the property AssociatedRuleGroupArn. /// <para> /// The Amazon Resource Name (ARN) of the vendor's rule group that's used in the published /// managed rule group version. /// </para> /// </summary> [AWSProperty(Min=20, Max=2048)] public string AssociatedRuleGroupArn { get { return this._associatedRuleGroupArn; } set { this._associatedRuleGroupArn = value; } } // Check to see if AssociatedRuleGroupArn property is set internal bool IsSetAssociatedRuleGroupArn() { return this._associatedRuleGroupArn != null; } /// <summary> /// Gets and sets the property ForecastedLifetime. /// <para> /// The amount of time the vendor expects this version of the managed rule group to last, /// in days. /// </para> /// </summary> [AWSProperty(Min=1)] public int ForecastedLifetime { get { return this._forecastedLifetime.GetValueOrDefault(); } set { this._forecastedLifetime = value; } } // Check to see if ForecastedLifetime property is set internal bool IsSetForecastedLifetime() { return this._forecastedLifetime.HasValue; } } }
33.819149
135
0.642026
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/WAFV2/Generated/Model/VersionToPublish.cs
3,179
C#
using System; using System.Collections.Generic; using System.Linq; using I18Next.Net.Backends; using I18Next.Net.Extensions.Configuration; using I18Next.Net.Plugins; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; namespace I18Next.Net.Extensions.Builder { /// <summary> /// Allows registering I18Next into an IServiceCollection using simple fluent configuration methods. /// </summary> public class I18NextBuilder { /// <summary> /// Constructor. /// </summary> /// <param name="services">Underlying service collection.</param> public I18NextBuilder(IServiceCollection services) { Services = services; Services.AddOptions<I18NextOptions>(); } /// <summary> /// Provides direct access to the underlying IServiceCollection used to register the services and plugins. /// </summary> public IServiceCollection Services { get; } /// <summary> /// Registers the provided instance of a translation backend plugin. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one backend at a time. By default the last registered /// backend will be used. /// You can use a CompositeBackend to combine multiple backend implementations into one. /// </para> /// </remarks> /// <param name="backend">The translation backend instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddBackend(ITranslationBackend backend) { Services.AddSingleton(backend); return this; } /// <summary> /// Registers a new translation backend plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one backend at a time. By default the last registered /// backend will be used. /// You can use a CompositeBackend to combine multiple backend implementations into one. /// </para> /// </remarks> /// <typeparam name="T">Type of the translation backend.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddBackend<T>() where T : class, ITranslationBackend { Services.AddSingleton<ITranslationBackend, T>(); return this; } /// <summary> /// Registers a new translation backend plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one backend at a time. By default the last registered /// backend will be used. /// You can use a CompositeBackend to combine multiple backend implementations into one. /// </para> /// </remarks> /// <param name="factory">Translation backend factory function.</param> /// <typeparam name="T">Type of the translation backend.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddBackend<T>(Func<IServiceProvider, T> factory) where T : class, ITranslationBackend { Services.AddSingleton<ITranslationBackend, T>(factory); return this; } /// <summary> /// Registers the provided instance of a formatter plugin. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used interpolator implementation whether formatters will be used. The /// default interpolator will use it. /// </para> /// <para>It is possible to use multiple formatters.</para> /// </remarks> /// <param name="formatter">The formatter plugin instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddFormatter(IFormatter formatter) { Services.AddSingleton(formatter); return this; } /// <summary> /// Registers a new formatter plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used interpolator implementation whether formatters will be used. The /// default interpolator will use it. /// </para> /// <para>It is possible to use multiple formatters.</para> /// </remarks> /// <para>It is possible to use multiple formatters.</para> /// <typeparam name="T">The formatter plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddFormatter<T>() where T : class, IFormatter { Services.AddSingleton<IFormatter, T>(); return this; } /// <summary> /// Registers a new formatter plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used interpolator implementation whether formatters will be used. The /// default interpolator will use it. /// </para> /// <para>It is possible to use multiple formatters.</para> /// </remarks> /// <param name="factory">Formatter plugin factory function.</param> /// <typeparam name="T">Type of the formatter plugin.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddFormatter<T>(Func<IServiceProvider, T> factory) where T : class, IFormatter { Services.AddSingleton<IFormatter, T>(factory); return this; } /// <summary> /// Registers the provided instance of a translation interpolator plugin. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one interpolator at a time. By default the last registered /// interpolator will be used. /// It's not supported to combine multiple interpolator plugins. /// </para> /// </remarks> /// <param name="backend">The translation interpolator instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddInterpolator(IInterpolator interpolator) { Services.AddSingleton(interpolator); return this; } /// <summary> /// Registers a new interpolator plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one interpolator at a time. By default the last registered /// interpolator will be used. /// It's not supported to combine multiple interpolator plugins. /// </para> /// </remarks> /// <typeparam name="T">The interpolator plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddInterpolator<T>() where T : class, IInterpolator { Services.AddSingleton<IInterpolator, T>(); return this; } /// <summary> /// Registers a new interpolator plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one interpolator at a time. By default the last registered /// interpolator will be used. /// It's not supported to combine multiple interpolator plugins. /// </para> /// </remarks> /// <param name="factory">Interpolator plugin factory function.</param> /// <typeparam name="T">The interpolator plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddInterpolator<T>(Func<IServiceProvider, T> factory) where T : class, IInterpolator { Services.AddSingleton<IInterpolator, T>(factory); return this; } /// <summary> /// Registers the provided instance of a language detector plugin. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one language detector at a time. By default the last /// registered language detector will be used. /// </para> /// </remarks> /// <param name="languageDetector">The language detector instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLanguageDetector(ILanguageDetector languageDetector) { Services.AddSingleton(languageDetector); return this; } /// <summary> /// Registers a new language detector plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one language detector at a time. By default the last /// registered language detector will be used. /// </para> /// </remarks> /// <typeparam name="T">The language detector plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLanguageDetector<T>() where T : class, ILanguageDetector { Services.AddSingleton<ILanguageDetector, T>(); return this; } /// <summary> /// Registers a new language detector plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one language detector at a time. By default the last /// registered language detector will be used. /// </para> /// </remarks> /// <param name="factory">Language detector plugin factory function.</param> /// <typeparam name="T">The language detector plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLanguageDetector<T>(Func<IServiceProvider, T> factory) where T : class, ILanguageDetector { Services.AddSingleton<ILanguageDetector, T>(factory); return this; } /// <summary> /// Registers the provided instance of a logger plugin. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one logger at a time. By default the last registered /// logger will be used. /// </para> /// </remarks> /// <param name="languageDetector">The logger instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLogger(ILogger backend) { Services.AddSingleton(backend); return this; } /// <summary> /// Registers a new logger plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one logger at a time. By default the last registered /// logger will be used. /// </para> /// </remarks> /// <typeparam name="T">The logger plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLogger<T>() where T : class, ILogger { Services.AddSingleton<ILogger, T>(); return this; } /// <summary> /// Registers a new logger plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one logger at a time. By default the last registered /// logger will be used. /// </para> /// </remarks> /// <param name="factory">Logger plugin factory function.</param> /// <typeparam name="T">The logger plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddLogger<T>(Func<IServiceProvider, T> factory) where T : class, ILogger { Services.AddSingleton<ILogger, T>(factory); return this; } /// <summary> /// Registers the provided instance of a missing key handler plugin. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether missing key handlers will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple missing key handlers.</para> /// </remarks> /// <param name="languageDetector">The missing key handler instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddMissingKeyHandler(IMissingKeyHandler missingKeyHandler) { Services.AddSingleton(missingKeyHandler); return this; } /// <summary> /// Registers a new missing key handler plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether missing key handlers will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple missing key handlers.</para> /// </remarks> /// <typeparam name="T">The missing key handler plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddMissingKeyHandler<T>() where T : class, IMissingKeyHandler { Services.AddSingleton<IMissingKeyHandler, T>(); return this; } /// <summary> /// Registers a new missing key handler plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether missing key handlers will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple missing key handlers.</para> /// </remarks> /// <param name="factory">Missing key handler plugin factory function.</param> /// <typeparam name="T">The missing key handler plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddMissingKeyHandler<T>(Func<IServiceProvider, T> factory) where T : class, IMissingKeyHandler { Services.AddSingleton<IMissingKeyHandler, T>(factory); return this; } /// <summary> /// Registers the provided instance of a plural resolver plugin. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether a registered plural resolver will be used. /// The default translator will use it. /// </para> /// <para> /// Note: The configuring default I18Next instance can only use one plural resolver at a time. By default the last /// registered plural resolver will be used. /// </para> /// </remarks> /// <param name="languageDetector">The plural resolver instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPluralResolver(IPluralResolver pluralResolver) { Services.AddSingleton(pluralResolver); return this; } /// <summary> /// Registers a new plural resolver plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether a registered plural resolver will be used. /// The default translator will use it. /// </para> /// <para> /// Note: The configuring default I18Next instance can only use one logger at a time. By default the last /// registered logger will be used. /// </para> /// </remarks> /// <typeparam name="T">The plural resolver plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPluralResolver<T>() where T : class, IPluralResolver { Services.AddSingleton<IPluralResolver, T>(); return this; } /// <summary> /// Registers a new plural resolver plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether a registered plural resolver will be used. /// The default translator will use it. /// </para> /// <para> /// Note: The configuring default I18Next instance can only use one plural resolver at a time. By default the last /// registered plural resolver will be used. /// </para> /// </remarks> /// <param name="factory">Plural resolver plugin factory function.</param> /// <typeparam name="T">The plural resolver plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPluralResolver<T>(Func<IServiceProvider, T> factory) where T : class, IPluralResolver { Services.AddSingleton<IPluralResolver, T>(factory); return this; } /// <summary> /// Registers the provided instance of a post processor plugin. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether post processors will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple post processors.</para> /// </remarks> /// <param name="languageDetector">The post processor instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPostProcessor(IPostProcessor postProcessor) { Services.AddSingleton(postProcessor); return this; } /// <summary> /// Registers a new post processor plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether post processors will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple post processors.</para> /// </remarks> /// <typeparam name="T">The post processor plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPostProcessor<T>() where T : class, IPostProcessor { Services.AddSingleton<IPostProcessor, T>(); return this; } /// <summary> /// Registers a new post processor plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: It's dependent on the used translator implementation whether post processors will be used. The /// default translator will use it. /// </para> /// <para>It is possible to use multiple post processors.</para> /// </remarks> /// <param name="factory">Post processor plugin factory function.</param> /// <typeparam name="T">The post processor plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddPostProcessor<T>(Func<IServiceProvider, T> factory) where T : class, IPostProcessor { Services.AddSingleton<IPostProcessor, T>(factory); return this; } /// <summary> /// Registers the provided instance of a translator plugin. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one translator at a time. By default the last registered /// translator will be used. /// It's not supported to combine multiple translator plugins. /// </para> /// </remarks> /// <param name="backend">The translator instance.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddTranslator<T>() where T : class, ITranslator { Services.AddSingleton<ITranslator, T>(); return this; } /// <summary> /// Registers a new translator plugin of the given type. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one translator at a time. By default the last registered /// translator will be used. /// It's not supported to combine multiple translator plugins. /// </para> /// </remarks> /// <typeparam name="T">The translator plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddTranslator(ITranslator translator) { Services.AddSingleton(translator); return this; } /// <summary> /// Registers a new translator plugin using a factory function. /// </summary> /// <remarks> /// <para> /// Note: The configuring I18Next instance can only use one translator at a time. By default the last registered /// translator will be used. /// It's not supported to combine multiple translator plugins. /// </para> /// </remarks> /// <param name="factory">Translator plugin factory function.</param> /// <typeparam name="T">The translator plugin type.</typeparam> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder AddTranslator<T>(Func<IServiceProvider, T> factory) where T : class, ITranslator { Services.AddSingleton<ITranslator, T>(factory); return this; } /// <summary> /// Build the final service configurations and applies them to the underlying IServiceCollection. /// </summary> public void Build() { AddSingletonIfNotPresent(DefaultLoggerFactory); AddSingletonIfNotPresent<IPluralResolver, DefaultPluralResolver>(); AddSingletonIfNotPresent<ILanguageDetector>(DefaultLanguageDetectorFactory); AddSingletonIfNotPresent<ITranslationBackend, JsonFileBackend>(); AddSingletonIfNotPresent<ITranslator>(DefaultTranslatorFactory); AddSingletonIfNotPresent<IInterpolator>(DefaultInterpolatorFactory); Services.AddSingleton<II18NextFactory, I18NextFactory>(); Services.AddSingleton(c => c.GetRequiredService<II18NextFactory>().CreateInstance()); Services.AddSingleton<IStringLocalizerFactory, I18NextStringLocalizerFactory>(); Services.AddTransient(typeof(IStringLocalizer<>), typeof(StringLocalizer<>)); Services.TryAddTransient(typeof(IStringLocalizer), c => c.GetRequiredService<IStringLocalizerFactory>().Create(null)); } /// <summary> /// Allows configuration of some global I18Next options. /// </summary> /// <param name="configure">Configuration callback.</param> /// <returns>The current I18Next builder instance.</returns> public I18NextBuilder Configure(Action<I18NextOptions> configure) { Services.Configure<I18NextOptions>(options => configure?.Invoke(options)); return this; } /// <summary> /// Sets the global default language used by I18Next to translate keys. /// </summary> /// <remarks> /// <para>Allowed format examples: de-DE, en-US, en, de, en-GB</para> /// </remarks> /// <param name="language">The default language identifier.</param> /// <returns>The current I18Next builder instance.</returns> /// <exception cref="ArgumentException">If the provided default language value is null or empty.</exception> public I18NextBuilder UseDefaultLanguage(string language) { if (string.IsNullOrEmpty(language)) throw new ArgumentException("Language cannot be null or empty.", nameof(language)); Services.Configure<I18NextOptions>(options => options.DefaultLanguage = language); return this; } /// <summary> /// Sets the global default namespace used by I18Next to resolve translations. /// </summary> /// <param name="namespace">The default namespace.</param> /// <returns>The current I18Next builder instance.</returns> /// <exception cref="ArgumentException">If the provided default namespace value is null or empty.</exception> public I18NextBuilder UseDefaultNamespace(string @namespace) { if (string.IsNullOrEmpty(@namespace)) throw new ArgumentException("Namespace cannot be null or empty.", nameof(@namespace)); Services.Configure<I18NextOptions>(options => options.DefaultNamespace = @namespace); return this; } /// <summary> /// Sets one or more globally used fallback languages used by I18Next to resolve translations if the default or /// requested language does /// not provide a value for a requested key. The fallback languages will be checked in given order until a value is /// found. /// </summary> /// <remarks> /// <para>Allowed format examples: de-DE, en-US, en, de, en-GB</para> /// </remarks> /// <param name="languages">One or more fallback language identifiers.</param> /// <returns>The current I18Next builder instance.</returns> /// <exception cref="ArgumentException"> /// If no fallback language was provided or any of the provided values is null or /// empty. /// </exception> public I18NextBuilder UseFallbackLanguage(params string[] languages) { if (languages.Length == 0) throw new ArgumentException("Please supply at least one fallback language", nameof(languages)); if (languages.Any(string.IsNullOrEmpty)) throw new ArgumentException("None of fallback languages can be null or empty.", nameof(languages)); Services.Configure<I18NextOptions>(options => options.FallbackLanguages = languages); return this; } private void AddSingletonIfNotPresent<TService, TImplementation>() where TImplementation : class, TService where TService : class { if (Services.All(s => s.ServiceType != typeof(TService))) Services.AddSingleton<TService, TImplementation>(); } private void AddSingletonIfNotPresent<TService>(Func<IServiceProvider, TService> factory) where TService : class { if (Services.All(s => s.ServiceType != typeof(TService))) Services.AddSingleton(factory); } private static DefaultInterpolator DefaultInterpolatorFactory(IServiceProvider c) { var formatters = c.GetRequiredService<IEnumerable<IFormatter>>(); var instance = new DefaultInterpolator(); instance.Formatters.AddRange(formatters); return instance; } private static DefaultLanguageDetector DefaultLanguageDetectorFactory(IServiceProvider c) { var options = c.GetRequiredService<IOptions<I18NextOptions>>(); return new DefaultLanguageDetector(options.Value.DefaultLanguage); } private static ILogger DefaultLoggerFactory(IServiceProvider c) { var msLogger = c.GetService<Microsoft.Extensions.Logging.ILogger>(); if (msLogger != null) return new DefaultExtensionsLogger(msLogger); return new TraceLogger(); } private static DefaultTranslator DefaultTranslatorFactory(IServiceProvider c) { var backend = c.GetRequiredService<ITranslationBackend>(); var logger = c.GetRequiredService<ILogger>(); var pluralResolver = c.GetRequiredService<IPluralResolver>(); var interpolator = c.GetRequiredService<IInterpolator>(); var postProcessors = c.GetService<IEnumerable<IPostProcessor>>(); var missingKeyHandlers = c.GetService<IEnumerable<IMissingKeyHandler>>(); var instance = new DefaultTranslator(backend, logger, pluralResolver, interpolator); if (postProcessors != null) instance.PostProcessors.AddRange(postProcessors); if (missingKeyHandlers != null) instance.MissingKeyHandlers.AddRange(missingKeyHandlers); return instance; } } }
42.036635
130
0.584745
[ "Apache-2.0" ]
DarkLiKally/I18Next.Net
src/I18Next.Net.Extensions/Builder/I18NextBuilder.cs
30,983
C#
// ReSharper disable InconsistentNaming namespace Orleans { /// <summary> /// The set of error types used by the Orleans runtime libraries for logging errors. /// </summary> internal enum ErrorCode { Runtime = 100000, Runtime_Error_100001 = Runtime + 1, Runtime_Error_100002 = Runtime + 2, Runtime_Error_100003 = Runtime + 3, Runtime_Error_100004 = Runtime + 4, Runtime_Error_100005 = Runtime + 5, Runtime_Error_100006 = Runtime + 6, Runtime_Error_100007 = Runtime + 7, Runtime_Error_100008 = Runtime + 8, Runtime_Error_100009 = Runtime + 9, Runtime_Error_100010 = Runtime + 10, Runtime_Error_100011 = Runtime + 11, Runtime_Error_100012 = Runtime + 12, Runtime_Error_100013 = Runtime + 13, Runtime_Error_100014 = Runtime + 14, Runtime_Error_100015 = Runtime + 15, Runtime_Error_100016 = Runtime + 16, Runtime_Error_100017 = Runtime + 17, Runtime_Error_100018 = Runtime + 18, Runtime_Error_100019 = Runtime + 19, Runtime_Error_100020 = Runtime + 20, Runtime_Error_100021 = Runtime + 21, Runtime_Error_100022 = Runtime + 22, Runtime_Error_100023 = Runtime + 23, Runtime_Error_100024 = Runtime + 24, Runtime_Error_100025 = Runtime + 25, Runtime_Error_100026 = Runtime + 26, Runtime_Error_100027 = Runtime + 27, Runtime_Error_100028 = Runtime + 28, Runtime_Error_100029 = Runtime + 29, Runtime_Error_100030 = Runtime + 30, Runtime_Error_100031 = Runtime + 31, Runtime_Error_100032 = Runtime + 32, Runtime_Error_100033 = Runtime + 33, Runtime_Error_100034 = Runtime + 34, Runtime_Error_100035 = Runtime + 35, Runtime_Error_100036 = Runtime + 36, Runtime_Error_100037 = Runtime + 37, //Runtime_Error_100038 = Runtime + 38, Runtime_Error_100039 = Runtime + 39, Runtime_Error_100040 = Runtime + 40, Runtime_Error_100041 = Runtime + 41, Runtime_Error_100042 = Runtime + 42, Runtime_Error_100043 = Runtime + 43, Runtime_Error_100044 = Runtime + 44, Runtime_Error_100045 = Runtime + 45, Runtime_Error_100046 = Runtime + 46, Runtime_Error_100047 = Runtime + 47, Runtime_Error_100048 = Runtime + 48, Runtime_Error_100049 = Runtime + 49, Runtime_Error_100050 = Runtime + 50, Runtime_Error_100051 = Runtime + 51, Runtime_Error_100052 = Runtime + 52, Runtime_Error_100053 = Runtime + 53, Runtime_Error_100054 = Runtime + 54, Runtime_Error_100055 = Runtime + 55, Runtime_Error_100056 = Runtime + 56, Runtime_Error_100057 = Runtime + 57, Runtime_Error_100058 = Runtime + 58, Runtime_Error_100059 = Runtime + 59, Runtime_Error_100060 = Runtime + 60, Runtime_Error_100061 = Runtime + 61, Runtime_Error_100062 = Runtime + 62, Runtime_Error_100063 = Runtime + 63, Runtime_Error_100064 = Runtime + 64, Runtime_Error_100065 = Runtime + 65, Runtime_Error_100066 = Runtime + 66, Runtime_Error_100067 = Runtime + 67, Runtime_Error_100068 = Runtime + 68, Runtime_Error_100069 = Runtime + 69, Runtime_Error_100070 = Runtime + 70, Runtime_Error_100071 = Runtime + 71, Runtime_Error_100072 = Runtime + 72, Runtime_Error_100073 = Runtime + 73, Runtime_Error_100074 = Runtime + 74, Runtime_Error_100075 = Runtime + 75, Runtime_Error_100076 = Runtime + 76, Runtime_Error_100077 = Runtime + 77, Runtime_Error_100078 = Runtime + 78, Runtime_Error_100079 = Runtime + 79, Runtime_Error_100080 = Runtime + 80, Runtime_Error_100081 = Runtime + 81, Runtime_Error_100082 = Runtime + 82, Runtime_Error_100083 = Runtime + 83, Runtime_Error_100084 = Runtime + 84, Runtime_Error_100085 = Runtime + 85, Runtime_Error_100086 = Runtime + 86, Runtime_Error_100087 = Runtime + 87, Runtime_Error_100088 = Runtime + 88, Runtime_Error_100089 = Runtime + 89, Runtime_Error_100090 = Runtime + 90, Runtime_Error_100091 = Runtime + 91, Runtime_Error_100092 = Runtime + 92, Runtime_Error_100093 = Runtime + 93, Runtime_Error_100094 = Runtime + 94, Runtime_Error_100095 = Runtime + 95, Runtime_Error_100096 = Runtime + 96, Runtime_Error_100097 = Runtime + 97, Runtime_Error_100098 = Runtime + 98, Runtime_Error_100099 = Runtime + 99, Runtime_Error_100100 = Runtime + 100, Runtime_Error_100101 = Runtime + 101, Runtime_Error_100102 = Runtime + 102, Runtime_Error_100103 = Runtime + 103, Runtime_Error_100104 = Runtime + 104, Runtime_Error_100105 = Runtime + 105, Runtime_Error_100106 = Runtime + 106, Runtime_Error_100107 = Runtime + 107, Runtime_Error_100108 = Runtime + 108, Runtime_Error_100109 = Runtime + 109, Runtime_Error_100110 = Runtime + 110, Runtime_Error_100111 = Runtime + 111, Runtime_Error_100112 = Runtime + 112, Runtime_Error_100113 = Runtime + 113, Runtime_Error_100114 = Runtime + 114, Runtime_Error_100115 = Runtime + 115, Runtime_Error_100116 = Runtime + 116, Runtime_Error_100117 = Runtime + 117, Runtime_Error_100118 = Runtime + 118, Runtime_Error_100119 = Runtime + 119, Runtime_Error_100120 = Runtime + 120, Runtime_Error_100121 = Runtime + 121, Runtime_Error_100122 = Runtime + 122, Runtime_Error_100123 = Runtime + 123, Runtime_Error_100124 = Runtime + 124, Runtime_Error_100125 = Runtime + 125, Runtime_Error_100126 = Runtime + 126, Runtime_Error_100127 = Runtime + 127, Runtime_Error_100128 = Runtime + 128, Runtime_Error_100129 = Runtime + 129, Runtime_Error_100130 = Runtime + 130, Runtime_Error_100131 = Runtime + 131, Runtime_Error_100132 = Runtime + 132, Runtime_Error_100133 = Runtime + 133, Runtime_Error_100134 = Runtime + 134, Runtime_Error_100135 = Runtime + 135, Runtime_Error_100136 = Runtime + 136, Runtime_Error_100137 = Runtime + 137, Runtime_Error_100138 = Runtime + 138, Runtime_Error_100139 = Runtime + 139, Runtime_Error_100140 = Runtime + 140, Runtime_Error_100141 = Runtime + 141, Runtime_Error_100142 = Runtime + 142, Runtime_Error_100143 = Runtime + 143, Runtime_Error_100144 = Runtime + 144, Runtime_Error_100145 = Runtime + 145, Runtime_Error_100146 = Runtime + 146, Runtime_Error_100147 = Runtime + 147, Runtime_Error_100148 = Runtime + 148, Runtime_Error_100149 = Runtime + 149, Runtime_Error_100150 = Runtime + 150, Runtime_Error_100151 = Runtime + 151, Runtime_Error_100152 = Runtime + 152, Runtime_Error_100153 = Runtime + 153, Runtime_Error_100154 = Runtime + 154, Runtime_Error_100155 = Runtime + 155, Runtime_Error_100156 = Runtime + 156, Runtime_Error_100157 = Runtime + 157, Runtime_Error_100158 = Runtime + 158, Runtime_Error_100159 = Runtime + 159, Runtime_Error_100160 = Runtime + 160, Runtime_Error_100161 = Runtime + 161, Runtime_Error_100162 = Runtime + 162, Runtime_Error_100163 = Runtime + 163, Runtime_Error_100164 = Runtime + 164, Runtime_Error_100165 = Runtime + 165, Runtime_Error_100166 = Runtime + 166, Runtime_Error_100167 = Runtime + 167, Runtime_Error_100168 = Runtime + 168, Runtime_Error_100169 = Runtime + 169, Runtime_Error_100170 = Runtime + 170, Runtime_Error_100171 = Runtime + 171, Runtime_Error_100172 = Runtime + 172, Runtime_Error_100173 = Runtime + 173, Runtime_Error_100174 = Runtime + 174, Runtime_Error_100175 = Runtime + 175, Runtime_Error_100176 = Runtime + 176, Runtime_Error_100177 = Runtime + 177, Runtime_Error_100178 = Runtime + 178, Runtime_Error_100179 = Runtime + 179, Runtime_Error_100180 = Runtime + 180, Runtime_Error_100181 = Runtime + 181, Runtime_Error_100182 = Runtime + 182, Runtime_Error_100183 = Runtime + 183, Runtime_Error_100184 = Runtime + 184, Runtime_Error_100185 = Runtime + 185, Runtime_Error_100186 = Runtime + 186, Runtime_Error_100187 = Runtime + 187, Runtime_Error_100188 = Runtime + 188, Runtime_Error_100189 = Runtime + 189, Runtime_Error_100190 = Runtime + 190, Runtime_Error_100191 = Runtime + 191, Runtime_Error_100192 = Runtime + 192, Runtime_Error_100193 = Runtime + 193, Runtime_Error_100194 = Runtime + 194, Runtime_Error_100195 = Runtime + 195, Runtime_Error_100196 = Runtime + 196, Runtime_Error_100197 = Runtime + 197, Runtime_Error_100198 = Runtime + 198, Runtime_Error_100199 = Runtime + 199, Runtime_Error_100200 = Runtime + 200, Runtime_Error_100201 = Runtime + 201, Runtime_Error_100202 = Runtime + 202, Runtime_Error_100203 = Runtime + 203, Runtime_Error_100204 = Runtime + 204, Runtime_Error_100205 = Runtime + 205, Runtime_Error_100206 = Runtime + 206, Runtime_Error_100207 = Runtime + 207, Runtime_Error_100208 = Runtime + 208, Runtime_Error_100209 = Runtime + 209, Runtime_Error_100210 = Runtime + 210, Runtime_Error_100211 = Runtime + 211, Runtime_Error_100212 = Runtime + 212, Runtime_Error_100213 = Runtime + 213, Runtime_Error_100214 = Runtime + 214, Runtime_Error_100215 = Runtime + 215, Runtime_Error_100216 = Runtime + 216, Runtime_Error_100217 = Runtime + 217, Runtime_Error_100218 = Runtime + 218, Runtime_Error_100219 = Runtime + 219, Runtime_Error_100220 = Runtime + 220, Runtime_Error_100221 = Runtime + 221, Runtime_Error_100222 = Runtime + 222, Runtime_Error_100223 = Runtime + 223, Runtime_Error_100224 = Runtime + 224, Runtime_Error_100225 = Runtime + 225, Runtime_Error_100226 = Runtime + 226, Runtime_Error_100227 = Runtime + 227, Runtime_Error_100228 = Runtime + 228, Runtime_Error_100229 = Runtime + 229, Runtime_Error_100230 = Runtime + 230, Runtime_Error_100231 = Runtime + 231, Runtime_Error_100232 = Runtime + 232, Runtime_Error_100233 = Runtime + 233, Runtime_Error_100234 = Runtime + 234, Runtime_Error_100235 = Runtime + 235, Runtime_Error_100236 = Runtime + 236, Runtime_Error_100237 = Runtime + 237, Runtime_Error_100238 = Runtime + 238, Runtime_Error_100239 = Runtime + 239, Runtime_Error_100240 = Runtime + 240, Runtime_Error_100241 = Runtime + 241, Runtime_Error_100242 = Runtime + 242, Runtime_Error_100243 = Runtime + 243, Runtime_Error_100244 = Runtime + 244, Runtime_Error_100245 = Runtime + 245, Runtime_Error_100246 = Runtime + 246, Runtime_Error_100247 = Runtime + 247, Runtime_Error_100248 = Runtime + 248, Runtime_Error_100249 = Runtime + 249, Runtime_Error_100250 = Runtime + 250, Runtime_Error_100251 = Runtime + 251, Runtime_Error_100252 = Runtime + 252, Runtime_Error_100253 = Runtime + 253, Runtime_Error_100254 = Runtime + 254, Runtime_Error_100255 = Runtime + 255, Runtime_Error_100256 = Runtime + 256, Runtime_Error_100257 = Runtime + 257, Runtime_Error_100258 = Runtime + 258, Runtime_Error_100259 = Runtime + 259, Runtime_Error_100260 = Runtime + 260, Runtime_Error_100261 = Runtime + 261, Runtime_Error_100262 = Runtime + 262, Runtime_Error_100263 = Runtime + 263, Runtime_Error_100264 = Runtime + 264, Runtime_Error_100265 = Runtime + 265, Runtime_Error_100266 = Runtime + 266, Runtime_Error_100267 = Runtime + 267, Runtime_Error_100268 = Runtime + 268, Runtime_Error_100269 = Runtime + 269, Runtime_Error_100270 = Runtime + 270, Runtime_Error_100271 = Runtime + 271, Runtime_Error_100272 = Runtime + 272, Runtime_Error_100273 = Runtime + 273, Runtime_Error_100274 = Runtime + 274, Runtime_Error_100275 = Runtime + 275, Runtime_Error_100276 = Runtime + 276, Runtime_Error_100277 = Runtime + 277, Runtime_Error_100278 = Runtime + 278, Runtime_Error_100279 = Runtime + 279, Runtime_Error_100280 = Runtime + 280, Runtime_Error_100281 = Runtime + 281, Runtime_Error_100282 = Runtime + 282, Runtime_Error_100283 = Runtime + 283, Runtime_Error_100284 = Runtime + 284, Runtime_Error_100285 = Runtime + 285, Runtime_Error_100286 = Runtime + 286, Runtime_Error_100287 = Runtime + 287, Runtime_Error_100288 = Runtime + 288, Runtime_Error_100289 = Runtime + 289, Runtime_Error_100290 = Runtime + 290, Runtime_Error_100291 = Runtime + 291, Runtime_Error_100292 = Runtime + 292, Runtime_Error_100293 = Runtime + 293, Runtime_Error_100294 = Runtime + 294, Runtime_Error_100295 = Runtime + 295, Runtime_Error_100296 = Runtime + 296, Runtime_Error_100297 = Runtime + 297, Runtime_Error_100298 = Runtime + 298, Runtime_Error_100299 = Runtime + 299, Runtime_Error_100300 = Runtime + 300, Runtime_Error_100301 = Runtime + 301, Runtime_Error_100302 = Runtime + 302, Runtime_Error_100303 = Runtime + 303, Runtime_Error_100304 = Runtime + 304, Runtime_Error_100305 = Runtime + 305, Runtime_Error_100306 = Runtime + 306, Runtime_Error_100307 = Runtime + 307, Runtime_Error_100308 = Runtime + 308, Runtime_Error_100309 = Runtime + 309, Runtime_Error_100310 = Runtime + 310, Runtime_Error_100311 = Runtime + 311, Runtime_Error_100312 = Runtime + 312, ClientInitializing = Runtime + 313, ClientStarting = Runtime + 314, ClientError = Runtime + 315, Runtime_Error_100316 = Runtime + 316, Runtime_Error_100317 = Runtime + 317, Runtime_Error_100318 = Runtime + 318, Runtime_Error_100319 = Runtime + 319, Runtime_Error_100320 = Runtime + 320, Runtime_Error_100321 = Runtime + 321, GrainInvokeException = Runtime + 322, Runtime_Error_100323 = Runtime + 323, Runtime_Error_100324 = Runtime + 324, Runtime_Error_100325 = Runtime + 325, Runtime_Error_100326 = Runtime + 326, Runtime_Error_100327 = Runtime + 327, Runtime_Error_100328 = Runtime + 328, Runtime_Error_100329 = Runtime + 329, Runtime_Error_100330 = Runtime + 330, Runtime_Error_100331 = Runtime + 331, SiloBase = Runtime + 400, SiloStarting = SiloBase + 1, SiloStarted = SiloBase + 2, SiloInitializing = SiloBase + 3, SiloGcSetting = SiloBase + 4, SiloGcWarning = SiloBase + 5, SiloSetDeploymentId = SiloBase + 6, SiloSetSiloEndpoint = SiloBase + 7, SiloSetProxyEndpoint = SiloBase + 8, SiloSetSeedNode = SiloBase + 9, SiloAddSeedNode = SiloBase + 10, SiloSetPrimaryNode = SiloBase + 11, SiloSetWorkingDir = SiloBase + 12, SiloStopped = SiloBase + 13, SiloStopping = SiloBase + 14, SiloInitConfig = SiloBase + 15, SiloDebugDump = SiloBase + 16, SiloShuttingDown = SiloBase + 17, SiloShutDown = SiloBase + 18, SiloFailedToStopMembership = SiloBase + 19, SiloIgnoreErrorDuringStop = SiloBase + 20, SiloHeartbeatTimerStalled = Runtime_Error_100150, // Backward compatability SiloCannotResetHeartbeatTimer = SiloBase + 21, SiloInitializingFinished = SiloBase + 22, SiloSetSiloType = SiloBase + 23, SiloStartupEventName = SiloBase + 24, SiloStartupEventCreated = SiloBase + 25, SiloStartupEventOpened = SiloBase + 26, SiloStopInProgress = SiloBase + 27, WaitingForSiloStop = SiloBase + 28, CannotCheckRoleEnvironment = SiloBase + 29, SiloConfiguredThreadPool = SiloBase + 30, SiloFailedToConfigureThreadPool = SiloBase + 31, SetSiloLivenessType = SiloBase + 34, SiloEndpointConfigError = SiloBase + 35, SiloConfiguredServicePointManager = SiloBase + 36, SiloCallingProviderInit = SiloBase + 37, SetReminderServiceType = SiloBase + 38, SiloStartError = SiloBase + 39, SiloConfigDeprecated = SiloBase + 40, SiloShutdownEventName = SiloBase + 41, SiloShutdownEventCreated = SiloBase + 42, SiloShutdownEventOpened = SiloBase + 43, SiloShutdownEventReceived = SiloBase + 44, SiloLoadedDI = SiloBase + 45, // Not used anymore SiloFailedToLoadDI = SiloBase + 46, // Not used anymore SiloFileNotFoundLoadingDI = SiloBase + 47, // Not used anymore SiloStartupEventFailure = SiloBase + 48, SiloShutdownEventFailure = SiloBase + 49, LifecycleStartFailure = SiloBase + 50, LifecycleStopFailure = SiloBase + 51, CatalogBase = Runtime + 500, CatalogNonExistingActivation1 = CatalogBase + 1, Catalog_UnregisterManyAsync = CatalogBase + 2, Catalog_DestroyActivations = CatalogBase + 3, Catalog_UnknownActivation = CatalogBase + 4, Catalog_ActivationException = CatalogBase + 5, Catalog_GetApproximateSiloStatuses = CatalogBase + 6, Catalog_BeforeCollection = CatalogBase + 7, Catalog_AfterCollection = CatalogBase + 8, Catalog_ShutdownActivations_1 = CatalogBase + 9, CatalogNonExistingActivation2 = CatalogBase + 10, Catalog_BeforeCallingActivate = CatalogBase + 11, Catalog_AfterCallingActivate = CatalogBase + 12, Catalog_ErrorCallingActivate = CatalogBase + 13, Catalog_BeforeCallingDeactivate = CatalogBase + 14, Catalog_AfterCallingDeactivate = CatalogBase + 15, Catalog_ErrorCallingDeactivate = CatalogBase + 16, Catalog_MissingTypeOnCreate = CatalogBase + 17, Catalog_ResendDuplicateFailed = CatalogBase + 18, Catalog_NullGetTypeAndStrategies= CatalogBase + 19, Catalog_DuplicateActivation = CatalogBase + 20, Catalog_RegistrationFailure = CatalogBase + 21, Catalog_Warn_ActivationTooManyRequests = CatalogBase + 22, Catalog_Reject_ActivationTooManyRequests = CatalogBase + 23, Catalog_SiloStatusChangeNotification = CatalogBase + 24, Catalog_SiloStatusChangeNotification_Exception = CatalogBase + 25, Catalog_AttemptToCollectActivationEarly = CatalogBase + 26, Catalog_DeactivateActivation_Exception = CatalogBase + 27, Catalog_ActivationDirectory_Statistics = CatalogBase + 28, Catalog_UnregisterMessageTarget1 = CatalogBase + 29, Catalog_UnregisterMessageTarget2 = CatalogBase + 30, Catalog_UnregisterMessageTarget3 = CatalogBase + 31, Catalog_UnregisterMessageTarget4 = CatalogBase + 32, Catalog_Failed_SetupActivationState = CatalogBase + 33, Catalog_Failed_InvokeActivate = CatalogBase + 34, Catalog_RerouteAllQueuedMessages = CatalogBase + 35, Catalog_WaitForAllTimersToFinish_Exception = CatalogBase + 36, Catalog_ActivationCollector_BadState_1 = CatalogBase + 37, Catalog_ActivationCollector_BadState_2 = CatalogBase + 38, Catalog_DestroyActivations_Done = CatalogBase + 39, Catalog_ShutdownActivations_2 = CatalogBase + 40, Catalog_ShutdownActivations_3 = CatalogBase + 41, Catalog_DeactivateStreamResources_Exception = CatalogBase + 42, Catalog_FinishDeactivateActivation_Exception = CatalogBase + 43, Catalog_FinishGrainDeactivateAndCleanupStreams_Exception = CatalogBase + 44, Catalog_DeactivateAllActivations = CatalogBase + 45, Catalog_ActivationCollector_BadState_3 = CatalogBase + 46, MembershipBase = Runtime + 600, MembershipCantWriteLivenessDisabled = Runtime_Error_100225, // Backward compatability MembershipNodeMigrated = MembershipBase + 1, MembershipNodeRestarted = MembershipBase + 2, MembershipStarting = MembershipBase + 3, MembershipBecomeActive = MembershipBase + 4, MembershipFinishBecomeActive = MembershipBase + 5, MembershipShutDown = MembershipBase + 6, MembershipStop = MembershipBase + 7, MembershipReadTable = MembershipBase + 8, MembershipKillMyself = MembershipBase + 9, MembershipVotingForKill = MembershipBase + 10, MembershipMarkingAsDead = MembershipBase + 11, MembershipWatchList = MembershipBase + 12, MembershipMissedPing = MembershipBase + 13, MembershipSendingPreJoinPing = MembershipBase + 14, MembershipFailedToWrite = MembershipBase + 15, MembershipFailedToWriteConditional = MembershipBase + 16, MembershipFoundMyselfDead1 = MembershipBase + 17, MembershipFoundMyselfDead2 = MembershipBase + 18, MembershipDetectedOlder = MembershipBase + 19, MembershipDetectedNewer = MembershipBase + 20, MembershipDelayedTableUpdateTimer = MembershipBase + 21, MembershipDelayedProbeOtherSilosTimer = MembershipBase + 22, MembershipFailedToReadSilo = MembershipBase + 23, MembershipDelayedIAmAliveUpdateTimer = MembershipBase + 24, MembershipMissedIAmAliveTableUpdate = MembershipBase + 25, MembershipLocalSubscriberException = MembershipBase + 26, MembershipKillMyselfLocally = MembershipBase + 27, MembershipFoundMyselfDead3 = MembershipBase + 28, MembershipMarkDeadWriteFailed = MembershipBase + 29, MembershipTableGrainInit1 = MembershipBase + 30, MembershipTableGrainInit2 = MembershipBase + 31, MembershipTableGrainInit3 = MembershipBase + 32, MembershipTableGrainInit4 = MembershipBase + 33, MembershipReadAll_1 = MembershipBase + 34, MembershipFactory1 = MembershipBase + 35, MembershipFactory2 = MembershipBase + 36, MembershipGrainBasedTable1 = MembershipBase + 37, MembershipGrainBasedTable2 = MembershipBase + 38, MembershipGrainBasedTable3 = MembershipBase + 39, MembershipFileBasedTable1 = MembershipBase + 40, MembershipFileBasedTable2 = MembershipBase + 41, MembershipFileBasedTable3 = MembershipBase + 42, MembershipFileBasedTable4 = MembershipBase + 43, MembershipPingedSiloNotInWatchList = MembershipBase + 44, MembershipReadAll_2 = MembershipBase + 45, MembershipFailedToStart = MembershipBase + 46, MembershipFailedToBecomeActive = MembershipBase + 47, MembershipFailedToStop = MembershipBase + 48, MembershipFailedToShutdown = MembershipBase + 49, MembershipFailedToKillMyself = MembershipBase + 50, MembershipFailedToSuspect = MembershipBase + 51, MembershipReadAll_Cleanup = MembershipBase + 52, MembershipShutDownFailure = MembershipBase + 53, MembershipKillMyselfFailure = MembershipBase + 54, MembershipGossipProcessingFailure = MembershipBase + 55, MembershipGossipSendFailure = MembershipBase + 56, MembershipTimerProcessingFailure = MembershipBase + 57, MembershipSendPingFailure = MembershipBase + 58, MembershipUpdateIAmAliveFailure = MembershipBase + 59, MembershipStartingIAmAliveTimer = MembershipBase + 60, MembershipJoiningPreconditionFailure = MembershipBase + 61, NSMembershipStarting = MembershipBase + 70, NSMembershipBecomeActive = MembershipBase + 71, NSMembershipFailedToBecomeActive = MembershipBase + 72, NSMembershipShutDown = MembershipBase + 73, NSMembershipStop = MembershipBase + 74, NSMembershipKillMyself = MembershipBase + 75, NSMembershipKillMyselfLocally = MembershipBase + 76, NSMembershipNotificationProcessingFailure = MembershipBase + 77, NSMembershipReadAll_1 = MembershipBase + 78, NSMembershipReadAll_2 = MembershipBase + 79, NSMembershipFoundMyselfDead2 = MembershipBase + 80, NSMembershipDetectedOlder = MembershipBase + 81, NSMembershipDetectedNewer = MembershipBase + 82, NSMembershipTimerProcessingFailure = MembershipBase + 83, NSMembershipShutDownFailure = MembershipBase + 84, NSMembershipKillMyselfFailure = MembershipBase + 85, NSMembershipNSDetails = MembershipBase + 86, SSMT_ReadRowError = MembershipBase + 87, SSMT_ReadAllError = MembershipBase + 88, SSMT_InsertRowError = MembershipBase + 89, SSMT_UpdateRowError = MembershipBase + 90, SSMT_MergeRowError = MembershipBase + 91, SSMT_EtagMismatch_Insert = MembershipBase + 92, SSMT_EtagMismatch_Update = MembershipBase + 93, PerfCounterBase = Runtime + 700, PerfCounterNotFound = PerfCounterBase + 1, PerfCounterStarting = PerfCounterBase + 2, PerfCounterStopping = PerfCounterBase + 3, PerfCounterDumpAll = PerfCounterBase + 4, PerfCounterWriteErrors = PerfCounterBase + 5, PerfCounterWriteSuccess = PerfCounterBase + 6, PerfCounterWriteTooManyErrors = PerfCounterBase + 7, PerfCounterNotRegistered = PerfCounterBase + 8, PerfCounterUnableToConnect = PerfCounterBase + 9, PerfCounterUnableToWrite = PerfCounterBase + 10, PerfCounterWriting = PerfCounterBase + 11, PerfCounterSkipping = PerfCounterBase + 12, PerfMetricsStoppingTimer = PerfCounterBase + 13, PerfMetricsStartingTimer = PerfCounterBase + 14, PerfStatistics = PerfCounterBase + 15, PerfCounterRegistering = PerfCounterBase + 16, PerfCounterTimerError = PerfCounterBase + 17, PerfCounterCategoryCheckError = PerfCounterBase + 18, PerfCounterConnectError = PerfCounterBase + 19, PerfCounterFailedToInitialize = PerfCounterBase + 20, AzureTableBase = Runtime + 800, AzureTable_01 = AzureTableBase + 1, AzureTable_02 = AzureTableBase + 2, AzureTable_03 = AzureTableBase + 3, AzureTable_04 = AzureTableBase + 4, AzureTable_05 = AzureTableBase + 5, AzureTable_06 = AzureTableBase + 6, AzureTable_07 = AzureTableBase + 7, AzureTable_08 = AzureTableBase + 8, AzureTable_09 = AzureTableBase + 9, AzureTable_10 = AzureTableBase + 10, AzureTable_11 = AzureTableBase + 11, AzureTable_12 = AzureTableBase + 12, AzureTable_13 = AzureTableBase + 13, AzureTable_14 = AzureTableBase + 14, AzureTable_15 = AzureTableBase + 15, AzureTable_16 = AzureTableBase + 16, AzureTable_17 = AzureTableBase + 17, AzureTable_18 = AzureTableBase + 18, AzureTable_19 = AzureTableBase + 19, AzureTable_20 = AzureTableBase + 20, AzureTable_21 = AzureTableBase + 21, AzureTable_22 = AzureTableBase + 22, AzureTable_23 = AzureTableBase + 23, AzureTable_24 = AzureTableBase + 24, AzureTable_25 = AzureTableBase + 25, AzureTable_26 = AzureTableBase + 26, AzureTable_27 = AzureTableBase + 27, AzureTable_28 = AzureTableBase + 28, AzureTable_29 = AzureTableBase + 29, AzureTable_30 = AzureTableBase + 30, AzureTable_31 = AzureTableBase + 31, AzureTable_32 = AzureTableBase + 32, AzureTable_33 = AzureTableBase + 33, AzureTable_34 = AzureTableBase + 34, AzureTable_35 = AzureTableBase + 35, AzureTable_36 = AzureTableBase + 36, AzureTable_37 = AzureTableBase + 37, // reminders related AzureTable_38 = AzureTableBase + 38, AzureTable_39 = AzureTableBase + 39, AzureTable_40 = AzureTableBase + 40, AzureTable_41 = AzureTableBase + 41, AzureTable_42 = AzureTableBase + 42, AzureTable_43 = AzureTableBase + 43, AzureTable_44 = AzureTableBase + 44, AzureTable_45 = AzureTableBase + 45, AzureTable_46 = AzureTableBase + 46, AzureTable_47 = AzureTableBase + 47, AzureTable_48 = AzureTableBase + 48, AzureTable_49 = AzureTableBase + 49, // Azure storage provider related AzureTable_DataNotFound = AzureTableBase + 50, AzureTable_ReadingData = AzureTableBase + 51, AzureTable_WritingData = AzureTableBase + 52, AzureTable_Storage_Reading = AzureTableBase + 53, AzureTable_Storage_Writing = AzureTableBase + 54, AzureTable_Storage_DataRead = AzureTableBase + 55, AzureTable_WriteError = AzureTableBase + 56, AzureTable_DeleteError = AzureTableBase + 57, AzureTable_InitProvider = AzureTableBase + 58, AzureTable_ParamConnectionString = AzureTableBase + 59, AzureTable_60 = AzureTableBase + 60, AzureTable_61 = AzureTableBase + 61, AzureTable_62 = AzureTableBase + 62, AzureTableStorage_InitProvider = AzureTableBase + 63, AzureTable_ReadWrongReminder = AzureTableBase + 64, ProxyClientBase = Runtime + 900, ProxyClient_ReceiveError = Runtime_Error_100021, // Backward compatability ProxyClient_SerializationError = Runtime_Error_100159, // Backward compatability ProxyClient_SocketSendError = Runtime_Error_100161, // Backward compatability ProxyClient_ByteCountMismatch = Runtime_Error_100163, // Backward compatability ProxyClient_CannotConnect = Runtime_Error_100178, // Backward compatability ProxyClientUnhandledExceptionWhileSending = ProxyClientBase + 1, ProxyClientUnhandledExceptionWhileReceiving = ProxyClientBase + 2, ProxyClient_CannotSend = ProxyClientBase + 3, ProxyClient_CannotSend_NoGateway = ProxyClientBase + 4, ProxyClient_DroppingMsg = ProxyClientBase + 5, ProxyClient_RejectingMsg = ProxyClientBase + 6, ProxyClient_MsgSent = ProxyClientBase + 7, ProxyClient_Connected = ProxyClientBase + 8, ProxyClient_PauseBeforeRetry = ProxyClientBase + 9, ProxyClient_MsgCtrNotRunning = ProxyClientBase + 10, ProxyClient_DeadGateway = ProxyClientBase + 11, ProxyClient_MarkGatewayDead = ProxyClientBase + 12, ProxyClient_MarkGatewayDisconnected = ProxyClientBase + 13, ProxyClient_GatewayConnStarted = ProxyClientBase + 14, ProxyClient_CreatedGatewayUnordered = ProxyClientBase + 15, ProxyClient_CreatedGatewayToGrain = ProxyClientBase + 16, ProxyClient_NewBucketIndex = ProxyClientBase + 17, ProxyClient_QueueRequest = ProxyClientBase + 18, ProxyClient_ThreadAbort = ProxyClientBase + 19, ProxyClient_OperationCancelled = ProxyClientBase + 20, ProxyClient_GetGateways = ProxyClientBase + 21, ProxyClient_NetworkError = ProxyClientBase + 22, ProxyClient_SendException = ProxyClientBase + 23, ProxyClient_OGC_TargetNotFound = ProxyClientBase + 24, ProxyClient_OGC_SendResponseFailed = ProxyClientBase + 25, ProxyClient_OGC_SendExceptionResponseFailed = ProxyClientBase + 26, ProxyClient_OGC_UnhandledExceptionInOneWayInvoke = ProxyClientBase + 27, ProxyClient_ClientInvokeCallback_Error = ProxyClientBase + 28, ProxyClient_StartDone = ProxyClientBase + 29, ProxyClient_OGC_TargetNotFound_2 = ProxyClientBase + 30, ProxyClient_AppDomain_Unload = ProxyClientBase + 31, MessagingBase = Runtime + 1000, Messaging_IMA_DroppingConnection = MessagingBase + 1, Messaging_Dispatcher_DiscardRejection = MessagingBase + 2, MessagingBeginReceiveException = MessagingBase + 3, MessagingBeginAcceptSocketException = MessagingBase + 4, MessagingAcceptingSocketClosed = MessagingBase + 5, MessagingEndAcceptSocketException = MessagingBase + 6, MessagingUnexpectedSendError = MessagingBase + 7, MessagingSendingRejection = MessagingBase + 8, MessagingMessageFromUnknownActivation = MessagingBase + 9, Messaging_IMA_OpenedListeningSocket = MessagingBase + 10, Messaging_IMA_AcceptCallbackNullState = MessagingBase + 11, Messaging_IMA_AcceptCallbackUnexpectedState = MessagingBase + 12, Messaging_IMA_NewBeginReceiveException = MessagingBase + 13, Messaging_Socket_ReceiveError = MessagingBase + 14, Messaging_IMA_ClosingSocket = MessagingBase + 15, Messaging_OutgoingMS_DroppingMessage = MessagingBase + 16, MessagingProcessReceiveBufferException = MessagingBase + 17, Messaging_LargeMsg_Outgoing = MessagingBase + 18, Messaging_LargeMsg_Incoming = MessagingBase + 19, Messaging_SiloNetworkError = MessagingBase + 20, Messaging_UnableToGetSendingSocket = MessagingBase + 21, Messaging_ExceptionSending = MessagingBase + 22, Messaging_CountMismatchSending = MessagingBase + 23, Messaging_ExceptionReceiving = MessagingBase + 24, Messaging_ExceptionBeginReceiving = MessagingBase + 25, Messaging_IMA_ExceptionAccepting = MessagingBase + 26, Messaging_IMA_BadBufferReceived = MessagingBase + 27, Messaging_IMA_ActivationOverloaded = MessagingBase + 28, Messaging_Gateway_SerializationError = MessagingBase + 29, Messaging_UnableToDeserializeBody = MessagingBase + 30, Messaging_Dispatcher_TryForward = MessagingBase + 31, Messaging_Dispatcher_TryForwardFailed = MessagingBase + 32, Messaging_Dispatcher_ForwardingRequests = MessagingBase + 33, Messaging_SimulatedMessageLoss = MessagingBase + 34, Messaging_Dispatcher_ReturnToOriginCluster = MessagingBase + 35, MessagingAcceptAsyncSocketException = MessagingBase + 36, Messaging_ExceptionReceiveAsync = MessagingBase + 37, DirectoryBase = Runtime + 1100, DirectoryBothPrimaryAndBackupForGrain = DirectoryBase + 1, DirectoryPartitionPredecessorExpected = DirectoryBase + 2, DirectoryUnexpectedDelta = DirectoryBase + 4, Directory_SiloStatusChangeNotification_Exception = DirectoryBase + 5, SchedulerBase = Runtime + 1200, SchedulerWorkerPoolThreadQueueWaitTime = SchedulerBase + 1, SchedulerWorkItemGroupQueueWaitTime = SchedulerBase + 2, SchedulerStatistics = SchedulerBase + 3, SchedulerFinishShutdown = SchedulerBase + 4, SchedulerNullActivation = SchedulerBase + 5, SchedulerExceptionFromExecute = SchedulerBase + 6, SchedulerNullContext = SchedulerBase + 7, SchedulerTaskExecuteIncomplete1 = SchedulerBase + 8, WaitCalledInsideGrain = SchedulerBase + 9, SchedulerStatus = SchedulerBase + 10, WaitCalledInServerCode = SchedulerBase + 11, SchedulerTurnTooLong = SchedulerBase + 12, SchedulerTooManyPendingItems = SchedulerBase + 13, SchedulerTurnTooLong2 = SchedulerBase + 14, SchedulerTurnTooLong3 = SchedulerBase + 15, SchedulerWorkGroupShuttingDown = SchedulerBase + 16, SchedulerNotEnqueuWorkWhenShutdown = SchedulerBase + 17, SchedulerNotExecuteWhenShutdown = SchedulerBase + 18, SchedulerAppTurnsStopped_1 = SchedulerBase + 19, SchedulerWorkGroupStopping = SchedulerBase + 20, SchedulerSkipWorkStopping = SchedulerBase + 21, SchedulerSkipWorkCancelled = SchedulerBase + 22, SchedulerTaskRunningOnWrongScheduler1 = SchedulerBase + 23, SchedulerQueueWorkItemWrongCall = SchedulerBase + 24, SchedulerQueueTaskWrongCall = SchedulerBase + 25, SchedulerTaskExecuteIncomplete2 = SchedulerBase + 26, SchedulerTaskExecuteIncomplete3 = SchedulerBase + 27, SchedulerTaskExecuteIncomplete4 = SchedulerBase + 28, SchedulerTaskWaitIncomplete = SchedulerBase + 29, SchedulerWorkerThreadExc = SchedulerBase + 30, SchedulerQueueWorkItemWrongContext = SchedulerBase + 31, SchedulerAppTurnsStopped_2 = SchedulerBase + 32, GatewayBase = Runtime + 1300, GatewayClientOpenedSocket = GatewayBase + 1, GatewayClientClosedSocket = GatewayBase + 2, GatewayDroppingClient = GatewayBase + 3, GatewayTryingToSendToUnrecognizedClient = GatewayBase + 4, GatewayByteCountMismatch = GatewayBase + 5, GatewayExceptionSendingToClient = GatewayBase + 6, GatewayAcceptor_SocketClosed = GatewayBase + 7, GatewayAcceptor_ExceptionReceiving = GatewayBase + 8, GatewayManager_FoundKnownGateways = GatewayBase + 9, MessageAcceptor_Connection = GatewayBase + 10, MessageAcceptor_NotAProxiedConnection = GatewayBase + 11, MessageAcceptor_UnexpectedProxiedConnection = GatewayBase + 12, GatewayManager_NoGateways = GatewayBase + 13, GatewayNetworkError = GatewayBase + 14, GatewayFailedToParse = GatewayBase + 15, ClientRegistrarFailedToRegister = GatewayBase + 16, ClientRegistrarFailedToRegister_2 = GatewayBase + 17, ClientRegistrarFailedToUnregister = GatewayBase + 18, ClientRegistrarTimerFailed = GatewayBase + 19, GatewayAcceptor_WrongClusterId = GatewayBase + 20, TimerBase = Runtime + 1400, TimerChangeError = PerfCounterTimerError, // Backward compatability //TimerCallbackError = Runtime_Error_100306, // Backward compatability TimerCallbackError = Runtime_Error_100037, // Backward compatability TimerDisposeError = TimerBase + 1, TimerStopError = TimerBase + 2, TimerQueueTickError = TimerBase + 3, TimerChanging = TimerBase + 4, TimerBeforeCallback = TimerBase + 5, TimerAfterCallback = TimerBase + 6, TimerNextTick = TimerBase + 7, TimerDisposing = TimerBase + 8, TimerStopped = TimerBase + 9, Timer_TimerInsideGrainIsNotTicking = TimerBase + 10, Timer_TimerInsideGrainIsDelayed = TimerBase + 11, Timer_SafeTimerIsNotTicking = TimerBase + 12, Timer_GrainTimerCallbackError = TimerBase + 13, Timer_InvalidContext = TimerBase + 14, DispatcherBase = Runtime + 1500, Dispatcher_SelectTarget_Failed = Runtime_Error_100071, // Backward compatability Dispatcher_InvalidEnum_Direction = Runtime_Error_100072, // Backward compatability Dispatcher_NoCallbackForRejectionResp = Runtime_Error_100073, // Backward compatability Dispatcher_InvalidEnum_RejectionType = Runtime_Error_100075, // Backward compatability Dispatcher_NoCallbackForResp = Runtime_Error_100076, // Backward compatability Dispatcher_InvalidMsg_Direction = Runtime_Error_100077, // Backward compatability Dispatcher_Intermediate_GetOrCreateActivation = Runtime_Error_100147, // Backward compatability Dispatcher_NoTargetActivation = Runtime_Error_100148, // Backward compatability Dispatcher_QueueingRequestBadTargetState = Runtime_Error_100152, // Backward compatability Dispatcher_InjectingRejection = Runtime_Error_100299, // Backward compatability Dispatcher_InjectingMessageLoss = Runtime_Error_100300, // Backward compatability Dispatcher_UnknownTypeCode = Runtime_Error_100303, // Backward compatability Dispatcher_SelectTarget_FailPending = DispatcherBase + 1, Dispatcher_RegisterCallback_Replaced = DispatcherBase + 2, Dispatcher_Send_BufferResponse = DispatcherBase + 3, Dispatcher_Send_AddressedMessage = DispatcherBase + 4, Dispatcher_Receive_InvalidActivation = DispatcherBase + 5, Dispatcher_WriteGrainFailed = DispatcherBase + 6, Dispatcher_ActivationEndedTurn_Waiting = DispatcherBase + 7, Dispatcher_Retarget = DispatcherBase + 8, Dispatcher_TryAcceptMessage = DispatcherBase + 9, Dispatcher_UpdateReceiveOrder = DispatcherBase + 10, Dispatcher_ReceiveOrderCorrelation = DispatcherBase + 11, Dispatcher_AddSendOrder = DispatcherBase + 12, Dispatcher_AddSendOrderNoPrior = DispatcherBase + 13, Dispatcher_AddSendOrder_PriorIds = DispatcherBase + 14, Dispatcher_AddSendOrder_First = DispatcherBase + 15, Dispatcher_EnqueueMessage = DispatcherBase + 16, Dispatcher_AddressMsg = DispatcherBase + 17, Dispatcher_AddressMsg_GrainOrder = DispatcherBase + 18, Dispatcher_AddressMsg_NullingLastSentTo = DispatcherBase + 19, Dispatcher_AddressMsg_SMPlacement = DispatcherBase + 20, Dispatcher_AddressMsg_UnregisteredClient = DispatcherBase + 21, Dispatcher_AddressMsg_SelectTarget = DispatcherBase + 22, Dispatcher_HandleMsg = DispatcherBase + 23, Dispatcher_OnActivationCompletedRequest_Waiting = DispatcherBase + 24, IGC_DisposeError = DispatcherBase + 25, IGC_SendRequest_NullContext = DispatcherBase + 26, IGC_SniffIncomingMessage_Exc = DispatcherBase + 27, Dispatcher_DetectedDeadlock = DispatcherBase + 28, Dispatcher_DroppingExpiredMessage = DispatcherBase + 29, Dispatcher_ActivationOverloaded = DispatcherBase + 30, IGC_SendResponseFailed = DispatcherBase + 31, IGC_SendExceptionResponseFailed = DispatcherBase + 32, IGC_UnhandledExceptionInInvoke = DispatcherBase + 33, Dispatcher_ExtendedMessageProcessing = DispatcherBase + 34, Dispatcher_FailedToUnregisterNonExistingAct = DispatcherBase + 35, Dispatcher_NoGrainInstance = DispatcherBase + 36, Dispatcher_RuntimeStatisticsUnavailable = DispatcherBase + 37, Dispatcher_InvalidActivation = DispatcherBase + 38, InvokeWorkItem_UnhandledExceptionInInvoke = DispatcherBase + 39, Dispatcher_ErrorCreatingActivation = DispatcherBase + 40, Dispatcher_StuckActivation = DispatcherBase + 41, SerializationBase = Runtime + 1600, Ser_IncompatibleIntermediateType = Runtime_Error_100033, // Backward compatability Ser_CannotConstructBaseObj = Runtime_Error_100034, // Backward compatability Ser_IncompatibleType = Runtime_Error_100035, // Backward compatability Ser_AssemblyLoadError = SerializationBase + 1, Ser_BadRegisterSerializer = SerializationBase + 2, Ser_AssemblyLoadErrorDetails = SerializationBase + 3, Ser_AssemblyLoadSuccess = SerializationBase + 4, Ser_LargeObjectAllocated = SerializationBase + 5, LoaderBase = Runtime + 1700, Loader_NotGrainAssembly = Runtime_Error_100047, // Backward compatability Loader_TypeLoadError = Runtime_Error_100048, // Backward compatability Loader_ProxyLoadError = Runtime_Error_100049, // Backward compatability Loader_AssemblyLookupFailed = LoaderBase + 1, Loader_AssemblyLookupResolved = LoaderBase + 2, Loader_LoadingFromDir = LoaderBase + 3, Loader_LoadingFromFile = LoaderBase + 4, Loader_DirNotFound = LoaderBase + 5, Loader_LoadingSerInfo = LoaderBase + 6, Loader_LoadingGrainType = LoaderBase + 7, Loader_SkippingFile = LoaderBase + 8, Loader_SkippingDynamicAssembly = LoaderBase + 9, Loader_AssemblyInspectError = LoaderBase + 10, Loader_GrainTypeFullList = LoaderBase + 11, Loader_IgnoreAbstractGrainClass = LoaderBase + 12, Loader_AssemblyInspectionError = LoaderBase + 13, Loader_FoundBinary = LoaderBase + 14, Loader_IgnoreNonPublicGrainClass = LoaderBase + 15, Loader_UnexpectedException = LoaderBase + 16, Loader_SkippingBadAssembly = LoaderBase + 17, Loader_TypeLoadError_2 = LoaderBase + 18, Loader_TypeLoadError_3 = LoaderBase + 19, Loader_TypeLoadError_4 = LoaderBase + 20, Loader_LoadAndCreateInstance_Failure = LoaderBase + 21, Loader_TryLoadAndCreateInstance_Failure = LoaderBase + 22, Loader_TypeLoadError_5 = LoaderBase + 23, Loader_AssemblyLoadError = LoaderBase + 24, PlacementBase = Runtime + 1800, Placement_RuntimeStatisticsUpdateFailure_1 = PlacementBase + 1, Placement_RuntimeStatisticsUpdateFailure_2 = PlacementBase + 2, Placement_RuntimeStatisticsUpdateFailure_3 = PlacementBase + 3, Placement_ActivationCountBasedDirector_NoSilos = PlacementBase + 4, StorageProviderBase = Runtime + 2200, StorageProvider_ReadFailed = StorageProviderBase + 2, StorageProvider_WriteFailed = StorageProviderBase + 3, StorageProvider_DeleteFailed = StorageProviderBase + 4, StorageProvider_ForceReRead = StorageProviderBase + 5, SerializationManagerBase = Runtime + 2400, SerMgr_TypeRegistrationFailure = SerializationManagerBase + 1, SerMgr_MissingRegisterMethod = SerializationManagerBase + 2, SerMgr_ErrorBindingMethods = SerializationManagerBase + 3, SerMgr_ErrorLoadingAssemblyTypes = SerializationManagerBase + 4, SerMgr_TooLongSerialize = SerializationManagerBase + 5, SerMgr_TooLongDeserialize = SerializationManagerBase + 6, SerMgr_TooLongDeepCopy = SerializationManagerBase + 7, SerMgr_IgnoreAssembly = SerializationManagerBase + 8, SerMgr_TypeRegistrationFailureIgnore = SerializationManagerBase + 9, SerMgr_ArtifactReport = SerializationManagerBase + 10, SerMgr_UnavailableSerializer = SerializationManagerBase + 11, SerMgr_SerializationMethodsMissing = SerializationManagerBase + 12, WatchdogBase = Runtime + 2600, Watchdog_ParticipantThrownException = WatchdogBase + 1, Watchdog_InternalError = WatchdogBase + 2, Watchdog_HealthCheckFailure = WatchdogBase + 3, LoggerBase = Runtime + 2700, Logger_MiniDumpCreated = Runtime_Error_100001, // Backward compatability Logger_ProcessCrashing = Runtime_Error_100002, // Backward compatability Logger_LogMessageTruncated = LoggerBase + 1, WFServiceBase = Runtime + 2800, WFService_Error_1 = WFServiceBase + 1, WFService_Error_2 = WFServiceBase + 2, WFService_Error_3 = WFServiceBase + 3, WFService_Error_4 = WFServiceBase + 4, WFService_Error_5 = WFServiceBase + 5, WFService_Error_6 = WFServiceBase + 6, WFService_Error_7 = WFServiceBase + 7, WFService_Error_8 = WFServiceBase + 8, WFService_Error_9 = WFServiceBase + 9, // Codes for the Reminder Service ReminderServiceBase = Runtime + 2900, RS_Register_TableError = ReminderServiceBase + 5, RS_Register_AlreadyRegistered = ReminderServiceBase + 7, RS_Register_InvalidPeriod = ReminderServiceBase + 8, RS_Register_NotRemindable = ReminderServiceBase + 9, RS_NotResponsible = ReminderServiceBase + 10, RS_Unregister_NotFoundLocally = ReminderServiceBase + 11, RS_Unregister_TableError = ReminderServiceBase + 12, RS_Table_Insert = ReminderServiceBase + 13, RS_Table_Remove = ReminderServiceBase + 14, RS_Tick_Delivery_Error = ReminderServiceBase + 15, RS_Not_Started = ReminderServiceBase + 16, RS_UnregisterGrain_TableError = ReminderServiceBase + 17, RS_GrainBasedTable1 = ReminderServiceBase + 18, RS_Factory1 = ReminderServiceBase + 19, RS_FailedToReadTableAndStartTimer = ReminderServiceBase + 20, RS_TableGrainInit1 = ReminderServiceBase + 21, RS_TableGrainInit2 = ReminderServiceBase + 22, RS_TableGrainInit3 = ReminderServiceBase + 23, RS_GrainBasedTable2 = ReminderServiceBase + 24, RS_ServiceStarting = ReminderServiceBase + 25, RS_ServiceStarted = ReminderServiceBase + 26, RS_ServiceStopping = ReminderServiceBase + 27, RS_RegisterOrUpdate = ReminderServiceBase + 28, RS_Unregister = ReminderServiceBase + 29, RS_Stop = ReminderServiceBase + 30, RS_RemoveFromTable = ReminderServiceBase + 31, RS_GetReminder = ReminderServiceBase + 32, RS_GetReminders = ReminderServiceBase + 33, RS_RangeChanged = ReminderServiceBase + 34, RS_LocalStop = ReminderServiceBase + 35, RS_Started = ReminderServiceBase + 36, RS_ServiceInitialLoadFailing = ReminderServiceBase + 37, RS_ServiceInitialLoadFailed = ReminderServiceBase + 38, // Codes for the Consistent Ring Provider ConsistentRingProviderBase = Runtime + 3000, CRP_Local_Subscriber_Exception = ConsistentRingProviderBase + 1, CRP_ForGrains_Local_Subscriber_Exception_1 = ConsistentRingProviderBase + 2, CRP_Added_Silo = ConsistentRingProviderBase + 3, CRP_Removed_Silo = ConsistentRingProviderBase + 4, CRP_Notify = ConsistentRingProviderBase + 5, CRP_ForGrains_Local_Subscriber_Exception_2 = ConsistentRingProviderBase + 6, ProviderManagerBase = Runtime + 3100, Provider_InstanceConstructionError1 = ProviderManagerBase + 1, Provider_Loaded = ProviderManagerBase + 2, Provider_AssemblyLoadError = ProviderManagerBase + 3, Provider_CatalogNoStorageProvider_1 = ProviderManagerBase + 4, Provider_CatalogNoStorageProvider_2 = ProviderManagerBase + 5, Provider_CatalogStorageProviderAllocated = ProviderManagerBase + 6, Provider_NoDefaultProvider = ProviderManagerBase + 7, Provider_ConfiguredProviderNotLoaded = ProviderManagerBase + 8, Provider_ErrorFromInit = ProviderManagerBase + 9, Provider_IgnoringExplicitSet = ProviderManagerBase + 10, Provider_NotLoaded = ProviderManagerBase + 11, Provider_Manager_Already_Loaded = ProviderManagerBase + 12, Provider_CatalogNoStorageProvider_3 = ProviderManagerBase + 13, Provider_ProviderLoadedOk = ProviderManagerBase + 14, Provider_ProviderNotFound = ProviderManagerBase + 15, Provider_ProviderNotControllable = ProviderManagerBase + 16, Provider_CatalogNoLogConsistencyProvider = ProviderManagerBase + 17, Provider_CatalogLogConsistencyProviderAllocated = ProviderManagerBase + 18, AzureQueueBase = Runtime + 3200, AzureQueue_01 = AzureQueueBase + 1, AzureQueue_02 = AzureQueueBase + 2, AzureQueue_03 = AzureQueueBase + 3, AzureQueue_04 = AzureQueueBase + 4, AzureQueue_05 = AzureQueueBase + 5, AzureQueue_06 = AzureQueueBase + 6, AzureQueue_07 = AzureQueueBase + 7, AzureQueue_08 = AzureQueueBase + 8, AzureQueue_09 = AzureQueueBase + 9, AzureQueue_10 = AzureQueueBase + 10, AzureQueue_11 = AzureQueueBase + 11, AzureQueue_12 = AzureQueueBase + 12, AzureQueue_13 = AzureQueueBase + 13, AzureQueue_14 = AzureQueueBase + 14, AzureQueue_15 = AzureQueueBase + 15, PersistentStreamPullingAgentBase = Runtime + 3300, PersistentStreamPullingAgent_01 = PersistentStreamPullingAgentBase + 1, PersistentStreamPullingAgent_02 = PersistentStreamPullingAgentBase + 2, PersistentStreamPullingAgent_03 = PersistentStreamPullingAgentBase + 3, PersistentStreamPullingAgent_04 = PersistentStreamPullingAgentBase + 4, PersistentStreamPullingAgent_05 = PersistentStreamPullingAgentBase + 5, PersistentStreamPullingAgent_06 = PersistentStreamPullingAgentBase + 6, PersistentStreamPullingAgent_07 = PersistentStreamPullingAgentBase + 7, PersistentStreamPullingAgent_08 = PersistentStreamPullingAgentBase + 8, PersistentStreamPullingAgent_09 = PersistentStreamPullingAgentBase + 9, PersistentStreamPullingAgent_10 = PersistentStreamPullingAgentBase + 10, PersistentStreamPullingAgent_11 = PersistentStreamPullingAgentBase + 11, PersistentStreamPullingAgent_12 = PersistentStreamPullingAgentBase + 12, PersistentStreamPullingAgent_13 = PersistentStreamPullingAgentBase + 13, PersistentStreamPullingAgent_14 = PersistentStreamPullingAgentBase + 14, PersistentStreamPullingAgent_15 = PersistentStreamPullingAgentBase + 15, PersistentStreamPullingAgent_16 = PersistentStreamPullingAgentBase + 16, PersistentStreamPullingAgent_17 = PersistentStreamPullingAgentBase + 17, PersistentStreamPullingAgent_18 = PersistentStreamPullingAgentBase + 18, PersistentStreamPullingAgent_19 = PersistentStreamPullingAgentBase + 19, PersistentStreamPullingAgent_20 = PersistentStreamPullingAgentBase + 20, PersistentStreamPullingAgent_21 = PersistentStreamPullingAgentBase + 21, PersistentStreamPullingAgent_22 = PersistentStreamPullingAgentBase + 22, PersistentStreamPullingAgent_23 = PersistentStreamPullingAgentBase + 23, PersistentStreamPullingAgent_24 = PersistentStreamPullingAgentBase + 24, PersistentStreamPullingAgent_25 = PersistentStreamPullingAgentBase + 25, PersistentStreamPullingAgent_26 = PersistentStreamPullingAgentBase + 26, PersistentStreamPullingAgent_27 = PersistentStreamPullingAgentBase + 27, PersistentStreamPullingAgent_28 = PersistentStreamPullingAgentBase + 28, StreamProviderManagerBase = Runtime +3400, StreamProvider_FailedToDispose = StreamProviderManagerBase + 1, StreamProvider_ProducerFailedToUnregister = StreamProviderManagerBase + 2, StreamProvider_NoStreamForItem = StreamProviderManagerBase + 3, StreamProvider_AddObserverException = StreamProviderManagerBase + 4, Stream_ExtensionNotInstalled = StreamProviderManagerBase + 5, Stream_ProducerIsDead = StreamProviderManagerBase + 6, StreamProvider_NoStreamForBatch = StreamProviderManagerBase + 7, StreamProvider_ConsumerFailedToUnregister = StreamProviderManagerBase + 8, Stream_ConsumerIsDead = StreamProviderManagerBase + 9, Stream_RegisterProducerFailed = StreamProviderManagerBase + 10, Stream_UnegisterProducerFailed = StreamProviderManagerBase + 11, Stream_RegisterConsumerFailed = StreamProviderManagerBase + 12, Stream_UnregisterConsumerFailed = StreamProviderManagerBase + 13, Stream_SetSubscriptionToFaultedFailed = StreamProviderManagerBase + 14, PersistentStreamPullingManagerBase = Runtime + 3500, PersistentStreamPullingManager_01 = PersistentStreamPullingManagerBase + 1, PersistentStreamPullingManager_02 = PersistentStreamPullingManagerBase + 2, PersistentStreamPullingManager_03 = PersistentStreamPullingManagerBase + 3, PersistentStreamPullingManager_04 = PersistentStreamPullingManagerBase + 4, PersistentStreamPullingManager_05 = PersistentStreamPullingManagerBase + 5, PersistentStreamPullingManager_06 = PersistentStreamPullingManagerBase + 6, PersistentStreamPullingManager_07 = PersistentStreamPullingManagerBase + 7, PersistentStreamPullingManager_08 = PersistentStreamPullingManagerBase + 8, PersistentStreamPullingManager_09 = PersistentStreamPullingManagerBase + 9, PersistentStreamPullingManager_10 = PersistentStreamPullingManagerBase + 10, PersistentStreamPullingManager_11 = PersistentStreamPullingManagerBase + 11, PersistentStreamPullingManager_12 = PersistentStreamPullingManagerBase + 12, PersistentStreamPullingManager_13 = PersistentStreamPullingManagerBase + 13, PersistentStreamPullingManager_14 = PersistentStreamPullingManagerBase + 14, PersistentStreamPullingManager_15 = PersistentStreamPullingManagerBase + 15, PersistentStreamPullingManager_16 = PersistentStreamPullingManagerBase + 16, PersistentStreamPullingManager_Starting = PersistentStreamPullingManagerBase + 17, PersistentStreamPullingManager_Stopping = PersistentStreamPullingManagerBase + 18, PersistentStreamPullingManager_Started = PersistentStreamPullingManagerBase + 19, PersistentStreamPullingManager_Stopped = PersistentStreamPullingManagerBase + 20, PersistentStreamPullingManager_AlreadyStarted = PersistentStreamPullingManagerBase + 21, PersistentStreamPullingManager_AlreadyStopped = PersistentStreamPullingManagerBase + 22, PersistentStreamPullingManager_PeriodicPrint = PersistentStreamPullingManagerBase + 23, AzureServiceRuntimeWrapper = Runtime + 3700, AzureServiceRuntime_NotLoaded = AzureServiceRuntimeWrapper +1, AzureServiceRuntime_FailedToLoad = AzureServiceRuntimeWrapper + 2, CodeGenBase = Runtime + 3800, CodeGenCompilationFailed = CodeGenBase + 1, CodeGenCompilationSucceeded = CodeGenBase + 2, CodeGenSourceGenerated = CodeGenBase + 3, CodeGenSerializerGenerator = CodeGenBase + 4, CodeGenIgnoringTypes = CodeGenBase + 5, CodeGenDllMissing = CodeGenBase + 6, CodeGenSystemTypeRequiresSerializer = CodeGenBase + 7, MultiClusterNetworkBase = Runtime + 3900, MultiClusterNetwork_Starting = MultiClusterNetworkBase + 1, MultiClusterNetwork_Started = MultiClusterNetworkBase + 2, MultiClusterNetwork_FailedToStart = MultiClusterNetworkBase + 3, MultiClusterNetwork_LocalSubscriberException = MultiClusterNetworkBase + 4, MultiClusterNetwork_GossipCommunicationFailure = MultiClusterNetworkBase + 5, MultiClusterNetwork_NoChannelsConfigured = MultiClusterNetworkBase + 6, CancellationTokenManagerBase = Runtime + 4000, CancellationTokenCancelFailed = CancellationTokenManagerBase + 1, CancellationExtensionCreationFailed = CancellationTokenManagerBase + 2, GlobalSingleInstanceBase = Runtime + 4100, GlobalSingleInstance_ProtocolError = GlobalSingleInstanceBase + 1, GlobalSingleInstance_WarningInvalidOrigin = GlobalSingleInstanceBase + 2, GlobalSingleInstance_MaintainerException = GlobalSingleInstanceBase + 3, GlobalSingleInstance_MultipleOwners = GlobalSingleInstanceBase + 4, TypeManagerBase = Runtime + 4200, TypeManager_GetSiloGrainInterfaceMapError = TypeManagerBase + 1, LogConsistencyBase = Runtime + 4300, LogConsistency_UserCodeException = LogConsistencyBase + 1, LogConsistency_CaughtException = LogConsistencyBase + 2, LogConsistency_ProtocolError = LogConsistencyBase + 3, LogConsistency_ProtocolFatalError = LogConsistencyBase + 4, // Note: individual Service Fabric error codes are defined in // Microsoft.Orleans.ServiceFabric.Utilities.ErrorCode. ServiceFabricBase = Runtime + 4400, TransactionsBase = Runtime + 4500, Transactions_SendingTMRequest = TransactionsBase + 1, Transactions_ReceivedTMResponse = TransactionsBase + 2, Transactions_TMError = TransactionsBase + 3, } } // ReSharper restore InconsistentNaming
59.613333
103
0.63088
[ "MIT" ]
seralexeev/orleans
src/Orleans.Core/Logging/ErrorCodes.cs
67,065
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.MixedReality.Toolkit.Utilities; using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Profiling; namespace Microsoft.MixedReality.Toolkit { /// <summary> /// Camera extension methods to test if colliders are within camera's FOV. Uses /// caching to improve performance and ensure values are only computed once per frame /// </summary> public static class CameraFOVChecker { // Help to clear caches when new frame runs static private int inFOVLastCalculatedFrame = -1; // Map from grabbable => is the grabbable in FOV for this frame. Cleared every frame private static Dictionary<Tuple<Collider, Camera>, bool> inFOVColliderCache = new Dictionary<Tuple<Collider, Camera>, bool>(); // List of corners shared across all sphere pointer query instances -- // used to store list of corners for a bounds. Shared and static // to avoid allocating memory each frame private static List<Vector3> inFOVBoundsCornerPoints = new List<Vector3>(); /// <summary> /// Returns true if a collider's bounds is within the camera FOV. /// Utilizes a cache to test if this collider has been seen before and returns current frame's calculated result. /// NOTE: This is a 'loose' FOV check -- it can return true in cases when the collider is actually not in the FOV /// because it does an axis-aligned check when testing for large colliders. So, if the axis aligned bounds are in the bounds of the camera, it will return true. /// </summary> /// <param name="myCollider">The collider to test</param> public static bool IsInFOVCached(this Camera cam, Collider myCollider) { // if the collider's size is zero, it is not visible. Return false. if (myCollider.bounds.size == Vector3.zero || myCollider.transform.localScale == Vector3.zero) { return false; } Tuple<Collider, Camera> cameraColliderPair = new Tuple<Collider, Camera>(myCollider, cam); bool result = false; if (inFOVLastCalculatedFrame != Time.frameCount) { inFOVColliderCache.Clear(); inFOVLastCalculatedFrame = Time.frameCount; } else if (inFOVColliderCache.TryGetValue(cameraColliderPair, out result)) { return result; } inFOVBoundsCornerPoints.Clear(); BoundsExtensions.GetColliderBoundsPoints(myCollider, inFOVBoundsCornerPoints, 0); float xMin = float.MaxValue, yMin = float.MaxValue, zMin = float.MaxValue; float xMax = float.MinValue, yMax = float.MinValue, zMax = float.MinValue; for (int i = 0; i < inFOVBoundsCornerPoints.Count; i++) { var corner = inFOVBoundsCornerPoints[i]; Vector3 screenPoint = cam.WorldToViewportPoint(corner); bool isInFOV = screenPoint.z >= 0 && screenPoint.z <= cam.farClipPlane && screenPoint.x >= 0 && screenPoint.x <= 1 && screenPoint.y >= 0 && screenPoint.y <= 1; if (isInFOV) { inFOVColliderCache.Add(cameraColliderPair, true); return true; } // if the point is behind the camera, the x and y viewport positions are negated var zViewport = screenPoint.z; var xViewport = zViewport >= 0 ? screenPoint.x : -screenPoint.x; var yViewport = zViewport >= 0 ? screenPoint.y : -screenPoint.y; xMin = Mathf.Min(xMin, xViewport); yMin = Mathf.Min(yMin, yViewport); zMin = Mathf.Min(zMin, zViewport); xMax = Mathf.Max(xMax, xViewport); yMax = Mathf.Max(yMax, yViewport); zMax = Mathf.Max(zMax, zViewport); } // Check that collider is visible even if all corners are not visible // such as when having a large collider result = zMax > 0 // Front of collider is in front of the camera. && zMin < cam.farClipPlane // Back of collider is not too far away. && xMin < 1 // Left edge is not too far to the right. && xMax > 0 // Right edge is not too far to the left. && yMin < 1 // Bottom edge is not too high. && yMax > 0; // Top edge is not too low. inFOVColliderCache.Add(cameraColliderPair, result); return result; } } }
46.228571
168
0.602802
[ "MIT" ]
MRW-Eric/MixedRealityToolkit-Unity
Assets/MRTK/Core/Utilities/CameraFOVChecker.cs
4,854
C#
namespace Unosquare.PassCore.Common { using System; using System.Collections.Generic; using System.Text; /// <summary> /// Link info https://docs.secureauth.com/display/KBA/Active+Directory+Attributes+List /// </summary> public class UserInfoAd { /// <summary> /// Returns a Boolean value that specifies whether the account is currently locked /// </summary> /// <value> /// true if the account is locked out; otherwise false. /// </value> public bool isLocked { get; set; } /// <summary> /// Get /// </summary> /// <value> /// /// </value> public string userPrincipalName { get; set; } /// <summary> /// Get /// </summary> /// <value> /// /// </value> public string sAMAccountName { get; set; } /// <summary> /// name và cn Giống nhau (Rename trong AD thì 2 trường này cùng thay đổi, hiện thị trong rename là Fullname) /// </summary> public string name { get; set; } /// <summary> /// Get Common Name /// </summary> /// <value> /// /// </value> public string CN { get; set; } /// <summary> /// Get Last Name Họ (và tên đệm) /// </summary> /// <value> /// /// </value> public string sn { get; set; } /// <summary> /// Get First Name Tên /// </summary> /// <value> /// /// </value> public string givenName { get; set; } /// <summary> /// Get Initials Tên đệm /// </summary> /// <value> /// /// </value> public string initials { get; set; } /// <summary> /// Get Display Name /// </summary> /// <value> /// /// </value> public string displayName { get; set; } /// <summary> /// Get mail /// </summary> /// <value> /// /// </value> public string mail { get; set; } /// <summary> /// Get Telephone Number (là userPrincipal.VoiceTelephoneNumber trong dll của Microsoft) /// </summary> /// <value> /// /// </value> public string telephoneNumber { get; set; } /// <summary> /// Phòng ban user /// </summary> public string department { get; set; } /// <summary> /// Chức Danh của user /// </summary> public string title { get; set; } /// <summary> /// Mã nhân viên /// </summary> public string employeeID { get; set; } /// <summary> /// Get /// </summary> /// <value> /// /// </value> public string description { get; set; } /// <summary> /// Get Office /// </summary> /// <value> /// /// </value> public string physicalDeliveryOfficeName { get; set; } /// <summary> /// Get Telephone Number (Other) /// </summary> /// <value> /// /// </value> public string otherTelephone { get; set; } /// <summary> /// Get Home phone /// </summary> /// <value> /// /// </value> public string homePhone { get; set; } /// <summary> /// Get mobile phone /// </summary> /// <value> /// /// </value> public string mobile { get; set; } /// <summary> /// Get Web Page /// </summary> /// <value> /// /// </value> public string wWWHomePage { get; set; } /// <summary> /// Get Web Page (Other) /// </summary> /// <value> /// /// </value> public string url { get; set; } /// <summary> /// Get OU CN=baonx,OU=Company Structure,DC=baonx,DC=com /// </summary> /// <value> /// /// </value> public string distinguishedName { get; set; } /// <summary> /// Get CN=Employees,CN=Users,DC=baonx,DC=com /// </summary> /// <value> /// /// </value> public string memberOf { get; set; } /// <summary> /// Get CN=Person,CN=Schema,CN=Configuration,DC=baonx,DC=com /// </summary> /// <value> /// /// </value> public string objectCategory { get; set; } } }
24.036269
117
0.43005
[ "MIT" ]
baonxvn/passcore
src/Unosquare.PassCore.Common/UserInfoAd.cs
4,681
C#
using System.Collections.Generic; using System.Windows.Forms; using System.Drawing; namespace TimeHACK.Engine { public class TaskBarController { public static int AvalibleApplicationID; public Panel AddTaskbarItem95(string ApplicationID, string ApplicationName, Image ApplicationIcon, UserControl taskbar_item, Panel oldPanel) { Panel returnPanel = oldPanel; AvalibleApplicationID++; taskbar_item.BackgroundImage = ApplicationIcon; taskbar_item.Tag = ApplicationName; taskbar_item.Dock = DockStyle.Left; returnPanel.Controls.Add(taskbar_item); return returnPanel; } public List<Form> GetAllOpenApps() { List<Form> AppsList = new List<Form>(); foreach (Form form in Application.OpenForms) { try { if (form.Tag.ToString() != "ignoreFormOnTaskbar") { AppsList.Add(form); } } catch { AppsList.Add(form); } } return AppsList; } public void FocusAppFromID(string ApplicationID) { foreach (Form form in Application.OpenForms) { if (form.Tag.ToString() == ApplicationID) { form.Show(); form.BringToFront(); form.Focus(); return; } } } } }
27.15
148
0.494782
[ "MIT" ]
STTADev/TimeHTML
TimeHACK.Engine/TaskBarController.cs
1,631
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; namespace PersonalityAppWeb { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
23.68
62
0.584459
[ "MIT" ]
Wolverine971/PersonalityApp
Web/App_Start/WebApiConfig.cs
594
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.ConcurrencyLimiter { internal class StackPolicy : IQueuePolicy { private readonly List<ResettableBooleanCompletionSource> _buffer; public ResettableBooleanCompletionSource? _cachedResettableTCS; private readonly int _maxQueueCapacity; private readonly int _maxConcurrentRequests; private bool _hasReachedCapacity; private int _head; private int _queueLength; private readonly object _bufferLock = new Object(); private int _freeServerSpots; public StackPolicy(IOptions<QueuePolicyOptions> options) { _buffer = new List<ResettableBooleanCompletionSource>(); _maxQueueCapacity = options.Value.RequestQueueLimit; _maxConcurrentRequests = options.Value.MaxConcurrentRequests; _freeServerSpots = options.Value.MaxConcurrentRequests; } public ValueTask<bool> TryEnterAsync() { lock (_bufferLock) { if (_freeServerSpots > 0) { _freeServerSpots--; return new ValueTask<bool>(true); } // if queue is full, cancel oldest request if (_queueLength == _maxQueueCapacity) { _hasReachedCapacity = true; _buffer[_head].Complete(false); _queueLength--; } var tcs = _cachedResettableTCS ??= new ResettableBooleanCompletionSource(this); _cachedResettableTCS = null; if (_hasReachedCapacity || _queueLength < _buffer.Count) { _buffer[_head] = tcs; } else { _buffer.Add(tcs); } _queueLength++; // increment _head for next time _head++; if (_head == _maxQueueCapacity) { _head = 0; } return tcs.GetValueTask(); } } public void OnExit() { lock (_bufferLock) { if (_queueLength == 0) { _freeServerSpots++; if (_freeServerSpots > _maxConcurrentRequests) { _freeServerSpots--; throw new InvalidOperationException("OnExit must only be called once per successful call to TryEnterAsync"); } return; } // step backwards and launch a new task if (_head == 0) { _head = _maxQueueCapacity - 1; } else { _head--; } _buffer[_head].Complete(true); _queueLength--; } } } }
30.302752
132
0.505298
[ "MIT" ]
48355746/AspNetCore
src/Middleware/ConcurrencyLimiter/src/QueuePolicies/StackPolicy.cs
3,303
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. namespace Microsoft.Extensions.DependencyInjection { public static partial class PollyHttpClientBuilderExtensions { public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandler(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage> policy) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandler(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Func<System.IServiceProvider, System.Net.Http.HttpRequestMessage, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policySelector) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandler(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Func<System.IServiceProvider, System.Net.Http.HttpRequestMessage, string, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policyFactory, System.Func<System.Net.Http.HttpRequestMessage, string> keySelector) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandler(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Func<System.Net.Http.HttpRequestMessage, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policySelector) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandlerFromRegistry(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Func<Polly.Registry.IReadOnlyPolicyRegistry<string>, System.Net.Http.HttpRequestMessage, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policySelector) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddPolicyHandlerFromRegistry(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, string policyKey) { throw null; } public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddTransientHttpErrorPolicy(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Func<Polly.PolicyBuilder<System.Net.Http.HttpResponseMessage>, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> configurePolicy) { throw null; } } public static partial class PollyServiceCollectionExtensions { public static Polly.Registry.IPolicyRegistry<string> AddPolicyRegistry(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) { throw null; } public static Polly.Registry.IPolicyRegistry<string> AddPolicyRegistry(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Polly.Registry.IPolicyRegistry<string> registry) { throw null; } } } namespace Microsoft.Extensions.Http { public partial class PolicyHttpMessageHandler : System.Net.Http.DelegatingHandler { public PolicyHttpMessageHandler(Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage> policy) { } public PolicyHttpMessageHandler(System.Func<System.Net.Http.HttpRequestMessage, Polly.IAsyncPolicy<System.Net.Http.HttpResponseMessage>> policySelector) { } [System.Diagnostics.DebuggerStepThroughAttribute] protected override System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } protected virtual System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendCoreAsync(System.Net.Http.HttpRequestMessage request, Polly.Context context, System.Threading.CancellationToken cancellationToken) { throw null; } } } namespace Polly { public static partial class HttpRequestMessageExtensions { public static Polly.Context GetPolicyExecutionContext(this System.Net.Http.HttpRequestMessage request) { throw null; } public static void SetPolicyExecutionContext(this System.Net.Http.HttpRequestMessage request, Polly.Context context) { } } }
102.857143
410
0.825231
[ "MIT" ]
beppemarazzi/extensions
src/HttpClientFactory/Polly/ref/Microsoft.Extensions.Http.Polly.netstandard2.0.cs
4,320
C#
// // ThemedImage.cs // // Author: // Lluis Sanchez Gual <lluis@xamarin.com> // // Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Linq; using System.Collections.Generic; namespace Xwt.Drawing { public class ThemedImage: DrawingImage { List<Tuple<Image, string []>> images; public ThemedImage (List<Tuple<Image, string []>> images, Size size = default (Size)) { this.images = images; Size = size; } public IEnumerable<Tuple<Image, string []>> Images { get { return images; } } protected override void OnDraw (Context ctx, Rectangle bounds) { var best = GetImage (ctx.Styles); if (best != null) ctx.DrawImage (best, bounds); } public Image GetImage (IEnumerable<string> tags) { Image best = null; int bestMatches = -1; int bestNoMatches = int.MaxValue; foreach (var img in images) { int matches = 0; foreach (var t in tags) { if (img.Item2.Contains (t)) matches++; } var noMatches = img.Item2.Length - matches; if (matches > bestMatches || (matches == bestMatches && noMatches < bestNoMatches)) { best = img.Item1; bestMatches = matches; bestNoMatches = noMatches; } } return best; } } }
29.531646
89
0.696099
[ "MIT" ]
BretJohnson/xwt
Xwt/Xwt.Drawing/ThemedImage.cs
2,335
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Fibon.Api.Repository; using Fibon.Messages.Commands; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis.Semantics; using RawRabbit; namespace Fibon.Api.Controllers { [Route("[controller]")] public class FibonacciController:Controller { private readonly IBusClient _busClient; private readonly IRepository _repository; public FibonacciController(IBusClient busClient, IRepository repository) { _busClient = busClient; _repository = repository; } [HttpGet("{number}")] public IActionResult Get(int number) { int? calculatedValue = _repository.Get(number); if (calculatedValue.HasValue) { return Content(calculatedValue.ToString()); } return NotFound(); } [HttpPost("{number}")] public async Task<IActionResult> Post(int number) { int? calculatedValue = _repository.Get(number); if (!calculatedValue.HasValue) { await _busClient.PublishAsync(new CalculateValueCommand(number)); } return Accepted($"fibonacci/{number}", null); } } }
29.152174
81
0.618941
[ "MIT" ]
MKurpinski/Fibon
Fibon.Api/Controllers/FibonacciController.cs
1,343
C#
using System.Collections.Generic; using System.Linq; namespace Dgt.Yahtzee.Engine { public class FaceValueCategory : ICategory { public string Name { get; } private readonly int _faceValue; // TODO Parameter validation of the name - no nulls or empty strings public FaceValueCategory(string name, int faceValue) { Name = name; _faceValue = faceValue; } // TODO Parameter validation - no nulls, but an empty enumerable is reasonable public int GetCategoryScore(IEnumerable<int> scoreValues) => scoreValues.Sum(x => x == _faceValue ? _faceValue : 0); } }
31.238095
124
0.650915
[ "MIT" ]
mmmcaffeine/yahtzee
src/Engine/FaceValueCategory.cs
658
C#
namespace LTMCompanyNameFree.YoyoCmsTemplate.Web.ViewModels.Account { public class RegisterResultViewModel { public string TenancyName { get; set; } public string UserName { get; set; } public string EmailAddress { get; set; } public string NameAndSurname { get; set; } public bool IsActive { get; set; } public bool IsEmailConfirmationRequiredForLogin { get; set; } public bool IsEmailConfirmed { get; set; } } }
25.2
69
0.634921
[ "MIT" ]
cnmediar/YoyoCmsFree.Template
src/aspnet-core/src/LTMCompanyNameFree.YoyoCmsTemplate.Web.Mvc/ViewModels/Account/RegisterResultViewModel.cs
504
C#
#pragma warning disable 108 // new keyword hiding #pragma warning disable 114 // new keyword hiding namespace Windows.Globalization.DateTimeFormatting { #if false || false || false || false || false || false || false public enum SecondFormat { // Skipping already declared field Windows.Globalization.DateTimeFormatting.SecondFormat.None // Skipping already declared field Windows.Globalization.DateTimeFormatting.SecondFormat.Default } #endif }
35.230769
98
0.777293
[ "Apache-2.0" ]
AbdalaMask/uno
src/Uno.UWP/Generated/3.0.0.0/Windows.Globalization.DateTimeFormatting/SecondFormat.cs
458
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using NUnit.Framework.Internal.Filters; using UnityEditor; using UnityEditor.TestRunner.TestLaunchers; using UnityEditor.TestTools.TestRunner.Api; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.TestRunner.Utils; using UnityEngine.TestTools.TestRunner; using UnityEngine.TestTools.TestRunner.Callbacks; namespace UnityEditor.TestTools.TestRunner { internal class TestLaunchFailedException : Exception { public TestLaunchFailedException() {} public TestLaunchFailedException(string message) : base(message) {} } [Serializable] internal class PlayerLauncher : RuntimeTestLauncherBase { private readonly PlaymodeTestsControllerSettings m_Settings; private readonly BuildTarget m_TargetPlatform; private ITestRunSettings m_OverloadTestRunSettings; private string m_SceneName; private int m_HeartbeatTimeout; public PlayerLauncher(PlaymodeTestsControllerSettings settings, BuildTarget? targetPlatform, ITestRunSettings overloadTestRunSettings, int heartbeatTimeout) { m_Settings = settings; m_TargetPlatform = targetPlatform ?? EditorUserBuildSettings.activeBuildTarget; m_OverloadTestRunSettings = overloadTestRunSettings; m_HeartbeatTimeout = heartbeatTimeout; } protected override RuntimePlatform? TestTargetPlatform { get { return BuildTargetConverter.TryConvertToRuntimePlatform(m_TargetPlatform); } } public override void Run() { var editorConnectionTestCollector = RemoteTestRunController.instance; editorConnectionTestCollector.hideFlags = HideFlags.HideAndDontSave; editorConnectionTestCollector.Init(m_TargetPlatform, m_HeartbeatTimeout); var remotePlayerLogController = RemotePlayerLogController.instance; remotePlayerLogController.hideFlags = HideFlags.HideAndDontSave; using (var settings = new PlayerLauncherContextSettings(m_OverloadTestRunSettings)) { m_SceneName = CreateSceneName(); var scene = PrepareScene(m_SceneName); string scenePath = scene.path; var filter = m_Settings.BuildNUnitFilter(); var runner = LoadTests(filter); var exceptionThrown = ExecutePreBuildSetupMethods(runner.LoadedTest, filter); if (exceptionThrown) { ReopenOriginalScene(m_Settings.originalScene); AssetDatabase.DeleteAsset(m_SceneName); CallbacksDelegator.instance.RunFailed("Run Failed: One or more errors in a prebuild setup. See the editor log for details."); return; } var playerBuildOptions = GetBuildOptions(scenePath); var success = BuildAndRunPlayer(playerBuildOptions); editorConnectionTestCollector.PostBuildAction(); ExecutePostBuildCleanupMethods(runner.LoadedTest, filter); ReopenOriginalScene(m_Settings.originalScene); AssetDatabase.DeleteAsset(m_SceneName); if (!success) { ScriptableObject.DestroyImmediate(editorConnectionTestCollector); Debug.LogError("Player build failed"); throw new TestLaunchFailedException("Player build failed"); } editorConnectionTestCollector.PostSuccessfulBuildAction(); } } public Scene PrepareScene(string sceneName) { var scene = CreateBootstrapScene(sceneName, runner => { runner.AddEventHandlerMonoBehaviour<PlayModeRunnerCallback>(); runner.settings = m_Settings; runner.AddEventHandlerMonoBehaviour<RemoteTestResultSender>(); runner.AddEventHandlerScriptableObject<TestRunCallbackListener>(); }); return scene; } private static bool BuildAndRunPlayer(PlayerLauncherBuildOptions buildOptions) { Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, "Building player with following options:\n{0}", buildOptions); // Android has to be in listen mode to establish player connection if (buildOptions.BuildPlayerOptions.target == BuildTarget.Android) { buildOptions.BuildPlayerOptions.options &= ~BuildOptions.ConnectToHost; } // For now, so does Lumin if (buildOptions.BuildPlayerOptions.target == BuildTarget.Lumin) { buildOptions.BuildPlayerOptions.options &= ~BuildOptions.ConnectToHost; } var result = BuildPipeline.BuildPlayer(buildOptions.BuildPlayerOptions); if (result.summary.result != Build.Reporting.BuildResult.Succeeded) Debug.LogError(result.SummarizeErrors()); return result.summary.result == Build.Reporting.BuildResult.Succeeded; } private PlayerLauncherBuildOptions GetBuildOptions(string scenePath) { var buildOptions = new BuildPlayerOptions(); var reduceBuildLocationPathLength = false; //Some platforms hit MAX_PATH limits during the build process, in these cases minimize the path length if ((m_TargetPlatform == BuildTarget.WSAPlayer) || (m_TargetPlatform == BuildTarget.XboxOne)) { reduceBuildLocationPathLength = true; } var scenes = new List<string>() { scenePath }; scenes.AddRange(EditorBuildSettings.scenes.Select(x => x.path)); buildOptions.scenes = scenes.ToArray(); buildOptions.options |= BuildOptions.AutoRunPlayer | BuildOptions.Development | BuildOptions.ConnectToHost | BuildOptions.IncludeTestAssemblies | BuildOptions.StrictMode; buildOptions.target = m_TargetPlatform; if (EditorUserBuildSettings.waitForPlayerConnection) buildOptions.options |= BuildOptions.WaitForPlayerConnection; var buildTargetGroup = EditorUserBuildSettings.activeBuildTargetGroup; //Check if Lz4 is supported for the current buildtargetgroup and enable it if need be if (PostprocessBuildPlayer.SupportsLz4Compression(buildTargetGroup, m_TargetPlatform)) { if (EditorUserBuildSettings.GetCompressionType(buildTargetGroup) == Compression.Lz4) buildOptions.options |= BuildOptions.CompressWithLz4; else if (EditorUserBuildSettings.GetCompressionType(buildTargetGroup) == Compression.Lz4HC) buildOptions.options |= BuildOptions.CompressWithLz4HC; } var uniqueTempPathInProject = FileUtil.GetUniqueTempPathInProject(); var playerDirectoryName = reduceBuildLocationPathLength ? "PwT" : "PlayerWithTests"; if (reduceBuildLocationPathLength) { uniqueTempPathInProject = Path.GetTempFileName(); File.Delete(uniqueTempPathInProject); Directory.CreateDirectory(uniqueTempPathInProject); } var tempPath = Path.GetFullPath(uniqueTempPathInProject); var buildLocation = Path.Combine(tempPath, playerDirectoryName); // iOS builds create a folder with Xcode project instead of an executable, therefore no executable name is added if (m_TargetPlatform == BuildTarget.iOS) { buildOptions.locationPathName = buildLocation; } else { string extensionForBuildTarget = PostprocessBuildPlayer.GetExtensionForBuildTarget(buildTargetGroup, buildOptions.target, buildOptions.options); var playerExecutableName = "PlayerWithTests"; playerExecutableName += string.Format(".{0}", extensionForBuildTarget); buildOptions.locationPathName = Path.Combine(buildLocation, playerExecutableName); } return new PlayerLauncherBuildOptions { BuildPlayerOptions = ModifyBuildOptions(buildOptions), PlayerDirectory = buildLocation, }; } private BuildPlayerOptions ModifyBuildOptions(BuildPlayerOptions buildOptions) { var allAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.GetReferencedAssemblies().Any(z => z.Name == "UnityEngine.TestRunner")).ToArray(); var attributes = allAssemblies.SelectMany(assembly => assembly.GetCustomAttributes(typeof(TestPlayerBuildModifierAttribute), true).OfType<TestPlayerBuildModifierAttribute>()).ToArray(); var modifiers = attributes.Select(attribute => attribute.ConstructModifier()).ToArray(); foreach (var modifier in modifiers) { buildOptions = modifier.ModifyOptions(buildOptions); } return buildOptions; } } }
44.830918
197
0.661422
[ "MIT" ]
16pxdesign/genetic-algorithm-unity
Library/PackageCache/com.unity.test-framework@1.1.9/UnityEditor.TestRunner/TestLaunchers/PlayerLauncher.cs
9,280
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameManager : MonoBehaviour { public int highScore = 0; public int livesLeft = 3; void Awake() { GameObject[] objs = GameObject.FindGameObjectsWithTag("DrManager"); if (objs.Length > 1) { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }
18.969697
76
0.5623
[ "MIT" ]
dmcleodnine/2D-Unity-Platformer
GameManager.cs
626
C#
using System; using System.Collections.Generic; using Reinforced.Typings.Attributes; using Reinforced.Typings.Fluent.Interfaces; namespace Reinforced.Typings.Fluent { /// <summary> /// Configuration builder for Enum type /// </summary> /// <typeparam name="TEnum"></typeparam> public class EnumConfigurationBuilder<TEnum> : IEnumConfigurationBuidler where TEnum : struct { internal readonly TypeBlueprint _blueprint; public EnumConfigurationBuilder(ExportContext context) { _blueprint = context.Project.Blueprint(typeof(TEnum)); Context = context; if (_blueprint.TypeAttribute == null) _blueprint.TypeAttribute = new TsEnumAttribute(); } TsEnumAttribute IAttributed<TsEnumAttribute>.AttributePrototype { get { return _blueprint.Attr<TsEnumAttribute>(); } } Type IEnumConfigurationBuidler.EnumType { get { return typeof(TEnum); } } /// <summary> /// Export context /// </summary> public ExportContext Context { get; } ICollection<TsAddTypeReferenceAttribute> IReferenceConfigurationBuilder.References { get { return _blueprint.References; } } ICollection<TsAddTypeImportAttribute> IReferenceConfigurationBuilder.Imports { get { return _blueprint.Imports; } } string IReferenceConfigurationBuilder.PathToFile { get { return _blueprint.PathToFile; } set { _blueprint.PathToFile = value; } } List<TsDecoratorAttribute> IDecoratorsAggregator.Decorators { get { return _blueprint.Decorators; } } } }
30
99
0.629379
[ "MIT" ]
otto-gebb/Reinforced.Typings
Reinforced.Typings/Fluent/EnumConfigurationBuilder.cs
1,772
C#
using System.Collections.Generic; using Q42.HueApi; namespace Xpressive.Home.Plugins.PhilipsHue.LightCommandStrategies { internal sealed class AlarmOnceLightCommandStrategy : LightCommandStrategyBase { public override LightCommand GetLightCommand(IDictionary<string, string> values, PhilipsHueDevice bulb) { return new LightCommand { Alert = Alert.Once }; } } }
27.470588
112
0.64454
[ "MIT" ]
xpressive-websolutions/Xpressive.Home
Xpressive.Home.Plugins.PhilipsHue/LightCommandStrategies/AlarmOnceLightCommandStrategy.cs
467
C#
/* Yet Another Forum.NET * Copyright (C) 2003-2005 Bjørnar Henden * Copyright (C) 2006-2013 Jaben Cargman * Copyright (C) 2014 Ingo Herbote * http://www.yetanotherforum.net/ * * 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. */ namespace YAF.Providers.Utils { #region Using using System; using System.Configuration.Provider; using System.Web; using System.Xml; using YAF.Classes; using YAF.Types; using YAF.Types.Extensions; #endregion /// <summary> /// The exception reporter. /// </summary> public static class ExceptionReporter { #region Properties /// <summary> /// Gets the Exception XML File Name from AppSettings /// </summary> [NotNull] private static string ProviderExceptionFile { get { return Config.GetConfigValueAsString("YAF.ProviderExceptionXML") ?? "ProviderExceptions.xml"; } } #endregion #region Public Methods /// <summary> /// Get Exception String /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The get report. /// </returns> public static string GetReport([NotNull] string providerSection, [NotNull] string tag) { string select = "//provider[@name='{0}']/Resource[@tag='{1}']".FormatWith( providerSection.ToUpper(), tag.ToUpper()); XmlNode node = ExceptionXML().SelectSingleNode(select); return node != null ? node.InnerText : "Exception({1}:{0}) cannot be found in Exception file!".FormatWith(tag, providerSection); } /// <summary> /// Throw Exception /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The throw. /// </returns> public static string Throw([NotNull] string providerSection, [NotNull] string tag) { throw new ApplicationException(GetReport(providerSection, tag)); } /// <summary> /// Throw ArgumentException /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The throw argument. /// </returns> public static string ThrowArgument([NotNull] string providerSection, [NotNull] string tag) { throw new ArgumentException(GetReport(providerSection, tag)); } /// <summary> /// Throw ArgumentNullException /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The throw argument null. /// </returns> public static string ThrowArgumentNull([NotNull] string providerSection, [NotNull] string tag) { throw new ArgumentNullException(GetReport(providerSection, tag)); } /// <summary> /// Throw NotSupportedException /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The throw not supported. /// </returns> public static string ThrowNotSupported([NotNull] string providerSection, [NotNull] string tag) { throw new NotSupportedException(GetReport(providerSection, tag)); } /// <summary> /// Throw ProviderException /// </summary> /// <param name="providerSection"> /// The provider Section. /// </param> /// <param name="tag"> /// The tag. /// </param> /// <returns> /// The throw provider. /// </returns> public static string ThrowProvider([NotNull] string providerSection, [NotNull] string tag) { throw new ProviderException(GetReport(providerSection, tag)); } #endregion #region Methods /// <summary> /// Return XMLDocument containing text for the Exceptions /// </summary> /// <returns> Returns the XMLDocument containing text for the Exceptions</returns> /// <exception cref="System.ApplicationException">Exception file cannot be null or empty!</exception> [NotNull] private static XmlDocument ExceptionXML() { if (ProviderExceptionFile.IsNotSet()) { throw new ApplicationException("Exceptionfile cannot be null or empty!"); } var exceptionXmlDoc = new XmlDocument(); exceptionXmlDoc.Load( HttpContext.Current.Server.MapPath( "{0}{1}resources/{1}".FormatWith( Config.ServerFileRoot, Config.ServerFileRoot.EndsWith("/") ? string.Empty : "/", ProviderExceptionFile))); return exceptionXmlDoc; } #endregion } }
32.402985
115
0.540304
[ "Apache-2.0" ]
maxdm/YAFNET
yafsrc/YAF.Providers/Utils/ExceptionReporter.cs
6,314
C#
/* * Measurement repository interface. * * @author Michel Megens * @email michel@michelmegens.net */ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MongoDB.Bson; using SensateIoT.Platform.Network.Data.Models; namespace SensateIoT.Platform.Network.DataAccess.Abstract { public interface IMeasurementRepository { Task StoreAsync(IDictionary<ObjectId, List<Measurement>> measurements, CancellationToken ct = default); Task DeleteBySensorId(ObjectId sensorId, CancellationToken ct = default); Task DeleteBySensorId(IEnumerable<ObjectId> sensorId, CancellationToken ct = default); } }
25.88
105
0.794436
[ "Apache-2.0" ]
sensate-iot/platform-network
SensateIoT.Platform.Network.DataAccess/Abstract/IMeasurementRepository.cs
649
C#
// Copyright 2018 yinyue200.com // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using LottieUWP.Animation.Content; using LottieUWP.Model.Animatable; using LottieUWP.Model.Layer; namespace LottieUWP.Model.Content { public class ShapeTrimPath : IContentModel { public enum Type { Simultaneously = 1, Individually = 2 } private readonly Type _type; public ShapeTrimPath(string name, Type type, AnimatableFloatValue start, AnimatableFloatValue end, AnimatableFloatValue offset, bool hidden) { Name = name; _type = type; Start = start; End = end; Offset = offset; IsHidden = hidden; } internal string Name { get; } internal new Type GetType() { return _type; } internal AnimatableFloatValue End { get; } internal AnimatableFloatValue Start { get; } internal AnimatableFloatValue Offset { get; } internal bool IsHidden { get; } public IContent ToContent(ILottieDrawable drawable, BaseLayer layer) { return new TrimPathContent(layer, this); } public override string ToString() { return "Trim Path: {start: " + Start + ", end: " + End + ", offset: " + Offset + "}"; } } }
29.4
148
0.619571
[ "Apache-2.0" ]
cm4ker/LottieSharp
LottieSkiaSharp/Model/Content/ShapeTrimPath.cs
1,913
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("z80DotNet")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("z80DotNet")] [assembly: AssemblyCopyright("Copyright © 2017-2019 informedcitizenry")] [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("d3e93973-2352-4188-a527-df2dbbfd17b1")] // 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.15.0.0")] [assembly: AssemblyFileVersion("1.15.0.0")]
39.216216
85
0.729152
[ "MIT" ]
informedcitizenry/z80DotNet
z80DotNet/Properties/AssemblyInfo.cs
1,454
C#
using GRA.Domain.Model; using GRA.Domain.Model.Filters; using GRA.Domain.Repository; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using GRA.Domain.Repository.Extensions; using AutoMapper.QueryableExtensions; using System; namespace GRA.Data.Repository { public class BroadcastRepository : AuditingRepository<Model.Broadcast, Broadcast>, IBroadcastRepository { public BroadcastRepository(ServiceFacade.Repository repositoryFacade, ILogger<BroadcastRepository> logger) : base(repositoryFacade, logger) { } public async Task<ICollection<Broadcast>> PageAsync(BroadcastFilter filter) { var broadcasts = ApplyFilters(filter); if (filter.Upcoming == false) { broadcasts = broadcasts.OrderByDescending(_ => _.SendAt); } else { broadcasts = broadcasts.OrderBy(_ => _.SendAt); } return await broadcasts .ApplyPagination(filter) .ProjectTo<Broadcast>(_mapper.ConfigurationProvider) .ToListAsync(); } public async Task<int> CountAsync(BroadcastFilter filter) { return await ApplyFilters(filter) .CountAsync(); } private IQueryable<Model.Broadcast> ApplyFilters(BroadcastFilter filter) { var broadcasts = DbSet.AsNoTracking() .Where(_ => _.SiteId == filter.SiteId); if (filter.Upcoming == true) { broadcasts = broadcasts.Where(_ => _.SendAt >= _dateTimeProvider.Now); } else if (filter.Upcoming == false) { broadcasts = broadcasts.Where(_ => _.SendAt < _dateTimeProvider.Now); } return broadcasts; } public async Task<IEnumerable<Broadcast>> GetNewBroadcastsAsync(int siteId, DateTime? lastBroadcast) { var broadcasts = DbSet.AsNoTracking() .Where(_ => _.SiteId == siteId && _.SendAt <= _dateTimeProvider.Now); if (lastBroadcast.HasValue) { broadcasts = broadcasts.Where(_ => _.SendAt > lastBroadcast); } return await broadcasts .OrderBy(_ => _.SendAt) .ProjectTo<Broadcast>(_mapper.ConfigurationProvider) .ToListAsync(); } } }
32.275
108
0.587916
[ "MIT" ]
codacy-badger/greatreadingadventure
src/GRA.Data/Repository/BroadcastRepository.cs
2,584
C#
using ChunkUpload.Helpers; using ChunkUpload.Interfaces; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; using System; using System.IO; using System.Net; using System.Threading.Tasks; namespace ChunkUpload.Services { public class UploadService : IUploadService { private readonly FormOptions _formOptions; private readonly IFileStorage _storageService; public UploadService(IFileStorage storageService, IOptions<FormOptions> formOptions) { _formOptions = formOptions.Value; _storageService = storageService; } public async Task<bool> UploadAsync(HttpRequest request, ModelStateDictionary modelState) { if (!MultipartRequestHelper.IsMultipartContentType(request.ContentType)) { modelState.AddModelError("File", "The request couldn't be processed (Error 1)."); return false; } var formAccumulator = new KeyValueAccumulator(); var boundary = MultipartRequestHelper.GetBoundary( MediaTypeHeaderValue.Parse(request.ContentType), _formOptions.MultipartBoundaryLengthLimit); var reader = new MultipartReader(boundary, request.Body); var section = await reader.ReadNextSectionAsync(); while (section != null) { var hasContentDispositionHeader = ContentDispositionHeaderValue.TryParse(section.ContentDisposition, out var contentDisposition); if (hasContentDispositionHeader) { if (MultipartRequestHelper.HasFileContentDisposition(contentDisposition)) { var fileName = WebUtility.HtmlEncode(contentDisposition.FileName.Value); await _storageService.UploadAsync(fileName, section.Body); if (!modelState.IsValid) { return false; } } else if (MultipartRequestHelper.HasFormDataContentDisposition(contentDisposition)) { var key = HeaderUtilities.RemoveQuotes(contentDisposition.Name).Value; var encoding = MultipartRequestHelper.GetEncoding(section); if (encoding == null) { modelState.AddModelError("File", "The request couldn't be processed (Error 2)."); return false; } using var streamReader = new StreamReader( section.Body, encoding, detectEncodingFromByteOrderMarks: true, bufferSize: 1024, leaveOpen: true); var value = await streamReader.ReadToEndAsync(); if (string.Equals(value, "undefined", StringComparison.OrdinalIgnoreCase)) { value = string.Empty; } formAccumulator.Append(key, value); if (formAccumulator.ValueCount > _formOptions.ValueCountLimit) { modelState.AddModelError("File", "The request couldn't be processed (Error 3)."); return false; } } } section = await reader.ReadNextSectionAsync(); } /* var formData = new FormData(); var formValueProvider = new FormValueProvider( BindingSource.Form, new FormCollection(formAccumulator.GetResults()), CultureInfo.CurrentCulture); var bindingSuccessful = await TryUpdateModelAsync(formData, "", formValueProvider); if (!bindingSuccessful) { ModelState.AddModelError("File", "The request couldn't be processed (Error 5)."); return BadRequest(ModelState); } */ return true; } } }
37.889831
145
0.549094
[ "MIT" ]
adamfoneil/ChunkUpload
ChunkUpload/Services/UploadService.cs
4,473
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/msxml.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace TerraFX.Interop { [Guid("65725580-9B5D-11D0-9BFE-00C04FC99C8E")] [NativeTypeName("struct IXMLElementCollection : IDispatch")] [NativeInheritance("IDispatch")] public unsafe partial struct IXMLElementCollection { public void** lpVtbl; [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(0)] [return: NativeTypeName("HRESULT")] public int QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) { return ((delegate* unmanaged<IXMLElementCollection*, Guid*, void**, int>)(lpVtbl[0]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), riid, ppvObject); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(1)] [return: NativeTypeName("ULONG")] public uint AddRef() { return ((delegate* unmanaged<IXMLElementCollection*, uint>)(lpVtbl[1]))((IXMLElementCollection*)Unsafe.AsPointer(ref this)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(2)] [return: NativeTypeName("ULONG")] public uint Release() { return ((delegate* unmanaged<IXMLElementCollection*, uint>)(lpVtbl[2]))((IXMLElementCollection*)Unsafe.AsPointer(ref this)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(3)] [return: NativeTypeName("HRESULT")] public int GetTypeInfoCount([NativeTypeName("UINT *")] uint* pctinfo) { return ((delegate* unmanaged<IXMLElementCollection*, uint*, int>)(lpVtbl[3]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), pctinfo); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(4)] [return: NativeTypeName("HRESULT")] public int GetTypeInfo([NativeTypeName("UINT")] uint iTInfo, [NativeTypeName("LCID")] uint lcid, ITypeInfo** ppTInfo) { return ((delegate* unmanaged<IXMLElementCollection*, uint, uint, ITypeInfo**, int>)(lpVtbl[4]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), iTInfo, lcid, ppTInfo); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(5)] [return: NativeTypeName("HRESULT")] public int GetIDsOfNames([NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LPOLESTR *")] ushort** rgszNames, [NativeTypeName("UINT")] uint cNames, [NativeTypeName("LCID")] uint lcid, [NativeTypeName("DISPID *")] int* rgDispId) { return ((delegate* unmanaged<IXMLElementCollection*, Guid*, ushort**, uint, uint, int*, int>)(lpVtbl[5]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), riid, rgszNames, cNames, lcid, rgDispId); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(6)] [return: NativeTypeName("HRESULT")] public int Invoke([NativeTypeName("DISPID")] int dispIdMember, [NativeTypeName("const IID &")] Guid* riid, [NativeTypeName("LCID")] uint lcid, [NativeTypeName("WORD")] ushort wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, [NativeTypeName("UINT *")] uint* puArgErr) { return ((delegate* unmanaged<IXMLElementCollection*, int, Guid*, uint, ushort, DISPPARAMS*, VARIANT*, EXCEPINFO*, uint*, int>)(lpVtbl[6]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(7)] [return: NativeTypeName("HRESULT")] public int put_length([NativeTypeName("long")] int v) { return ((delegate* unmanaged<IXMLElementCollection*, int, int>)(lpVtbl[7]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), v); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(8)] [return: NativeTypeName("HRESULT")] public int get_length([NativeTypeName("long *")] int* p) { return ((delegate* unmanaged<IXMLElementCollection*, int*, int>)(lpVtbl[8]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), p); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(9)] [return: NativeTypeName("HRESULT")] public int get__newEnum(IUnknown** ppUnk) { return ((delegate* unmanaged<IXMLElementCollection*, IUnknown**, int>)(lpVtbl[9]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), ppUnk); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(10)] [return: NativeTypeName("HRESULT")] public int item(VARIANT var1, VARIANT var2, IDispatch** ppDisp) { return ((delegate* unmanaged<IXMLElementCollection*, VARIANT, VARIANT, IDispatch**, int>)(lpVtbl[10]))((IXMLElementCollection*)Unsafe.AsPointer(ref this), var1, var2, ppDisp); } } }
49.388889
302
0.666667
[ "MIT" ]
DaZombieKiller/terrafx.interop.windows
sources/Interop/Windows/um/msxml/IXMLElementCollection.cs
5,336
C#
using System.Xml.Serialization; namespace Rock.Logging.Configuration { [XmlRoot("category")] public class Category { [XmlAttribute("name")] public string Name { get; set; } [XmlAttribute("throttlingRule")] public string ThrottlingRule { get; set; } [XmlArray("providers")] [XmlArrayItem("provider")] public LogProviderProxy[] LogProviders { get; set; } } }
23.944444
60
0.61949
[ "MIT" ]
bfriesen/Rock.Logging
Rock.Logging/Configuration/Xml/Category.cs
431
C#
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://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. // Generated code. DO NOT EDIT! namespace Google.Apis.CloudAsset.v1 { /// <summary>The CloudAsset Service.</summary> public class CloudAssetService : Google.Apis.Services.BaseClientService { /// <summary>The API version.</summary> public const string Version = "v1"; /// <summary>The discovery version used to generate this service.</summary> public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed = Google.Apis.Discovery.DiscoveryVersion.Version_1_0; /// <summary>Constructs a new service.</summary> public CloudAssetService() : this(new Google.Apis.Services.BaseClientService.Initializer()) { } /// <summary>Constructs a new service.</summary> /// <param name="initializer">The service initializer.</param> public CloudAssetService(Google.Apis.Services.BaseClientService.Initializer initializer) : base(initializer) { Assets = new AssetsResource(this); Feeds = new FeedsResource(this); Operations = new OperationsResource(this); SavedQueries = new SavedQueriesResource(this); V1 = new V1Resource(this); } /// <summary>Gets the service supported features.</summary> public override System.Collections.Generic.IList<string> Features => new string[0]; /// <summary>Gets the service name.</summary> public override string Name => "cloudasset"; /// <summary>Gets the service base URI.</summary> public override string BaseUri => #if NETSTANDARD1_3 || NETSTANDARD2_0 || NET45 BaseUriOverride ?? "https://cloudasset.googleapis.com/"; #else "https://cloudasset.googleapis.com/"; #endif /// <summary>Gets the service base path.</summary> public override string BasePath => ""; #if !NET40 /// <summary>Gets the batch base URI; <c>null</c> if unspecified.</summary> public override string BatchUri => "https://cloudasset.googleapis.com/batch"; /// <summary>Gets the batch base path; <c>null</c> if unspecified.</summary> public override string BatchPath => "batch"; #endif /// <summary>Available OAuth 2.0 scopes for use with the Cloud Asset API.</summary> public class Scope { /// <summary> /// See, edit, configure, and delete your Google Cloud data and see the email address for your Google /// Account. /// </summary> public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Available OAuth 2.0 scope constants for use with the Cloud Asset API.</summary> public static class ScopeConstants { /// <summary> /// See, edit, configure, and delete your Google Cloud data and see the email address for your Google /// Account. /// </summary> public const string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Gets the Assets resource.</summary> public virtual AssetsResource Assets { get; } /// <summary>Gets the Feeds resource.</summary> public virtual FeedsResource Feeds { get; } /// <summary>Gets the Operations resource.</summary> public virtual OperationsResource Operations { get; } /// <summary>Gets the SavedQueries resource.</summary> public virtual SavedQueriesResource SavedQueries { get; } /// <summary>Gets the V1 resource.</summary> public virtual V1Resource V1 { get; } } /// <summary>A base abstract class for CloudAsset requests.</summary> public abstract class CloudAssetBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse> { /// <summary>Constructs a new CloudAssetBaseServiceRequest instance.</summary> protected CloudAssetBaseServiceRequest(Google.Apis.Services.IClientService service) : base(service) { } /// <summary>V1 error format.</summary> [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<XgafvEnum> Xgafv { get; set; } /// <summary>V1 error format.</summary> public enum XgafvEnum { /// <summary>v1 error format</summary> [Google.Apis.Util.StringValueAttribute("1")] Value1 = 0, /// <summary>v2 error format</summary> [Google.Apis.Util.StringValueAttribute("2")] Value2 = 1, } /// <summary>OAuth access token.</summary> [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string AccessToken { get; set; } /// <summary>Data format for response.</summary> [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<AltEnum> Alt { get; set; } /// <summary>Data format for response.</summary> public enum AltEnum { /// <summary>Responses with Content-Type of application/json</summary> [Google.Apis.Util.StringValueAttribute("json")] Json = 0, /// <summary>Media download with context-dependent Content-Type</summary> [Google.Apis.Util.StringValueAttribute("media")] Media = 1, /// <summary>Responses with Content-Type of application/x-protobuf</summary> [Google.Apis.Util.StringValueAttribute("proto")] Proto = 2, } /// <summary>JSONP</summary> [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)] public virtual string Callback { get; set; } /// <summary>Selector specifying which fields to include in a partial response.</summary> [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)] public virtual string Fields { get; set; } /// <summary> /// API key. Your API key identifies your project and provides you with API access, quota, and reports. Required /// unless you provide an OAuth 2.0 token. /// </summary> [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)] public virtual string Key { get; set; } /// <summary>OAuth 2.0 token for the current user.</summary> [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string OauthToken { get; set; } /// <summary>Returns response with indentations and line breaks.</summary> [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> PrettyPrint { get; set; } /// <summary> /// Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a /// user, but should not exceed 40 characters. /// </summary> [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)] public virtual string QuotaUser { get; set; } /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary> [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)] public virtual string UploadType { get; set; } /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary> [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)] public virtual string UploadProtocol { get; set; } /// <summary>Initializes CloudAsset parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("$.xgafv", new Google.Apis.Discovery.Parameter { Name = "$.xgafv", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("access_token", new Google.Apis.Discovery.Parameter { Name = "access_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("alt", new Google.Apis.Discovery.Parameter { Name = "alt", IsRequired = false, ParameterType = "query", DefaultValue = "json", Pattern = null, }); RequestParameters.Add("callback", new Google.Apis.Discovery.Parameter { Name = "callback", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("fields", new Google.Apis.Discovery.Parameter { Name = "fields", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("key", new Google.Apis.Discovery.Parameter { Name = "key", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("oauth_token", new Google.Apis.Discovery.Parameter { Name = "oauth_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("prettyPrint", new Google.Apis.Discovery.Parameter { Name = "prettyPrint", IsRequired = false, ParameterType = "query", DefaultValue = "true", Pattern = null, }); RequestParameters.Add("quotaUser", new Google.Apis.Discovery.Parameter { Name = "quotaUser", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("uploadType", new Google.Apis.Discovery.Parameter { Name = "uploadType", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("upload_protocol", new Google.Apis.Discovery.Parameter { Name = "upload_protocol", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>The "assets" collection of methods.</summary> public class AssetsResource { private const string Resource = "assets"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public AssetsResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Lists assets with time and resource types and returns paged results in response.</summary> /// <param name="parent"> /// Required. Name of the organization or project the assets belong to. Format: /// "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as /// "projects/my-project-id"), or "projects/[project-number]" (such as "projects/12345"). /// </param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists assets with time and resource types and returns paged results in response.</summary> public class ListRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.ListAssetsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary> /// Required. Name of the organization or project the assets belong to. Format: /// "organizations/[organization-number]" (such as "organizations/123"), "projects/[project-id]" (such as /// "projects/my-project-id"), or "projects/[project-number]" (such as "projects/12345"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary> /// A list of asset types to take a snapshot for. For example: "compute.googleapis.com/Disk". Regular /// expression is also supported. For example: * "compute.googleapis.com.*" snapshots resources whose asset /// type starts with "compute.googleapis.com". * ".*Instance" snapshots resources whose asset type ends with /// "Instance". * ".*Instance.*" snapshots resources whose asset type contains "Instance". See /// [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the /// regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. /// If specified, only matching assets will be returned, otherwise, it will snapshot all asset types. See /// [Introduction to Cloud Asset Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all /// supported asset types. /// </summary> [Google.Apis.Util.RequestParameterAttribute("assetTypes", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AssetTypes { get; set; } /// <summary>Asset content type. If not specified, no content but the asset name will be returned.</summary> [Google.Apis.Util.RequestParameterAttribute("contentType", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<ContentTypeEnum> ContentType { get; set; } /// <summary>Asset content type. If not specified, no content but the asset name will be returned.</summary> public enum ContentTypeEnum { /// <summary>Unspecified content type.</summary> [Google.Apis.Util.StringValueAttribute("CONTENT_TYPE_UNSPECIFIED")] CONTENTTYPEUNSPECIFIED = 0, /// <summary>Resource metadata.</summary> [Google.Apis.Util.StringValueAttribute("RESOURCE")] RESOURCE = 1, /// <summary>The actual IAM policy set on a resource.</summary> [Google.Apis.Util.StringValueAttribute("IAM_POLICY")] IAMPOLICY = 2, /// <summary>The Cloud Organization Policy set on an asset.</summary> [Google.Apis.Util.StringValueAttribute("ORG_POLICY")] ORGPOLICY = 3, /// <summary>The Cloud Access context manager Policy set on an asset.</summary> [Google.Apis.Util.StringValueAttribute("ACCESS_POLICY")] ACCESSPOLICY = 4, /// <summary>The runtime OS Inventory information.</summary> [Google.Apis.Util.StringValueAttribute("OS_INVENTORY")] OSINVENTORY = 5, /// <summary>The related resources.</summary> [Google.Apis.Util.StringValueAttribute("RELATIONSHIP")] RELATIONSHIP = 6, } /// <summary> /// The maximum number of assets to be returned in a single response. Default is 100, minimum is 1, and /// maximum is 1000. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary> /// The `next_page_token` returned from the previous `ListAssetsResponse`, or unspecified for the first /// `ListAssetsRequest`. It is a continuation of a prior `ListAssets` call, and the API should return the /// next page of assets. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary> /// Timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and /// the current time minus 35 days (inclusive). If not specified, the current time will be used. Due to /// delays in resource data collection and indexing, there is a volatile window during which running the /// same query may get different results. /// </summary> [Google.Apis.Util.RequestParameterAttribute("readTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object ReadTime { get; set; } /// <summary> /// A list of relationship types to output, for example: `INSTANCE_TO_INSTANCEGROUP`. This field should only /// be specified if content_type=RELATIONSHIP. * If specified: it snapshots specified relationships. It /// returns an error if any of the [relationship_types] doesn't belong to the supported relationship types /// of the [asset_types] or if any of the [asset_types] doesn't belong to the source types of the /// [relationship_types]. * Otherwise: it snapshots the supported relationships for all [asset_types] or /// returns an error if any of the [asset_types] has no relationship support. An unspecified asset types /// field means all supported asset_types. See [Introduction to Cloud Asset /// Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all supported asset types and /// relationship types. /// </summary> [Google.Apis.Util.RequestParameterAttribute("relationshipTypes", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> RelationshipTypes { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/assets"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("assetTypes", new Google.Apis.Discovery.Parameter { Name = "assetTypes", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("contentType", new Google.Apis.Discovery.Parameter { Name = "contentType", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("readTime", new Google.Apis.Discovery.Parameter { Name = "readTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("relationshipTypes", new Google.Apis.Discovery.Parameter { Name = "relationshipTypes", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>The "feeds" collection of methods.</summary> public class FeedsResource { private const string Resource = "feeds"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public FeedsResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Creates a feed in a parent project/folder/organization to listen to its asset updates.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent"> /// Required. The name of the project/folder/organization where this feed should be created in. It can only be /// an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID /// (such as "projects/my-project-id")", or a project number (such as "projects/12345"). /// </param> public virtual CreateRequest Create(Google.Apis.CloudAsset.v1.Data.CreateFeedRequest body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a feed in a parent project/folder/organization to listen to its asset updates.</summary> public class CreateRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Feed> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.CreateFeedRequest body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary> /// Required. The name of the project/folder/organization where this feed should be created in. It can only /// be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a /// project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.CreateFeedRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/feeds"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); } } /// <summary>Deletes an asset feed.</summary> /// <param name="name"> /// Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id /// folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id /// </param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes an asset feed.</summary> public class DeleteRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Empty> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary> /// Required. The name of the feed and it must be in the format of: projects/project_number/feeds/feed_id /// folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/feeds/[^/]+$", }); } } /// <summary>Gets details about an asset feed.</summary> /// <param name="name"> /// Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id /// folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id /// </param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details about an asset feed.</summary> public class GetRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Feed> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary> /// Required. The name of the Feed and it must be in the format of: projects/project_number/feeds/feed_id /// folders/folder_number/feeds/feed_id organizations/organization_number/feeds/feed_id /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/feeds/[^/]+$", }); } } /// <summary>Lists all asset feeds in a parent project/folder/organization.</summary> /// <param name="parent"> /// Required. The parent project/folder/organization whose feeds are to be listed. It can only be using /// project/folder/organization number (such as "folders/12345")", or a project ID (such as /// "projects/my-project-id"). /// </param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists all asset feeds in a parent project/folder/organization.</summary> public class ListRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.ListFeedsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary> /// Required. The parent project/folder/organization whose feeds are to be listed. It can only be using /// project/folder/organization number (such as "folders/12345")", or a project ID (such as /// "projects/my-project-id"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/feeds"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); } } /// <summary>Updates an asset feed configuration.</summary> /// <param name="body">The body of the request.</param> /// <param name="name"> /// Required. The format will be projects/{project_number}/feeds/{client-assigned_feed_identifier} or /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} The client-assigned feed /// identifier must be unique within the parent project/folder/organization. /// </param> public virtual PatchRequest Patch(Google.Apis.CloudAsset.v1.Data.UpdateFeedRequest body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates an asset feed configuration.</summary> public class PatchRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Feed> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.UpdateFeedRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary> /// Required. The format will be projects/{project_number}/feeds/{client-assigned_feed_identifier} or /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} The client-assigned feed /// identifier must be unique within the parent project/folder/organization. /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.UpdateFeedRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "patch"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Patch parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/feeds/[^/]+$", }); } } } /// <summary>The "operations" collection of methods.</summary> public class OperationsResource { private const string Resource = "operations"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public OperationsResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary> /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result /// at intervals as recommended by the API service. /// </summary> /// <param name="name">The name of the operation resource.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary> /// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result /// at intervals as recommended by the API service. /// </summary> public class GetRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Operation> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the operation resource.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/operations/[^/]+/.*$", }); } } } /// <summary>The "savedQueries" collection of methods.</summary> public class SavedQueriesResource { private const string Resource = "savedQueries"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public SavedQueriesResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Creates a saved query in a parent project/folder/organization.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent"> /// Required. The name of the project/folder/organization where this saved_query should be created in. It can /// only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a /// project ID (such as "projects/my-project-id")", or a project number (such as "projects/12345"). /// </param> public virtual CreateRequest Create(Google.Apis.CloudAsset.v1.Data.SavedQuery body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a saved query in a parent project/folder/organization.</summary> public class CreateRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.SavedQuery> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.SavedQuery body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary> /// Required. The name of the project/folder/organization where this saved_query should be created in. It /// can only be an organization number (such as "organizations/123"), a folder number (such as /// "folders/123"), a project ID (such as "projects/my-project-id")", or a project number (such as /// "projects/12345"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary> /// Required. The ID to use for the saved query, which must be unique in the specified parent. It will /// become the final component of the saved query's resource name. This value should be 4-63 characters, and /// valid characters are /a-z-/. Notice that this field is required in the saved query creation, and the /// `name` field of the `saved_query` will be ignored. /// </summary> [Google.Apis.Util.RequestParameterAttribute("savedQueryId", Google.Apis.Util.RequestParameterType.Query)] public virtual string SavedQueryId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.SavedQuery Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "create"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/savedQueries"; /// <summary>Initializes Create parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("savedQueryId", new Google.Apis.Discovery.Parameter { Name = "savedQueryId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes a saved query.</summary> /// <param name="name"> /// Required. The name of the saved query to delete. It must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * /// organizations/organization_number/savedQueries/saved_query_id /// </param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a saved query.</summary> public class DeleteRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Empty> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary> /// Required. The name of the saved query to delete. It must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id /// * organizations/organization_number/savedQueries/saved_query_id /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "delete"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Delete parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/savedQueries/[^/]+$", }); } } /// <summary>Gets details about a saved query.</summary> /// <param name="name"> /// Required. The name of the saved query and it must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * /// organizations/organization_number/savedQueries/saved_query_id /// </param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets details about a saved query.</summary> public class GetRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.SavedQuery> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary> /// Required. The name of the saved query and it must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id /// * organizations/organization_number/savedQueries/saved_query_id /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "get"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Get parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/savedQueries/[^/]+$", }); } } /// <summary>Lists all saved queries in a parent project/folder/organization.</summary> /// <param name="parent"> /// Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be using /// project/folder/organization number (such as "folders/12345")", or a project ID (such as /// "projects/my-project-id"). /// </param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists all saved queries in a parent project/folder/organization.</summary> public class ListRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.ListSavedQueriesResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary> /// Required. The parent project/folder/organization whose savedQueries are to be listed. It can only be /// using project/folder/organization number (such as "folders/12345")", or a project ID (such as /// "projects/my-project-id"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary> /// Optional. The expression to filter resources. The expression is a list of zero or more restrictions /// combined via logical operators `AND` and `OR`. When `AND` and `OR` are both used in the expression, /// parentheses must be appropriately used to group the combinations. The expression may also contain /// regular expressions. See https://google.aip.dev/160 for more information on the grammar. /// </summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary> /// Optional. The maximum number of saved queries to return per page. The service may return fewer than this /// value. If unspecified, at most 50 will be returned. The maximum value is 1000; values above 1000 will be /// coerced to 1000. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary> /// Optional. A page token, received from a previous `ListSavedQueries` call. Provide this to retrieve the /// subsequent page. When paginating, all other parameters provided to `ListSavedQueries` must match the /// call that provided the page token. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "list"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/savedQueries"; /// <summary>Initializes List parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Updates a saved query.</summary> /// <param name="body">The body of the request.</param> /// <param name="name"> /// The resource name of the saved query. The format must be: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * /// organizations/organization_number/savedQueries/saved_query_id /// </param> public virtual PatchRequest Patch(Google.Apis.CloudAsset.v1.Data.SavedQuery body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates a saved query.</summary> public class PatchRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.SavedQuery> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.SavedQuery body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary> /// The resource name of the saved query. The format must be: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id /// * organizations/organization_number/savedQueries/saved_query_id /// </summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Required. The list of fields to update.</summary> [Google.Apis.Util.RequestParameterAttribute("updateMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object UpdateMask { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.SavedQuery Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "patch"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PATCH"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Patch parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("name", new Google.Apis.Discovery.Parameter { Name = "name", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+/savedQueries/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>The "v1" collection of methods.</summary> public class V1Resource { private const string Resource = "v1"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public V1Resource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Analyzes IAM policies to answer which identities have what accesses on which resources.</summary> /// <param name="scope"> /// Required. The relative name of the root asset. Only resources and IAM policies within the scope will be /// analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such as /// "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"). To know how to get organization id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). /// To know how to get folder or project id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). /// </param> public virtual AnalyzeIamPolicyRequest AnalyzeIamPolicy(string scope) { return new AnalyzeIamPolicyRequest(service, scope); } /// <summary>Analyzes IAM policies to answer which identities have what accesses on which resources.</summary> public class AnalyzeIamPolicyRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.AnalyzeIamPolicyResponse> { /// <summary>Constructs a new AnalyzeIamPolicy request.</summary> public AnalyzeIamPolicyRequest(Google.Apis.Services.IClientService service, string scope) : base(service) { Scope = scope; InitParameters(); } /// <summary> /// Required. The relative name of the root asset. Only resources and IAM policies within the scope will be /// analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such /// as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"). To know how to get organization id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). /// To know how to get folder or project id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). /// </summary> [Google.Apis.Util.RequestParameterAttribute("scope", Google.Apis.Util.RequestParameterType.Path)] public virtual string Scope { get; private set; } /// <summary>Optional. The permissions to appear in result.</summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.accessSelector.permissions", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AnalysisQueryAccessSelectorPermissions { get; set; } /// <summary>Optional. The roles to appear in result.</summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.accessSelector.roles", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AnalysisQueryAccessSelectorRoles { get; set; } /// <summary> /// The hypothetical access timestamp to evaluate IAM conditions. Note that this value must not be earlier /// than the current time; otherwise, an INVALID_ARGUMENT error will be returned. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.conditionContext.accessTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object AnalysisQueryConditionContextAccessTime { get; set; } /// <summary> /// Required. The identity appear in the form of principals in [IAM policy /// binding](https://cloud.google.com/iam/reference/rest/v1/Binding). The examples of supported forms are: /// "user:mike@example.com", "group:admins@example.com", "domain:google.com", /// "serviceAccount:my-project-id@appspot.gserviceaccount.com". Notice that wildcard characters (such as * /// and ?) are not supported. You must give a specific identity. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.identitySelector.identity", Google.Apis.Util.RequestParameterType.Query)] public virtual string AnalysisQueryIdentitySelectorIdentity { get; set; } /// <summary> /// Optional. If true, the response will include access analysis from identities to resources via service /// account impersonation. This is a very expensive operation, because many derived queries will be /// executed. We highly recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, /// if the request analyzes for which resources user A has permission P, and there's an IAM policy states /// user A has iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another /// IAM policy states service account SA has permission P to a GCP folder F, then user A potentially has /// access to the GCP folder F. And those advanced analysis results will be included in /// AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request /// analyzes for who has permission P to a GCP folder F, and there's an IAM policy states user A has /// iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states /// service account SA has permission P to the GCP folder F, then user A potentially has access to the GCP /// folder F. And those advanced analysis results will be included in /// AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.analyzeServiceAccountImpersonation", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsAnalyzeServiceAccountImpersonation { get; set; } /// <summary> /// Optional. If true, the identities section of the result will expand any Google groups appearing in an /// IAM policy binding. If IamPolicyAnalysisQuery.identity_selector is specified, the identity in the result /// will be determined by the selector, and this flag is not allowed to set. Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.expandGroups", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsExpandGroups { get; set; } /// <summary> /// Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of /// the result will expand any resource attached to an IAM policy to include resources lower in the resource /// hierarchy. For example, if the request analyzes for which resources user A has permission P, and the /// results include an IAM policy with P on a GCP folder, the results will also include resources in that /// folder with permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the /// resource section of the result will expand the specified resource to include resources lower in the /// resource hierarchy. Only project or lower resources are supported. Folder and organization resource /// cannot be used together with this option. For example, if the request analyzes for which users have /// permission P on a GCP project with this option enabled, the results will include all users who have /// permission P on that project or any lower resource. Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.expandResources", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsExpandResources { get; set; } /// <summary> /// Optional. If true, the access section of result will expand any roles appearing in IAM policy bindings /// to include their permissions. If IamPolicyAnalysisQuery.access_selector is specified, the access section /// of the result will be determined by the selector, and this flag is not allowed to set. Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.expandRoles", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsExpandRoles { get; set; } /// <summary> /// Optional. If true, the result will output the relevant membership relationships between groups and other /// groups, and between groups and principals. Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.outputGroupEdges", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsOutputGroupEdges { get; set; } /// <summary> /// Optional. If true, the result will output the relevant parent/child relationships between resources. /// Default is false. /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.options.outputResourceEdges", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<bool> AnalysisQueryOptionsOutputResourceEdges { get; set; } /// <summary> /// Required. The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) /// of a resource of [supported resource /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). /// </summary> [Google.Apis.Util.RequestParameterAttribute("analysisQuery.resourceSelector.fullResourceName", Google.Apis.Util.RequestParameterType.Query)] public virtual string AnalysisQueryResourceSelectorFullResourceName { get; set; } /// <summary> /// Optional. Amount of time executable has to complete. See JSON representation of /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json). If this field is set with a /// value less than the RPC deadline, and the execution of your query hasn't finished in the specified /// execution timeout, you will get a response with partial result. Otherwise, your query's execution will /// continue until the RPC deadline. If it's not finished until then, you will get a DEADLINE_EXCEEDED /// error. Default is empty. /// </summary> [Google.Apis.Util.RequestParameterAttribute("executionTimeout", Google.Apis.Util.RequestParameterType.Query)] public virtual object ExecutionTimeout { get; set; } /// <summary> /// Optional. The name of a saved query, which must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id /// * organizations/organization_number/savedQueries/saved_query_id If both `analysis_query` and /// `saved_analysis_query` are provided, they will be merged together with the `saved_analysis_query` as /// base and the `analysis_query` as overrides. For more details of the merge behavior, please refer to the /// [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) /// page. Note that you cannot override primitive fields with default value, such as 0 or empty string, /// etc., because we use proto3, which doesn't support field presence yet. /// </summary> [Google.Apis.Util.RequestParameterAttribute("savedAnalysisQuery", Google.Apis.Util.RequestParameterType.Query)] public virtual string SavedAnalysisQuery { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "analyzeIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+scope}:analyzeIamPolicy"; /// <summary>Initializes AnalyzeIamPolicy parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("scope", new Google.Apis.Discovery.Parameter { Name = "scope", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("analysisQuery.accessSelector.permissions", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.accessSelector.permissions", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.accessSelector.roles", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.accessSelector.roles", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.conditionContext.accessTime", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.conditionContext.accessTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.identitySelector.identity", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.identitySelector.identity", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.analyzeServiceAccountImpersonation", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.analyzeServiceAccountImpersonation", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.expandGroups", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.expandGroups", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.expandResources", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.expandResources", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.expandRoles", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.expandRoles", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.outputGroupEdges", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.outputGroupEdges", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.options.outputResourceEdges", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.options.outputResourceEdges", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("analysisQuery.resourceSelector.fullResourceName", new Google.Apis.Discovery.Parameter { Name = "analysisQuery.resourceSelector.fullResourceName", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("executionTimeout", new Google.Apis.Discovery.Parameter { Name = "executionTimeout", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("savedAnalysisQuery", new Google.Apis.Discovery.Parameter { Name = "savedAnalysisQuery", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary> /// Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and /// writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage /// destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse. This method /// implements the google.longrunning.Operation, which allows you to track the operation status. We recommend /// intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata /// contains the metadata for the long-running operation. /// </summary> /// <param name="body">The body of the request.</param> /// <param name="scope"> /// Required. The relative name of the root asset. Only resources and IAM policies within the scope will be /// analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such as /// "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"). To know how to get organization id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). /// To know how to get folder or project id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). /// </param> public virtual AnalyzeIamPolicyLongrunningRequest AnalyzeIamPolicyLongrunning(Google.Apis.CloudAsset.v1.Data.AnalyzeIamPolicyLongrunningRequest body, string scope) { return new AnalyzeIamPolicyLongrunningRequest(service, body, scope); } /// <summary> /// Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and /// writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage /// destination, the output format is the JSON format that represents a AnalyzeIamPolicyResponse. This method /// implements the google.longrunning.Operation, which allows you to track the operation status. We recommend /// intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata /// contains the metadata for the long-running operation. /// </summary> public class AnalyzeIamPolicyLongrunningRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Operation> { /// <summary>Constructs a new AnalyzeIamPolicyLongrunning request.</summary> public AnalyzeIamPolicyLongrunningRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.AnalyzeIamPolicyLongrunningRequest body, string scope) : base(service) { Scope = scope; Body = body; InitParameters(); } /// <summary> /// Required. The relative name of the root asset. Only resources and IAM policies within the scope will be /// analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such /// as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"). To know how to get organization id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). /// To know how to get folder or project id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). /// </summary> [Google.Apis.Util.RequestParameterAttribute("scope", Google.Apis.Util.RequestParameterType.Path)] public virtual string Scope { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.AnalyzeIamPolicyLongrunningRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "analyzeIamPolicyLongrunning"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+scope}:analyzeIamPolicyLongrunning"; /// <summary>Initializes AnalyzeIamPolicyLongrunning parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("scope", new Google.Apis.Discovery.Parameter { Name = "scope", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); } } /// <summary> /// Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is /// best effort depending on the user's permissions of viewing different hierarchical policies and /// configurations. The policies and configuration are subject to change before the actual resource migration /// takes place. /// </summary> /// <param name="resource"> /// Required. Name of the resource to perform the analysis against. Only GCP Project are supported as of today. /// Hence, this can only be Project ID (such as "projects/my-project-id") or a Project Number (such as /// "projects/12345"). /// </param> public virtual AnalyzeMoveRequest AnalyzeMove(string resource) { return new AnalyzeMoveRequest(service, resource); } /// <summary> /// Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is /// best effort depending on the user's permissions of viewing different hierarchical policies and /// configurations. The policies and configuration are subject to change before the actual resource migration /// takes place. /// </summary> public class AnalyzeMoveRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.AnalyzeMoveResponse> { /// <summary>Constructs a new AnalyzeMove request.</summary> public AnalyzeMoveRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary> /// Required. Name of the resource to perform the analysis against. Only GCP Project are supported as of /// today. Hence, this can only be Project ID (such as "projects/my-project-id") or a Project Number (such /// as "projects/12345"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary> /// Required. Name of the GCP Folder or Organization to reparent the target resource. The analysis will be /// performed against hypothetically moving the resource to this specified desitination parent. This can /// only be a Folder number (such as "folders/123") or an Organization number (such as "organizations/123"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("destinationParent", Google.Apis.Util.RequestParameterType.Query)] public virtual string DestinationParent { get; set; } /// <summary> /// Analysis view indicating what information should be included in the analysis response. If unspecified, /// the default view is FULL. /// </summary> [Google.Apis.Util.RequestParameterAttribute("view", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<ViewEnum> View { get; set; } /// <summary> /// Analysis view indicating what information should be included in the analysis response. If unspecified, /// the default view is FULL. /// </summary> public enum ViewEnum { /// <summary>The default/unset value. The API will default to the FULL view.</summary> [Google.Apis.Util.StringValueAttribute("ANALYSIS_VIEW_UNSPECIFIED")] ANALYSISVIEWUNSPECIFIED = 0, /// <summary>Full analysis including all level of impacts of the specified resource move.</summary> [Google.Apis.Util.StringValueAttribute("FULL")] FULL = 1, /// <summary> /// Basic analysis only including blockers which will prevent the specified resource move at runtime. /// </summary> [Google.Apis.Util.StringValueAttribute("BASIC")] BASIC = 2, } /// <summary>Gets the method name.</summary> public override string MethodName => "analyzeMove"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:analyzeMove"; /// <summary>Initializes AnalyzeMove parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("resource", new Google.Apis.Discovery.Parameter { Name = "resource", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("destinationParent", new Google.Apis.Discovery.Parameter { Name = "destinationParent", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("view", new Google.Apis.Discovery.Parameter { Name = "view", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary> /// Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs /// history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. /// Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset /// does not exist, this API returns an INVALID_ARGUMENT error. /// </summary> /// <param name="parent"> /// Required. The relative name of the root asset. It can only be an organization number (such as /// "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as /// "projects/12345"). /// </param> public virtual BatchGetAssetsHistoryRequest BatchGetAssetsHistory(string parent) { return new BatchGetAssetsHistoryRequest(service, parent); } /// <summary> /// Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs /// history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. /// Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset /// does not exist, this API returns an INVALID_ARGUMENT error. /// </summary> public class BatchGetAssetsHistoryRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.BatchGetAssetsHistoryResponse> { /// <summary>Constructs a new BatchGetAssetsHistory request.</summary> public BatchGetAssetsHistoryRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary> /// Required. The relative name of the root asset. It can only be an organization number (such as /// "organizations/123"), a project ID (such as "projects/my-project-id")", or a project number (such as /// "projects/12345"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary> /// A list of the full names of the assets. See: /// https://cloud.google.com/asset-inventory/docs/resource-name-format Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. The request becomes /// a no-op if the asset name list is empty, and the max size of the asset name list is 100 in one request. /// </summary> [Google.Apis.Util.RequestParameterAttribute("assetNames", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AssetNames { get; set; } /// <summary>Optional. The content type.</summary> [Google.Apis.Util.RequestParameterAttribute("contentType", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<ContentTypeEnum> ContentType { get; set; } /// <summary>Optional. The content type.</summary> public enum ContentTypeEnum { /// <summary>Unspecified content type.</summary> [Google.Apis.Util.StringValueAttribute("CONTENT_TYPE_UNSPECIFIED")] CONTENTTYPEUNSPECIFIED = 0, /// <summary>Resource metadata.</summary> [Google.Apis.Util.StringValueAttribute("RESOURCE")] RESOURCE = 1, /// <summary>The actual IAM policy set on a resource.</summary> [Google.Apis.Util.StringValueAttribute("IAM_POLICY")] IAMPOLICY = 2, /// <summary>The Cloud Organization Policy set on an asset.</summary> [Google.Apis.Util.StringValueAttribute("ORG_POLICY")] ORGPOLICY = 3, /// <summary>The Cloud Access context manager Policy set on an asset.</summary> [Google.Apis.Util.StringValueAttribute("ACCESS_POLICY")] ACCESSPOLICY = 4, /// <summary>The runtime OS Inventory information.</summary> [Google.Apis.Util.StringValueAttribute("OS_INVENTORY")] OSINVENTORY = 5, /// <summary>The related resources.</summary> [Google.Apis.Util.StringValueAttribute("RELATIONSHIP")] RELATIONSHIP = 6, } /// <summary> /// End time of the time window (inclusive). If not specified, the current timestamp is used instead. /// </summary> [Google.Apis.Util.RequestParameterAttribute("readTimeWindow.endTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object ReadTimeWindowEndTime { get; set; } /// <summary>Start time of the time window (exclusive).</summary> [Google.Apis.Util.RequestParameterAttribute("readTimeWindow.startTime", Google.Apis.Util.RequestParameterType.Query)] public virtual object ReadTimeWindowStartTime { get; set; } /// <summary> /// Optional. A list of relationship types to output, for example: `INSTANCE_TO_INSTANCEGROUP`. This field /// should only be specified if content_type=RELATIONSHIP. * If specified: it outputs specified /// relationships' history on the [asset_names]. It returns an error if any of the [relationship_types] /// doesn't belong to the supported relationship types of the [asset_names] or if any of the [asset_names]'s /// types doesn't belong to the source types of the [relationship_types]. * Otherwise: it outputs the /// supported relationships' history on the [asset_names] or returns an error if any of the [asset_names]'s /// types has no relationship support. See [Introduction to Cloud Asset /// Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all supported asset types and /// relationship types. /// </summary> [Google.Apis.Util.RequestParameterAttribute("relationshipTypes", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> RelationshipTypes { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "batchGetAssetsHistory"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}:batchGetAssetsHistory"; /// <summary>Initializes BatchGetAssetsHistory parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("assetNames", new Google.Apis.Discovery.Parameter { Name = "assetNames", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("contentType", new Google.Apis.Discovery.Parameter { Name = "contentType", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("readTimeWindow.endTime", new Google.Apis.Discovery.Parameter { Name = "readTimeWindow.endTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("readTimeWindow.startTime", new Google.Apis.Discovery.Parameter { Name = "readTimeWindow.startTime", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("relationshipTypes", new Google.Apis.Discovery.Parameter { Name = "relationshipTypes", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary> /// Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud /// Storage location destinations, the output format is newline-delimited JSON. Each line represents a /// google.cloud.asset.v1.Asset in the JSON format; for BigQuery table destinations, the output table stores the /// fields in asset Protobuf as columns. This API implements the google.longrunning.Operation API, which allows /// you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll /// the export operation result. For regular-size resource parent, the export operation usually finishes within /// 5 minutes. /// </summary> /// <param name="body">The body of the request.</param> /// <param name="parent"> /// Required. The relative name of the root asset. This can only be an organization number (such as /// "organizations/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"), or a folder number (such as "folders/123"). /// </param> public virtual ExportAssetsRequest ExportAssets(Google.Apis.CloudAsset.v1.Data.ExportAssetsRequest body, string parent) { return new ExportAssetsRequest(service, body, parent); } /// <summary> /// Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud /// Storage location destinations, the output format is newline-delimited JSON. Each line represents a /// google.cloud.asset.v1.Asset in the JSON format; for BigQuery table destinations, the output table stores the /// fields in asset Protobuf as columns. This API implements the google.longrunning.Operation API, which allows /// you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll /// the export operation result. For regular-size resource parent, the export operation usually finishes within /// 5 minutes. /// </summary> public class ExportAssetsRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.Operation> { /// <summary>Constructs a new ExportAssets request.</summary> public ExportAssetsRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudAsset.v1.Data.ExportAssetsRequest body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary> /// Required. The relative name of the root asset. This can only be an organization number (such as /// "organizations/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"), or a folder number (such as "folders/123"). /// </summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudAsset.v1.Data.ExportAssetsRequest Body { get; set; } /// <summary>Returns the body of the request.</summary> protected override object GetBody() => Body; /// <summary>Gets the method name.</summary> public override string MethodName => "exportAssets"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}:exportAssets"; /// <summary>Initializes ExportAssets parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("parent", new Google.Apis.Discovery.Parameter { Name = "parent", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); } } /// <summary> /// Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller /// must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the /// request will be rejected. /// </summary> /// <param name="scope"> /// Required. A scope can be a project, a folder, or an organization. The search is limited to the IAM policies /// within the `scope`. The caller must be granted the /// [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) /// permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") /// * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") /// * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") /// </param> public virtual SearchAllIamPoliciesRequest SearchAllIamPolicies(string scope) { return new SearchAllIamPoliciesRequest(service, scope); } /// <summary> /// Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller /// must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the /// request will be rejected. /// </summary> public class SearchAllIamPoliciesRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.SearchAllIamPoliciesResponse> { /// <summary>Constructs a new SearchAllIamPolicies request.</summary> public SearchAllIamPoliciesRequest(Google.Apis.Services.IClientService service, string scope) : base(service) { Scope = scope; InitParameters(); } /// <summary> /// Required. A scope can be a project, a folder, or an organization. The search is limited to the IAM /// policies within the `scope`. The caller must be granted the /// [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) /// permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., /// "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} /// (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") /// </summary> [Google.Apis.Util.RequestParameterAttribute("scope", Google.Apis.Util.RequestParameterType.Path)] public virtual string Scope { get; private set; } /// <summary> /// Optional. A list of asset types that the IAM policies are attached to. If empty, it will search the IAM /// policies that are attached to all the [searchable asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). /// Regular expressions are also supported. For example: * "compute.googleapis.com.*" snapshots IAM policies /// attached to asset type starts with "compute.googleapis.com". * ".*Instance" snapshots IAM policies /// attached to asset type ends with "Instance". * ".*Instance.*" snapshots IAM policies attached to asset /// type contains "Instance". See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular /// expression syntax. If the regular expression does not match any supported asset type, an /// INVALID_ARGUMENT error will be returned. /// </summary> [Google.Apis.Util.RequestParameterAttribute("assetTypes", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AssetTypes { get; set; } /// <summary> /// Optional. A comma-separated list of fields specifying the sorting order of the results. The default /// order is ascending. Add " DESC" after the field name to indicate descending order. Redundant space /// characters are ignored. Example: "assetType DESC, resource". Only singular primitive fields in the /// response are sortable: * resource * assetType * project All the other fields such as repeated fields /// (e.g., `folders`) and non-primitive fields (e.g., `policy`) are not supported. /// </summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary> /// Optional. The page size for search result pagination. Page size is capped at 500 even if a larger value /// is given. If set to zero, server will pick an appropriate default. Returned results may be fewer than /// requested. When this happens, there could be more results as long as `next_page_token` is returned. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary> /// Optional. If present, retrieve the next batch of results from the preceding call to this method. /// `page_token` must be the value of `next_page_token` from the previous response. The values of all other /// method parameters must be identical to those in the previous call. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary> /// Optional. The query statement. See [how to construct a /// query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) /// for more information. If not specified or empty, it will search all the IAM policies within the /// specified `scope`. Note that the query string is compared against each Cloud IAM policy binding, /// including its principals, roles, and Cloud IAM conditions. The returned Cloud IAM policies will only /// contain the bindings that match your query. To learn more about the IAM policy structure, see [IAM /// policy doc](https://cloud.google.com/iam/docs/policies#structure). Examples: * `policy:amy@gmail.com` to /// find IAM policy bindings that specify user "amy@gmail.com". * `policy:roles/compute.admin` to find IAM /// policy bindings that specify the Compute Admin role. * `policy:comp*` to find IAM policy bindings that /// contain "comp" as a prefix of any word in the binding. * /// `policy.role.permissions:storage.buckets.update` to find IAM policy bindings that specify a role /// containing "storage.buckets.update" permission. Note that if callers don't have `iam.roles.get` access /// to a role's included permissions, policy bindings that specify this role will be dropped from the search /// results. * `policy.role.permissions:upd*` to find IAM policy bindings that specify a role containing /// "upd" as a prefix of any word in the role permission. Note that if callers don't have `iam.roles.get` /// access to a role's included permissions, policy bindings that specify this role will be dropped from the /// search results. * `resource:organizations/123456` to find IAM policy bindings that are set on /// "organizations/123456". * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to find /// IAM policy bindings that are set on the project named "myproject". * `Important` to find IAM policy /// bindings that contain "Important" as a word in any of the searchable fields (except for the included /// permissions). * `resource:(instance1 OR instance2) policy:amy` to find IAM policy bindings that are set /// on resources "instance1" or "instance2" and also specify user "amy". * `roles:roles/compute.admin` to /// find IAM policy bindings that specify the Compute Admin role. * `memberTypes:user` to find IAM policy /// bindings that contain the principal type "user". /// </summary> [Google.Apis.Util.RequestParameterAttribute("query", Google.Apis.Util.RequestParameterType.Query)] public virtual string Query { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchAllIamPolicies"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+scope}:searchAllIamPolicies"; /// <summary>Initializes SearchAllIamPolicies parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("scope", new Google.Apis.Discovery.Parameter { Name = "scope", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("assetTypes", new Google.Apis.Discovery.Parameter { Name = "assetTypes", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("query", new Google.Apis.Discovery.Parameter { Name = "query", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary> /// Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The /// caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise /// the request will be rejected. /// </summary> /// <param name="scope"> /// Required. A scope can be a project, a folder, or an organization. The search is limited to the resources /// within the `scope`. The caller must be granted the /// [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) /// permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") /// * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") /// * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") /// </param> public virtual SearchAllResourcesRequest SearchAllResources(string scope) { return new SearchAllResourcesRequest(service, scope); } /// <summary> /// Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The /// caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise /// the request will be rejected. /// </summary> public class SearchAllResourcesRequest : CloudAssetBaseServiceRequest<Google.Apis.CloudAsset.v1.Data.SearchAllResourcesResponse> { /// <summary>Constructs a new SearchAllResources request.</summary> public SearchAllResourcesRequest(Google.Apis.Services.IClientService service, string scope) : base(service) { Scope = scope; InitParameters(); } /// <summary> /// Required. A scope can be a project, a folder, or an organization. The search is limited to the resources /// within the `scope`. The caller must be granted the /// [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) /// permission on the desired scope. The allowed values are: * projects/{PROJECT_ID} (e.g., /// "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} /// (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") /// </summary> [Google.Apis.Util.RequestParameterAttribute("scope", Google.Apis.Util.RequestParameterType.Path)] public virtual string Scope { get; private set; } /// <summary> /// Optional. A list of asset types that this request searches for. If empty, it will search all the /// [searchable asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). /// Regular expressions are also supported. For example: * "compute.googleapis.com.*" snapshots resources /// whose asset type starts with "compute.googleapis.com". * ".*Instance" snapshots resources whose asset /// type ends with "Instance". * ".*Instance.*" snapshots resources whose asset type contains "Instance". /// See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the /// regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. /// </summary> [Google.Apis.Util.RequestParameterAttribute("assetTypes", Google.Apis.Util.RequestParameterType.Query)] public virtual Google.Apis.Util.Repeatable<string> AssetTypes { get; set; } /// <summary> /// Optional. A comma-separated list of fields specifying the sorting order of the results. The default /// order is ascending. Add " DESC" after the field name to indicate descending order. Redundant space /// characters are ignored. Example: "location DESC, name". Only singular primitive fields in the response /// are sortable: * name * assetType * project * displayName * description * location * kmsKey * createTime /// * updateTime * state * parentFullResourceName * parentAssetType All the other fields such as repeated /// fields (e.g., `networkTags`), map fields (e.g., `labels`) and struct fields (e.g., /// `additionalAttributes`) are not supported. /// </summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary> /// Optional. The page size for search result pagination. Page size is capped at 500 even if a larger value /// is given. If set to zero, server will pick an appropriate default. Returned results may be fewer than /// requested. When this happens, there could be more results as long as `next_page_token` is returned. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary> /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. /// `page_token` must be the value of `next_page_token` from the previous response. The values of all other /// method parameters, must be identical to those in the previous call. /// </summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary> /// Optional. The query statement. See [how to construct a /// query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) for /// more information. If not specified or empty, it will search all the resources within the specified /// `scope`. Examples: * `name:Important` to find Cloud resources whose name contains "Important" as a word. /// * `name=Important` to find the Cloud resource whose name is exactly "Important". * `displayName:Impor*` /// to find Cloud resources whose display name contains "Impor" as a prefix of any word in the field. * /// `location:us-west*` to find Cloud resources whose location contains both "us" and "west" as prefixes. * /// `labels:prod` to find Cloud resources whose labels contain "prod" as a key or value. * `labels.env:prod` /// to find Cloud resources that have a label "env" and its value is "prod". * `labels.env:*` to find Cloud /// resources that have a label "env". * `kmsKey:key` to find Cloud resources encrypted with a /// customer-managed encryption key whose name contains the word "key". * `state:ACTIVE` to find Cloud /// resources whose state contains "ACTIVE" as a word. * `NOT state:ACTIVE` to find Cloud resources whose /// state doesn't contain "ACTIVE" as a word. * `createTime&amp;lt;1609459200` to find Cloud resources that /// were created before "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00 /// UTC" in seconds. * `updateTime&amp;gt;1609459200` to find Cloud resources that were updated after /// "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of "2021-01-01 00:00:00 UTC" in seconds. * /// `Important` to find Cloud resources that contain "Important" as a word in any of the searchable fields. /// * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any word in any of the searchable /// fields. * `Important location:(us-west1 OR global)` to find Cloud resources that contain "Important" as /// a word in any of the searchable fields and are also located in the "us-west1" region or the "global" /// location. /// </summary> [Google.Apis.Util.RequestParameterAttribute("query", Google.Apis.Util.RequestParameterType.Query)] public virtual string Query { get; set; } /// <summary> /// Optional. A comma-separated list of fields specifying which fields to be returned in /// ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both /// snake_case and camelCase are supported. Examples: `"*"`, `"name,location"`, `"name,versionedResources"`. /// The read_mask paths must be valid field paths listed but not limited to (both snake_case and camelCase /// are supported): * name * assetType * project * displayName * description * location * labels * /// networkTags * kmsKey * createTime * updateTime * state * additionalAttributes * versionedResources If /// read_mask is not specified, all fields except versionedResources will be returned. If only '*' is /// specified, all fields including versionedResources will be returned. Any invalid field path will trigger /// INVALID_ARGUMENT error. /// </summary> [Google.Apis.Util.RequestParameterAttribute("readMask", Google.Apis.Util.RequestParameterType.Query)] public virtual object ReadMask { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchAllResources"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+scope}:searchAllResources"; /// <summary>Initializes SearchAllResources parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("scope", new Google.Apis.Discovery.Parameter { Name = "scope", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+/[^/]+$", }); RequestParameters.Add("assetTypes", new Google.Apis.Discovery.Parameter { Name = "assetTypes", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("orderBy", new Google.Apis.Discovery.Parameter { Name = "orderBy", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageSize", new Google.Apis.Discovery.Parameter { Name = "pageSize", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("pageToken", new Google.Apis.Discovery.Parameter { Name = "pageToken", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("query", new Google.Apis.Discovery.Parameter { Name = "query", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("readMask", new Google.Apis.Discovery.Parameter { Name = "readMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } } namespace Google.Apis.CloudAsset.v1.Data { /// <summary> /// Specifies roles and/or permissions to analyze, to determine both the identities possessing them and the /// resources they control. If multiple values are specified, results will include roles or permissions matching any /// of them. The total number of roles and permissions should be equal or less than 10. /// </summary> public class AccessSelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Optional. The permissions to appear in result.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>Optional. The roles to appear in result.</summary> [Newtonsoft.Json.JsonPropertyAttribute("roles")] public virtual System.Collections.Generic.IList<string> Roles { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents the metadata of the longrunning operation for the AnalyzeIamPolicyLongrunning rpc.</summary> public class AnalyzeIamPolicyLongrunningMetadata : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The time the operation was created.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A request message for AssetService.AnalyzeIamPolicyLongrunning.</summary> public class AnalyzeIamPolicyLongrunningRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Required. The request query.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisQuery")] public virtual IamPolicyAnalysisQuery AnalysisQuery { get; set; } /// <summary>Required. Output configuration indicating where the results will be output to.</summary> [Newtonsoft.Json.JsonPropertyAttribute("outputConfig")] public virtual IamPolicyAnalysisOutputConfig OutputConfig { get; set; } /// <summary> /// Optional. The name of a saved query, which must be in the format of: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * /// organizations/organization_number/savedQueries/saved_query_id If both `analysis_query` and /// `saved_analysis_query` are provided, they will be merged together with the `saved_analysis_query` as base /// and the `analysis_query` as overrides. For more details of the merge behavior, please refer to the /// [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) /// doc. Note that you cannot override primitive fields with default value, such as 0 or empty string, etc., /// because we use proto3, which doesn't support field presence yet. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("savedAnalysisQuery")] public virtual string SavedAnalysisQuery { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A response message for AssetService.AnalyzeIamPolicyLongrunning.</summary> public class AnalyzeIamPolicyLongrunningResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A response message for AssetService.AnalyzeIamPolicy.</summary> public class AnalyzeIamPolicyResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Represents whether all entries in the main_analysis and service_account_impersonation_analysis have been /// fully explored to answer the query in the request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("fullyExplored")] public virtual System.Nullable<bool> FullyExplored { get; set; } /// <summary>The main analysis that matches the original request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("mainAnalysis")] public virtual IamPolicyAnalysis MainAnalysis { get; set; } /// <summary> /// The service account impersonation analysis if AnalyzeIamPolicyRequest.analyze_service_account_impersonation /// is enabled. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("serviceAccountImpersonationAnalysis")] public virtual System.Collections.Generic.IList<IamPolicyAnalysis> ServiceAccountImpersonationAnalysis { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The response message for resource move analysis.</summary> public class AnalyzeMoveResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The list of analyses returned from performing the intended resource move analysis. The analysis is grouped /// by different Cloud services. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("moveAnalysis")] public virtual System.Collections.Generic.IList<MoveAnalysis> MoveAnalysis { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside /// the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. /// Cloud IAM policy), or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship). See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> public class Asset : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Please also refer to the [access level user /// guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessLevel")] public virtual GoogleIdentityAccesscontextmanagerV1AccessLevel AccessLevel { get; set; } /// <summary> /// Please also refer to the [access policy user /// guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessPolicy")] public virtual GoogleIdentityAccesscontextmanagerV1AccessPolicy AccessPolicy { get; set; } /// <summary> /// The ancestry path of an asset in Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as /// a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and /// ends at root. If the asset is a project, folder, or organization, the ancestry path starts from the asset /// itself. Example: `["projects/123456789", "folders/5432", "organizations/1234"]` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ancestors")] public virtual System.Collections.Generic.IList<string> Ancestors { get; set; } /// <summary> /// The type of the asset. Example: `compute.googleapis.com/Disk` See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud /// IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope /// from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is /// the union of both the policy set on this resource and each policy set on all of the resource's ancestry /// resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/docs/policies#inheritance) /// for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("iamPolicy")] public virtual Policy IamPolicy { get; set; } /// <summary> /// The full name of the asset. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource /// names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// A representation of an [organization /// policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). /// There can be more than one organization policy with different constraints set on a given resource. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("orgPolicy")] public virtual System.Collections.Generic.IList<GoogleCloudOrgpolicyV1Policy> OrgPolicy { get; set; } /// <summary> /// A representation of runtime OS Inventory information. See [this /// topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("osInventory")] public virtual Inventory OsInventory { get; set; } /// <summary> /// The related assets of the asset of one relationship type. One asset only represents one type of /// relationship. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("relatedAssets")] public virtual RelatedAssets RelatedAssets { get; set; } /// <summary>A representation of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resource")] public virtual Resource Resource { get; set; } /// <summary> /// Please also refer to the [service perimeter user /// guide](https://cloud.google.com/vpc-service-controls/docs/overview). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("servicePerimeter")] public virtual GoogleIdentityAccesscontextmanagerV1ServicePerimeter ServicePerimeter { get; set; } /// <summary> /// The last update timestamp of an asset. update_time is updated when create/update/delete operation is /// performed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Attached resource representation, which is defined by the corresponding service provider. It represents an /// attached resource's payload. /// </summary> public class AttachedResource : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The type of this attached resource. Example: `osconfig.googleapis.com/Inventory` You can find the supported /// attached asset types of each resource in this table: /// `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// Versioned resource representations of this attached resource. This is repeated because there could be /// multiple versions of the attached resource representations during version migration. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("versionedResources")] public virtual System.Collections.Generic.IList<VersionedResource> VersionedResources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Specifies the audit configuration for a service. The configuration determines which permission types are logged, /// and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If /// there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used /// for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each /// AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": /// "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] /// }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", /// "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ /// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ /// logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging. /// </summary> public class AuditConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The configuration for logging of each type of permission.</summary> [Newtonsoft.Json.JsonPropertyAttribute("auditLogConfigs")] public virtual System.Collections.Generic.IList<AuditLogConfig> AuditLogConfigs { get; set; } /// <summary> /// Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, /// `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("service")] public virtual string Service { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": /// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables /// 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging. /// </summary> public class AuditLogConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of /// Binding.members. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("exemptedMembers")] public virtual System.Collections.Generic.IList<string> ExemptedMembers { get; set; } /// <summary>The log type that this config enables.</summary> [Newtonsoft.Json.JsonPropertyAttribute("logType")] public virtual string LogType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Batch get assets history response.</summary> public class BatchGetAssetsHistoryResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A list of assets with valid time windows.</summary> [Newtonsoft.Json.JsonPropertyAttribute("assets")] public virtual System.Collections.Generic.IList<TemporalAsset> Assets { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A BigQuery destination for exporting assets to.</summary> public class BigQueryDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", to which the snapshot /// result should be exported. If this dataset does not exist, the export call returns an INVALID_ARGUMENT /// error. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("dataset")] public virtual string Dataset { get; set; } /// <summary> /// If the destination table already exists and this flag is `TRUE`, the table will be overwritten by the /// contents of assets snapshot. If the flag is `FALSE` or unset and the destination table already exists, the /// export call returns an INVALID_ARGUMEMT error. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("force")] public virtual System.Nullable<bool> Force { get; set; } /// <summary> /// [partition_spec] determines whether to export to partitioned table(s) and how to partition the data. If /// [partition_spec] is unset or [partition_spec.partition_key] is unset or `PARTITION_KEY_UNSPECIFIED`, the /// snapshot results will be exported to non-partitioned table(s). [force] will decide whether to overwrite /// existing table(s). If [partition_spec] is specified. First, the snapshot results will be written to /// partitioned table(s) with two additional timestamp columns, readTime and requestTime, one of which will be /// the partition key. Secondly, in the case when any destination table already exists, it will first try to /// update existing table's schema as necessary by appending additional columns. Then, if [force] is `TRUE`, the /// corresponding partition will be overwritten by the snapshot results (data in different partitions will /// remain intact); if [force] is unset or `FALSE`, it will append the data. An error will be returned if the /// schema update or data appension fails. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("partitionSpec")] public virtual PartitionSpec PartitionSpec { get; set; } /// <summary> /// If this flag is `TRUE`, the snapshot results will be written to one or multiple tables, each of which /// contains results of one asset type. The [force] and [partition_spec] fields will apply to each of them. /// Field [table] will be concatenated with "_" and the asset type names (see /// https://cloud.google.com/asset-inventory/docs/supported-asset-types for supported asset types) to construct /// per-asset-type table names, in which all non-alphanumeric characters like "." and "/" will be substituted by /// "_". Example: if field [table] is "mytable" and snapshot results contain "storage.googleapis.com/Bucket" /// assets, the corresponding table name will be "mytable_storage_googleapis_com_Bucket". If any of these tables /// does not exist, a new table with the concatenated name will be created. When [content_type] in the /// ExportAssetsRequest is `RESOURCE`, the schema of each table will include RECORD-type columns mapped to the /// nested fields in the Asset.resource.data field of that asset type (up to the 15 nested level BigQuery /// supports (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The fields in &amp;gt;15 /// nested levels will be stored in JSON format string as a child column of its parent RECORD column. If error /// occurs when exporting to any table, the whole export call will return an error but the export results that /// already succeed will persist. Example: if exporting to table_type_A succeeds when exporting to table_type_B /// fails during one export call, the results in table_type_A will persist and there will not be partial results /// persisting in a table. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("separateTablesPerAssetType")] public virtual System.Nullable<bool> SeparateTablesPerAssetType { get; set; } /// <summary> /// Required. The BigQuery table to which the snapshot result should be written. If this table does not exist, a /// new table with the given name will be created. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("table")] public virtual string Table { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Associates `members`, or principals, with a `role`.</summary> public class Binding : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The condition that is associated with this binding. If the condition evaluates to `true`, then this binding /// applies to the current request. If the condition evaluates to `false`, then this binding does not apply to /// the current request. However, a different role binding might grant the same role to one or more of the /// principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM /// documentation](https://cloud.google.com/iam/help/conditions/resource-policies). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("condition")] public virtual Expr Condition { get; set; } /// <summary> /// Specifies the principals requesting access for a Cloud Platform resource. `members` can have the following /// values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a /// Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated /// with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific /// Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that /// represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: /// An email address that represents a Google group. For example, `admins@example.com`. * /// `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that /// has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is /// recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * /// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a /// service account that has been recently deleted. For example, /// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, /// this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the /// binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing /// a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. /// If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role /// in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that /// domain. For example, `google.com` or `example.com`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("members")] public virtual System.Collections.Generic.IList<string> Members { get; set; } /// <summary> /// Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, /// or `roles/owner`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("role")] public virtual string Role { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The IAM conditions context.</summary> public class ConditionContext : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The hypothetical access timestamp to evaluate IAM conditions. Note that this value must not be earlier than /// the current time; otherwise, an INVALID_ARGUMENT error will be returned. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessTime")] public virtual object AccessTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The Condition evaluation.</summary> public class ConditionEvaluation : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The evaluation result.</summary> [Newtonsoft.Json.JsonPropertyAttribute("evaluationValue")] public virtual string EvaluationValue { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Create asset feed request.</summary> public class CreateFeedRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The feed details. The field `name` must be empty and it will be generated in the format of: /// projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id /// organizations/organization_number/feeds/feed_id /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("feed")] public virtual Feed Feed { get; set; } /// <summary> /// Required. This is the client-assigned asset feed identifier and it needs to be unique under a specific /// parent project/folder/organization. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("feedId")] public virtual string FeedId { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either /// specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one /// of the following: * A full date, with non-zero year, month, and day values * A month and day value, with a zero /// year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with /// a zero day, such as a credit card expiration date Related types are google.type.TimeOfDay and /// `google.protobuf.Timestamp`. /// </summary> public class Date : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a /// year and month where the day isn't significant. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("day")] public virtual System.Nullable<int> Day { get; set; } /// <summary>Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.</summary> [Newtonsoft.Json.JsonPropertyAttribute("month")] public virtual System.Nullable<int> Month { get; set; } /// <summary>Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.</summary> [Newtonsoft.Json.JsonPropertyAttribute("year")] public virtual System.Nullable<int> Year { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical /// example is to use it as the request or the response type of an API method. For instance: service Foo { rpc /// Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON /// object `{}`. /// </summary> public class Empty : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Explanation about the IAM policy search result.</summary> public class Explanation : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The map from roles to their included permissions that match the permission query (i.e., a query containing /// `policy.role.permissions:`). Example: if query `policy.role.permissions:compute.disk.get` matches a policy /// binding that contains owner role, the matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. /// The roles can also be found in the returned `policy` bindings. Note that the map is populated only for /// requests with permission queries. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("matchedPermissions")] public virtual System.Collections.Generic.IDictionary<string, Permissions> MatchedPermissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Export asset request.</summary> public class ExportAssetsRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of asset types to take a snapshot for. For example: "compute.googleapis.com/Disk". Regular /// expressions are also supported. For example: * "compute.googleapis.com.*" snapshots resources whose asset /// type starts with "compute.googleapis.com". * ".*Instance" snapshots resources whose asset type ends with /// "Instance". * ".*Instance.*" snapshots resources whose asset type contains "Instance". See /// [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular /// expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. If /// specified, only matching assets will be returned, otherwise, it will snapshot all asset types. See /// [Introduction to Cloud Asset Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all /// supported asset types. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetTypes")] public virtual System.Collections.Generic.IList<string> AssetTypes { get; set; } /// <summary>Asset content type. If not specified, no content but the asset name will be returned.</summary> [Newtonsoft.Json.JsonPropertyAttribute("contentType")] public virtual string ContentType { get; set; } /// <summary>Required. Output configuration indicating where the results will be output to.</summary> [Newtonsoft.Json.JsonPropertyAttribute("outputConfig")] public virtual OutputConfig OutputConfig { get; set; } /// <summary> /// Timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and the /// current time minus 35 days (inclusive). If not specified, the current time will be used. Due to delays in /// resource data collection and indexing, there is a volatile window during which running the same query may /// get different results. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("readTime")] public virtual object ReadTime { get; set; } /// <summary> /// A list of relationship types to export, for example: `INSTANCE_TO_INSTANCEGROUP`. This field should only be /// specified if content_type=RELATIONSHIP. * If specified: it snapshots specified relationships. It returns an /// error if any of the [relationship_types] doesn't belong to the supported relationship types of the /// [asset_types] or if any of the [asset_types] doesn't belong to the source types of the [relationship_types]. /// * Otherwise: it snapshots the supported relationships for all [asset_types] or returns an error if any of /// the [asset_types] has no relationship support. An unspecified asset types field means all supported /// asset_types. See [Introduction to Cloud Asset /// Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all supported asset types and /// relationship types. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("relationshipTypes")] public virtual System.Collections.Generic.IList<string> RelationshipTypes { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression /// language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example /// (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" /// expression: "document.summary.size() &amp;lt; 100" Example (Equality): title: "Requestor is owner" description: /// "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" /// Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly /// visible" expression: "document.type != 'private' &amp;amp;&amp;amp; document.type != 'internal'" Example (Data /// Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." /// expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that /// may be referenced within an expression are determined by the service that evaluates it. See the service /// documentation for additional information. /// </summary> public class Expr : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when /// hovered over it in a UI. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>Textual representation of an expression in Common Expression Language syntax.</summary> [Newtonsoft.Json.JsonPropertyAttribute("expression")] public virtual string Expression { get; set; } /// <summary> /// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a /// position in the file. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("location")] public virtual string Location { get; set; } /// <summary> /// Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs /// which allow to enter the expression. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset feed used to export asset updates to a destinations. An asset feed filter controls what updates are /// exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: /// Pub/Sub topics. /// </summary> public class Feed : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of the full names of the assets to receive updates. You must specify either or both of asset_names /// and asset_types. Only asset updates matching specified asset_names or asset_types are exported to the feed. /// Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. See [Resource /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more info. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetNames")] public virtual System.Collections.Generic.IList<string> AssetNames { get; set; } /// <summary> /// A list of types of the assets to receive updates. You must specify either or both of asset_names and /// asset_types. Only asset updates matching specified asset_names or asset_types are exported to the feed. /// Example: `"compute.googleapis.com/Disk"` See [this /// topic](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for a list of all supported /// asset types. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetTypes")] public virtual System.Collections.Generic.IList<string> AssetTypes { get; set; } /// <summary> /// A condition which determines whether an asset update should be published. If specified, an asset will be /// returned only when the expression evaluates to true. When set, `expression` field in the `Expr` must be a /// valid [CEL expression] (https://github.com/google/cel-spec) on a TemporalAsset with name `temporal_asset`. /// Example: a Feed with expression ("temporal_asset.deleted == true") will only publish Asset deletions. Other /// fields of `Expr` are optional. See our [user /// guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) for detailed /// instructions. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("condition")] public virtual Expr Condition { get; set; } /// <summary> /// Asset content type. If not specified, no content but the asset name and type will be returned. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("contentType")] public virtual string ContentType { get; set; } /// <summary>Required. Feed output configuration defining where the asset updates are published to.</summary> [Newtonsoft.Json.JsonPropertyAttribute("feedOutputConfig")] public virtual FeedOutputConfig FeedOutputConfig { get; set; } /// <summary> /// Required. The format will be projects/{project_number}/feeds/{client-assigned_feed_identifier} or /// folders/{folder_number}/feeds/{client-assigned_feed_identifier} or /// organizations/{organization_number}/feeds/{client-assigned_feed_identifier} The client-assigned feed /// identifier must be unique within the parent project/folder/organization. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// A list of relationship types to output, for example: `INSTANCE_TO_INSTANCEGROUP`. This field should only be /// specified if content_type=RELATIONSHIP. * If specified: it outputs specified relationship updates on the /// [asset_names] or the [asset_types]. It returns an error if any of the [relationship_types] doesn't belong to /// the supported relationship types of the [asset_names] or [asset_types], or any of the [asset_names] or the /// [asset_types] doesn't belong to the source types of the [relationship_types]. * Otherwise: it outputs the /// supported relationships of the types of [asset_names] and [asset_types] or returns an error if any of the /// [asset_names] or the [asset_types] has no replationship support. See [Introduction to Cloud Asset /// Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all supported asset types and /// relationship types. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("relationshipTypes")] public virtual System.Collections.Generic.IList<string> RelationshipTypes { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Output configuration for asset feed destination.</summary> public class FeedOutputConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Destination on Pub/Sub.</summary> [Newtonsoft.Json.JsonPropertyAttribute("pubsubDestination")] public virtual PubsubDestination PubsubDestination { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A Cloud Storage location.</summary> public class GcsDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: /// "gs://bucket_name/object_name". See [Viewing and Editing Object /// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the /// specified Cloud Storage object already exists and there is no /// [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the exported result. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("uri")] public virtual string Uri { get; set; } /// <summary> /// The uri prefix of all generated Cloud Storage objects. Example: "gs://bucket_name/object_name_prefix". Each /// object uri is in format: "gs://bucket_name/object_name_prefix// and only contains assets for that type. /// starts from 0. Example: "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is the first /// shard of output objects containing all compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be /// returned if file with the same name "gs://bucket_name/object_name_prefix" already exists. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("uriPrefix")] public virtual string UriPrefix { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An IAM role or permission under analysis.</summary> public class GoogleCloudAssetV1Access : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The analysis state of this access.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisState")] public virtual IamPolicyAnalysisState AnalysisState { get; set; } /// <summary>The permission.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permission")] public virtual string Permission { get; set; } /// <summary>The role.</summary> [Newtonsoft.Json.JsonPropertyAttribute("role")] public virtual string Role { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An access control list, derived from the above IAM policy binding, which contains a set of resources and /// accesses. May include one item from each set to compose an access control entry. NOTICE that there could be /// multiple access control lists for one IAM policy binding. The access control lists are created based on resource /// and access combinations. For example, assume we have the following cases in one IAM policy binding: - Permission /// P1 and P2 apply to resource R1 and R2; - Permission P3 applies to resource R2 and R3; This will result in the /// following access control lists: - AccessControlList 1: [R1, R2], [P1, P2] - AccessControlList 2: [R2, R3], [P3] /// </summary> public class GoogleCloudAssetV1AccessControlList : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The accesses that match one of the following conditions: - The access_selector, if it is specified in /// request; - Otherwise, access specifiers reachable from the policy binding's role. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accesses")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1Access> Accesses { get; set; } /// <summary> /// Condition evaluation for this AccessControlList, if there is a condition defined in the above IAM policy /// binding. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("conditionEvaluation")] public virtual ConditionEvaluation ConditionEvaluation { get; set; } /// <summary> /// Resource edges of the graph starting from the policy attached resource to any descendant resources. The /// Edge.source_node contains the full resource name of a parent resource and Edge.target_node contains the full /// resource name of a child resource. This field is present only if the output_resource_edges option is enabled /// in request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceEdges")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1Edge> ResourceEdges { get; set; } /// <summary> /// The resources that match one of the following conditions: - The resource_selector, if it is specified in /// request; - Otherwise, resources reachable from the policy attached resource. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1Resource> Resources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A BigQuery destination.</summary> public class GoogleCloudAssetV1BigQueryDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", to which the analysis /// results should be exported. If this dataset does not exist, the export call will return an INVALID_ARGUMENT /// error. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("dataset")] public virtual string Dataset { get; set; } /// <summary>The partition key for BigQuery partitioned table.</summary> [Newtonsoft.Json.JsonPropertyAttribute("partitionKey")] public virtual string PartitionKey { get; set; } /// <summary> /// Required. The prefix of the BigQuery tables to which the analysis results will be written. Tables will be /// created based on this table_prefix if not exist: * _analysis table will contain export operation's metadata. /// * _analysis_result will contain all the IamPolicyAnalysisResult. When [partition_key] is specified, both /// tables will be partitioned based on the [partition_key]. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("tablePrefix")] public virtual string TablePrefix { get; set; } /// <summary> /// Optional. Specifies the action that occurs if the destination table or partition already exists. The /// following values are supported: * WRITE_TRUNCATE: If the table or partition already exists, BigQuery /// overwrites the entire table or all the partitions data. * WRITE_APPEND: If the table or partition already /// exists, BigQuery appends the data to the table or the latest partition. * WRITE_EMPTY: If the table already /// exists and contains data, an error is returned. The default value is WRITE_APPEND. Each action is atomic and /// only occurs if BigQuery is able to complete the job successfully. Details are at /// https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("writeDisposition")] public virtual string WriteDisposition { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A directional edge.</summary> public class GoogleCloudAssetV1Edge : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The source node of the edge. For example, it could be a full resource name for a resource node or an email /// of an identity. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("sourceNode")] public virtual string SourceNode { get; set; } /// <summary> /// The target node of the edge. For example, it could be a full resource name for a resource node or an email /// of an identity. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("targetNode")] public virtual string TargetNode { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A Cloud Storage location.</summary> public class GoogleCloudAssetV1GcsDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: /// "gs://bucket_name/object_name". See [Viewing and Editing Object /// Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) for more information. If the /// specified Cloud Storage object already exists and there is no /// [hold](https://cloud.google.com/storage/docs/object-holds), it will be overwritten with the analysis result. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("uri")] public virtual string Uri { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An identity under analysis.</summary> public class GoogleCloudAssetV1Identity : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The analysis state of this identity.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisState")] public virtual IamPolicyAnalysisState AnalysisState { get; set; } /// <summary> /// The identity name in any form of members appear in [IAM policy /// binding](https://cloud.google.com/iam/reference/rest/v1/Binding), such as: - user:foo@google.com - /// group:group1@google.com - serviceAccount:s1@prj1.iam.gserviceaccount.com - projectOwner:some_project_id - /// domain:google.com - allUsers - etc. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The identities and group edges.</summary> public class GoogleCloudAssetV1IdentityList : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Group identity edges of the graph starting from the binding's group members to any node of the identities. /// The Edge.source_node contains a group, such as `group:parent@google.com`. The Edge.target_node contains a /// member of the group, such as `group:child@google.com` or `user:foo@google.com`. This field is present only /// if the output_group_edges option is enabled in request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("groupEdges")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1Edge> GroupEdges { get; set; } /// <summary> /// Only the identities that match one of the following conditions will be presented: - The identity_selector, /// if it is specified in request; - Otherwise, identities reachable from the policy binding's members. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identities")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1Identity> Identities { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A Google Cloud resource under analysis.</summary> public class GoogleCloudAssetV1Resource : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The analysis state of this resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisState")] public virtual IamPolicyAnalysisState AnalysisState { get; set; } /// <summary> /// The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("fullResourceName")] public virtual string FullResourceName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset in Google Cloud. An asset can be any resource in the Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside /// the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. /// Cloud IAM policy). See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> public class GoogleCloudAssetV1p7beta1Asset : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Please also refer to the [access level user /// guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessLevel")] public virtual GoogleIdentityAccesscontextmanagerV1AccessLevel AccessLevel { get; set; } /// <summary> /// Please also refer to the [access policy user /// guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessPolicy")] public virtual GoogleIdentityAccesscontextmanagerV1AccessPolicy AccessPolicy { get; set; } /// <summary> /// The ancestry path of an asset in Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as /// a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and /// ends at root. If the asset is a project, folder, or organization, the ancestry path starts from the asset /// itself. Example: `["projects/123456789", "folders/5432", "organizations/1234"]` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ancestors")] public virtual System.Collections.Generic.IList<string> Ancestors { get; set; } /// <summary> /// The type of the asset. Example: `compute.googleapis.com/Disk` See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// A representation of the Cloud IAM policy set on a Google Cloud resource. There can be a maximum of one Cloud /// IAM policy set on any given resource. In addition, Cloud IAM policies inherit their granted access scope /// from any policies set on parent resources in the resource hierarchy. Therefore, the effectively policy is /// the union of both the policy set on this resource and each policy set on all of the resource's ancestry /// resource levels in the hierarchy. See [this topic](https://cloud.google.com/iam/docs/policies#inheritance) /// for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("iamPolicy")] public virtual Policy IamPolicy { get; set; } /// <summary> /// The full name of the asset. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource /// names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// A representation of an [organization /// policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). /// There can be more than one organization policy with different constraints set on a given resource. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("orgPolicy")] public virtual System.Collections.Generic.IList<GoogleCloudOrgpolicyV1Policy> OrgPolicy { get; set; } /// <summary> /// The related assets of the asset of one relationship type. One asset only represents one type of /// relationship. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("relatedAssets")] public virtual GoogleCloudAssetV1p7beta1RelatedAssets RelatedAssets { get; set; } /// <summary>A representation of the resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resource")] public virtual GoogleCloudAssetV1p7beta1Resource Resource { get; set; } /// <summary> /// Please also refer to the [service perimeter user /// guide](https://cloud.google.com/vpc-service-controls/docs/overview). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("servicePerimeter")] public virtual GoogleIdentityAccesscontextmanagerV1ServicePerimeter ServicePerimeter { get; set; } /// <summary> /// The last update timestamp of an asset. update_time is updated when create/update/delete operation is /// performed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset identify in Google Cloud which contains its name, type and ancestors. An asset can be any resource in /// the Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside /// the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. /// Cloud IAM policy). See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> public class GoogleCloudAssetV1p7beta1RelatedAsset : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The ancestors of an asset in Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as /// a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and /// ends at root. Example: `["projects/123456789", "folders/5432", "organizations/1234"]` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ancestors")] public virtual System.Collections.Generic.IList<string> Ancestors { get; set; } /// <summary> /// The full name of the asset. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource /// names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("asset")] public virtual string Asset { get; set; } /// <summary> /// The type of the asset. Example: `compute.googleapis.com/Disk` See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The detailed related assets with the `relationship_type`.</summary> public class GoogleCloudAssetV1p7beta1RelatedAssets : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The peer resources of the relationship.</summary> [Newtonsoft.Json.JsonPropertyAttribute("assets")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1p7beta1RelatedAsset> Assets { get; set; } /// <summary>The detailed relation attributes.</summary> [Newtonsoft.Json.JsonPropertyAttribute("relationshipAttributes")] public virtual GoogleCloudAssetV1p7beta1RelationshipAttributes RelationshipAttributes { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// The relationship attributes which include `type`, `source_resource_type`, `target_resource_type` and `action`. /// </summary> public class GoogleCloudAssetV1p7beta1RelationshipAttributes : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The detail of the relationship, e.g. `contains`, `attaches`</summary> [Newtonsoft.Json.JsonPropertyAttribute("action")] public virtual string Action { get; set; } /// <summary>The source asset type. Example: `compute.googleapis.com/Instance`</summary> [Newtonsoft.Json.JsonPropertyAttribute("sourceResourceType")] public virtual string SourceResourceType { get; set; } /// <summary>The target asset type. Example: `compute.googleapis.com/Disk`</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetResourceType")] public virtual string TargetResourceType { get; set; } /// <summary>The unique identifier of the relationship type. Example: `INSTANCE_TO_INSTANCEGROUP`</summary> [Newtonsoft.Json.JsonPropertyAttribute("type")] public virtual string Type { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A representation of a Google Cloud resource.</summary> public class GoogleCloudAssetV1p7beta1Resource : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The content of the resource, in which some sensitive fields are removed and may not be present. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("data")] public virtual System.Collections.Generic.IDictionary<string, object> Data { get; set; } /// <summary> /// The URL of the discovery document containing the resource's JSON schema. Example: /// `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` This value is unspecified for resources that /// do not have an API based on a discovery document, such as Cloud Bigtable. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("discoveryDocumentUri")] public virtual string DiscoveryDocumentUri { get; set; } /// <summary> /// The JSON schema name listed in the discovery document. Example: `Project` This value is unspecified for /// resources that do not have an API based on a discovery document, such as Cloud Bigtable. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("discoveryName")] public virtual string DiscoveryName { get; set; } /// <summary> /// The location of the resource in Google Cloud, such as its zone and region. For more information, see /// https://cloud.google.com/about/locations/. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("location")] public virtual string Location { get; set; } /// <summary> /// The full name of the immediate parent of this resource. See [Resource /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For /// Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy /// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: /// `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be /// set differently. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("parent")] public virtual string Parent { get; set; } /// <summary> /// The REST URL for accessing the resource. An HTTP `GET` request using this URL returns the resource itself. /// Example: `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` This value is unspecified /// for resources without a REST API. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceUrl")] public virtual string ResourceUrl { get; set; } /// <summary>The API version. Example: `v1`</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual string Version { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Used in `policy_type` to specify how `boolean_policy` will behave at this resource.</summary> public class GoogleCloudOrgpolicyV1BooleanPolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// If `true`, then the `Policy` is enforced. If `false`, then any configuration is acceptable. Suppose you have /// a `Constraint` `constraints/compute.disableSerialPortAccess` with `constraint_default` set to `ALLOW`. A /// `Policy` for that `Constraint` exhibits the following behavior: - If the `Policy` at this resource has /// enforced set to `false`, serial port connection attempts will be allowed. - If the `Policy` at this resource /// has enforced set to `true`, serial port connection attempts will be refused. - If the `Policy` at this /// resource is `RestoreDefault`, serial port connection attempts will be allowed. - If no `Policy` is set at /// this resource or anywhere higher in the resource hierarchy, serial port connection attempts will be allowed. /// - If no `Policy` is set at this resource, but one exists higher in the resource hierarchy, the behavior is /// as if the`Policy` were set at this resource. The following examples demonstrate the different possible /// layerings: Example 1 (nearest `Constraint` wins): `organizations/foo` has a `Policy` with: {enforced: false} /// `projects/bar` has no `Policy` set. The constraint at `projects/bar` and `organizations/foo` will not be /// enforced. Example 2 (enforcement gets replaced): `organizations/foo` has a `Policy` with: {enforced: false} /// `projects/bar` has a `Policy` with: {enforced: true} The constraint at `organizations/foo` is not enforced. /// The constraint at `projects/bar` is enforced. Example 3 (RestoreDefault): `organizations/foo` has a `Policy` /// with: {enforced: true} `projects/bar` has a `Policy` with: {RestoreDefault: {}} The constraint at /// `organizations/foo` is enforced. The constraint at `projects/bar` is not enforced, because /// `constraint_default` for the `Constraint` is `ALLOW`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("enforced")] public virtual System.Nullable<bool> Enforced { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Used in `policy_type` to specify how `list_policy` behaves at this resource. `ListPolicy` can define specific /// values and subtrees of Cloud Resource Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that /// are allowed or denied by setting the `allowed_values` and `denied_values` fields. This is achieved by using the /// `under:` and optional `is:` prefixes. The `under:` prefix is used to denote resource subtree values. The `is:` /// prefix is used to denote specific values, and is required only if the value contains a ":". Values prefixed with /// "is:" are treated the same as values with no prefix. Ancestry subtrees must be in one of the following formats: /// - "projects/", e.g. "projects/tokyo-rain-123" - "folders/", e.g. "folders/1234" - "organizations/", e.g. /// "organizations/1234" The `supports_under` field of the associated `Constraint` defines whether ancestry prefixes /// can be used. You can set `allowed_values` and `denied_values` in the same `Policy` if `all_values` is /// `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all values. If `all_values` is set to /// either `ALLOW` or `DENY`, `allowed_values` and `denied_values` must be unset. /// </summary> public class GoogleCloudOrgpolicyV1ListPolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The policy all_values state.</summary> [Newtonsoft.Json.JsonPropertyAttribute("allValues")] public virtual string AllValues { get; set; } /// <summary> /// List of values allowed at this resource. Can only be set if `all_values` is set to `ALL_VALUES_UNSPECIFIED`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("allowedValues")] public virtual System.Collections.Generic.IList<string> AllowedValues { get; set; } /// <summary> /// List of values denied at this resource. Can only be set if `all_values` is set to `ALL_VALUES_UNSPECIFIED`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("deniedValues")] public virtual System.Collections.Generic.IList<string> DeniedValues { get; set; } /// <summary> /// Determines the inheritance behavior for this `Policy`. By default, a `ListPolicy` set at a resource /// supersedes any `Policy` set anywhere up the resource hierarchy. However, if `inherit_from_parent` is set to /// `true`, then the values from the effective `Policy` of the parent resource are inherited, meaning the values /// set in this `Policy` are added to the values inherited up the hierarchy. Setting `Policy` hierarchies that /// inherit both allowed values and denied values isn't recommended in most circumstances to keep the /// configuration simple and understandable. However, it is possible to set a `Policy` with `allowed_values` set /// that inherits a `Policy` with `denied_values` set. In this case, the values that are allowed must be in /// `allowed_values` and not present in `denied_values`. For example, suppose you have a `Constraint` /// `constraints/serviceuser.services`, which has a `constraint_type` of `list_constraint`, and with /// `constraint_default` set to `ALLOW`. Suppose that at the Organization level, a `Policy` is applied that /// restricts the allowed API activations to {`E1`, `E2`}. Then, if a `Policy` is applied to a project below the /// Organization that has `inherit_from_parent` set to `false` and field all_values set to DENY, then an attempt /// to activate any API will be denied. The following examples demonstrate different possible layerings for /// `projects/bar` parented by `organizations/foo`: Example 1 (no inherited values): `organizations/foo` has a /// `Policy` with values: {allowed_values: "E1" allowed_values:"E2"} `projects/bar` has `inherit_from_parent` /// `false` and values: {allowed_values: "E3" allowed_values: "E4"} The accepted values at `organizations/foo` /// are `E1`, `E2`. The accepted values at `projects/bar` are `E3`, and `E4`. Example 2 (inherited values): /// `organizations/foo` has a `Policy` with values: {allowed_values: "E1" allowed_values:"E2"} `projects/bar` /// has a `Policy` with values: {value: "E3" value: "E4" inherit_from_parent: true} The accepted values at /// `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. /// Example 3 (inheriting both allowed and denied values): `organizations/foo` has a `Policy` with values: /// {allowed_values: "E1" allowed_values: "E2"} `projects/bar` has a `Policy` with: {denied_values: "E1"} The /// accepted values at `organizations/foo` are `E1`, `E2`. The value accepted at `projects/bar` is `E2`. Example /// 4 (RestoreDefault): `organizations/foo` has a `Policy` with values: {allowed_values: "E1" /// allowed_values:"E2"} `projects/bar` has a `Policy` with values: {RestoreDefault: {}} The accepted values at /// `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar` are either all or none depending /// on the value of `constraint_default` (if `ALLOW`, all; if `DENY`, none). Example 5 (no policy inherits /// parent policy): `organizations/foo` has no `Policy` set. `projects/bar` has no `Policy` set. The accepted /// values at both levels are either all or none depending on the value of `constraint_default` (if `ALLOW`, /// all; if `DENY`, none). Example 6 (ListConstraint allowing all): `organizations/foo` has a `Policy` with /// values: {allowed_values: "E1" allowed_values: "E2"} `projects/bar` has a `Policy` with: {all: ALLOW} The /// accepted values at `organizations/foo` are `E1`, E2`. Any value is accepted at `projects/bar`. Example 7 /// (ListConstraint allowing none): `organizations/foo` has a `Policy` with values: {allowed_values: "E1" /// allowed_values: "E2"} `projects/bar` has a `Policy` with: {all: DENY} The accepted values at /// `organizations/foo` are `E1`, E2`. No value is accepted at `projects/bar`. Example 10 (allowed and denied /// subtrees of Resource Manager hierarchy): Given the following resource hierarchy O1-&amp;gt;{F1, F2}; /// F1-&amp;gt;{P1}; F2-&amp;gt;{P2, P3}, `organizations/foo` has a `Policy` with values: {allowed_values: /// "under:organizations/O1"} `projects/bar` has a `Policy` with: {allowed_values: "under:projects/P3"} /// {denied_values: "under:folders/F2"} The accepted values at `organizations/foo` are `organizations/O1`, /// `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, `projects/P3`. The accepted values at /// `projects/bar` are `organizations/O1`, `folders/F1`, `projects/P1`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("inheritFromParent")] public virtual System.Nullable<bool> InheritFromParent { get; set; } /// <summary> /// Optional. The Google Cloud Console will try to default to a configuration that matches the value specified /// in this `Policy`. If `suggested_value` is not set, it will inherit the value specified higher in the /// hierarchy, unless `inherit_from_parent` is `false`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("suggestedValue")] public virtual string SuggestedValue { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Defines a Cloud Organization `Policy` which is used to specify `Constraints` for configurations of Cloud /// Platform resources. /// </summary> public class GoogleCloudOrgpolicyV1Policy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>For boolean `Constraints`, whether to enforce the `Constraint` or not.</summary> [Newtonsoft.Json.JsonPropertyAttribute("booleanPolicy")] public virtual GoogleCloudOrgpolicyV1BooleanPolicy BooleanPolicy { get; set; } /// <summary> /// The name of the `Constraint` the `Policy` is configuring, for example, `constraints/serviceuser.services`. A /// [list of available constraints](/resource-manager/docs/organization-policy/org-policy-constraints) is /// available. Immutable after creation. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("constraint")] public virtual string Constraint { get; set; } /// <summary> /// An opaque tag indicating the current version of the `Policy`, used for concurrency control. When the /// `Policy` is returned from either a `GetPolicy` or a `ListOrgPolicy` request, this `etag` indicates the /// version of the current `Policy` to use when executing a read-modify-write loop. When the `Policy` is /// returned from a `GetEffectivePolicy` request, the `etag` will be unset. When the `Policy` is used in a /// `SetOrgPolicy` method, use the `etag` value that was returned from a `GetOrgPolicy` request as part of a /// read-modify-write loop for concurrency control. Not setting the `etag`in a `SetOrgPolicy` request will /// result in an unconditional write of the `Policy`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary>List of values either allowed or disallowed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("listPolicy")] public virtual GoogleCloudOrgpolicyV1ListPolicy ListPolicy { get; set; } /// <summary>Restores the default behavior of the constraint; independent of `Constraint` type.</summary> [Newtonsoft.Json.JsonPropertyAttribute("restoreDefault")] public virtual GoogleCloudOrgpolicyV1RestoreDefault RestoreDefault { get; set; } /// <summary> /// The time stamp the `Policy` was previously updated. This is set by the server, not specified by the caller, /// and represents the last time a call to `SetOrgPolicy` was made for that `Policy`. Any value set by the /// client will be ignored. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>Version of the `Policy`. Default version is 0;</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual System.Nullable<int> Version { get; set; } } /// <summary> /// Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the /// specific `Constraint` at this resource. Suppose that `constraint_default` is set to `ALLOW` for the `Constraint` /// `constraints/serviceuser.services`. Suppose that organization foo.com sets a `Policy` at their Organization /// resource node that restricts the allowed service activations to deny all service activations. They could then /// set a `Policy` with the `policy_type` `restore_default` on several experimental projects, restoring the /// `constraint_default` enforcement of the `Constraint` for only those projects, allowing those projects to have /// all services activated. /// </summary> public class GoogleCloudOrgpolicyV1RestoreDefault : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An `AccessLevel` is a label that can be applied to requests to Google Cloud services, along with a list of /// requirements necessary for the label to be applied. /// </summary> public class GoogleIdentityAccesscontextmanagerV1AccessLevel : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A `BasicLevel` composed of `Conditions`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("basic")] public virtual GoogleIdentityAccesscontextmanagerV1BasicLevel Basic { get; set; } /// <summary>A `CustomLevel` written in the Common Expression Language.</summary> [Newtonsoft.Json.JsonPropertyAttribute("custom")] public virtual GoogleIdentityAccesscontextmanagerV1CustomLevel Custom { get; set; } /// <summary>Description of the `AccessLevel` and its use. Does not affect behavior.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary> /// Required. Resource name for the Access Level. The `short_name` component must begin with a letter and only /// include alphanumeric and '_'. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The /// maximum length of the `access_level` component is 50 characters. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Human readable title. Must be unique within the Policy.</summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// `AccessPolicy` is a container for `AccessLevels` (which define the necessary attributes to use Google Cloud /// services) and `ServicePerimeters` (which define regions of services able to freely pass data within a /// perimeter). An access policy is globally visible within an organization, and the restrictions it specifies apply /// to all projects within an organization. /// </summary> public class GoogleIdentityAccesscontextmanagerV1AccessPolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Output only. An opaque identifier for the current version of the `AccessPolicy`. This will always be a /// strongly validated etag, meaning that two Access Polices will be identical if and only if their etags are /// identical. Clients should not expect this to be in any specific format. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary> /// Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{access_policy}` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once /// created. Format: `organizations/{organization_id}` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("parent")] public virtual string Parent { get; set; } /// <summary>Required. Human readable title. Does not affect behavior.</summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } } /// <summary>Identification for an API Operation.</summary> public class GoogleIdentityAccesscontextmanagerV1ApiOperation : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// API methods or permissions to allow. Method or permission must belong to the service specified by /// `service_name` field. A single MethodSelector entry with `*` specified for the `method` field will allow all /// methods AND permissions for the service specified in `service_name`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("methodSelectors")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1MethodSelector> MethodSelectors { get; set; } /// <summary> /// The name of the API whose methods or permissions the IngressPolicy or EgressPolicy want to allow. A single /// ApiOperation with `service_name` field set to `*` will allow all methods AND permissions for all services. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("serviceName")] public virtual string ServiceName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>`BasicLevel` is an `AccessLevel` using a set of recommended features.</summary> public class GoogleIdentityAccesscontextmanagerV1BasicLevel : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// How the `conditions` list should be combined to determine if a request is granted this `AccessLevel`. If AND /// is used, each `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. If OR is /// used, at least one `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. /// Default behavior is AND. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("combiningFunction")] public virtual string CombiningFunction { get; set; } /// <summary>Required. A list of requirements for the `AccessLevel` to be granted.</summary> [Newtonsoft.Json.JsonPropertyAttribute("conditions")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1Condition> Conditions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// A condition necessary for an `AccessLevel` to be granted. The Condition is an AND over its fields. So a /// Condition is true if: 1) the request IP is from one of the listed subnetworks AND 2) the originating device /// complies with the listed device policy AND 3) all listed access levels are granted AND 4) the request was sent /// at a time allowed by the DateTimeRestriction. /// </summary> public class GoogleIdentityAccesscontextmanagerV1Condition : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all /// devices are allowed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("devicePolicy")] public virtual GoogleIdentityAccesscontextmanagerV1DevicePolicy DevicePolicy { get; set; } /// <summary> /// CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the /// specified IP address portion must be properly truncated (i.e. all the host bits must be zero) or the input /// is considered malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is not. Similarly, for /// IPv6, "2001:db8::/32" is accepted whereas "2001:db8::1/32" is not. The originating IP of a request must be /// in one of the listed subnets in order for this Condition to be true. If empty, all IP addresses are allowed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ipSubnetworks")] public virtual System.Collections.Generic.IList<string> IpSubnetworks { get; set; } /// <summary> /// The request must be made by one of the provided user or service accounts. Groups are not supported. Syntax: /// `user:{emailid}` `serviceAccount:{emailid}` If not specified, a request may come from any user. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("members")] public virtual System.Collections.Generic.IList<string> Members { get; set; } /// <summary> /// Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field /// must be false for the Condition overall to be satisfied. Defaults to false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("negate")] public virtual System.Nullable<bool> Negate { get; set; } /// <summary> /// The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 /// codes. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("regions")] public virtual System.Collections.Generic.IList<string> Regions { get; set; } /// <summary> /// A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an /// `AccessLevel` which does not exist is an error. All access levels listed must be granted for the Condition /// to be true. Example: "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("requiredAccessLevels")] public virtual System.Collections.Generic.IList<string> RequiredAccessLevels { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language to represent the necessary /// conditions for the level to apply to a request. See CEL spec at: https://github.com/google/cel-spec /// </summary> public class GoogleIdentityAccesscontextmanagerV1CustomLevel : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Required. A Cloud CEL expression evaluating to a boolean.</summary> [Newtonsoft.Json.JsonPropertyAttribute("expr")] public virtual Expr Expr { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// `DevicePolicy` specifies device specific restrictions necessary to acquire a given access level. A /// `DevicePolicy` specifies requirements for requests from devices to be granted access levels, it does not do any /// enforcement on the device. `DevicePolicy` acts as an AND over all specified fields, and each repeated field is /// an OR over its elements. Any unset fields are ignored. For example, if the proto is { os_type : DESKTOP_WINDOWS, /// os_type : DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be true for requests /// originating from encrypted Linux desktops and encrypted Windows desktops. /// </summary> public class GoogleIdentityAccesscontextmanagerV1DevicePolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Allowed device management levels, an empty list allows all management levels.</summary> [Newtonsoft.Json.JsonPropertyAttribute("allowedDeviceManagementLevels")] public virtual System.Collections.Generic.IList<string> AllowedDeviceManagementLevels { get; set; } /// <summary>Allowed encryptions statuses, an empty list allows all statuses.</summary> [Newtonsoft.Json.JsonPropertyAttribute("allowedEncryptionStatuses")] public virtual System.Collections.Generic.IList<string> AllowedEncryptionStatuses { get; set; } /// <summary>Allowed OS versions, an empty list allows all types and all versions.</summary> [Newtonsoft.Json.JsonPropertyAttribute("osConstraints")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1OsConstraint> OsConstraints { get; set; } /// <summary>Whether the device needs to be approved by the customer admin.</summary> [Newtonsoft.Json.JsonPropertyAttribute("requireAdminApproval")] public virtual System.Nullable<bool> RequireAdminApproval { get; set; } /// <summary>Whether the device needs to be corp owned.</summary> [Newtonsoft.Json.JsonPropertyAttribute("requireCorpOwned")] public virtual System.Nullable<bool> RequireCorpOwned { get; set; } /// <summary> /// Whether or not screenlock is required for the DevicePolicy to be true. Defaults to `false`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("requireScreenlock")] public virtual System.Nullable<bool> RequireScreenlock { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Defines the conditions under which an EgressPolicy matches a request. Conditions based on information about the /// source of the request. Note that if the destination of the request is also protected by a ServicePerimeter, then /// that ServicePerimeter must have an IngressPolicy which allows access in order for this request to succeed. /// </summary> public class GoogleIdentityAccesscontextmanagerV1EgressFrom : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of identities that are allowed access through this [EgressPolicy]. Should be in the format of email /// address. The email address should represent individual user or service account only. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identities")] public virtual System.Collections.Generic.IList<string> Identities { get; set; } /// <summary> /// Specifies the type of identities that are allowed access to outside the perimeter. If left unspecified, then /// members of `identities` field will be allowed access. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identityType")] public virtual string IdentityType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Policy for egress from perimeter. EgressPolicies match requests based on `egress_from` and `egress_to` stanzas. /// For an EgressPolicy to match, both `egress_from` and `egress_to` stanzas must be matched. If an EgressPolicy /// matches a request, the request is allowed to span the ServicePerimeter boundary. For example, an EgressPolicy /// can be used to allow VMs on networks within the ServicePerimeter to access a defined set of projects outside the /// perimeter in certain contexts (e.g. to read data from a Cloud Storage bucket or query against a BigQuery /// dataset). EgressPolicies are concerned with the *resources* that a request relates as well as the API services /// and API actions being used. They do not related to the direction of data movement. More detailed documentation /// for this concept can be found in the descriptions of EgressFrom and EgressTo. /// </summary> public class GoogleIdentityAccesscontextmanagerV1EgressPolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Defines conditions on the source of a request causing this EgressPolicy to apply.</summary> [Newtonsoft.Json.JsonPropertyAttribute("egressFrom")] public virtual GoogleIdentityAccesscontextmanagerV1EgressFrom EgressFrom { get; set; } /// <summary> /// Defines the conditions on the ApiOperation and destination resources that cause this EgressPolicy to apply. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("egressTo")] public virtual GoogleIdentityAccesscontextmanagerV1EgressTo EgressTo { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Defines the conditions under which an EgressPolicy matches a request. Conditions are based on information about /// the ApiOperation intended to be performed on the `resources` specified. Note that if the destination of the /// request is also protected by a ServicePerimeter, then that ServicePerimeter must have an IngressPolicy which /// allows access in order for this request to succeed. The request must match `operations` AND `resources` fields /// in order to be allowed egress out of the perimeter. /// </summary> public class GoogleIdentityAccesscontextmanagerV1EgressTo : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of ApiOperations allowed to be performed by the sources specified in the corresponding EgressFrom. A /// request matches if it uses an operation/service in this list. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("operations")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1ApiOperation> Operations { get; set; } /// <summary> /// A list of resources, currently only projects in the form `projects/`, that are allowed to be accessed by /// sources defined in the corresponding EgressFrom. A request matches if it contains a resource in this list. /// If `*` is specified for `resources`, then this EgressTo rule will authorize access to all resources outside /// the perimeter. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual System.Collections.Generic.IList<string> Resources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Defines the conditions under which an IngressPolicy matches a request. Conditions are based on information about /// the source of the request. The request must satisfy what is defined in `sources` AND identity related fields in /// order to match. /// </summary> public class GoogleIdentityAccesscontextmanagerV1IngressFrom : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of identities that are allowed access through this ingress policy. Should be in the format of email /// address. The email address should represent individual user or service account only. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identities")] public virtual System.Collections.Generic.IList<string> Identities { get; set; } /// <summary> /// Specifies the type of identities that are allowed access from outside the perimeter. If left unspecified, /// then members of `identities` field will be allowed access. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identityType")] public virtual string IdentityType { get; set; } /// <summary>Sources that this IngressPolicy authorizes access from.</summary> [Newtonsoft.Json.JsonPropertyAttribute("sources")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1IngressSource> Sources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Policy for ingress into ServicePerimeter. IngressPolicies match requests based on `ingress_from` and /// `ingress_to` stanzas. For an ingress policy to match, both the `ingress_from` and `ingress_to` stanzas must be /// matched. If an IngressPolicy matches a request, the request is allowed through the perimeter boundary from /// outside the perimeter. For example, access from the internet can be allowed either based on an AccessLevel or, /// for traffic hosted on Google Cloud, the project of the source network. For access from private networks, using /// the project of the hosting network is required. Individual ingress policies can be limited by restricting which /// services and/or actions they match using the `ingress_to` field. /// </summary> public class GoogleIdentityAccesscontextmanagerV1IngressPolicy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Defines the conditions on the source of a request causing this IngressPolicy to apply.</summary> [Newtonsoft.Json.JsonPropertyAttribute("ingressFrom")] public virtual GoogleIdentityAccesscontextmanagerV1IngressFrom IngressFrom { get; set; } /// <summary> /// Defines the conditions on the ApiOperation and request destination that cause this IngressPolicy to apply. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ingressTo")] public virtual GoogleIdentityAccesscontextmanagerV1IngressTo IngressTo { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The source that IngressPolicy authorizes access from.</summary> public class GoogleIdentityAccesscontextmanagerV1IngressSource : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// An AccessLevel resource name that allow resources within the ServicePerimeters to be accessed from the /// internet. AccessLevels listed must be in the same policy as this ServicePerimeter. Referencing a nonexistent /// AccessLevel will cause an error. If no AccessLevel names are listed, resources within the perimeter can only /// be accessed via Google Cloud calls with request origins within the perimeter. Example: /// `accessPolicies/MY_POLICY/accessLevels/MY_LEVEL`. If a single `*` is specified for `access_level`, then all /// IngressSources will be allowed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessLevel")] public virtual string AccessLevel { get; set; } /// <summary> /// A Google Cloud resource that is allowed to ingress the perimeter. Requests from these resources will be /// allowed to access perimeter data. Currently only projects are allowed. Format: `projects/{project_number}` /// The project may be in any Google Cloud organization, not just the organization that the perimeter is defined /// in. `*` is not allowed, the case of allowing all Google Cloud resources only is not supported. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resource")] public virtual string Resource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Defines the conditions under which an IngressPolicy matches a request. Conditions are based on information about /// the ApiOperation intended to be performed on the target resource of the request. The request must satisfy what /// is defined in `operations` AND `resources` in order to match. /// </summary> public class GoogleIdentityAccesscontextmanagerV1IngressTo : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of ApiOperations allowed to be performed by the sources specified in corresponding IngressFrom in /// this ServicePerimeter. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("operations")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1ApiOperation> Operations { get; set; } /// <summary> /// A list of resources, currently only projects in the form `projects/`, protected by this ServicePerimeter /// that are allowed to be accessed by sources defined in the corresponding IngressFrom. If a single `*` is /// specified, then access to all resources inside the perimeter are allowed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual System.Collections.Generic.IList<string> Resources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An allowed method or permission of a service specified in ApiOperation.</summary> public class GoogleIdentityAccesscontextmanagerV1MethodSelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Value for `method` should be a valid method name for the corresponding `service_name` in ApiOperation. If /// `*` used as value for `method`, then ALL methods and permissions are allowed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("method")] public virtual string Method { get; set; } /// <summary> /// Value for `permission` should be a valid Cloud IAM permission for the corresponding `service_name` in /// ApiOperation. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("permission")] public virtual string Permission { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A restriction on the OS type and version of devices making requests.</summary> public class GoogleIdentityAccesscontextmanagerV1OsConstraint : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: /// `"major.minor.patch"`. Examples: `"10.5.301"`, `"9.2.1"`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("minimumVersion")] public virtual string MinimumVersion { get; set; } /// <summary>Required. The allowed OS type.</summary> [Newtonsoft.Json.JsonPropertyAttribute("osType")] public virtual string OsType { get; set; } /// <summary> /// Only allows requests from devices with a verified Chrome OS. Verifications includes requirements that the /// device is enterprise-managed, conformant to domain policies, and the caller has permission to call the API /// targeted by the request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("requireVerifiedChromeOs")] public virtual System.Nullable<bool> RequireVerifiedChromeOs { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// `ServicePerimeter` describes a set of Google Cloud resources which can freely import and export data amongst /// themselves, but not export outside of the `ServicePerimeter`. If a request with a source within this /// `ServicePerimeter` has a target outside of the `ServicePerimeter`, the request will be blocked. Otherwise the /// request is allowed. There are two types of Service Perimeter - Regular and Bridge. Regular Service Perimeters /// cannot overlap, a single Google Cloud project can only belong to a single regular Service Perimeter. Service /// Perimeter Bridges can contain only Google Cloud projects as members, a single Google Cloud project may belong to /// multiple Service Perimeter Bridges. /// </summary> public class GoogleIdentityAccesscontextmanagerV1ServicePerimeter : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Description of the `ServicePerimeter` and its use. Does not affect behavior.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary> /// Required. Resource name for the ServicePerimeter. The `short_name` component must begin with a letter and /// only include alphanumeric and '_'. Format: /// `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// Perimeter type indicator. A single project is allowed to be a member of single regular perimeter, but /// multiple service perimeter bridges. A project cannot be a included in a perimeter bridge without being /// included in regular perimeter. For perimeter bridges, the restricted service list as well as access level /// lists must be empty. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("perimeterType")] public virtual string PerimeterType { get; set; } /// <summary> /// Proposed (or dry run) ServicePerimeter configuration. This configuration allows to specify and test /// ServicePerimeter configuration without enforcing actual access restrictions. Only allowed to be set when the /// "use_explicit_dry_run_spec" flag is set. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("spec")] public virtual GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig Spec { get; set; } /// <summary> /// Current ServicePerimeter configuration. Specifies sets of resources, restricted services and access levels /// that determine perimeter content and boundaries. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("status")] public virtual GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig Status { get; set; } /// <summary>Human readable title. Must be unique within the Policy.</summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } /// <summary> /// Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly exists for all Service Perimeters, and /// that spec is identical to the status for those Service Perimeters. When this flag is set, it inhibits the /// generation of the implicit spec, thereby allowing the user to explicitly provide a configuration ("spec") to /// use in a dry-run version of the Service Perimeter. This allows the user to test changes to the enforced /// config ("status") without actually enforcing them. This testing is done through analyzing the differences /// between currently enforced and suggested restrictions. use_explicit_dry_run_spec must bet set to True if any /// of the fields in the spec are set to non-default values. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("useExplicitDryRunSpec")] public virtual System.Nullable<bool> UseExplicitDryRunSpec { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// `ServicePerimeterConfig` specifies a set of Google Cloud resources that describe specific Service Perimeter /// configuration. /// </summary> public class GoogleIdentityAccesscontextmanagerV1ServicePerimeterConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A list of `AccessLevel` resource names that allow resources within the `ServicePerimeter` to be accessed /// from the internet. `AccessLevels` listed must be in the same policy as this `ServicePerimeter`. Referencing /// a nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are listed, resources within the /// perimeter can only be accessed via Google Cloud calls with request origins within the perimeter. Example: /// `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. For Service Perimeter Bridge, must be empty. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessLevels")] public virtual System.Collections.Generic.IList<string> AccessLevels { get; set; } /// <summary> /// List of EgressPolicies to apply to the perimeter. A perimeter may have multiple EgressPolicies, each of /// which is evaluated separately. Access is granted if any EgressPolicy grants it. Must be empty for a /// perimeter bridge. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("egressPolicies")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1EgressPolicy> EgressPolicies { get; set; } /// <summary> /// List of IngressPolicies to apply to the perimeter. A perimeter may have multiple IngressPolicies, each of /// which is evaluated separately. Access is granted if any Ingress Policy grants it. Must be empty for a /// perimeter bridge. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ingressPolicies")] public virtual System.Collections.Generic.IList<GoogleIdentityAccesscontextmanagerV1IngressPolicy> IngressPolicies { get; set; } /// <summary> /// A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are /// allowed. Format: `projects/{project_number}` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual System.Collections.Generic.IList<string> Resources { get; set; } /// <summary> /// Google Cloud services that are subject to the Service Perimeter restrictions. For example, if /// `storage.googleapis.com` is specified, access to the storage buckets inside the perimeter must meet the /// perimeter's access restrictions. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("restrictedServices")] public virtual System.Collections.Generic.IList<string> RestrictedServices { get; set; } /// <summary>Configuration for APIs allowed within Perimeter.</summary> [Newtonsoft.Json.JsonPropertyAttribute("vpcAccessibleServices")] public virtual GoogleIdentityAccesscontextmanagerV1VpcAccessibleServices VpcAccessibleServices { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies how APIs are allowed to communicate within the Service Perimeter.</summary> public class GoogleIdentityAccesscontextmanagerV1VpcAccessibleServices : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The list of APIs usable within the Service Perimeter. Must be empty unless 'enable_restriction' is True. You /// can specify a list of individual services, as well as include the 'RESTRICTED-SERVICES' value, which /// automatically includes all of the services protected by the perimeter. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("allowedServices")] public virtual System.Collections.Generic.IList<string> AllowedServices { get; set; } /// <summary> /// Whether to restrict API calls within the Service Perimeter to the list of APIs specified in /// 'allowed_services'. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("enableRestriction")] public virtual System.Nullable<bool> EnableRestriction { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An analysis message to group the query and results.</summary> public class IamPolicyAnalysis : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The analysis query.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisQuery")] public virtual IamPolicyAnalysisQuery AnalysisQuery { get; set; } /// <summary> /// A list of IamPolicyAnalysisResult that matches the analysis query, or empty if no result is found. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("analysisResults")] public virtual System.Collections.Generic.IList<IamPolicyAnalysisResult> AnalysisResults { get; set; } /// <summary> /// Represents whether all entries in the analysis_results have been fully explored to answer the query. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("fullyExplored")] public virtual System.Nullable<bool> FullyExplored { get; set; } /// <summary>A list of non-critical errors happened during the query handling.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nonCriticalErrors")] public virtual System.Collections.Generic.IList<IamPolicyAnalysisState> NonCriticalErrors { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Output configuration for export IAM policy analysis destination.</summary> public class IamPolicyAnalysisOutputConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Destination on BigQuery.</summary> [Newtonsoft.Json.JsonPropertyAttribute("bigqueryDestination")] public virtual GoogleCloudAssetV1BigQueryDestination BigqueryDestination { get; set; } /// <summary>Destination on Cloud Storage.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsDestination")] public virtual GoogleCloudAssetV1GcsDestination GcsDestination { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>## IAM policy analysis query message.</summary> public class IamPolicyAnalysisQuery : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Optional. Specifies roles or permissions for analysis. This is optional.</summary> [Newtonsoft.Json.JsonPropertyAttribute("accessSelector")] public virtual AccessSelector AccessSelector { get; set; } /// <summary>Optional. The hypothetical context for IAM conditions evaluation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("conditionContext")] public virtual ConditionContext ConditionContext { get; set; } /// <summary>Optional. Specifies an identity for analysis.</summary> [Newtonsoft.Json.JsonPropertyAttribute("identitySelector")] public virtual IdentitySelector IdentitySelector { get; set; } /// <summary>Optional. The query options.</summary> [Newtonsoft.Json.JsonPropertyAttribute("options")] public virtual Options Options { get; set; } /// <summary>Optional. Specifies a resource for analysis.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceSelector")] public virtual ResourceSelector ResourceSelector { get; set; } /// <summary> /// Required. The relative name of the root asset. Only resources and IAM policies within the scope will be /// analyzed. This can only be an organization number (such as "organizations/123"), a folder number (such as /// "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as /// "projects/12345"). To know how to get organization id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). /// To know how to get folder or project id, visit [here /// ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("scope")] public virtual string Scope { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// IAM Policy analysis result, consisting of one IAM policy binding and derived access control lists. /// </summary> public class IamPolicyAnalysisResult : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The access control lists derived from the iam_binding that match or potentially match resource and access /// selectors specified in the request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("accessControlLists")] public virtual System.Collections.Generic.IList<GoogleCloudAssetV1AccessControlList> AccessControlLists { get; set; } /// <summary> /// The [full resource name](https://cloud.google.com/asset-inventory/docs/resource-name-format) of the resource /// to which the iam_binding policy attaches. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("attachedResourceFullName")] public virtual string AttachedResourceFullName { get; set; } /// <summary>Represents whether all analyses on the iam_binding have successfully finished.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fullyExplored")] public virtual System.Nullable<bool> FullyExplored { get; set; } /// <summary>The Cloud IAM policy binding under analysis.</summary> [Newtonsoft.Json.JsonPropertyAttribute("iamBinding")] public virtual Binding IamBinding { get; set; } /// <summary> /// The identity list derived from members of the iam_binding that match or potentially match identity selector /// specified in the request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identityList")] public virtual GoogleCloudAssetV1IdentityList IdentityList { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Represents the detailed state of an entity under analysis, such as a resource, an identity or an access. /// </summary> public class IamPolicyAnalysisState : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The human-readable description of the cause of failure.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cause")] public virtual string Cause { get; set; } /// <summary> /// The Google standard error code that best describes the state. For example: - OK means the analysis on this /// entity has been successfully finished; - PERMISSION_DENIED means an access denied error is encountered; - /// DEADLINE_EXCEEDED means the analysis on this entity hasn't been started in time; /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("code")] public virtual string Code { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A result of IAM Policy search, containing information of an IAM policy.</summary> public class IamPolicySearchResult : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The type of the resource associated with this IAM policy. Example: `compute.googleapis.com/Disk`. To search /// against the `asset_type`: * specify the `asset_types` field in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// Explanation about the IAM policy search result. It contains additional information to explain why the search /// result matches the query. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("explanation")] public virtual Explanation Explanation { get; set; } /// <summary> /// The folder(s) that the IAM policy belongs to, in the form of folders/{FOLDER_NUMBER}. This field is /// available when the IAM policy belongs to one or more folders. To search against `folders`: * use a field /// query. Example: `folders:(123 OR 456)` * use a free text query. Example: `123` * specify the `scope` field /// as this folder in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("folders")] public virtual System.Collections.Generic.IList<string> Folders { get; set; } /// <summary> /// The organization that the IAM policy belongs to, in the form of organizations/{ORGANIZATION_NUMBER}. This /// field is available when the IAM policy belongs to an organization. To search against `organization`: * use a /// field query. Example: `organization:123` * use a free text query. Example: `123` * specify the `scope` field /// as this organization in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("organization")] public virtual string Organization { get; set; } /// <summary> /// The IAM policy directly set on the given resource. Note that the original IAM policy can contain multiple /// bindings. This only contains the bindings that match the given query. For queries that don't contain a /// constrain on policies (e.g., an empty query), this contains all the bindings. To search against the `policy` /// bindings: * use a field query: - query by the policy contained members. Example: `policy:amy@gmail.com` - /// query by the policy contained roles. Example: `policy:roles/compute.admin` - query by the policy contained /// roles' included permissions. Example: `policy.role.permissions:compute.instances.create` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("policy")] public virtual Policy Policy { get; set; } /// <summary> /// The project that the associated GCP resource belongs to, in the form of projects/{PROJECT_NUMBER}. If an IAM /// policy is set on a resource (like VM instance, Cloud Storage bucket), the project field will indicate the /// project that contains the resource. If an IAM policy is set on a folder or orgnization, this field will be /// empty. To search against the `project`: * specify the `scope` field as this project in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("project")] public virtual string Project { get; set; } /// <summary> /// The full resource name of the resource associated with this IAM policy. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. See [Cloud Asset /// Inventory Resource Name Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) for more /// information. To search against the `resource`: * use a field query. Example: `resource:organizations/123` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resource")] public virtual string Resource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Specifies an identity for which to determine resource access, based on roles assigned either directly to them or /// to the groups they belong to, directly or indirectly. /// </summary> public class IdentitySelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The identity appear in the form of principals in [IAM policy /// binding](https://cloud.google.com/iam/reference/rest/v1/Binding). The examples of supported forms are: /// "user:mike@example.com", "group:admins@example.com", "domain:google.com", /// "serviceAccount:my-project-id@appspot.gserviceaccount.com". Notice that wildcard characters (such as * and /// ?) are not supported. You must give a specific identity. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("identity")] public virtual string Identity { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// This API resource represents the available inventory data for a Compute Engine virtual machine (VM) instance at /// a given point in time. You can use this API resource to determine the inventory data of your VM. For more /// information, see [Information provided by OS inventory /// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). /// </summary> public class Inventory : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Inventory items related to the VM keyed by an opaque unique identifier for each inventory item. The /// identifier is unique to each distinct and addressable inventory item and will change, when there is a new /// package version. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("items")] public virtual System.Collections.Generic.IDictionary<string, Item> Items { get; set; } /// <summary> /// Output only. The `Inventory` API resource name. Format: /// `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Base level operating system information for the VM.</summary> [Newtonsoft.Json.JsonPropertyAttribute("osInfo")] public virtual OsInfo OsInfo { get; set; } /// <summary>Output only. Timestamp of the last reported inventory for the VM.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A single piece of inventory on a VM.</summary> public class Item : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Software package available to be installed on the VM instance.</summary> [Newtonsoft.Json.JsonPropertyAttribute("availablePackage")] public virtual SoftwarePackage AvailablePackage { get; set; } /// <summary>When this inventory item was first detected.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Identifier for this item, unique across items for this VM.</summary> [Newtonsoft.Json.JsonPropertyAttribute("id")] public virtual string Id { get; set; } /// <summary>Software package present on the VM instance.</summary> [Newtonsoft.Json.JsonPropertyAttribute("installedPackage")] public virtual SoftwarePackage InstalledPackage { get; set; } /// <summary>The origin of this inventory item.</summary> [Newtonsoft.Json.JsonPropertyAttribute("originType")] public virtual string OriginType { get; set; } /// <summary>The specific type of inventory, correlating to its specific details.</summary> [Newtonsoft.Json.JsonPropertyAttribute("type")] public virtual string Type { get; set; } /// <summary>When this inventory item was last modified.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>ListAssets response.</summary> public class ListAssetsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Assets.</summary> [Newtonsoft.Json.JsonPropertyAttribute("assets")] public virtual System.Collections.Generic.IList<Asset> Assets { get; set; } /// <summary> /// Token to retrieve the next page of results. It expires 72 hours after the page token for the first page is /// generated. Set to empty if there are no remaining results. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>Time the snapshot was taken.</summary> [Newtonsoft.Json.JsonPropertyAttribute("readTime")] public virtual object ReadTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } public class ListFeedsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A list of feeds.</summary> [Newtonsoft.Json.JsonPropertyAttribute("feeds")] public virtual System.Collections.Generic.IList<Feed> Feeds { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response of listing saved queries.</summary> public class ListSavedQueriesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no /// subsequent pages. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>A list of savedQueries.</summary> [Newtonsoft.Json.JsonPropertyAttribute("savedQueries")] public virtual System.Collections.Generic.IList<SavedQuery> SavedQueries { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A message to group the analysis information.</summary> public class MoveAnalysis : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Analysis result of moving the target resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("analysis")] public virtual MoveAnalysisResult Analysis { get; set; } /// <summary>The user friendly display name of the analysis. E.g. IAM, Organization Policy etc.</summary> [Newtonsoft.Json.JsonPropertyAttribute("displayName")] public virtual string DisplayName { get; set; } /// <summary>Description of error encountered when performing the analysis.</summary> [Newtonsoft.Json.JsonPropertyAttribute("error")] public virtual Status Error { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>An analysis result including blockers and warnings.</summary> public class MoveAnalysisResult : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Blocking information that would prevent the target resource from moving to the specified destination at /// runtime. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("blockers")] public virtual System.Collections.Generic.IList<MoveImpact> Blockers { get; set; } /// <summary> /// Warning information indicating that moving the target resource to the specified destination might be unsafe. /// This can include important policy information and configuration changes, but will not block moves at /// runtime. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("warnings")] public virtual System.Collections.Generic.IList<MoveImpact> Warnings { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A message to group impacts of moving the target resource.</summary> public class MoveImpact : Google.Apis.Requests.IDirectResponseSchema { /// <summary>User friendly impact detail in a free form message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("detail")] public virtual string Detail { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>This resource represents a long-running operation that is the result of a network API call.</summary> public class Operation : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, /// and either `error` or `response` is available. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("done")] public virtual System.Nullable<bool> Done { get; set; } /// <summary>The error result of the operation in case of failure or cancellation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("error")] public virtual Status Error { get; set; } /// <summary> /// Service-specific metadata associated with the operation. It typically contains progress information and /// common metadata such as create time. Some services might not provide such metadata. Any method that returns /// a long-running operation should document the metadata type, if any. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("metadata")] public virtual System.Collections.Generic.IDictionary<string, object> Metadata { get; set; } /// <summary> /// The server-assigned name, which is only unique within the same service that originally returns it. If you /// use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// The normal response of the operation in case of success. If the original method returns no data on success, /// such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard /// `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have /// the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is /// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("response")] public virtual System.Collections.Generic.IDictionary<string, object> Response { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Contains query options.</summary> public class Options : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Optional. If true, the response will include access analysis from identities to resources via service /// account impersonation. This is a very expensive operation, because many derived queries will be executed. We /// highly recommend you use AssetService.AnalyzeIamPolicyLongrunning rpc instead. For example, if the request /// analyzes for which resources user A has permission P, and there's an IAM policy states user A has /// iam.serviceAccounts.getAccessToken permission to a service account SA, and there's another IAM policy states /// service account SA has permission P to a GCP folder F, then user A potentially has access to the GCP folder /// F. And those advanced analysis results will be included in /// AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Another example, if the request analyzes /// for who has permission P to a GCP folder F, and there's an IAM policy states user A has /// iam.serviceAccounts.actAs permission to a service account SA, and there's another IAM policy states service /// account SA has permission P to the GCP folder F, then user A potentially has access to the GCP folder F. And /// those advanced analysis results will be included in /// AnalyzeIamPolicyResponse.service_account_impersonation_analysis. Default is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("analyzeServiceAccountImpersonation")] public virtual System.Nullable<bool> AnalyzeServiceAccountImpersonation { get; set; } /// <summary> /// Optional. If true, the identities section of the result will expand any Google groups appearing in an IAM /// policy binding. If IamPolicyAnalysisQuery.identity_selector is specified, the identity in the result will be /// determined by the selector, and this flag is not allowed to set. Default is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("expandGroups")] public virtual System.Nullable<bool> ExpandGroups { get; set; } /// <summary> /// Optional. If true and IamPolicyAnalysisQuery.resource_selector is not specified, the resource section of the /// result will expand any resource attached to an IAM policy to include resources lower in the resource /// hierarchy. For example, if the request analyzes for which resources user A has permission P, and the results /// include an IAM policy with P on a GCP folder, the results will also include resources in that folder with /// permission P. If true and IamPolicyAnalysisQuery.resource_selector is specified, the resource section of the /// result will expand the specified resource to include resources lower in the resource hierarchy. Only project /// or lower resources are supported. Folder and organization resource cannot be used together with this option. /// For example, if the request analyzes for which users have permission P on a GCP project with this option /// enabled, the results will include all users who have permission P on that project or any lower resource. /// Default is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("expandResources")] public virtual System.Nullable<bool> ExpandResources { get; set; } /// <summary> /// Optional. If true, the access section of result will expand any roles appearing in IAM policy bindings to /// include their permissions. If IamPolicyAnalysisQuery.access_selector is specified, the access section of the /// result will be determined by the selector, and this flag is not allowed to set. Default is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("expandRoles")] public virtual System.Nullable<bool> ExpandRoles { get; set; } /// <summary> /// Optional. If true, the result will output the relevant membership relationships between groups and other /// groups, and between groups and principals. Default is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("outputGroupEdges")] public virtual System.Nullable<bool> OutputGroupEdges { get; set; } /// <summary> /// Optional. If true, the result will output the relevant parent/child relationships between resources. Default /// is false. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("outputResourceEdges")] public virtual System.Nullable<bool> OutputResourceEdges { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Operating system information for the VM.</summary> public class OsInfo : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The system architecture of the operating system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("architecture")] public virtual string Architecture { get; set; } /// <summary>The VM hostname.</summary> [Newtonsoft.Json.JsonPropertyAttribute("hostname")] public virtual string Hostname { get; set; } /// <summary>The kernel release of the operating system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("kernelRelease")] public virtual string KernelRelease { get; set; } /// <summary>The kernel version of the operating system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("kernelVersion")] public virtual string KernelVersion { get; set; } /// <summary> /// The operating system long name. For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 /// Datacenter'. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("longName")] public virtual string LongName { get; set; } /// <summary>The current version of the OS Config agent running on the VM.</summary> [Newtonsoft.Json.JsonPropertyAttribute("osconfigAgentVersion")] public virtual string OsconfigAgentVersion { get; set; } /// <summary>The operating system short name. For example, 'windows' or 'debian'.</summary> [Newtonsoft.Json.JsonPropertyAttribute("shortName")] public virtual string ShortName { get; set; } /// <summary>The version of the operating system.</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual string Version { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Output configuration for export assets destination.</summary> public class OutputConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Destination on BigQuery. The output table stores the fields in asset Protobuf as columns in BigQuery. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("bigqueryDestination")] public virtual BigQueryDestination BigqueryDestination { get; set; } /// <summary>Destination on Cloud Storage.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsDestination")] public virtual GcsDestination GcsDestination { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifications of BigQuery partitioned table as export destination.</summary> public class PartitionSpec : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The partition key for BigQuery partitioned table.</summary> [Newtonsoft.Json.JsonPropertyAttribute("partitionKey")] public virtual string PartitionKey { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>IAM permissions</summary> public class Permissions : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A list of permissions. A sample permission string: `compute.disk.get`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> PermissionsValue { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A /// `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single /// `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A /// `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. /// For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical /// expression that allows access to a resource only if the expression evaluates to `true`. A condition can add /// constraints based on attributes of the request, the resource, or both. To learn which resources support /// conditions in their IAM policies, see the [IAM /// documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { "bindings": /// [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", /// "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, /// { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { /// "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time /// &amp;lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** /// bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - /// serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - /// members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable /// access description: Does not grant access after Sep 2020 expression: request.time &amp;lt; /// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 For a description of IAM and its features, /// see the [IAM documentation](https://cloud.google.com/iam/docs/). /// </summary> public class Policy : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Specifies cloud audit logging configuration for this policy.</summary> [Newtonsoft.Json.JsonPropertyAttribute("auditConfigs")] public virtual System.Collections.Generic.IList<AuditConfig> AuditConfigs { get; set; } /// <summary> /// Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that /// determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one /// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals /// can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the /// `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you /// can add another 1,450 principals to the `bindings` in the `Policy`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("bindings")] public virtual System.Collections.Generic.IList<Binding> Bindings { get; set; } /// <summary> /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy /// from overwriting each other. It is strongly suggested that systems make use of the `etag` in the /// read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned /// in the response to `getIamPolicy`, and systems are expected to put that etag in the request to /// `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** /// If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit /// this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the /// conditions in the version `3` policy are lost. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("etag")] public virtual string ETag { get; set; } /// <summary> /// Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid /// value are rejected. Any operation that affects conditional role bindings must specify version `3`. This /// requirement applies to the following operations: * Getting a policy that includes a conditional role binding /// * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing /// any role binding, with or without a condition, from a policy that includes conditions **Important:** If you /// use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this /// field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the /// conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on /// that policy may specify any valid version or leave the field unset. To learn which resources support /// conditions in their IAM policies, see the [IAM /// documentation](https://cloud.google.com/iam/help/conditions/resource-policies). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual System.Nullable<int> Version { get; set; } } /// <summary>A Pub/Sub destination.</summary> public class PubsubDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The name of the Pub/Sub topic to publish to. Example: `projects/PROJECT_ID/topics/TOPIC_ID`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("topic")] public virtual string Topic { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The query content.</summary> public class QueryContent : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// An IAM Policy Analysis query, which could be used in the AssetService.AnalyzeIamPolicy rpc or the /// AssetService.AnalyzeIamPolicyLongrunning rpc. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("iamPolicyAnalysisQuery")] public virtual IamPolicyAnalysisQuery IamPolicyAnalysisQuery { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset identifier in Google Cloud which contains its name, type and ancestors. An asset can be any resource in /// the Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), a resource outside /// the Google Cloud resource hierarchy (such as Google Kubernetes Engine clusters and objects), or a policy (e.g. /// Cloud IAM policy). See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> public class RelatedAsset : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The ancestors of an asset in Google Cloud [resource /// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), represented as /// a list of relative resource names. An ancestry path starts with the closest ancestor in the hierarchy and /// ends at root. Example: `["projects/123456789", "folders/5432", "organizations/1234"]` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("ancestors")] public virtual System.Collections.Generic.IList<string> Ancestors { get; set; } /// <summary> /// The full name of the asset. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` See [Resource /// names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("asset")] public virtual string Asset { get; set; } /// <summary> /// The type of the asset. Example: `compute.googleapis.com/Disk` See [Supported asset /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) for more information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The detailed related assets with the `relationship_type`.</summary> public class RelatedAssets : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The peer resources of the relationship.</summary> [Newtonsoft.Json.JsonPropertyAttribute("assets")] public virtual System.Collections.Generic.IList<RelatedAsset> Assets { get; set; } /// <summary>The detailed relationship attributes.</summary> [Newtonsoft.Json.JsonPropertyAttribute("relationshipAttributes")] public virtual RelationshipAttributes RelationshipAttributes { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The detailed related resource.</summary> public class RelatedResource : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The type of the asset. Example: `compute.googleapis.com/Instance`</summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// The full resource name of the related resource. Example: /// `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("fullResourceName")] public virtual string FullResourceName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The related resources of the primary resource.</summary> public class RelatedResources : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The detailed related resources of the primary resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("relatedResources")] public virtual System.Collections.Generic.IList<RelatedResource> RelatedResourcesValue { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// The relationship attributes which include `type`, `source_resource_type`, `target_resource_type` and `action`. /// </summary> public class RelationshipAttributes : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The detail of the relationship, e.g. `contains`, `attaches`</summary> [Newtonsoft.Json.JsonPropertyAttribute("action")] public virtual string Action { get; set; } /// <summary>The source asset type. Example: `compute.googleapis.com/Instance`</summary> [Newtonsoft.Json.JsonPropertyAttribute("sourceResourceType")] public virtual string SourceResourceType { get; set; } /// <summary>The target asset type. Example: `compute.googleapis.com/Disk`</summary> [Newtonsoft.Json.JsonPropertyAttribute("targetResourceType")] public virtual string TargetResourceType { get; set; } /// <summary>The unique identifier of the relationship type. Example: `INSTANCE_TO_INSTANCEGROUP`</summary> [Newtonsoft.Json.JsonPropertyAttribute("type")] public virtual string Type { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A representation of a Google Cloud resource.</summary> public class Resource : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The content of the resource, in which some sensitive fields are removed and may not be present. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("data")] public virtual System.Collections.Generic.IDictionary<string, object> Data { get; set; } /// <summary> /// The URL of the discovery document containing the resource's JSON schema. Example: /// `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` This value is unspecified for resources that /// do not have an API based on a discovery document, such as Cloud Bigtable. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("discoveryDocumentUri")] public virtual string DiscoveryDocumentUri { get; set; } /// <summary> /// The JSON schema name listed in the discovery document. Example: `Project` This value is unspecified for /// resources that do not have an API based on a discovery document, such as Cloud Bigtable. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("discoveryName")] public virtual string DiscoveryName { get; set; } /// <summary> /// The location of the resource in Google Cloud, such as its zone and region. For more information, see /// https://cloud.google.com/about/locations/. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("location")] public virtual string Location { get; set; } /// <summary> /// The full name of the immediate parent of this resource. See [Resource /// Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) for more information. For /// Google Cloud assets, this value is the parent resource defined in the [Cloud IAM policy /// hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). Example: /// `//cloudresourcemanager.googleapis.com/projects/my_project_123` For third-party assets, this field may be /// set differently. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("parent")] public virtual string Parent { get; set; } /// <summary> /// The REST URL for accessing the resource. An HTTP `GET` request using this URL returns the resource itself. /// Example: `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` This value is unspecified /// for resources without a REST API. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceUrl")] public virtual string ResourceUrl { get; set; } /// <summary>The API version. Example: `v1`</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual string Version { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A result of Resource Search, containing information of a cloud resource.</summary> public class ResourceSearchResult : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// The additional searchable attributes of this resource. The attributes may vary from one resource type to /// another. Examples: `projectId` for Project, `dnsName` for DNS ManagedZone. This field contains a subset of /// the resource metadata fields that are returned by the List or Get APIs provided by the corresponding GCP /// service (e.g., Compute Engine). see [API references and supported searchable /// attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types) to /// see which fields are included. You can search values of these fields through free text search. However, you /// should not consume the field programically as the field names and values may change as the GCP service /// updates to a new incompatible API version. To search against the `additional_attributes`: * use a free text /// query to match the attributes values. Example: to search `additional_attributes = { dnsName: "foobar" }`, /// you can issue a query `foobar`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("additionalAttributes")] public virtual System.Collections.Generic.IDictionary<string, object> AdditionalAttributes { get; set; } /// <summary> /// The type of this resource. Example: `compute.googleapis.com/Disk`. To search against the `asset_type`: * /// specify the `asset_type` field in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("assetType")] public virtual string AssetType { get; set; } /// <summary> /// Attached resources of this resource. For example, an OSConfig Inventory is an attached resource of a Compute /// Instance. This field is repeated because a resource could have multiple attached resources. This /// `attached_resources` field is not searchable. Some attributes of the attached resources are exposed in /// `additional_attributes` field, so as to allow users to search on them. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("attachedResources")] public virtual System.Collections.Generic.IList<AttachedResource> AttachedResources { get; set; } /// <summary> /// The create timestamp of this resource, at which the resource was created. The granularity is in seconds. /// Timestamp.nanos will always be 0. This field is available only when the resource's Protobuf contains it. To /// search against `create_time`: * use a field query. - value in seconds since unix epoch. Example: `createTime /// &amp;gt; 1609459200` - value in date string. Example: `createTime &amp;gt; 2021-01-01` - value in date-time /// string (must be quoted). Example: `createTime &amp;gt; "2021-01-01T00:00:00"` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary> /// One or more paragraphs of text description of this resource. Maximum length could be up to 1M bytes. This /// field is available only when the resource's Protobuf contains it. To search against the `description`: * use /// a field query. Example: `description:"important instance"` * use a free text query. Example: `"important /// instance"` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary> /// The display name of this resource. This field is available only when the resource's Protobuf contains it. To /// search against the `display_name`: * use a field query. Example: `displayName:"My Instance"` * use a free /// text query. Example: `"My Instance"` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("displayName")] public virtual string DisplayName { get; set; } /// <summary> /// The folder(s) that this resource belongs to, in the form of folders/{FOLDER_NUMBER}. This field is available /// when the resource belongs to one or more folders. To search against `folders`: * use a field query. Example: /// `folders:(123 OR 456)` * use a free text query. Example: `123` * specify the `scope` field as this folder in /// your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("folders")] public virtual System.Collections.Generic.IList<string> Folders { get; set; } /// <summary> /// The Cloud KMS /// [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) name /// or /// [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) /// name. This field is available only when the resource's Protobuf contains it. To search against the /// `kms_key`: * use a field query. Example: `kmsKey:key` * use a free text query. Example: `key` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("kmsKey")] public virtual string KmsKey { get; set; } /// <summary> /// Labels associated with this resource. See [Labelling and grouping GCP /// resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) /// for more information. This field is available only when the resource's Protobuf contains it. To search /// against the `labels`: * use a field query: - query on any label's key or value. Example: `labels:prod` - /// query by a given label. Example: `labels.env:prod` - query by a given label's existence. Example: /// `labels.env:*` * use a free text query. Example: `prod` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary> /// Location can be `global`, regional like `us-east1`, or zonal like `us-west1-b`. This field is available only /// when the resource's Protobuf contains it. To search against the `location`: * use a field query. Example: /// `location:us-west*` * use a free text query. Example: `us-west*` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("location")] public virtual string Location { get; set; } /// <summary> /// The full resource name of this resource. Example: /// `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. See [Cloud Asset /// Inventory Resource Name Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) for more /// information. To search against the `name`: * use a field query. Example: `name:instance1` * use a free text /// query. Example: `instance1` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary> /// Network tags associated with this resource. Like labels, network tags are a type of annotations used to /// group GCP resources. See [Labelling GCP /// resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) /// for more information. This field is available only when the resource's Protobuf contains it. To search /// against the `network_tags`: * use a field query. Example: `networkTags:internal` * use a free text query. /// Example: `internal` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("networkTags")] public virtual System.Collections.Generic.IList<string> NetworkTags { get; set; } /// <summary> /// The organization that this resource belongs to, in the form of organizations/{ORGANIZATION_NUMBER}. This /// field is available when the resource belongs to an organization. To search against `organization`: * use a /// field query. Example: `organization:123` * use a free text query. Example: `123` * specify the `scope` field /// as this organization in your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("organization")] public virtual string Organization { get; set; } /// <summary> /// The type of this resource's immediate parent, if there is one. To search against the `parent_asset_type`: * /// use a field query. Example: `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` * use a free /// text query. Example: `cloudresourcemanager.googleapis.com/Project` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("parentAssetType")] public virtual string ParentAssetType { get; set; } /// <summary> /// The full resource name of this resource's parent, if it has one. To search against the /// `parent_full_resource_name`: * use a field query. Example: `parentFullResourceName:"project-name"` * use a /// free text query. Example: `project-name` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("parentFullResourceName")] public virtual string ParentFullResourceName { get; set; } /// <summary> /// The project that this resource belongs to, in the form of projects/{PROJECT_NUMBER}. This field is available /// when the resource belongs to a project. To search against `project`: * use a field query. Example: /// `project:12345` * use a free text query. Example: `12345` * specify the `scope` field as this project in /// your search request. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("project")] public virtual string Project { get; set; } /// <summary> /// A map of related resources of this resource, keyed by the relationship type. A relationship type is in the /// format of {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, `DISK_TO_NETWORK`, /// `INSTANCE_TO_INSTANCEGROUP`. See [supported relationship /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("relationships")] public virtual System.Collections.Generic.IDictionary<string, RelatedResources> Relationships { get; set; } /// <summary> /// The state of this resource. Different resources types have different state definitions that are mapped from /// various fields of different resource types. This field is available only when the resource's Protobuf /// contains it. Example: If the resource is an instance provided by Compute Engine, its state will include /// PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` /// definition in [API Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). If the /// resource is a project provided by Cloud Resource Manager, its state will include /// LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and DELETE_IN_PROGRESS. See `lifecycleState` /// definition in [API Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). To /// search against the `state`: * use a field query. Example: `state:RUNNING` * use a free text query. Example: /// `RUNNING` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("state")] public virtual string State { get; set; } /// <summary> /// The last update timestamp of this resource, at which the resource was last modified or deleted. The /// granularity is in seconds. Timestamp.nanos will always be 0. This field is available only when the /// resource's Protobuf contains it. To search against `update_time`: * use a field query. - value in seconds /// since unix epoch. Example: `updateTime &amp;lt; 1609459200` - value in date string. Example: `updateTime /// &amp;lt; 2021-01-01` - value in date-time string (must be quoted). Example: `updateTime &amp;lt; /// "2021-01-01T00:00:00"` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("updateTime")] public virtual object UpdateTime { get; set; } /// <summary> /// Versioned resource representations of this resource. This is repeated because there could be multiple /// versions of resource representations during version migration. This `versioned_resources` field is not /// searchable. Some attributes of the resource representations are exposed in `additional_attributes` field, so /// as to allow users to search on them. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("versionedResources")] public virtual System.Collections.Generic.IList<VersionedResource> VersionedResources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Specifies the resource to analyze for access policies, which may be set directly on the resource, or on /// ancestors such as organizations, folders or projects. /// </summary> public class ResourceSelector : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The [full resource name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) of a /// resource of [supported resource /// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("fullResourceName")] public virtual string FullResourceName { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A saved query which can be shared with others or used later.</summary> public class SavedQuery : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The query content.</summary> [Newtonsoft.Json.JsonPropertyAttribute("content")] public virtual QueryContent Content { get; set; } /// <summary>Output only. The create time of this saved query.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Output only. The account's email address who has created this saved query.</summary> [Newtonsoft.Json.JsonPropertyAttribute("creator")] public virtual string Creator { get; set; } /// <summary>The description of this saved query. This value should be fewer than 255 characters.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary> /// Labels applied on the resource. This value should not contain more than 10 entries. The key and value of /// each entry must be non-empty and fewer than 64 characters. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>Output only. The last update time of this saved query.</summary> [Newtonsoft.Json.JsonPropertyAttribute("lastUpdateTime")] public virtual object LastUpdateTime { get; set; } /// <summary>Output only. The account's email address who has updated this saved query most recently.</summary> [Newtonsoft.Json.JsonPropertyAttribute("lastUpdater")] public virtual string LastUpdater { get; set; } /// <summary> /// The resource name of the saved query. The format must be: * /// projects/project_number/savedQueries/saved_query_id * folders/folder_number/savedQueries/saved_query_id * /// organizations/organization_number/savedQueries/saved_query_id /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Search all IAM policies response.</summary> public class SearchAllIamPoliciesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Set if there are more results than those appearing in this response; to get the next set of results, call /// this method again, using this value as the `page_token`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary> /// A list of IamPolicy that match the search query. Related information such as the associated resource is /// returned along with the policy. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("results")] public virtual System.Collections.Generic.IList<IamPolicySearchResult> Results { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Search all resources response.</summary> public class SearchAllResourcesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// If there are more results than those appearing in this response, then `next_page_token` is included. To get /// the next set of results, call this method again using the value of `next_page_token` as `page_token`. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary> /// A list of Resources that match the search query. It contains the resource standard metadata information. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("results")] public virtual System.Collections.Generic.IList<ResourceSearchResult> Results { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Software package information of the operating system.</summary> public class SoftwarePackage : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Details of an APT package. For details about the apt package manager, see https://wiki.debian.org/Apt. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("aptPackage")] public virtual VersionedPackage AptPackage { get; set; } /// <summary>Details of a COS package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cosPackage")] public virtual VersionedPackage CosPackage { get; set; } /// <summary> /// Details of a Googet package. For details about the googet package manager, see /// https://github.com/google/googet. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("googetPackage")] public virtual VersionedPackage GoogetPackage { get; set; } /// <summary> /// Details of a Windows Quick Fix engineering package. See /// https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering for info in Windows /// Quick Fix Engineering. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("qfePackage")] public virtual WindowsQuickFixEngineeringPackage QfePackage { get; set; } /// <summary>Details of Windows Application.</summary> [Newtonsoft.Json.JsonPropertyAttribute("windowsApplication")] public virtual WindowsApplication WindowsApplication { get; set; } /// <summary> /// Details of a Windows Update package. See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for /// information about Windows Update. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("wuaPackage")] public virtual WindowsUpdatePackage WuaPackage { get; set; } /// <summary> /// Yum package info. For details about the yum package manager, see /// https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("yumPackage")] public virtual VersionedPackage YumPackage { get; set; } /// <summary> /// Details of a Zypper package. For details about the Zypper package manager, see /// https://en.opensuse.org/SDB:Zypper_manual. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("zypperPackage")] public virtual VersionedPackage ZypperPackage { get; set; } /// <summary> /// Details of a Zypper patch. For details about the Zypper package manager, see /// https://en.opensuse.org/SDB:Zypper_manual. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("zypperPatch")] public virtual ZypperPatch ZypperPatch { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// The `Status` type defines a logical error model that is suitable for different programming environments, /// including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains /// three pieces of data: error code, error message, and error details. You can find out more about this error model /// and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). /// </summary> public class Status : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The status code, which should be an enum value of google.rpc.Code.</summary> [Newtonsoft.Json.JsonPropertyAttribute("code")] public virtual System.Nullable<int> Code { get; set; } /// <summary> /// A list of messages that carry the error details. There is a common set of message types for APIs to use. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("details")] public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string, object>> Details { get; set; } /// <summary> /// A developer-facing error message, which should be in English. Any user-facing error message should be /// localized and sent in the google.rpc.Status.details field, or localized by the client. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("message")] public virtual string Message { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// An asset in Google Cloud and its temporal metadata, including the time window when it was observed and its /// status during that window. /// </summary> public class TemporalAsset : Google.Apis.Requests.IDirectResponseSchema { /// <summary>An asset in Google Cloud.</summary> [Newtonsoft.Json.JsonPropertyAttribute("asset")] public virtual Asset Asset { get; set; } /// <summary>Whether the asset has been deleted or not.</summary> [Newtonsoft.Json.JsonPropertyAttribute("deleted")] public virtual System.Nullable<bool> Deleted { get; set; } /// <summary> /// Prior copy of the asset. Populated if prior_asset_state is PRESENT. Currently this is only set for responses /// in Real-Time Feed. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("priorAsset")] public virtual Asset PriorAsset { get; set; } /// <summary>State of prior_asset.</summary> [Newtonsoft.Json.JsonPropertyAttribute("priorAssetState")] public virtual string PriorAssetState { get; set; } /// <summary>The time window when the asset data and state was observed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("window")] public virtual TimeWindow Window { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A time window specified by its `start_time` and `end_time`.</summary> public class TimeWindow : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// End time of the time window (inclusive). If not specified, the current timestamp is used instead. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("endTime")] public virtual object EndTime { get; set; } /// <summary>Start time of the time window (exclusive).</summary> [Newtonsoft.Json.JsonPropertyAttribute("startTime")] public virtual object StartTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Update asset feed request.</summary> public class UpdateFeedRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// Required. The new values of feed details. It must match an existing feed and the field `name` must be in the /// format of: projects/project_number/feeds/feed_id or folders/folder_number/feeds/feed_id or /// organizations/organization_number/feeds/feed_id. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("feed")] public virtual Feed Feed { get; set; } /// <summary> /// Required. Only updates the `feed` fields indicated by this mask. The field mask must not be empty, and it /// must not contain fields that are immutable or only set by the server. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("updateMask")] public virtual object UpdateMask { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Information related to the a standard versioned package. This includes package info for APT, Yum, Zypper, and /// Googet package managers. /// </summary> public class VersionedPackage : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The system architecture this package is intended for.</summary> [Newtonsoft.Json.JsonPropertyAttribute("architecture")] public virtual string Architecture { get; set; } /// <summary>The name of the package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("packageName")] public virtual string PackageName { get; set; } /// <summary>The version of the package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual string Version { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Resource representation as defined by the corresponding service providing the resource for a given API version. /// </summary> public class VersionedResource : Google.Apis.Requests.IDirectResponseSchema { /// <summary> /// JSON representation of the resource as defined by the corresponding service providing this resource. /// Example: If the resource is an instance provided by Compute Engine, this field will contain the JSON /// representation of the instance as defined by Compute Engine: /// `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. You can find the resource definition /// for each supported resource type in this table: /// `https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types` /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("resource")] public virtual System.Collections.Generic.IDictionary<string, object> Resource { get; set; } /// <summary> /// API version of the resource. Example: If the resource is an instance provided by Compute Engine v1 API as /// defined in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, version will be "v1". /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("version")] public virtual string Version { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Contains information about a Windows application that is retrieved from the Windows Registry. For more /// information about these fields, see: https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key /// </summary> public class WindowsApplication : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the application or product.</summary> [Newtonsoft.Json.JsonPropertyAttribute("displayName")] public virtual string DisplayName { get; set; } /// <summary>The version of the product or application in string format.</summary> [Newtonsoft.Json.JsonPropertyAttribute("displayVersion")] public virtual string DisplayVersion { get; set; } /// <summary>The internet address for technical support.</summary> [Newtonsoft.Json.JsonPropertyAttribute("helpLink")] public virtual string HelpLink { get; set; } /// <summary> /// The last time this product received service. The value of this property is replaced each time a patch is /// applied or removed from the product or the command-line option is used to repair the product. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("installDate")] public virtual Date InstallDate { get; set; } /// <summary>The name of the manufacturer for the product or application.</summary> [Newtonsoft.Json.JsonPropertyAttribute("publisher")] public virtual string Publisher { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Information related to a Quick Fix Engineering package. Fields are taken from Windows QuickFixEngineering /// Interface and match the source names: /// https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering /// </summary> public class WindowsQuickFixEngineeringPackage : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A short textual description of the QFE update.</summary> [Newtonsoft.Json.JsonPropertyAttribute("caption")] public virtual string Caption { get; set; } /// <summary>A textual description of the QFE update.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary>Unique identifier associated with a particular QFE update.</summary> [Newtonsoft.Json.JsonPropertyAttribute("hotFixId")] public virtual string HotFixId { get; set; } /// <summary>Date that the QFE update was installed. Mapped from installed_on field.</summary> [Newtonsoft.Json.JsonPropertyAttribute("installTime")] public virtual object InstallTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Categories specified by the Windows Update.</summary> public class WindowsUpdateCategory : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The identifier of the windows update category.</summary> [Newtonsoft.Json.JsonPropertyAttribute("id")] public virtual string Id { get; set; } /// <summary>The name of the windows update category.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary> /// Details related to a Windows Update package. Field data and names are taken from Windows Update API IUpdate /// Interface: https://docs.microsoft.com/en-us/windows/win32/api/_wua/ Descriptive fields like title, and /// description are localized based on the locale of the VM being updated. /// </summary> public class WindowsUpdatePackage : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The categories that are associated with this update package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("categories")] public virtual System.Collections.Generic.IList<WindowsUpdateCategory> Categories { get; set; } /// <summary>The localized description of the update package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("description")] public virtual string Description { get; set; } /// <summary> /// A collection of Microsoft Knowledge Base article IDs that are associated with the update package. /// </summary> [Newtonsoft.Json.JsonPropertyAttribute("kbArticleIds")] public virtual System.Collections.Generic.IList<string> KbArticleIds { get; set; } /// <summary>The last published date of the update, in (UTC) date and time.</summary> [Newtonsoft.Json.JsonPropertyAttribute("lastDeploymentChangeTime")] public virtual object LastDeploymentChangeTime { get; set; } /// <summary>A collection of URLs that provide more information about the update package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("moreInfoUrls")] public virtual System.Collections.Generic.IList<string> MoreInfoUrls { get; set; } /// <summary>The revision number of this update package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("revisionNumber")] public virtual System.Nullable<int> RevisionNumber { get; set; } /// <summary>A hyperlink to the language-specific support information for the update.</summary> [Newtonsoft.Json.JsonPropertyAttribute("supportUrl")] public virtual string SupportUrl { get; set; } /// <summary>The localized title of the update package.</summary> [Newtonsoft.Json.JsonPropertyAttribute("title")] public virtual string Title { get; set; } /// <summary>Gets the identifier of an update package. Stays the same across revisions.</summary> [Newtonsoft.Json.JsonPropertyAttribute("updateId")] public virtual string UpdateId { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Details related to a Zypper Patch.</summary> public class ZypperPatch : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The category of the patch.</summary> [Newtonsoft.Json.JsonPropertyAttribute("category")] public virtual string Category { get; set; } /// <summary>The name of the patch.</summary> [Newtonsoft.Json.JsonPropertyAttribute("patchName")] public virtual string PatchName { get; set; } /// <summary>The severity specified for this patch</summary> [Newtonsoft.Json.JsonPropertyAttribute("severity")] public virtual string Severity { get; set; } /// <summary>Any summary information provided about this patch.</summary> [Newtonsoft.Json.JsonPropertyAttribute("summary")] public virtual string Summary { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } }
55.763126
200
0.647561
[ "Apache-2.0" ]
nwls-hermesj/google-api-dotnet-client
Src/Generated/Google.Apis.CloudAsset.v1/Google.Apis.CloudAsset.v1.cs
323,928
C#