content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using UnityEngine; namespace Assets.Gameplay.Character.Implementation.Orders { public abstract class Order : ScriptableObject, ICharacterOrder<BasicCharacter> { protected Order(string name) { Name = name; } public void Execute(IOrderArguments<BasicCharacter> arguments) { Execute((CharacterOrderArguments)arguments); } public string Name { get; } public void Execute<T>(IOrderArguments<T> arguments) { Execute((CharacterOrderArguments)arguments); } public abstract void Execute(CharacterOrderArguments arguments); } }
25.5
83
0.634992
[ "MIT" ]
martin-obert/WWI_Trenches
WWI_Trenches_Prototypes/Assets/Gameplay/Character/Implementation/Orders/Order.cs
665
C#
using System.Collections.Generic; using System.Web.Mvc; namespace Orchard.Mvc.ViewEngines { public class CreateThemeViewEngineParams { public string VirtualPath { get; set; } } public class CreateModulesViewEngineParams { public IEnumerable<string> VirtualPaths { get; set; } } public interface IViewEngineProvider : IDependency { IViewEngine CreateThemeViewEngine(CreateThemeViewEngineParams parameters); IViewEngine CreateModulesViewEngine(CreateModulesViewEngineParams parameters); } }
31.388889
87
0.727434
[ "BSD-3-Clause" ]
mofashi2011/orchardcms
src/Orchard/Mvc/ViewEngines/IViewEngineProvider.cs
565
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("BasicCompany.Web")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BasicCompany.Web")] [assembly: AssemblyCopyright("Copyright © 2019")] [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("023339ce-eea7-4e9b-9a7f-960202ad3135")] // 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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.916667
84
0.748718
[ "Apache-2.0" ]
GoranHalvarsson/Helix.Examples
examples/helix-basic-tds-consolidated/src/BasicCompany.Web/Properties/AssemblyInfo.cs
1,368
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Aws.WafV2.Inputs { public sealed class WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexPatternSetReferenceStatementTextTransformationArgs : Pulumi.ResourceArgs { /// <summary> /// Relative processing order for multiple transformations that are defined for a rule statement. AWS WAF processes all transformations, from lowest priority to highest, before inspecting the transformed content. /// </summary> [Input("priority", required: true)] public Input<int> Priority { get; set; } = null!; /// <summary> /// Transformation to apply, please refer to the Text Transformation [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details. /// </summary> [Input("type", required: true)] public Input<string> Type { get; set; } = null!; public WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexPatternSetReferenceStatementTextTransformationArgs() { } } }
45.59375
220
0.736806
[ "ECL-2.0", "Apache-2.0" ]
chivandikwa/pulumi-aws
sdk/dotnet/WafV2/Inputs/WebAclRuleStatementRateBasedStatementScopeDownStatementNotStatementStatementNotStatementStatementRegexPatternSetReferenceStatementTextTransformationArgs.cs
1,459
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 TrackballScroll.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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> /// Returns the cached ResourceManager instance used by this class. /// </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("TrackballScroll.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// </summary> internal static System.Drawing.Icon icon { get { object obj = ResourceManager.GetObject("icon", resourceCulture); return ((System.Drawing.Icon)(obj)); } } /// <summary> /// Looks up a localized string similar to About TrackballScroll. /// </summary> internal static string TextButtonAbout { get { return ResourceManager.GetString("TextButtonAbout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Emulate middle button when not scrolling. /// </summary> internal static string TextButtonEmulateMiddleButton { get { return ResourceManager.GetString("TextButtonEmulateMiddleButton", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Exit. /// </summary> internal static string TextButtonExit { get { return ResourceManager.GetString("TextButtonExit", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Paused (click to resume). /// </summary> internal static string TextButtonHookDisabled { get { return ResourceManager.GetString("TextButtonHookDisabled", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Enabled (click to pause). /// </summary> internal static string TextButtonHookEnabled { get { return ResourceManager.GetString("TextButtonHookEnabled", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Use button X1. /// </summary> internal static string TextButtonHookUseX1 { get { return ResourceManager.GetString("TextButtonHookUseX1", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Use button X2. /// </summary> internal static string TextButtonHookUseX2 { get { return ResourceManager.GetString("TextButtonHookUseX2", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prefer vertical/horizontal movement (disabled). /// </summary> internal static string TextButtonPreferAxisDisabled { get { return ResourceManager.GetString("TextButtonPreferAxisDisabled", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Prefer vertical/horizontal movement. /// </summary> internal static string TextButtonPreferAxisEnabled { get { return ResourceManager.GetString("TextButtonPreferAxisEnabled", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reverse horizontal movement. /// </summary> internal static string TextButtonReverseHorizontalScroll { get { return ResourceManager.GetString("TextButtonReverseHorizontalScroll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to Reverse verticall movement. /// </summary> internal static string TextButtonReverseVerticalScroll { get { return ResourceManager.GetString("TextButtonReverseVerticalScroll", resourceCulture); } } /// <summary> /// Looks up a localized string similar to TrackballScroll v6 ///Copyright (c) 2016-2018 Martin Seelge ///Project URL: https://github.com/Seelge/TrackballScroll/ /// ///Scroll with your trackball / mouse movement when holding down button X1 or X2 (typically buttons 3, 4). ///See README.md for additional information. /// ///License: The MIT License ///https://github.com/Seelge/TrackballScroll/blob/master/LICENSE. /// </summary> internal static string TextMessageBoxAbout { get { return ResourceManager.GetString("TextMessageBoxAbout", resourceCulture); } } /// <summary> /// Looks up a localized string similar to TrackballScroll. /// </summary> internal static string TextTitle { get { return ResourceManager.GetString("TextTitle", resourceCulture); } } } }
39.140704
181
0.577353
[ "MIT" ]
DBAJustin/TrackballScroll
TrackballScroll/Properties/Resources.Designer.cs
7,791
C#
using SeleniumWebdriver.Interfaces; using System; namespace SeleniumWebdriver.Configuration { public class XmlReader : IConfig { public BrowserType GetBrowser() { throw new NotImplementedException(); } public int GetElementLoadTimeout() { throw new NotImplementedException(); } public int GetPageLoadTimeout() { throw new NotImplementedException(); } public string GetPassword() { throw new NotImplementedException(); } public string GetUsername() { throw new NotImplementedException(); } public string GetWebsite() { throw new NotImplementedException(); } } }
20.410256
48
0.561558
[ "BSD-3-Clause" ]
thaotrant/SeleniumWebdriver
Configuration/XmlReader.cs
798
C#
using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; using System.Windows.Input; using Windows.UI.Xaml; using FindWord.Common; using FindWord.Messaging; using FindWord.Services; using System; namespace FindWord.ViewModels { public class StartPageViewModel : BindableBase { private const int LengthOfMaxWord = 100; public event EventHandler LettesChanged = delegate { }; #region Private Fields private Dictionary<int, List<string>> _findedWordsWithLength; private readonly INavigationService _navigator; private readonly IHub _messageHub; private readonly IDialogService _dialogService; private readonly SearchService _searchService; private readonly UndoRedoService _undoRedoService; private string _pattern; #endregion //Private Fields #region Constructor public StartPageViewModel(INavigationService navigator, IHub messageHub, IDialogService dialogService, SearchService searchService, UndoRedoService undoRedoService) { _navigator = navigator; _messageHub = messageHub; _dialogService = dialogService; _searchService = searchService; _undoRedoService = undoRedoService; TopN = 10; UndoCommand = _undoRedoService.UndoCommand; RedoCommand = _undoRedoService.RedoCommand; UndoEnabled = _undoRedoService.UndoEnabled; RedoEnabled = _undoRedoService.RedoEnabled; _undoRedoService.UndoEvent += UndoRedoServiceUndoEvent; _undoRedoService.RedoEvent += UndoRedoServiceRedoEvent; } #endregion //Constructor #region Public Properties private ObservableCollection<string> _letters; public ObservableCollection<string> Letters { get { if (_letters == null) _letters = new ObservableCollection<string>(); return _letters; } set { SetProperty(ref _letters, value); } } public int TopN { get; set; } private ObservableCollection<DataGroup> _allGroups; public ObservableCollection<DataGroup> AllGroups { get { if (_allGroups == null) _allGroups = new ObservableCollection<DataGroup>(); return _allGroups; } set { _allGroups = value; } } private bool _undoEnabled; public bool UndoEnabled { get { return _undoEnabled; } set { SetProperty<bool>(ref _undoEnabled, value); } } private bool _redoEnabled; public bool RedoEnabled { get { return _redoEnabled; } set { SetProperty<bool>(ref _redoEnabled, value); } } #endregion //Public Properties #region Commands public ICommand UndoCommand { get; set; } public ICommand RedoCommand { get; set; } #endregion //Commands #region Public Methods public async Task FindMatchedWords() { _pattern = _searchService.GetSearchPattern(Letters); _findedWordsWithLength = await _searchService.FindWordsByPatternAsync(_pattern, TopN); InitAppGroupsProp(); } public void ShowWordsWithTheSameLengthView(string title) { _messageHub.Send<ShowWordsWithTheSameLengthPageMessage>(new ShowWordsWithTheSameLengthPageMessage(title, _pattern, TopN)); } public void ShowProgressBar(Visibility progressBarVisibility) { _messageHub.Send<ShowProgressBarMessage>(new ShowProgressBarMessage(progressBarVisibility)); } public void SaveCurrentLettersState(ObservableCollection<string> _letters, bool isUser) { if (_undoRedoService == null) return; _undoRedoService.SaveCurrentLettersState(_letters, isUser); UndoEnabled = _undoRedoService.UndoEnabled; RedoEnabled = _undoRedoService.RedoEnabled; } #endregion //Public Methods #region Private Methods private bool InitAppGroupsProp() { var allGroups = new ObservableCollection<DataGroup>(); if (_findedWordsWithLength == null) return false; for (var i = 0; i < _findedWordsWithLength.Count; i++) { if (_findedWordsWithLength.Values.ElementAt(i).Count == 0) continue; var grWords = new DataGroup(); grWords.Title = string.Format("{0} LETTERS", _findedWordsWithLength.Keys.ElementAt(i)); grWords.Items = new ObservableCollection<object>(_findedWordsWithLength.Values.ElementAt(i)); allGroups.Add(grWords); } AllGroups = new ObservableCollection<DataGroup>(allGroups); return true; } #endregion //Private Methods #region Undo/Redo Event Handlers private void UndoRedoServiceRedoEvent(object sender, ObservableCollection<string> e) { Letters = e; UndoEnabled = _undoRedoService.UndoEnabled; RedoEnabled = _undoRedoService.RedoEnabled; LettesChanged(this, new EventArgs()); } private void UndoRedoServiceUndoEvent(object sender, ObservableCollection<string> e) { Letters = e; UndoEnabled = _undoRedoService.UndoEnabled; RedoEnabled = _undoRedoService.RedoEnabled; LettesChanged(this, new EventArgs()); } #endregion //Undo/Redo Event Handlers } }
30.047847
135
0.579618
[ "Apache-2.0" ]
EugeneBichel/XAML-Application-For-WindowsRT-Windows8
FindWord/WordFinder/ViewModels/StartPageViewModel.cs
6,282
C#
using Multiplayer.Common; using RimWorld; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Text; using System.Threading; using UnityEngine; using Verse; using Verse.Profile; using Verse.Sound; using Verse.Steam; namespace Multiplayer.Client { [HotSwappable] public class HostWindow : Window { public override Vector2 InitialSize => new Vector2(450f, height + 45f); private SaveFile file; public bool returnToServerBrowser; private bool withSimulation; private bool asyncTime; private float height; public HostWindow(SaveFile file = null, bool withSimulation = false) { closeOnAccept = false; doCloseX = true; this.withSimulation = withSimulation; this.file = file; settings.gameName = file?.gameName ?? Multiplayer.session?.gameName ?? $"{Multiplayer.username}'s game"; var localAddr = MpUtil.GetLocalIpAddress() ?? "127.0.0.1"; settings.lanAddress = localAddr; addressBuffer = localAddr; lan = true; settings.arbiter = true; } private ServerSettings settings = new ServerSettings(); private string maxPlayersBuffer, autosaveBuffer, addressBuffer; private bool lan, direct; public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.UpperCenter; string title; if (file == null) title = "MpHostIngame".Translate(); else if (file.replay) title = "MpHostReplay".Translate(); else title = "MpHostSavefile".Translate(); Widgets.Label(inRect.Down(0), title); Text.Anchor = TextAnchor.UpperLeft; Text.Font = GameFont.Small; var entry = new Rect(0, 45, inRect.width, 30f); var labelWidth = 100f; settings.gameName = TextEntryLabeled(entry, $"{"MpGameName".Translate()}: ", settings.gameName, labelWidth); entry = entry.Down(40); TextFieldNumericLabeled(entry.Width(labelWidth + 30f), $"{"MpMaxPlayers".Translate()}: ", ref settings.maxPlayers, ref maxPlayersBuffer, labelWidth, 0, 999); TextFieldNumericLabeled(entry.Right(200f).Width(labelWidth + 35f), $"{"MpAutosaveEvery".Translate()} ", ref settings.autosaveInterval, ref autosaveBuffer, labelWidth + 5f, 0, 999); Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(entry.Right(200f).Right(labelWidth + 35f), $" {"MpAutosaveMinutes".Translate()}"); Text.Anchor = TextAnchor.UpperLeft; entry = entry.Down(40); /*const char passChar = '\u2022'; if (Event.current.type == EventType.Repaint || Event.current.isMouse) TextEntryLabeled(entry.Width(200), "Password: ", new string(passChar, password.Length), labelWidth); else password = TextEntryLabeled(entry.Width(200), "Password: ", password, labelWidth); entry = entry.Down(40);*/ var directLabel = $"{"MpDirect".Translate()}: "; var directLabelWidth = Text.CalcSize(directLabel).x; CheckboxLabeled(entry.Width(130), directLabel, ref direct, placeTextNearCheckbox: true); if (direct) addressBuffer = Widgets.TextField(entry.Width(140).Right(130 + 10), addressBuffer); entry = entry.Down(30); var lanRect = entry.Width(130); CheckboxLabeled(lanRect, $"{"MpLan".Translate()}: ", ref lan, placeTextNearCheckbox: true); TooltipHandler.TipRegion(lanRect, $"{"MpLanDesc1".Translate()}\n\n{"MpLanDesc2".Translate(settings.lanAddress)}"); entry = entry.Down(30); if (SteamManager.Initialized) { CheckboxLabeled(entry.Width(130), $"{"MpSteam".Translate()}: ", ref settings.steam, placeTextNearCheckbox: true); entry = entry.Down(30); } TooltipHandler.TipRegion(entry.Width(130), "MpArbiterDesc".Translate()); CheckboxLabeled(entry.Width(130), "The Arbiter: ", ref settings.arbiter, placeTextNearCheckbox: true); entry = entry.Down(30); if (MpVersion.IsDebug) { TooltipHandler.TipRegion(entry.Width(130), $"{"MpAsyncTimeDesc".Translate()}\n\n{"MpExperimentalFeature".Translate()}"); CheckboxLabeled(entry.Width(130), "Async time: ", ref asyncTime, placeTextNearCheckbox: true); entry = entry.Down(30); } if (Event.current.type == EventType.layout && height != entry.yMax) { height = entry.yMax; SetInitialSizeAndPosition(); } var buttonRect = new Rect((inRect.width - 100f) / 2f, inRect.height - 35f, 100f, 35f); if (Widgets.ButtonText(buttonRect, "MpHostButton".Translate())) TryHost(); } private void TryHost() { if (direct && !TryParseIp(addressBuffer, out settings.bindAddress, out settings.bindPort)) return; if (settings.gameName.NullOrEmpty()) { Messages.Message("MpInvalidGameName".Translate(), MessageTypeDefOf.RejectInput, false); return; } if (!direct) settings.bindAddress = null; if (!lan) settings.lanAddress = null; if (file?.replay ?? Multiplayer.IsReplay) HostFromReplay(settings); else if (file == null) ClientUtil.HostServer(settings, false); else HostFromSave(settings); Close(true); } private bool TryParseIp(string ip, out string addr, out int port) { port = MultiplayerServer.DefaultPort; addr = null; string[] parts = ip.Split(':'); if (!IPAddress.TryParse(parts[0], out IPAddress ipAddr)) { Messages.Message("MpInvalidAddress".Translate(), MessageTypeDefOf.RejectInput, false); return false; } addr = parts[0]; if (parts.Length >= 2 && (!int.TryParse(parts[1], out port) || port < 0 || port > ushort.MaxValue)) { Messages.Message("MpInvalidPort".Translate(), MessageTypeDefOf.RejectInput, false); return false; } return true; } public static void CheckboxLabeled(Rect rect, string label, ref bool checkOn, bool disabled = false, Texture2D texChecked = null, Texture2D texUnchecked = null, bool placeTextNearCheckbox = false) { TextAnchor anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; if (placeTextNearCheckbox) { float textWidth = Text.CalcSize(label).x; rect.x = rect.xMax - textWidth - 24f - 5f; rect.width = textWidth + 24f + 5f; } Widgets.Label(rect, label); if (!disabled && Widgets.ButtonInvisible(rect, false)) { checkOn = !checkOn; if (checkOn) SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); else SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); } Widgets.CheckboxDraw(rect.x + rect.width - 24f, rect.y, checkOn, disabled, 24f, null, null); Text.Anchor = anchor; } public static string TextEntryLabeled(Rect rect, string label, string text, float labelWidth) { Rect labelRect = rect.Rounded(); labelRect.width = labelWidth; Rect fieldRect = rect; fieldRect.xMin += labelWidth; TextAnchor anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(labelRect, label); Text.Anchor = anchor; return Widgets.TextField(fieldRect, text); } public static void TextFieldNumericLabeled(Rect rect, string label, ref int val, ref string buffer, float labelWidth, float min = 0, float max = float.MaxValue) { Rect labelRect = rect; labelRect.width = labelWidth; Rect fieldRect = rect; fieldRect.xMin += labelWidth; TextAnchor anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(labelRect, label); Text.Anchor = anchor; Widgets.TextFieldNumeric(fieldRect, ref val, ref buffer, min, max); } public override void PostClose() { if (returnToServerBrowser) Find.WindowStack.Add(new ServerBrowser()); } private void HostFromSave(ServerSettings settings) { LongEventHandler.QueueLongEvent(() => { MemoryUtility.ClearAllMapsAndWorld(); Current.Game = new Game(); Current.Game.InitData = new GameInitData(); Current.Game.InitData.gameToLoad = file.fileName; LongEventHandler.ExecuteWhenFinished(() => { LongEventHandler.QueueLongEvent(() => ClientUtil.HostServer(settings, false), "MpLoading", false, null); }); }, "Play", "LoadingLongEvent", true, null); } private void HostFromReplay(ServerSettings settings) { void ReplayLoaded() => ClientUtil.HostServer(settings, true, withSimulation); if (file != null) { TickPatch.forceSkip = true; Replay.LoadReplay(file.fileName, true, ReplayLoaded); } else { ReplayLoaded(); } } } }
36.732852
204
0.570614
[ "MIT" ]
Nylux/Multiplayer
Source/Client/Windows/HostWindow.cs
10,177
C#
using System; using System.Collections.Generic; namespace Vue2Spa.Models.DB { public partial class CasherLogfile { public int LoginoutId { get; set; } public short OperId { get; set; } public DateTime? LoginDate { get; set; } public DateTime? LogoutDate { get; set; } public byte? ModleId { get; set; } public byte ModelId { get; set; } } }
25.1875
49
0.615385
[ "MIT" ]
MoeinElwani/Holiday
Models/DB/CasherLogfile.cs
405
C#
using NullGuard; namespace Rothko { public struct SaveDialogResult { readonly bool _success; readonly string _fileName; public static readonly SaveDialogResult Failed = new SaveDialogResult(); public SaveDialogResult(string chosenFileName) { _success = true; _fileName = chosenFileName; } public bool Success { get { return _success; } } public string FileName { get { return _fileName; } } public override bool Equals([AllowNull]object obj) { if (!(obj is SaveDialogResult)) return false; return this == ((SaveDialogResult)obj); } public static bool operator ==(SaveDialogResult a, SaveDialogResult b) { return a._success == b._success && a._fileName == b._fileName; } public static bool operator !=(SaveDialogResult a, SaveDialogResult b) { return !(a == b); } public override int GetHashCode() { unchecked { return (17327 * 67 + _success.GetHashCode()) * 67 + (_fileName ?? "").GetHashCode(); } } } }
24.307692
100
0.533228
[ "MIT" ]
Haacked/Rothko
src/Rothko/Infrastructure/SaveDialogResult.cs
1,264
C#
namespace IdentityAPI.Configuration { public class JwtBearerTokenSettings { public string SecretKey { get; set; } public string Audience { get; set; } public string Issuer { get; set; } public int ExpiryTimeInSeconds { get; set; } public int RefreshTokenExpiryInDays { get; set; } } }
28.166667
57
0.639053
[ "MIT" ]
arhamhamood1306/Dotnet
src/Services/Identity/Identity.API/Configuration/JwtBearerTokenSettings.cs
340
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> // ------------------------------------------------------------------------------ #nullable enable #pragma warning disable CS1591 #pragma warning disable CS0108 #pragma warning disable 618 using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel.DataAnnotations; using System.Globalization; using System.Linq; using System.Runtime.Serialization; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using JetBrains.Space.Common; using JetBrains.Space.Common.Json.Serialization; using JetBrains.Space.Common.Json.Serialization.Polymorphism; using JetBrains.Space.Common.Types; namespace JetBrains.Space.Client { [JsonConverter(typeof(ClassNameDtoTypeConverter))] public class SamlMetadataResponse : IClassNameConvertible, IPropagatePropertyAccessPath { [JsonPropertyName("className")] public virtual string? ClassName => "SamlMetadataResponse"; public static SamlMetadataResponseError Error(List<string> messages) => new SamlMetadataResponseError(messages: messages); public static SamlMetadataResponseSuccess Success(string metadata) => new SamlMetadataResponseSuccess(metadata: metadata); public SamlMetadataResponse() { } public virtual void SetAccessPath(string path, bool validateHasBeenSet) { } } }
32.222222
81
0.663218
[ "Apache-2.0" ]
PatrickRatzow/space-dotnet-sdk
src/JetBrains.Space.Client/Generated/Dtos/SamlMetadataResponse.generated.cs
1,740
C#
using System; using Google.Authenticator; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace mfa_web_app.Pages { public class IndexModel : PageModel { private readonly ILogger<IndexModel> logger; private readonly TwoFactorAuthenticator mfaAuthenticator; private string accountSecretKey; private readonly string accountTitleNoSpaces; private readonly bool secretIsBase32; private readonly int qrPixelsPerModule; private readonly string issuer; public string QrCodeSetupImageUrl { get; set; } public bool? IsClientMFACodeValid { get; set; } public IndexModel(ILogger<IndexModel> logger, TwoFactorAuthenticator mfaAuthenticator, IConfiguration configuration) { this.logger = logger; this.mfaAuthenticator = mfaAuthenticator; accountSecretKey = configuration.GetValue<string>("mfaAccountSecretKey"); // "MySecret##!!++$$aaa0001111"; accountTitleNoSpaces = configuration.GetValue<string>("mfaAccountTitleNoSpaces"); // "OpusMagusMFAWebApp"; secretIsBase32 = configuration.GetValue<bool>("mfaSecretIsBase32"); // false; qrPixelsPerModule = configuration.GetValue<int>("mfaQrPixelsPerModule"); // 4; issuer = configuration.GetValue<string>("mfaIssuer"); // "OpusMagus"; } public void OnGet(string twoFactorCodeFromClient) { drawQRCode(); } [BindProperty] public ClientMFA ClientMFA { get; set; } public void OnPost() { drawQRCode(); if(!String.IsNullOrEmpty(ClientMFA.MFACode)) { IsClientMFACodeValid = mfaAuthenticator.ValidateTwoFactorPIN(accountSecretKey, ClientMFA.MFACode); logger.LogInformation($"Client code validation = {IsClientMFACodeValid}"); } else logger.LogInformation("No client code found."); } private void drawQRCode() { var setupCode = mfaAuthenticator.GenerateSetupCode(issuer, accountTitleNoSpaces, accountSecretKey, secretIsBase32, qrPixelsPerModule); QrCodeSetupImageUrl = setupCode.QrCodeSetupImageUrl; logger.LogInformation("Setup code generated."); } } }
40.629032
147
0.643509
[ "MIT" ]
michaelringholm/mfa
dotnet/mfa-web-app/Pages/Index.cshtml.cs
2,521
C#
using System; using System.Collections.Generic; using net.r_eg.MvsSln; using Xunit; namespace MvsSlnTest { public class SlnItemsTest { public static IEnumerable<object[]> GetAnSlnItemsAll() { yield return new object[] { SlnItems.All, SlnItems.LoadMinimalDefaultData }; yield return new object[] { SlnItems.AllMinimal, SlnItems.LoadDefaultData, SlnItems.PackagesConfigLegacy }; yield return new object[] { SlnItems.AllNoLoad, SlnItems.LoadDefaultData, SlnItems.LoadMinimalDefaultData, SlnItems.PackagesConfigLegacy, SlnItems.PackagesConfigSolution }; } [Theory] [MemberData(nameof(GetAnSlnItemsAll))] public void AllItemsTest2(SlnItems input, params SlnItems[] ignoring) { foreach(var item in Enum.GetValues(typeof(SlnItems))) { SlnItems v = (SlnItems)item; if(!input.HasFlag(v)) { bool failed = true; foreach(var ignore in ignoring) { if(v.HasFlag(ignore)) { failed = false; break; } } if(failed) { Assert.False(true, $"`{input}` is not completed. Found `{v}`"); } } } } [Fact] public void ItemsTest1() { Assert.Equal<uint>(0, (uint)SlnItems.None); } } }
32.54386
94
0.433423
[ "MIT" ]
3F/MvsSln
MvsSlnTest/SlnItemsTest.cs
1,857
C#
using System.Collections.Generic; namespace Algorithms.SortAlgorithms { /// <summary> /// MSD - most significant digit /// Best: O(wn) /// Average: O(wn) /// Worst: O(wn) /// Additional memory: w + n /// where w - word size /// </summary> /// <remarks> /// Applicable for string: b, ba, c, d, e, f, g, h, i, j /// - Recursive /// - If w is small and alphabet is big - many space is wasting /// </remarks> public class MSDRadixSorter : ISorter<string> { public void sort(string[] array) { this.internalSort(array, 0); } private void internalSort(string[] array, int charPosition) { if (array.Length <= 1) { return; } List<string>[] buckets = new List<string>[128]; for (var i = 0; i < buckets.Length; i++) { buckets[i] = new List<string>(); } foreach (string value in array) { int bucketNumber = value.Length > charPosition ? value[charPosition] : 0; buckets[bucketNumber].Add(value); } charPosition++; int position = 0; foreach (var bucket in buckets) { if (bucket.Count > 0) { var sortedBucket = bucket.ToArray(); this.internalSort(sortedBucket, charPosition); foreach (var item in sortedBucket) { array[position] = item; position++; } } } } } }
27.242424
67
0.431591
[ "MIT" ]
PranamBhat/Algorithms
Algorithms/SortAlgorithms/NonComparison/MSDRadixSorter.cs
1,800
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 ec2-2016-11-15.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.EC2.Model { /// <summary> /// Describes a VPC with a security group that references your security group. /// </summary> public partial class SecurityGroupReference { private string _groupId; private string _referencingVpcId; private string _vpcPeeringConnectionId; /// <summary> /// Gets and sets the property GroupId. /// <para> /// The ID of your security group. /// </para> /// </summary> public string GroupId { get { return this._groupId; } set { this._groupId = value; } } // Check to see if GroupId property is set internal bool IsSetGroupId() { return this._groupId != null; } /// <summary> /// Gets and sets the property ReferencingVpcId. /// <para> /// The ID of the VPC with the referencing security group. /// </para> /// </summary> public string ReferencingVpcId { get { return this._referencingVpcId; } set { this._referencingVpcId = value; } } // Check to see if ReferencingVpcId property is set internal bool IsSetReferencingVpcId() { return this._referencingVpcId != null; } /// <summary> /// Gets and sets the property VpcPeeringConnectionId. /// <para> /// The ID of the VPC peering connection. /// </para> /// </summary> public string VpcPeeringConnectionId { get { return this._vpcPeeringConnectionId; } set { this._vpcPeeringConnectionId = value; } } // Check to see if VpcPeeringConnectionId property is set internal bool IsSetVpcPeeringConnectionId() { return this._vpcPeeringConnectionId != null; } } }
29.463158
101
0.61129
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/EC2/Generated/Model/SecurityGroupReference.cs
2,799
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using Microsoft.CodeAnalysis.DocumentationComments; namespace Microsoft.CodeAnalysis.MetadataAsSource { internal partial class AbstractMetadataAsSourceService { private class WrappedMethodSymbol : AbstractWrappedSymbol, IMethodSymbol { private readonly IMethodSymbol _symbol; public WrappedMethodSymbol(IMethodSymbol methodSymbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService) : base(methodSymbol, canImplementImplicitly, docCommentFormattingService) { _symbol = methodSymbol; } public int Arity => _symbol.Arity; public ISymbol AssociatedSymbol => _symbol.AssociatedSymbol; public INamedTypeSymbol AssociatedAnonymousDelegate => _symbol.AssociatedAnonymousDelegate; public IMethodSymbol ConstructedFrom => _symbol.ConstructedFrom; public bool IsReadOnly => _symbol.IsReadOnly; public bool IsInitOnly => _symbol.IsInitOnly; public ImmutableArray<IMethodSymbol> ExplicitInterfaceImplementations { get { return CanImplementImplicitly ? ImmutableArray.Create<IMethodSymbol>() : _symbol.ExplicitInterfaceImplementations; } } public bool HidesBaseMethodsByName => _symbol.HidesBaseMethodsByName; public bool IsExtensionMethod => _symbol.IsExtensionMethod; public bool IsGenericMethod => _symbol.IsGenericMethod; public bool IsAsync => _symbol.IsAsync; public MethodKind MethodKind => _symbol.MethodKind; public new IMethodSymbol OriginalDefinition { get { return this; } } public IMethodSymbol OverriddenMethod => _symbol.OverriddenMethod; public ImmutableArray<IParameterSymbol> Parameters => _symbol.Parameters; public IMethodSymbol PartialDefinitionPart => _symbol.PartialDefinitionPart; public IMethodSymbol PartialImplementationPart => _symbol.PartialImplementationPart; public ITypeSymbol ReceiverType => _symbol.ReceiverType; public NullableAnnotation ReceiverNullableAnnotation => _symbol.ReceiverNullableAnnotation; public IMethodSymbol ReducedFrom => // This implementation feels incorrect! _symbol.ReducedFrom; public ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) { // This implementation feels incorrect, but it follows the pattern that other extension method related APIs are using! return _symbol.GetTypeInferredDuringReduction(reducedFromTypeParameter); } public bool ReturnsVoid => _symbol.ReturnsVoid; public bool ReturnsByRef => _symbol.ReturnsByRef; public bool ReturnsByRefReadonly => _symbol.ReturnsByRefReadonly; public RefKind RefKind => _symbol.RefKind; public ITypeSymbol ReturnType => _symbol.ReturnType; public NullableAnnotation ReturnNullableAnnotation => _symbol.ReturnNullableAnnotation; public ImmutableArray<AttributeData> GetReturnTypeAttributes() => _symbol.GetReturnTypeAttributes(); public ImmutableArray<CustomModifier> RefCustomModifiers => _symbol.RefCustomModifiers; public ImmutableArray<CustomModifier> ReturnTypeCustomModifiers => _symbol.ReturnTypeCustomModifiers; public ImmutableArray<ITypeSymbol> TypeArguments => _symbol.TypeArguments; public ImmutableArray<NullableAnnotation> TypeArgumentNullableAnnotations => _symbol.TypeArgumentNullableAnnotations; public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters; public IMethodSymbol Construct(params ITypeSymbol[] typeArguments) => _symbol.Construct(typeArguments); public IMethodSymbol Construct(ImmutableArray<ITypeSymbol> typeArguments, ImmutableArray<NullableAnnotation> typeArgumentNullableAnnotations) => _symbol.Construct(typeArguments, typeArgumentNullableAnnotations); public DllImportData GetDllImportData() => _symbol.GetDllImportData(); public IMethodSymbol ReduceExtensionMethod(ITypeSymbol receiverType) { // This implementation feels incorrect! return _symbol.ReduceExtensionMethod(receiverType); } public bool IsVararg => _symbol.IsVararg; public bool IsCheckedBuiltin => _symbol.IsCheckedBuiltin; public bool IsConditional => _symbol.IsConditional; } } }
39.80916
163
0.676127
[ "MIT" ]
JavierMatosD/roslyn
src/Features/Core/Portable/MetadataAsSource/AbstractMetadataAsSourceService.WrappedMethodSymbol.cs
5,217
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace SetFocusBehavior { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
22
45
0.716301
[ "MIT" ]
ChrisDiky/MaterialDesignInXaml.Examples
Behaviors/SetFocusBehavior/MainWindow.xaml.cs
640
C#
using RefactoringEssentials.VB.CodeRefactorings; using Xunit; namespace RefactoringEssentials.Tests.VB.CodeRefactorings { public class AddAnotherAccessorTests : VBCodeRefactoringTestBase { [Fact] public void TestAddSet() { Test<AddAnotherAccessorCodeRefactoringProvider>(@" Class TestClass Dim _field As Integer Public ReadOnly Property $Field As Integer Get Return _field End Get End Property End Class", @" Class TestClass Dim _field As Integer Public Property Field As Integer Get Return _field End Get Set(ByVal value As Integer) _field = value End Set End Property End Class"); } [Fact] public void TestAddSet_ReadOnlyField() { Test<AddAnotherAccessorCodeRefactoringProvider>(@" Class TestClass ReadOnly _field As Integer Public ReadOnly Property $Field As Integer Get Return _field End Get End Property End Class", @" Class TestClass ReadOnly _field As Integer Public Property Field As Integer Get Return _field End Get Set(ByVal value As Integer) Throw New System.NotImplementedException() End Set End Property End Class"); } [Fact] public void TestAddGet() { Test<AddAnotherAccessorCodeRefactoringProvider>(@" Class TestClass Dim _field As Integer Public WriteOnly Property $Field As Integer Set(ByVal value As Integer) _field = value End Set End Property End Class", @" Class TestClass Dim _field As Integer Public Property Field As Integer Get Return _field End Get Set(ByVal value As Integer) _field = value End Set End Property End Class"); } [Fact] public void TestAddGetWithComment() { Test<AddAnotherAccessorCodeRefactoringProvider>(@" Class TestClass Dim _field As Integer Public WriteOnly Property $Field As Integer ' Some comment Set(ByVal value As Integer) _field = value End Set End Property End Class", @" Class TestClass Dim _field As Integer Public Property Field As Integer Get Return _field End Get ' Some comment Set(ByVal value As Integer) _field = value End Set End Property End Class"); } } }
23.081081
68
0.605386
[ "MIT" ]
GrahamTheCoder/RefactoringEssentials
Tests/VB/CodeRefactorings/AddAnotherAccessorTests.cs
2,562
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using LINQtoCSV; namespace DataSciLib.IO { public class Reader { } }
12.714286
33
0.685393
[ "MIT" ]
IntersectTechnologies/portfolio_optimization
DataSciLib.IO/Reader.cs
180
C#
using AutoMapper; namespace Accelerator.GeoLocation; public class AutoMapperProfiles : Profile { public AutoMapperProfiles() { // TODO: Add profiles } }
15.909091
41
0.691429
[ "MIT" ]
lambda-snail/GeolocationAccelerator
Azure.Functions/AutoMapperProfiles.cs
177
C#
using NUnit.Framework; public class Crawler_tests { [Test] public void Should_load_all_cralwers() { var allCrawlers = CrawlerRepo.GetAll(); Assert.That(allCrawlers.Count, Is.GreaterThanOrEqualTo(199)); } }
19.461538
70
0.644269
[ "MIT" ]
memucho/webapp
src/TrueOrFalse.Tests/7 Web/Crawler_tests.cs
255
C#
using System; using System.Collections.Generic; using System.Text; using Microsoft.Extensions.Options; namespace StoneAge.TestUtils { public class MockOptions<T> : IOptions<T> where T: class, new() { public T Value { get; } public MockOptions(T value) { Value = value; } } }
18.578947
68
0.583569
[ "MIT" ]
StoneAgeTechnologies/DotNetCoreTestUtils
TestUtils/MockOptions.cs
355
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Hatfield.EnviroData.Core; using Hatfield.EnviroData.WQDataProfile; namespace Hatfield.EnviroData.DataAcquisition.ESDAT.Converters { public abstract class MeasurementResultValueMapperBase : ODM2MapperBase<MeasurementResultValue> { public MeasurementResultValueMapperBase(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List<IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { } protected override void Validate(MeasurementResultValue entity) { Validate(entity.DataValue, new ODM2ConverterSourceLocation(this.ToString(), GetVariableName(() => entity.DataValue))); Validate(entity.ValueDateTime, new ODM2ConverterSourceLocation(this.ToString(), GetVariableName(() => entity.ValueDateTime))); } } }
42.083333
196
0.764356
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
HatfieldConsultants/Hatfield.EnviroData.DataAcquisition
Source/hatfield.envirodata.dataacquisition.esdat/Converters/ODM2MapperBases/MeasurementResultValueMapperBase.cs
1,012
C#
// Copyright (C) 2010, 2011 Zeno Gantner // // This file is part of MyMediaLite. // // MyMediaLite is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // MyMediaLite is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with MyMediaLite. If not, see <http://www.gnu.org/licenses/>. using System.IO; using MyMediaLite.Correlation; using MyMediaLite.Util; namespace MyMediaLite.ItemRecommendation { /// <summary>Base class for item recommenders that use some kind of kNN model</summary> public abstract class KNN : ItemRecommender { /// <summary>The number of neighbors to take into account for prediction</summary> public uint K { get { return k; } set { k = value; } } /// <summary>The number of neighbors to take into account for prediction</summary> protected uint k = 80; /// <summary>Precomputed nearest neighbors</summary> protected int[][] nearest_neighbors; /// <summary>Correlation matrix over some kind of entity</summary> protected CorrelationMatrix correlation; /// public override void SaveModel(string filename) { using ( StreamWriter writer = Recommender.GetWriter(filename, this.GetType()) ) { writer.WriteLine(nearest_neighbors.Length); foreach (int[] nn in nearest_neighbors) { writer.Write(nn[0]); for (int i = 1; i < nn.Length; i++) writer.Write(" {0}", nn[i]); writer.WriteLine(); } correlation.Write(writer); } } /// public override void LoadModel(string filename) { using ( StreamReader reader = Recommender.GetReader(filename, this.GetType()) ) { int num_users = int.Parse(reader.ReadLine()); var nearest_neighbors = new int[num_users][]; for (int u = 0; u < nearest_neighbors.Length; u++) { string[] numbers = reader.ReadLine().Split(' '); nearest_neighbors[u] = new int[numbers.Length]; for (int i = 0; i < numbers.Length; i++) nearest_neighbors[u][i] = int.Parse(numbers[i]); } this.correlation = CorrelationMatrix.ReadCorrelationMatrix(reader); this.k = (uint) nearest_neighbors[0].Length; this.nearest_neighbors = nearest_neighbors; } } } }
32.607595
88
0.696429
[ "BSD-3-Clause" ]
zenogantner/MML-KDD
src/MyMediaLite/ItemRecommendation/KNN.cs
2,576
C#
using MediatR; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Rusell.Employees.Application; using Rusell.Employees.Application.SearchAllByType; using Rusell.Employees.Domain; namespace Rusell.Employees.Api.Controllers; [ApiController] [Authorize] [Route("api/employees/companies/{companyId:guid}/employees/by-type")] public class GetAllByCompanyAndTypeController : ControllerBase { private readonly IMediator _mediator; public GetAllByCompanyAndTypeController(IMediator mediator) { _mediator = mediator; } [HttpGet("{employeeType}")] public async Task<ActionResult<IEnumerable<EmployeeResponse>>> GetEmployeesByType(Guid companyId, EmployeeType employeeType) { var result = await _mediator.Send(new SearchAllCompanyEmployeesByTypeQuery(companyId, employeeType)); return Ok(result); } }
29.566667
109
0.771139
[ "MIT" ]
cantte/Rusell.Api
apps/Employees.Api/Controllers/GetAllByCompanyAndTypeController.cs
887
C#
using Sharpen; namespace java.net { [Sharpen.NakedStub] public class AddressCache { [Sharpen.NakedStub] public class AddressCacheEntry { } } }
11.142857
32
0.711538
[ "Apache-2.0" ]
Conceptengineai/XobotOS
android/generated/java/net/AddressCache.cs
156
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Generic; using System.IO; using System.Text; using Microsoft.SqlServer.TDS.ColMetadata; namespace Microsoft.SqlServer.TDS.Row { /// <summary> /// Token that corresponds to the row of data with null-byte compression /// </summary> public class TDSNBCRowToken : TDSRowTokenBase { /// <summary> /// Initialization constructor /// </summary> public TDSNBCRowToken(TDSColMetadataToken metadata) : base(metadata) { } /// <summary> /// Inflate the token /// NOTE: This operation is not continuable and assumes that the entire token is available in the stream /// </summary> /// <param name="source">Stream to inflate the token from</param> /// <returns>TRUE if inflation is complete</returns> public override bool Inflate(Stream source) { // NOTE: We skip the identifier because it was read by the factory // Calculate the number of bytes necessary to contain all columns int byteCount = (int)Math.Ceiling((double)Metadata.Columns.Count / 8); /* bits in a byte */ // Allocate a bit mask byte[] bitMask = new byte[byteCount]; // Read the bit mask if (source.Read(bitMask, 0, bitMask.Length) != bitMask.Length) { // We don't suppot continuation of inflation at this point throw new Exception("Failed to inflate the bit mask of NBC row token"); } // Process each column for (int index = 0; index < Metadata.Columns.Count; index++) { // Check if column is null. Null columns have corresponding bits set if (((bitMask[(int)(index / 8)] >> (index % 8)) & 0x01) != 0) { // Data is null Data.Add(null); } else { // Inflate and add data to the list Data.Add(InflateColumn(source, Metadata.Columns[index])); } } return true; } /// <summary> /// Deflate the token /// </summary> /// <param name="destination">Stream to deflate token to</param> public override void Deflate(Stream destination) { // Serialize token identifier destination.WriteByte((byte)TDSTokenType.NBCRow); // Calculate the number of bytes necessary to contain all columns int byteCount = (int)Math.Ceiling((double)Metadata.Columns.Count / 8); /* bits in a byte */ // Allocate a bit mask byte[] bitMask = new byte[byteCount]; // Fist pass - figure out which column values are null for (int index = 0; index < Data.Count; index++) { // Check if data is null if (Data[index] == null) { // Enable the corresponding bit bitMask[(int)(index / 8)] = (byte)(bitMask[(int)(index / 8)] | (0x01 << (index % 8))); } } // Serialize the bit mask destination.Write(bitMask, 0, bitMask.Length); // Process each column for (int index = 0; index < Data.Count; index++) { // Check if data isn't null if (Data[index] != null) { // Deflate each column DeflateColumn(destination, Metadata.Columns[index], Data[index]); } } } } }
35.315315
112
0.532143
[ "MIT" ]
2E0PGS/corefx
src/System.Data.SqlClient/tests/Tools/TDS/TDS/Row/TDSNBCRowToken.cs
3,922
C#
using Appinion.Domain.Entity; using System; using System.Collections.Generic; using System.Text; namespace Appinion.Domain.Interface { public interface IUsuarioRepository : IRepository<Usuario> { bool UsuarioExiste(string username); bool EmailExiste(string email); string RecuperarSenhaCriptografada(string username); Usuario RecuperarUsuarioPeloUsername(string username); } }
26.4375
62
0.747045
[ "MIT" ]
eduardosbcabral/appinion-backend
Appinion.Domain/Usuario/IUsuarioRepository.cs
425
C#
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. //------------------------------------------------------------------------------ namespace Microsoft.CodeTalk { using System; using System.Runtime.InteropServices; using Microsoft.VisualStudio.Shell; /// <summary> /// This class implements the tool window exposed by this package and hosts a user control. /// </summary> /// <remarks> /// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane, /// usually implemented by the package implementer. /// <para> /// This class derives from the ToolWindowPane class provided from the MPF in order to use its /// implementation of the IVsUIElementPane interface. /// </para> /// </remarks> [Guid("f3b26d37-88e1-47b8-9eea-04e83684bc97")] public class AccessibilityToolWindow : ToolWindowPane { internal AccessibilityToolbarWindowControl windowControl; /// <summary> /// Initializes a new instance of the <see cref="AccessibilityToolWindow"/> class. /// </summary> public AccessibilityToolWindow() : base(null) { this.Caption = "AccessibilityToolWindow"; // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. this.windowControl = new AccessibilityToolbarWindowControl(); this.Content = this.windowControl; } } }
41.162791
120
0.609605
[ "MIT" ]
Bhaskers-Blu-Org2/CodeTalk
src/VisualStudio/CodeTalk/UI/FunctionsListToolWindow.cs
1,772
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/winnt.h in the Windows SDK for Windows 10.0.19041.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System.Runtime.InteropServices; namespace TerraFX.Interop.UnitTests { /// <summary>Provides validation of the <see cref="PPM_IDLE_ACCOUNTING_EX" /> struct.</summary> public static unsafe class PPM_IDLE_ACCOUNTING_EXTests { /// <summary>Validates that the <see cref="PPM_IDLE_ACCOUNTING_EX" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<PPM_IDLE_ACCOUNTING_EX>(), Is.EqualTo(sizeof(PPM_IDLE_ACCOUNTING_EX))); } /// <summary>Validates that the <see cref="PPM_IDLE_ACCOUNTING_EX" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(PPM_IDLE_ACCOUNTING_EX).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="PPM_IDLE_ACCOUNTING_EX" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { Assert.That(sizeof(PPM_IDLE_ACCOUNTING_EX), Is.EqualTo(440)); } } }
39.805556
145
0.681089
[ "MIT" ]
Ethereal77/terrafx.interop.windows
tests/Interop/Windows/um/winnt/PPM_IDLE_ACCOUNTING_EXTests.cs
1,435
C#
namespace H8QMedia.Services.Data { using System.Linq; using H8QMedia.Data.Common.Repositories; using H8QMedia.Data.Models; using H8QMedia.Services.Data.Contracts; public class UsersService : IUsersService { private readonly IDbRepository<ApplicationUser, string> users; public UsersService(IDbRepository<ApplicationUser, string> users) { this.users = users; } public IQueryable<ApplicationUser> GetUser(string name) { return this.users .All() .Where(x => x.UserName == name); } public IQueryable<ApplicationUser> GetAll() { return this.users.All(); } public IQueryable<ApplicationUser> UserById(string id) { return this.users .All() .Where(x => x.Id == id); } public IQueryable<ApplicationUser> AddToRole(string iduserId, string roleName) { throw new System.NotImplementedException(); } public IQueryable<ApplicationUser> RemoveFromRole(string iduserId, string roleName) { throw new System.NotImplementedException(); } public void Destroy(string userId) { var userToDedlete = this.users.GetById(userId); this.users.Delete(userToDedlete); this.users.Save(); } } }
26.563636
91
0.572211
[ "MIT" ]
IvoPaunov/Course-Project-ASP.NET-MVC
Source/Services/H8QMedia.Services.Data/UsersService.cs
1,463
C#
using NServiceBus; using NServiceBus.Persistence.Sql; namespace SqlPersistence_1.UsingSaga { #region SqlPersistenceSagaWithNoMessageMapping [SqlSaga] public class SagaWithNoMessageMapping : SqlSaga<SagaWithNoMessageMapping.SagaData> { protected override void ConfigureMapping(MessagePropertyMapper<SagaData> mapper) { } public class SagaData : ContainSagaData { } } #endregion }
20.791667
89
0.641283
[ "Apache-2.0" ]
Cogax/docs.particular.net
Snippets/SqlPersistence/SqlPersistence_1/UsingSaga/SagaWithNoMessageMapping.cs
478
C#
using ApolloInterop.Classes; using ApolloInterop.Interfaces; using ApolloInterop.Serializers; using ApolloInterop.Structs.MythicStructs; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO.Pipes; using System.Linq; using System.Text; using AI = ApolloInterop; using ApolloInterop.Constants; using AS = ApolloInterop.Structs.ApolloStructs; using System.Threading; using TTasks = System.Threading.Tasks; using ApolloInterop.Enums.ApolloEnums; using ApolloInterop.Classes.Core; using ApolloInterop.Structs.ApolloStructs; namespace Apollo.Peers.SMB { public class SMBPeer : AI.Classes.P2P.Peer { private AsyncNamedPipeClient _pipeClient = null; private PipeStream _pipe = null; private Action<object> _sendAction; private TTasks.Task _sendTask; public SMBPeer(IAgent agent, PeerInformation info) : base(agent, info) { C2ProfileName = "smb"; _pipeClient = new AsyncNamedPipeClient(info.Hostname, info.C2Profile.Parameters.PipeName); _pipeClient.ConnectionEstablished += OnConnect; _pipeClient.MessageReceived += OnMessageReceived; _pipeClient.Disconnect += OnDisconnect; _sendAction = (object p) => { PipeStream ps = (PipeStream)p; while (ps.IsConnected && !_cts.IsCancellationRequested) { _senderEvent.WaitOne(); if (!_cts.IsCancellationRequested && ps.IsConnected && _senderQueue.TryDequeue(out byte[] result)) { ps.BeginWrite(result, 0, result.Length, OnAsyncMessageSent, p); } } }; } public void OnAsyncMessageSent(IAsyncResult result) { PipeStream pipe = (PipeStream)result.AsyncState; // Potentially delete this since theoretically the sender Task does everything if (pipe.IsConnected && !_cts.IsCancellationRequested && _senderQueue.TryDequeue(out byte[] data)) { pipe.EndWrite(result); pipe.BeginWrite(data, 0, data.Length, OnAsyncMessageSent, pipe); } } public override bool Connected() { return _pipe.IsConnected; } public override bool Finished() { return _previouslyConnected && !_pipe.IsConnected; } public void OnConnect(object sender, NamedPipeMessageArgs args) { _pipe = args.Pipe; OnConnectionEstablished(sender, args); _sendTask = new TTasks.Task(_sendAction, args.Pipe); _sendTask.Start(); _previouslyConnected = true; } public void OnDisconnect(object sender, NamedPipeMessageArgs args) { _cts.Cancel(); args.Pipe.Close(); _senderEvent.Set(); _sendTask.Wait(); base.OnDisconnect(this, args); } public void OnMessageReceived(object sender, NamedPipeMessageArgs args) { AS.IPCChunkedData chunkedData = _serializer.Deserialize<AS.IPCChunkedData>( Encoding.UTF8.GetString( args.Data.Data.Take(args.Data.DataLength).ToArray() ) ); lock(_messageOrganizer) { if (!_messageOrganizer.ContainsKey(chunkedData.ID)) { _messageOrganizer[chunkedData.ID] = new ChunkedMessageStore<IPCChunkedData>(); _messageOrganizer[chunkedData.ID].MessageComplete += DeserializeToReceiver; } } _messageOrganizer[chunkedData.ID].AddMessage(chunkedData); } public override bool Start() { return _pipeClient.Connect(5000); } public override void Stop() { _pipe.Close(); _sendTask.Wait(); } } }
33.716667
118
0.597874
[ "BSD-3-Clause" ]
getshellz/Apollo
Payload_Type/apollo/agent_code/Apollo/Peers/SMB/SMBPeer.cs
4,048
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.SecurityInsights.Models { using Newtonsoft.Json; using System.Linq; /// <summary> /// The parameters required to execute an expand operation on the given /// bookmark. /// </summary> public partial class BookmarkExpandParameters { /// <summary> /// Initializes a new instance of the BookmarkExpandParameters class. /// </summary> public BookmarkExpandParameters() { CustomInit(); } /// <summary> /// Initializes a new instance of the BookmarkExpandParameters class. /// </summary> /// <param name="endTime">The end date filter, so the only expansion /// results returned are before this date.</param> /// <param name="expansionId">The Id of the expansion to /// perform.</param> /// <param name="startTime">The start date filter, so the only /// expansion results returned are after this date.</param> public BookmarkExpandParameters(System.DateTime? endTime = default(System.DateTime?), System.Guid? expansionId = default(System.Guid?), System.DateTime? startTime = default(System.DateTime?)) { EndTime = endTime; ExpansionId = expansionId; StartTime = startTime; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets the end date filter, so the only expansion results /// returned are before this date. /// </summary> [JsonProperty(PropertyName = "endTime")] public System.DateTime? EndTime { get; set; } /// <summary> /// Gets or sets the Id of the expansion to perform. /// </summary> [JsonProperty(PropertyName = "expansionId")] public System.Guid? ExpansionId { get; set; } /// <summary> /// Gets or sets the start date filter, so the only expansion results /// returned are after this date. /// </summary> [JsonProperty(PropertyName = "startTime")] public System.DateTime? StartTime { get; set; } } }
35.743243
199
0.61966
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandParameters.cs
2,645
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: Templates\CSharp\Requests\IMethodRequest.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Threading; /// <summary> /// The interface IUserTranslateExchangeIdsRequest. /// </summary> public partial interface IUserTranslateExchangeIdsRequest : IBaseRequest { /// <summary> /// Gets the request body. /// </summary> UserTranslateExchangeIdsRequestBody RequestBody { get; } /// <summary> /// Issues the POST request. /// </summary> System.Threading.Tasks.Task<IUserTranslateExchangeIdsCollectionPage> PostAsync(); /// <summary> /// Issues the POST request. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await for async call.</returns> System.Threading.Tasks.Task<IUserTranslateExchangeIdsCollectionPage> PostAsync( CancellationToken cancellationToken); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="value">The expand value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest Expand(string value); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="value">The select value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest Select(string value); /// <summary> /// Adds the specified top value to the request. /// </summary> /// <param name="value">The top value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest Top(int value); /// <summary> /// Adds the specified filter value to the request. /// </summary> /// <param name="value">The filter value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest Filter(string value); /// <summary> /// Adds the specified skip value to the request. /// </summary> /// <param name="value">The skip value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest Skip(int value); /// <summary> /// Adds the specified orderby value to the request. /// </summary> /// <param name="value">The orderby value.</param> /// <returns>The request object to send.</returns> IUserTranslateExchangeIdsRequest OrderBy(string value); } }
35.725275
153
0.594586
[ "MIT" ]
andrueastman/msgraph-sdk-dotnet
src/Microsoft.Graph/Generated/requests/IUserTranslateExchangeIdsRequest.cs
3,251
C#
using FFXIVClientStructs.FFXIV.Client.Game.Gauge; namespace FFXIVClientStructs.FFXIV.Client.Game; [StructLayout(LayoutKind.Explicit, Size = 0x60)] public unsafe partial struct JobGaugeManager { [FieldOffset(0x00)] public JobGauge* CurrentGauge; [FieldOffset(0x08)] public JobGauge EmptyGauge; [FieldOffset(0x08)] public WhiteMageGauge WhiteMage; [FieldOffset(0x08)] public ScholarGauge Scholar; [FieldOffset(0x08)] public AstrologianGauge Astrologian; [FieldOffset(0x08)] public SageGauge Sage; [FieldOffset(0x08)] public BardGauge Bard; [FieldOffset(0x08)] public MachinistGauge Machinist; [FieldOffset(0x08)] public DancerGauge Dancer; [FieldOffset(0x08)] public BlackMageGauge BlackMage; [FieldOffset(0x08)] public SummonerGauge Summoner; [FieldOffset(0x08)] public RedMageGauge RedMage; [FieldOffset(0x08)] public MonkGauge Monk; [FieldOffset(0x08)] public DragoonGauge Dragoon; [FieldOffset(0x08)] public NinjaGauge Ninja; [FieldOffset(0x08)] public SamuraiGauge Samurai; [FieldOffset(0x08)] public ReaperGauge Reaper; [FieldOffset(0x08)] public DarkKnightGauge DarkKnight; [FieldOffset(0x08)] public PaladinGauge Paladin; [FieldOffset(0x08)] public WarriorGauge Warrior; [FieldOffset(0x08)] public GunbreakerGauge Gunbreaker; [FieldOffset(0x58)] public byte ClassJobID; [StaticAddress("48 8B 3D ?? ?? ?? ?? 33 ED")] public static partial JobGaugeManager* Instance(); }
37.025
60
0.750169
[ "MIT" ]
AsgardXIV/FFXIVClientStructs
FFXIVClientStructs/FFXIV/Client/Game/JobGaugeManager.cs
1,483
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. 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. */ namespace TencentCloud.Scf.V20180416.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class DeleteTriggerRequest : AbstractModel { /// <summary> /// 函数的名称 /// </summary> [JsonProperty("FunctionName")] public string FunctionName{ get; set; } /// <summary> /// 要删除的触发器名称 /// </summary> [JsonProperty("TriggerName")] public string TriggerName{ get; set; } /// <summary> /// 要删除的触发器类型,目前支持 cos 、cmq、 timer、ckafka 类型 /// </summary> [JsonProperty("Type")] public string Type{ get; set; } /// <summary> /// 函数所属命名空间 /// </summary> [JsonProperty("Namespace")] public string Namespace{ get; set; } /// <summary> /// 如果删除的触发器类型为 COS 触发器,该字段为必填值,存放 JSON 格式的数据 {"event":"cos:ObjectCreated:*"},数据内容和 SetTrigger 接口中该字段的格式相同;如果删除的触发器类型为定时触发器或 CMQ 触发器,可以不指定该字段 /// </summary> [JsonProperty("TriggerDesc")] public string TriggerDesc{ get; set; } /// <summary> /// 函数的版本信息 /// </summary> [JsonProperty("Qualifier")] public string Qualifier{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> internal override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "FunctionName", this.FunctionName); this.SetParamSimple(map, prefix + "TriggerName", this.TriggerName); this.SetParamSimple(map, prefix + "Type", this.Type); this.SetParamSimple(map, prefix + "Namespace", this.Namespace); this.SetParamSimple(map, prefix + "TriggerDesc", this.TriggerDesc); this.SetParamSimple(map, prefix + "Qualifier", this.Qualifier); } } }
32.683544
149
0.613091
[ "Apache-2.0" ]
ImEdisonJiang/tencentcloud-sdk-dotnet
TencentCloud/Scf/V20180416/Models/DeleteTriggerRequest.cs
2,832
C#
namespace MovieDb.Data.Migrations { using System; using System.Data.Entity.Migrations; public partial class AnotationAdded : DbMigration { public override void Up() { AlterColumn("dbo.Adresses", "AdressText", c => c.String(nullable: false, maxLength: 200)); } public override void Down() { AlterColumn("dbo.Adresses", "AdressText", c => c.String(nullable: false)); } } }
25.105263
102
0.57652
[ "MIT" ]
WorkenWithLopaten/MovieDatabaseServer
WebAPI/Data/MovieDb.Data/Migrations/201706061442005_AnotationAdded.cs
477
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the storagegateway-2013-06-30.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.StorageGateway.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.StorageGateway.Model.Internal.MarshallTransformations { /// <summary> /// DeleteBandwidthRateLimit Request Marshaller /// </summary> public class DeleteBandwidthRateLimitRequestMarshaller : IMarshaller<IRequest, DeleteBandwidthRateLimitRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteBandwidthRateLimitRequest)input); } public IRequest Marshall(DeleteBandwidthRateLimitRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.StorageGateway"); string target = "StorageGateway_20130630.DeleteBandwidthRateLimit"; request.Headers["X-Amz-Target"] = target; request.Headers["Content-Type"] = "application/x-amz-json-1.1"; request.HttpMethod = "POST"; string uriResourcePath = "/"; request.ResourcePath = uriResourcePath; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetBandwidthType()) { context.Writer.WritePropertyName("BandwidthType"); context.Writer.Write(publicRequest.BandwidthType); } if(publicRequest.IsSetGatewayARN()) { context.Writer.WritePropertyName("GatewayARN"); context.Writer.Write(publicRequest.GatewayARN); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } } }
36.630952
163
0.663308
[ "Apache-2.0" ]
ermshiperete/aws-sdk-net
AWSSDK_DotNet35/Amazon.StorageGateway/Model/Internal/MarshallTransformations/DeleteBandwidthRateLimitRequestMarshaller.cs
3,077
C#
using BenchmarkDotNet.Running; namespace Benchmarks { public static class Program { public static void Main(string[] args) { var summary = BenchmarkRunner.Run<ScheduledProcessorWorkerBehchmark>(); } } }
19.461538
83
0.636364
[ "MIT" ]
IcaroTorres/rabbitmq-billing-processing
src/Utils/Benchmarks/Program.cs
255
C#
using System; using System.Linq; using System.Reflection; using System.Security.Principal; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using System.Web.Routing; using EmpleoDotNet.AppServices; using EmpleoDotNet.Controllers; using EmpleoDotNet.Core.Domain; using EmpleoDotNet.Core.Dto; using EmpleoDotNet.Helpers; using EmpleoDotNet.Helpers.Alerts; using EmpleoDotNet.Services.Social.Twitter; using EmpleoDotNet.ViewModel; using EmpleoDotNet.ViewModel.JobOpportunity; using FluentAssertions; using NSubstitute; using NSubstitute.ReturnsExtensions; using NUnit.Framework; using PagedList; using reCAPTCHA.MVC; // ReSharper disable Mvc.ActionNotResolved namespace EmpleoDotNet.Tests.Web.Controllers { [TestFixture] public class JobOpportunityControllerTest { private IJobOpportunityService _jobOpportunityService; private ITwitterService _twitterService; private JobOpportunityController _sut; [SetUp] public void SetUp() { _jobOpportunityService = Substitute.For<IJobOpportunityService>(); _twitterService = Substitute.For<ITwitterService>(); _sut = new JobOpportunityController(_jobOpportunityService, _twitterService); } #region Index [Test] public void Index_LocationNameNotNull_PlaceIdNull_ReturnsViewWithError() { // Arrange var param = new JobOpportunityPagingParameter { SelectedLocationPlaceId = null, SelectedLocationName = "Guachupita", JobCategory = JobCategory.None, Keyword = "myKeyword", IsRemote = true }; var jobCategoriesCount = new[] { new JobCategoryCountDto() }.ToList(); _jobOpportunityService.GetMainJobCategoriesCount().Returns(jobCategoriesCount); // Act var result = (AlertDecoratorResult)_sut.Index(param); // Assert _jobOpportunityService.Received(1).GetMainJobCategoriesCount(); _jobOpportunityService.DidNotReceiveWithAnyArgs().GetAllJobOpportunitiesPagedByFilters(param); _sut.ModelState.IsValid.Should().BeFalse(); _sut.ModelState.Should().ContainKey("SelectedLocationName"); result.AlertClass.Should().Be("alert-danger"); result.Message.Should().Be("Debe seleccionar una Localidad para buscar."); var viewResult = (ViewResult)result.InnerResult; var model = (JobOpportunitySearchViewModel)viewResult.Model; model.SelectedLocationLatitude.Should().Be(param.SelectedLocationLatitude); model.SelectedLocationLongitude.Should().Be(param.SelectedLocationLongitude); model.SelectedLocationPlaceId.Should().BeNull(); model.SelectedLocationName.Should().Be(param.SelectedLocationName); model.JobCategory.Should().Be(param.JobCategory); model.Keyword.Should().Be(param.Keyword); model.IsRemote.Should().Be(param.IsRemote); model.CategoriesCount.Should().BeSameAs(jobCategoriesCount); model.Result.Should().BeEmpty(); } [Test] public void Index_ReturnsRequestedDataCorrectly_LocationEmpty() { // Arrange var param = new JobOpportunityPagingParameter { SelectedLocationName = string.Empty, SelectedLocationLatitude = "18.686868", SelectedLocationLongitude = "-69.454545", SelectedLocationPlaceId = "111", JobCategory = JobCategory.None, Keyword = "myKeyword", IsRemote = true }; var jobCategoriesCount = new[] { new JobCategoryCountDto() }.ToList(); var jobOpportunityList = new[] { new JobOpportunity() }.ToPagedList(1, 1); _jobOpportunityService.GetMainJobCategoriesCount().Returns(jobCategoriesCount); _jobOpportunityService.GetAllJobOpportunitiesPagedByFilters(param).Returns(jobOpportunityList); // Act var result = (ViewResult)_sut.Index(param); // Assert _sut.ModelState.IsValid.Should().BeTrue(); _jobOpportunityService.Received(1).GetMainJobCategoriesCount(); _jobOpportunityService.Received(1).GetAllJobOpportunitiesPagedByFilters(param); var model = (JobOpportunitySearchViewModel)result.Model; model.SelectedLocationLatitude.Should().BeEmpty(); model.SelectedLocationLongitude.Should().BeEmpty(); model.SelectedLocationPlaceId.Should().BeEmpty(); model.SelectedLocationName.Should().BeEmpty(); model.JobCategory.Should().Be(param.JobCategory); model.Keyword.Should().Be(param.Keyword); model.IsRemote.Should().Be(param.IsRemote); model.CategoriesCount.Should().BeSameAs(jobCategoriesCount); model.Result.Should().BeSameAs(jobOpportunityList); } [Test] public void Index_ReturnsRequestedDataCorrectly_LocationNotEmpty() { // Arrange var param = new JobOpportunityPagingParameter { SelectedLocationName = "Santo Domingo", SelectedLocationLatitude = "18.686868", SelectedLocationLongitude = "-69.454545", SelectedLocationPlaceId = "111", JobCategory = JobCategory.None, Keyword = "myKeyword", IsRemote = true }; var jobCategoriesCount = new[] { new JobCategoryCountDto() }.ToList(); var jobOpportunityList = new[] { new JobOpportunity() }.ToPagedList(1, 1); _jobOpportunityService.GetMainJobCategoriesCount().Returns(jobCategoriesCount); _jobOpportunityService.GetAllJobOpportunitiesPagedByFilters(param).Returns(jobOpportunityList); // Act var result = (ViewResult)_sut.Index(param); // Assert _sut.ModelState.IsValid.Should().BeTrue(); _jobOpportunityService.Received(1).GetMainJobCategoriesCount(); _jobOpportunityService.Received(1).GetAllJobOpportunitiesPagedByFilters(param); var model = (JobOpportunitySearchViewModel)result.Model; model.SelectedLocationLatitude.Should().Be(param.SelectedLocationLatitude); model.SelectedLocationLongitude.Should().Be(param.SelectedLocationLongitude); model.SelectedLocationPlaceId.Should().Be(param.SelectedLocationPlaceId); model.SelectedLocationName.Should().Be(param.SelectedLocationName); model.JobCategory.Should().Be(param.JobCategory); model.Keyword.Should().Be(param.Keyword); model.IsRemote.Should().Be(param.IsRemote); model.CategoriesCount.Should().BeSameAs(jobCategoriesCount); model.Result.Should().BeSameAs(jobOpportunityList); } #endregion #region New [Test] public void New_GET_HasExpectedActionFilters() { // Arrange var controller = typeof(JobOpportunityController); var action = controller.GetMethod(nameof(JobOpportunityController.New), new Type[0]); // Act var filters = action.GetCustomAttributes().ToArray(); // Assert filters.Should().ContainSingle(x => x is HttpGetAttribute); } [Test] public void New_GET_ReturnsView_WithEmptyModel() { // Arrange var model = new NewJobOpportunityViewModel(); _sut.Url = Substitute.For<UrlHelper>(); _sut.Url.Action("Wizard").Returns("/jobs/wizard"); // Act var result = (AlertDecoratorResult)_sut.New(); // Assert result.AlertClass.Should().Be("alert-info"); result.Message.Should().Be( "Prueba nuestro nuevo proceso guiado de creación de posiciones haciendo " + "<b><a href='/jobs/wizard'>click aquí</a></b>"); var viewResult = (ViewResult)result.InnerResult; viewResult.ViewName.Should().BeEmpty(); ((NewJobOpportunityViewModel)viewResult.Model).ShouldBeEquivalentTo(model); } [Test] public void New_POST_HasExpectedActionFilters() { // Arrange var controller = typeof(JobOpportunityController); var action = controller.GetMethod(nameof(JobOpportunityController.New), new[] { typeof(NewJobOpportunityViewModel), typeof(bool) }); // Act var filters = action.GetCustomAttributes().ToArray(); // Assert filters.Should().ContainSingle(x => x is HttpPostAttribute); filters.Should().ContainSingle(x => x is ValidateAntiForgeryTokenAttribute); var validateInput = (ValidateInputAttribute)filters.Single(x => x is ValidateInputAttribute); var captchaValidator = (CaptchaValidatorAttribute)filters.Single(x => x is CaptchaValidatorAttribute); validateInput.EnableValidation.Should().BeFalse(); captchaValidator.RequiredMessage.Should().Be("Por favor confirma que no eres un robot"); } [Test] public async Task New_POST_ModelStateInvalid_ReturnsViewWithError() { // Arrange var model = new NewJobOpportunityViewModel(); _sut.ModelState.AddModelError("", ""); // Act var result = (AlertDecoratorResult)await _sut.New(model, false); // Assert _jobOpportunityService.DidNotReceiveWithAnyArgs().CreateNewJobOpportunity(null, string.Empty); await _twitterService.DidNotReceiveWithAnyArgs().PostNewJobOpportunity(null, _sut.Url); _sut.ModelState.IsValid.Should().BeFalse(); result.AlertClass.Should().Be("alert-danger"); result.Message.Should().Be("Han ocurrido errores de validación que no permiten continuar el proceso"); var innerResult = (ViewResult)result.InnerResult; innerResult.ViewName.Should().BeEmpty(); innerResult.Model.Should().BeSameAs(model); } [Test] public async Task New_POST_LocationPlaceIdNullOrWhitespace_ReturnsViewWithError( [Values(null, "", " ")] string placeId ) { // Arrange var model = new NewJobOpportunityViewModel { LocationPlaceId = placeId }; // Act var result = (AlertDecoratorResult)await _sut.New(model, false); // Assert _jobOpportunityService.DidNotReceiveWithAnyArgs().CreateNewJobOpportunity(null,string.Empty); await _twitterService.DidNotReceiveWithAnyArgs().PostNewJobOpportunity(null, _sut.Url); _sut.ModelState.IsValid.Should().BeFalse(); _sut.ModelState.Should().ContainKey(nameof(model.LocationName)); result.AlertClass.Should().Be("alert-danger"); result.Message.Should().Be("Debe seleccionar una Localidad."); var innerResult = (ViewResult)result.InnerResult; innerResult.ViewName.Should().BeEmpty(); innerResult.Model.Should().BeSameAs(model); } [Test] public async Task New_POST_ValidModel_CreatesJob_PostsTweet_RedirectsToDetail() { // Arrange var model = new NewJobOpportunityViewModel { Title = "myTitle", Category = JobCategory.MobileDevelopment, Description = "My description", CompanyName = "Company", CompanyUrl = "http://example.com", CompanyLogoUrl = "http://s22.postimg.org/ogi7669wh/batman.png", CompanyEmail = "company@example.com", IsRemote = true, LocationName = "My location", LocationPlaceId = "123", LocationLatitude = "18.3939393", LocationLongitude = "-69.22222", JobType = JobType.FullTime }; _sut.ControllerContext = GenerateControllerContext(_sut); _jobOpportunityService.WhenForAnyArgs(x => x.CreateNewJobOpportunity(null, null)) .Do(x => { x.Arg<JobOpportunity>().Id = 1; }); // Act var result = (RedirectToRouteResult)await _sut.New(model, false); // Assert _jobOpportunityService.Received(1).CreateNewJobOpportunity( Arg.Do<JobOpportunity>(entity => VerifyGeneratedJobOpportunityEntity(model, entity)), null); await _twitterService.Received(1).PostNewJobOpportunity( Arg.Do<JobOpportunity>(entity => VerifyGeneratedJobOpportunityEntity(model, entity)), _sut.Url); result.RouteValues["action"].Should().Be(nameof(_sut.Detail)); result.RouteValues["id"].Should().Be(UrlHelperExtensions.SeoUrl(1, "myTitle")); } private ControllerContext GenerateControllerContext(ControllerBase controller) { var fakeIdentity = new GenericIdentity("Jimmy"); var fakeUser = new GenericPrincipal(fakeIdentity, null); var httpContext = new Moq.Mock<HttpContextBase>(); httpContext.Setup(x => x.User).Returns(fakeUser); var reqContext = new RequestContext(httpContext.Object, new RouteData()); return new ControllerContext(reqContext, controller); } private static void VerifyGeneratedJobOpportunityEntity( NewJobOpportunityViewModel model, JobOpportunity entity) { entity.Title.Should().Be(model.Title); entity.Category.Should().Be(model.Category); entity.Description.Should().Be(model.Description); entity.CompanyName.Should().Be(model.CompanyName); entity.CompanyUrl.Should().Be(model.CompanyUrl); entity.CompanyLogoUrl.Should().Be(model.CompanyLogoUrl); entity.CompanyEmail.Should().Be(model.CompanyEmail); entity.PublishedDate.Should().BeCloseTo(DateTime.Now); entity.IsRemote.Should().Be(model.IsRemote); entity.JobType.Should().Be(model.JobType); entity.JobOpportunityLocation.Should().Match<JobOpportunityLocation>(x => x.Latitude == model.LocationLatitude && x.Longitude == model.LocationLongitude && x.Name == model.LocationName && x.PlaceId == model.LocationPlaceId ); } #endregion #region Wizard [Test] public void Wizard_GET_HasExpectedActionFilters() { // Arrange var controller = typeof(JobOpportunityController); var action = controller.GetMethod(nameof(JobOpportunityController.Wizard), new Type[0]); // Act var filters = action.GetCustomAttributes().ToArray(); // Assert filters.Should().ContainSingle(x => x is HttpGetAttribute); } [Test] public void Wizard_GET_ReturnsView() { // Act var result = (ViewResult)_sut.Wizard(); // Assert result.ViewName.Should().BeEmpty(); ((Wizard) result.Model).ShouldBeEquivalentTo(new Wizard()); } #endregion } }
41.097368
114
0.626625
[ "Unlicense" ]
gromney/empleo-dot-net
EmpleoDotNet.Tests/Web/Controllers/JobOpportunityControllerTest.cs
15,622
C#
using apophis.Lexer.Tokens; namespace ArithmeticParser.Lexing { public class OpenParenthesisToken : IToken { } }
14.111111
46
0.716535
[ "BSD-3-Clause" ]
FreeApophis/ArithmeticParser
LambdaCalculusParser/Tokens/OpenParenthesisToken.cs
129
C#
#pragma checksum "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6719933e554dc1357baa9f1d7939f0c70087e59a" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Invoices_Details), @"mvc.1.0.view", @"/Views/Invoices/Details.cshtml")] [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Views/Invoices/Details.cshtml", typeof(AspNetCore.Views_Invoices_Details))] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #line 1 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\_ViewImports.cshtml" using SDC_Web; #line default #line hidden #line 2 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\_ViewImports.cshtml" using SDC_Web.Models; #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"6719933e554dc1357baa9f1d7939f0c70087e59a", @"/Views/Invoices/Details.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"9f8df17492fda0035aed1881beeaea7bb718f24b", @"/Views/_ViewImports.cshtml")] public class Views_Invoices_Details : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<SDC_Web.Models.Invoice> { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Edit", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Index", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0169 private string __tagHelperStringValueBuffer; #pragma warning restore 0169 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager { get { if (__backed__tagHelperScopeManager == null) { __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); } return __backed__tagHelperScopeManager; } } private global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(31, 2, true); WriteLiteral("\r\n"); EndContext(); #line 3 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" ViewData["Title"] = "Details"; #line default #line hidden BeginContext(76, 130, true); WriteLiteral("\r\n<h1>Details</h1>\r\n\r\n<div>\r\n <h4>Invoice</h4>\r\n <hr />\r\n <dl class=\"row\">\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(207, 47, false); #line 14 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.InvoiceDate)); #line default #line hidden EndContext(); BeginContext(254, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(318, 43, false); #line 17 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.InvoiceDate)); #line default #line hidden EndContext(); BeginContext(361, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(424, 41, false); #line 20 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.Terms)); #line default #line hidden EndContext(); BeginContext(465, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(529, 37, false); #line 23 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.Terms)); #line default #line hidden EndContext(); BeginContext(566, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(629, 45, false); #line 26 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.BillPlace)); #line default #line hidden EndContext(); BeginContext(674, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(738, 41, false); #line 29 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.BillPlace)); #line default #line hidden EndContext(); BeginContext(779, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(842, 47, false); #line 32 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.BillAddress)); #line default #line hidden EndContext(); BeginContext(889, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(953, 43, false); #line 35 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.BillAddress)); #line default #line hidden EndContext(); BeginContext(996, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(1059, 45, false); #line 38 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.BillPhone)); #line default #line hidden EndContext(); BeginContext(1104, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(1168, 41, false); #line 41 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.BillPhone)); #line default #line hidden EndContext(); BeginContext(1209, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(1272, 45, false); #line 44 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.BillEmail)); #line default #line hidden EndContext(); BeginContext(1317, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(1381, 41, false); #line 47 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.BillEmail)); #line default #line hidden EndContext(); BeginContext(1422, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(1485, 45, false); #line 50 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.ShipPlace)); #line default #line hidden EndContext(); BeginContext(1530, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(1594, 41, false); #line 53 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.ShipPlace)); #line default #line hidden EndContext(); BeginContext(1635, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(1698, 47, false); #line 56 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.ShipAddress)); #line default #line hidden EndContext(); BeginContext(1745, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(1809, 43, false); #line 59 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.ShipAddress)); #line default #line hidden EndContext(); BeginContext(1852, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(1915, 44, false); #line 62 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.Subtotal)); #line default #line hidden EndContext(); BeginContext(1959, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(2023, 40, false); #line 65 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.Subtotal)); #line default #line hidden EndContext(); BeginContext(2063, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(2126, 44, false); #line 68 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.Shipping)); #line default #line hidden EndContext(); BeginContext(2170, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(2234, 40, false); #line 71 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.Shipping)); #line default #line hidden EndContext(); BeginContext(2274, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(2337, 39, false); #line 74 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.Hst)); #line default #line hidden EndContext(); BeginContext(2376, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(2440, 35, false); #line 77 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.Hst)); #line default #line hidden EndContext(); BeginContext(2475, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(2538, 47, false); #line 80 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.TotalAmount)); #line default #line hidden EndContext(); BeginContext(2585, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(2649, 43, false); #line 83 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.TotalAmount)); #line default #line hidden EndContext(); BeginContext(2692, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(2755, 47, false); #line 86 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.CreatedTime)); #line default #line hidden EndContext(); BeginContext(2802, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(2866, 43, false); #line 89 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.CreatedTime)); #line default #line hidden EndContext(); BeginContext(2909, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(2972, 47, false); #line 92 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.UpdatedTime)); #line default #line hidden EndContext(); BeginContext(3019, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(3083, 43, false); #line 95 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.UpdatedTime)); #line default #line hidden EndContext(); BeginContext(3126, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(3189, 55, false); #line 98 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.InvoiceByNavigation)); #line default #line hidden EndContext(); BeginContext(3244, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(3308, 61, false); #line 101 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.InvoiceByNavigation.FirstName)); #line default #line hidden EndContext(); BeginContext(3369, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(3432, 43, false); #line 104 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.Project)); #line default #line hidden EndContext(); BeginContext(3475, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(3539, 50, false); #line 107 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.Project.ProjectTag)); #line default #line hidden EndContext(); BeginContext(3589, 62, true); WriteLiteral("\r\n </dd>\r\n <dt class = \"col-sm-2\">\r\n "); EndContext(); BeginContext(3652, 55, false); #line 110 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayNameFor(model => model.UpdatedByNavigation)); #line default #line hidden EndContext(); BeginContext(3707, 63, true); WriteLiteral("\r\n </dt>\r\n <dd class = \"col-sm-10\">\r\n "); EndContext(); BeginContext(3771, 61, false); #line 113 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" Write(Html.DisplayFor(model => model.UpdatedByNavigation.FirstName)); #line default #line hidden EndContext(); BeginContext(3832, 47, true); WriteLiteral("\r\n </dd>\r\n </dl>\r\n</div>\r\n<div>\r\n "); EndContext(); BeginContext(3879, 61, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6719933e554dc1357baa9f1d7939f0c70087e59a18272", async() => { BeginContext(3932, 4, true); WriteLiteral("Edit"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 118 "C:\Users\Jay\source\repos\SDC\SDC_Web\Views\Invoices\Details.cshtml" WriteLiteral(Model.ProjectId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3940, 8, true); WriteLiteral(" |\r\n "); EndContext(); BeginContext(3948, 38, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "6719933e554dc1357baa9f1d7939f0c70087e59a20590", async() => { BeginContext(3970, 12, true); WriteLiteral("Back to List"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3986, 10, true); WriteLiteral("\r\n</div>\r\n"); EndContext(); } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<SDC_Web.Models.Invoice> Html { get; private set; } } } #pragma warning restore 1591
46.899582
298
0.617093
[ "MIT" ]
jjang3530/SDC
SDC_Web/obj/Debug/netcoreapp2.2/Razor/Views/Invoices/Details.cshtml.g.cs
22,418
C#
using System; using UnityEngine; public class TileInfo : IEquatable<TileInfo> { public float MapTileSize { get; private set; } public TileInfo(WorldCoordinate centerLocation, int zoom, float mapTileSize) { SetStandardValues(mapTileSize); var latrad = centerLocation.Lat * Mathf.Deg2Rad; var n = Math.Pow(2, zoom); X = (int)((centerLocation.Lon + 180.0) / 360.0 * n); Y = (int)((1.0 - Mathf.Log(Mathf.Tan(latrad) + 1 / Mathf.Cos(latrad)) / Mathf.PI) / 2.0 * n); ZoomLevel = zoom; } public TileInfo(int x, int y, int zoom, float mapTileSize) { SetStandardValues(mapTileSize); X = x; Y = y; ZoomLevel = zoom; } private void SetStandardValues(float mapTileSize) { MapTileSize = mapTileSize; } public int X { get; set; } public int Y { get; set; } public int ZoomLevel { get; private set; } public override bool Equals(object obj) { return Equals(obj as TileInfo); } public override string ToString() { return string.Format("X={0},Y={1},zoom={2}", X, Y, ZoomLevel); } public virtual bool Equals(TileInfo other) { if (other != null) { return X == other.X && Y == other.Y && ZoomLevel == other.ZoomLevel; } return base.Equals(other); } public override int GetHashCode() { unchecked { var hashCode = X; hashCode = (hashCode * 397) ^ Y; hashCode = (hashCode * 397) ^ ZoomLevel; return hashCode; } } private WorldCoordinate GetNorthWestLocation(int tileX, int tileY, int zoomLevel) { var p = new WorldCoordinate(); var n = Math.Pow(2.0, zoomLevel); p.Lon = (float)(tileX / n * 360.0 - 180.0); var latRad = Math.Atan(Math.Sinh(Math.PI * (1 - 2 * tileY / n))); p.Lat = (float)(latRad * 180.0 / Math.PI); return p; } public WorldCoordinate GetNorthEast() { return GetNorthWestLocation(X + 1, Y, ZoomLevel); } public WorldCoordinate GetSouthWest() { return GetNorthWestLocation(X, Y + 1, ZoomLevel); } private static readonly float[] _zoomScales = { 156412f, 78206f, 39103f, 19551f, 9776f, 4888f, 2444f, 1222f, 610.984f, 305.492f, 152.746f, 76.373f, 38.187f, 19.093f, 9.547f, 4.773f, 2.387f, 1.193f, 0.596f, 0.298f }; private const int MapPixelSize = 256; public float ScaleFactor { get { return _zoomScales[ZoomLevel] * MapPixelSize; } } }
25.504854
101
0.571755
[ "MIT" ]
Petachok/Holo3D
Assets/App/Scripts/TileInfo.cs
2,629
C#
using Microsoft.AspNetCore.Identity.UI.Services; using RazorHtmlEmails.RazorClassLib.Models; using RazorHtmlEmails.RazorClassLib.Services; using RazorHtmlEmails.RazorClassLib.Views.Emails.NewAccount; using RazorHtmlEmails.RazorClassLib.Views.Emails.ProductRequestEmail; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace WebAPI.Services { public class EmailSenderUseCases : IEmailSenderUseCases { private readonly IEmailSender emailSender; private readonly IRazorViewToStringRenderer razorViewToStringRenderer; public EmailSenderUseCases(IEmailSender emailSender, IRazorViewToStringRenderer razorViewToStringRenderer) { this.emailSender = emailSender; this.razorViewToStringRenderer = razorViewToStringRenderer; } public async Task CreateEmailSpecializedAsync(string email, string subject, NewAccountEmailViewModel model) { string htmlMessage = await razorViewToStringRenderer.RenderViewToStringAsync("/Views/Emails/NewAccount/NewAccountEmail.cshtml", model); await emailSender.SendEmailAsync(email, subject, htmlMessage); } public async Task CreateEmailSpecializedAsync(string email, string subject, ProductRequestViewModel model) { string htmlMessage = await razorViewToStringRenderer.RenderViewToStringAsync("/Views/Emails/ProductRequest/ProductRequestEmail.cshtml", model); await emailSender.SendEmailAsync(email, subject, htmlMessage); } } }
41.921053
155
0.760829
[ "MIT" ]
behluluysal/fibu-app-demo
WebAPICore/RazorHtmlEmails.Common/Services/EmailSenderUseCases.cs
1,595
C#
namespace Kigg.Web { using System; using System.Text; public static class DateTimeExtension { public static string ToRelative(this DateTime target) { Check.Argument.IsNotInFuture(target, "target"); StringBuilder result = new StringBuilder(); TimeSpan diff = (SystemTime.Now() - target); Action<int, string> format = (v, u) => { if (v > 0) { if (result.Length > 0) { result.Append(", "); } string plural = (v > 1) ? "s" : string.Empty; result.Append("{0} {1}{2}".FormatWith(v, u, plural)); } }; format(diff.Days, "day"); format(diff.Hours, "hour"); format(diff.Minutes, "minute"); return (result.Length == 0) ? "few moments" : result.ToString(); } } }
39.702703
114
0.300204
[ "BSD-3-Clause-Clear" ]
1103003188/Kigg
Source/Kigg.WebApp/Extension/DateTimeExtension.cs
1,469
C#
namespace TheFlash.Entities { public class User { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Username { get; set; } public byte[] PasswordHash { get; set; } public byte[] PasswordSalt { get; set; } } }
27.916667
48
0.573134
[ "MIT" ]
duykhiem/The-Flash
Entities/User.cs
335
C#
/********************************************************************++ Copyright (c) Microsoft Corporation. All rights reserved. --********************************************************************/ using System.Management.Automation.Runspaces; using System.Management.Automation.Host; using System.Management.Automation.Internal; using System.Management.Automation.Tracing; using Dbg = System.Management.Automation.Diagnostics; using System.Threading; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Management.Automation.Remoting; using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.PowerShell.Commands; using System.Security.Principal; using System.Management.Automation.Runspaces.Internal; #pragma warning disable 1634, 1691 // Stops compiler from warning about unknown warnings namespace System.Management.Automation { /// <summary> /// Remote runspace which will be created on the client side. This /// runspace is wrapped on a RunspacePool(1). /// </summary> internal class RemoteRunspace : Runspace, IDisposable { #region Private Members private ArrayList _runningPipelines = new ArrayList(); private object _syncRoot = new object(); private RunspaceStateInfo _runspaceStateInfo = new RunspaceStateInfo(RunspaceState.BeforeOpen); private bool _bSessionStateProxyCallInProgress = false; private RunspaceConnectionInfo _connectionInfo; private RemoteDebugger _remoteDebugger; private PSPrimitiveDictionary _applicationPrivateData; private bool _disposed = false; // the following two variables have been added for supporting // the Invoke-Command | Invoke-Command scenario private InvokeCommandCommand _currentInvokeCommand = null; private long _currentLocalPipelineId = 0; /// <summary> /// This is queue of all the state change event which have occured for /// this runspace. RaiseRunspaceStateEvents raises event for each /// item in this queue. We don't raise events from with SetRunspaceState /// because SetRunspaceState is often called from with in the a lock. /// Raising event with in a lock introduces chances of deadlock in GUI /// applications. /// </summary> private Queue<RunspaceEventQueueItem> _runspaceEventQueue = new Queue<RunspaceEventQueueItem>(); protected class RunspaceEventQueueItem { public RunspaceEventQueueItem(RunspaceStateInfo runspaceStateInfo, RunspaceAvailability currentAvailability, RunspaceAvailability newAvailability) { this.RunspaceStateInfo = runspaceStateInfo; this.CurrentRunspaceAvailability = currentAvailability; this.NewRunspaceAvailability = newAvailability; } public RunspaceStateInfo RunspaceStateInfo; public RunspaceAvailability CurrentRunspaceAvailability; public RunspaceAvailability NewRunspaceAvailability; } /// <summary> /// In RemoteRunspace, it is required to invoke pipeline /// as part of open call (i.e. while state is Opening). /// If this property is true, runspace state check is /// not performed in AddToRunningPipelineList call. /// </summary> private bool _bypassRunspaceStateCheck; /// <summary> /// In RemoteRunspace, it is required to invoke pipeline /// as part of open call (i.e. while state is Opening). /// If this property is true, runspace state check is /// not performed in AddToRunningPipelineList call. /// </summary> protected bool ByPassRunspaceStateCheck { get { return _bypassRunspaceStateCheck; } set { _bypassRunspaceStateCheck = value; } } /// <summary> /// Temporary place to remember whether to close this runspace on pop or not. /// Used by Start-PSSession. /// </summary> internal bool ShouldCloseOnPop { get; set; } = false; #endregion Private Members #region Constructors /// <summary> /// Construct a remote runspace based on the connection information /// and the specified host /// </summary> /// <param name="typeTable"> /// The TypeTable to use while deserializing/serializing remote objects. /// TypeTable has the following information used by serializer: /// 1. SerializationMethod /// 2. SerializationDepth /// 3. SpecificSerializationProperties /// TypeTable has the following information used by deserializer: /// 1. TargetTypeForDeserialization /// 2. TypeConverter /// </param> /// <param name="connectionInfo">connection information which identifies /// the remote computer</param> /// <param name="host">host on the client</param> /// <param name="applicationArguments"> /// <param name="name">Friendly name for remote runspace session.</param> /// <param name="id">Id for remote runspace.</param> /// Application arguments the server can see in <see cref="System.Management.Automation.Remoting.PSSenderInfo.ApplicationArguments"/> /// </param> internal RemoteRunspace(TypeTable typeTable, RunspaceConnectionInfo connectionInfo, PSHost host, PSPrimitiveDictionary applicationArguments, string name = null, int id = -1) { PSEtwLog.SetActivityIdForCurrentThread(this.InstanceId); PSEtwLog.LogOperationalVerbose(PSEventId.RunspaceConstructor, PSOpcode.Constructor, PSTask.CreateRunspace, PSKeyword.UseAlwaysOperational, InstanceId.ToString()); _connectionInfo = connectionInfo.InternalCopy(); OriginalConnectionInfo = connectionInfo.InternalCopy(); RunspacePool = new RunspacePool(1, 1, typeTable, host, applicationArguments, connectionInfo, name); this.PSSessionId = id; SetEventHandlers(); } /// <summary> /// Constructs a RemoteRunspace object based on the passed in RunspacePool object, /// with a starting state of Disconnected. /// </summary> /// <param name="runspacePool"></param> internal RemoteRunspace(RunspacePool runspacePool) { // The RemoteRunspace object can only be constructed this way with a RunspacePool that // is in the disconnected state. if ((runspacePool.RunspacePoolStateInfo.State != RunspacePoolState.Disconnected) || !(runspacePool.ConnectionInfo is WSManConnectionInfo)) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.InvalidRunspacePool); } RunspacePool = runspacePool; // The remote runspace pool object can only have the value one set for min/max pools. // This sets the runspace pool object min/max pool values to one. The PSRP/WSMan stack // will fail during connection if the min/max pool values do not match. RunspacePool.RemoteRunspacePoolInternal.SetMinRunspaces(1); RunspacePool.RemoteRunspacePoolInternal.SetMaxRunspaces(1); _connectionInfo = runspacePool.ConnectionInfo.InternalCopy(); // Update runspace DisconnectedOn and ExpiresOn property from WSManConnectionInfo UpdateDisconnectExpiresOn(); // Initial state must be Disconnected. SetRunspaceState(RunspaceState.Disconnected, null); // Normal Availability for a disconnected runspace is "None", which means it can be connected. // However, we can also have disconnected runspace objects that are *not* available for // connection and in this case the Availability is set to "Busy". _runspaceAvailability = RunspacePool.RemoteRunspacePoolInternal.AvailableForConnection ? Runspaces.RunspaceAvailability.None : Runspaces.RunspaceAvailability.Busy; SetEventHandlers(); PSEtwLog.SetActivityIdForCurrentThread(this.InstanceId); PSEtwLog.LogOperationalVerbose(PSEventId.RunspaceConstructor, PSOpcode.Constructor, PSTask.CreateRunspace, PSKeyword.UseAlwaysOperational, this.InstanceId.ToString()); } /// <summary> /// Helper function to set event handlers. /// </summary> private void SetEventHandlers() { // RemoteRunspace must have the same instanceID as its contained RunspacePool instance because // the PSRP/WinRS layer tracks remote runspace Ids. this.InstanceId = RunspacePool.InstanceId; _eventManager = new PSRemoteEventManager(_connectionInfo.ComputerName, this.InstanceId); RunspacePool.StateChanged += new EventHandler<RunspacePoolStateChangedEventArgs>(HandleRunspacePoolStateChanged); RunspacePool.RemoteRunspacePoolInternal.HostCallReceived += new EventHandler<RemoteDataEventArgs<RemoteHostCall>>(HandleHostCallReceived); RunspacePool.RemoteRunspacePoolInternal.URIRedirectionReported += new EventHandler<RemoteDataEventArgs<Uri>>(HandleURIDirectionReported); RunspacePool.ForwardEvent += new EventHandler<PSEventArgs>(HandleRunspacePoolForwardEvent); RunspacePool.RemoteRunspacePoolInternal.SessionCreateCompleted += new EventHandler<CreateCompleteEventArgs>(HandleSessionCreateCompleted); } #endregion Constructors #region Properties /// <summary> /// runspaceConfiguration information for this runspace /// </summary> internal override RunspaceConfiguration RunspaceConfiguration { get { #pragma warning disable 56503 throw PSTraceSource.NewNotImplementedException(); #pragma warning restore 56503 } } /// <summary> /// initialsessionstate information for this runspace /// </summary> public override InitialSessionState InitialSessionState { get { #pragma warning disable 56503 throw PSTraceSource.NewNotImplementedException(); #pragma warning restore 56503 } } /// <summary> /// Manager for JobSourceAdapters registered in this runspace. /// </summary> public override JobManager JobManager { get { #pragma warning disable 56503 throw PSTraceSource.NewNotImplementedException(); #pragma warning restore 56503 } } /// <summary> /// Return version of this runspace /// </summary> public override Version Version { get; } = PSVersionInfo.PSVersion; /// <summary> /// PS Version running on server. /// </summary> internal Version ServerVersion { get; private set; } /// <summary> /// Retrieve information about current state of the runspace /// </summary> public override RunspaceStateInfo RunspaceStateInfo { get { lock (_syncRoot) { //Do not return internal state. return _runspaceStateInfo.Clone(); } } } /// <summary> /// This property determines whether a new thread is create for each invocation /// </summary> /// <remarks> /// Any updates to the value of this property must be done before the Runspace is opened /// </remarks> /// <exception cref="InvalidRunspaceStateException"> /// An attempt to change this property was made after opening the Runspace /// </exception> /// <exception cref="InvalidOperationException"> /// The thread options cannot be changed to the requested value /// </exception> public override PSThreadOptions ThreadOptions { get { return _createThreadOptions; } set { lock (_syncRoot) { if (value != _createThreadOptions) { if (this.RunspaceStateInfo.State != RunspaceState.BeforeOpen) { throw new InvalidRunspaceStateException(StringUtil.Format(RunspaceStrings.ChangePropertyAfterOpen)); } _createThreadOptions = value; } } } } private PSThreadOptions _createThreadOptions = PSThreadOptions.Default; /// <summary> /// Gets the current availability of the Runspace /// </summary> public override RunspaceAvailability RunspaceAvailability { get { return _runspaceAvailability; } protected set { _runspaceAvailability = value; } } private RunspaceAvailability _runspaceAvailability = RunspaceAvailability.None; /// <summary> /// Event raised when RunspaceState changes. /// </summary> public override event EventHandler<RunspaceStateEventArgs> StateChanged; /// <summary> /// Event raised when the availability of the Runspace changes. /// </summary> public override event EventHandler<RunspaceAvailabilityEventArgs> AvailabilityChanged; /// <summary> /// Returns true if there are any subscribers to the AvailabilityChanged event /// </summary> internal override bool HasAvailabilityChangedSubscribers { get { return this.AvailabilityChanged != null; } } /// <summary> /// Raises the AvailabilityChanged event /// </summary> protected override void OnAvailabilityChanged(RunspaceAvailabilityEventArgs e) { EventHandler<RunspaceAvailabilityEventArgs> eh = this.AvailabilityChanged; if (eh != null) { try { eh(this, e); } catch (Exception) { } } } /// <summary> /// Connection information to this runspace /// </summary> public override RunspaceConnectionInfo ConnectionInfo { get { return _connectionInfo; } } /// <summary> /// ConnectionInfo originally supplied by the user /// </summary> public override RunspaceConnectionInfo OriginalConnectionInfo { get; } /// <summary> /// Gets the event manager /// </summary> public override PSEventManager Events { get { return _eventManager; } } private PSRemoteEventManager _eventManager; #pragma warning disable 56503 /// <summary> /// Gets the execution context for this runspace /// </summary> internal override ExecutionContext GetExecutionContext { get { throw PSTraceSource.NewNotImplementedException(); } } /// <summary> /// Returns true if the internal host is in a nested prompt /// </summary> internal override bool InNestedPrompt { get { return false; // nested prompts are not supported on remote runspaces } } #pragma warning restore 56503 /// <summary> /// Gets the client remote session associated with this /// runspace /// </summary> /// <remarks>This member is actually not required /// for the product code. However, there are /// existing transport manager tests which depend on /// the same. Once transport manager is modified, /// this needs to be removed</remarks> internal ClientRemoteSession ClientRemoteSession { get { try { return RunspacePool.RemoteRunspacePoolInternal.DataStructureHandler.RemoteSession; } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } } /// <summary> /// Gets command information on a currently running remote command. /// If no command is running then null is returned. /// </summary> internal ConnectCommandInfo RemoteCommand { get { if (RunspacePool.RemoteRunspacePoolInternal.ConnectCommands == null) { return null; } Dbg.Assert(RunspacePool.RemoteRunspacePoolInternal.ConnectCommands.Length < 2, "RemoteRunspace should have no more than one remote running command."); if (RunspacePool.RemoteRunspacePoolInternal.ConnectCommands.Length > 0) { return RunspacePool.RemoteRunspacePoolInternal.ConnectCommands[0]; } else { return null; } } } /// <summary> /// Gets friendly name for the remote PSSession. /// </summary> internal string PSSessionName { get { return RunspacePool.RemoteRunspacePoolInternal.Name; } set { RunspacePool.RemoteRunspacePoolInternal.Name = value; } } /// <summary> /// Gets the Id value for the remote PSSession. /// </summary> internal int PSSessionId { get; set; } = -1; /// <summary> /// Returns true if Runspace supports disconnect. /// </summary> internal bool CanDisconnect { get { return RunspacePool.RemoteRunspacePoolInternal.CanDisconnect; } } /// <summary> /// Returns true if Runspace can be connected. /// </summary> internal bool CanConnect { get { return RunspacePool.RemoteRunspacePoolInternal.AvailableForConnection; } } /// <summary> /// Debugger /// </summary> public override Debugger Debugger { get { return _remoteDebugger; } } #endregion Properties #region Open /// <summary> /// Open the runspace Asynchronously. /// </summary> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not BeforeOpen /// </exception> public override void OpenAsync() { AssertIfStateIsBeforeOpen(); try { RunspacePool.BeginOpen(null, null); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Open the runspace synchronously. /// </summary> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not BeforeOpen /// </exception> public override void Open() { AssertIfStateIsBeforeOpen(); try { RunspacePool.ThreadOptions = this.ThreadOptions; #if !CORECLR // No ApartmentState In CoreCLR RunspacePool.ApartmentState = this.ApartmentState; #endif RunspacePool.Open(); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } #endregion Open #region Close /// <summary> /// Close the runspace Asynchronously. /// </summary> public override void CloseAsync() { try { RunspacePool.BeginClose(null, null); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Close the runspace synchronously. /// </summary> /// <remarks> /// Attempts to execute pipelines after a call to close will fail. /// </remarks> public override void Close() { try { IAsyncResult result = RunspacePool.BeginClose(null, null); WaitForFinishofPipelines(); // It is possible for the result ASyncResult object to be null if the runspace // pool is already being closed from a server initiated close event. if (result != null) { RunspacePool.EndClose(result); } } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Dispose this runspace /// </summary> /// <param name="disposing">true if called from Dispose</param> protected override void Dispose(bool disposing) { try { if (_disposed) { return; } lock (_syncRoot) { if (_disposed) { return; } _disposed = true; } if (disposing) { try { Close(); } catch (PSRemotingTransportException) { // // If the WinRM listener has been removed before the runspace is closed, then calling // Close() will cause a PSRemotingTransportException. We don't want this exception // surfaced. Most developers don't expect an exception from calling Dispose. // See [Windows 8 Bugs] 968184. // } if (_remoteDebugger != null) { // Release RunspacePool event forwarding handlers. _remoteDebugger.Dispose(); } try { RunspacePool.StateChanged -= new EventHandler<RunspacePoolStateChangedEventArgs>(HandleRunspacePoolStateChanged); RunspacePool.RemoteRunspacePoolInternal.HostCallReceived -= new EventHandler<RemoteDataEventArgs<RemoteHostCall>>(HandleHostCallReceived); RunspacePool.RemoteRunspacePoolInternal.URIRedirectionReported -= new EventHandler<RemoteDataEventArgs<Uri>>(HandleURIDirectionReported); RunspacePool.ForwardEvent -= new EventHandler<PSEventArgs>(HandleRunspacePoolForwardEvent); RunspacePool.RemoteRunspacePoolInternal.SessionCreateCompleted -= new EventHandler<CreateCompleteEventArgs>(HandleSessionCreateCompleted); _eventManager = null; RunspacePool.Dispose(); //_runspacePool = null; } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } } finally { base.Dispose(disposing); } } #endregion Close #region Reset Runspace State /// <summary> /// Resets the runspace state to allow for fast reuse. Not all of the runspace /// elements are reset. The goal is to minimize the chance of the user taking /// accidental dependencies on prior runspace state. /// </summary> /// <exception cref="PSInvalidOperationException"> /// Thrown when runspace is not in proper state or availability or if the /// reset operation fails in the remote session. /// </exception> public override void ResetRunspaceState() { PSInvalidOperationException invalidOperation = null; if (this.RunspaceStateInfo.State != Runspaces.RunspaceState.Opened) { invalidOperation = PSTraceSource.NewInvalidOperationException( RunspaceStrings.RunspaceNotInOpenedState, this.RunspaceStateInfo.State); } else if (this.RunspaceAvailability != Runspaces.RunspaceAvailability.Available) { invalidOperation = PSTraceSource.NewInvalidOperationException( RunspaceStrings.ConcurrentInvokeNotAllowed); } else { bool success = RunspacePool.RemoteRunspacePoolInternal.ResetRunspaceState(); if (!success) { invalidOperation = PSTraceSource.NewInvalidOperationException(); } } if (invalidOperation != null) { invalidOperation.Source = "ResetRunspaceState"; throw invalidOperation; } } #endregion #region Disconnect-Connect /// <summary> /// Queries the server for disconnected runspaces and creates an array of runspace /// objects associated with each disconnected runspace on the server. Each /// runspace object in the returned array is in the Disconnected state and can be /// connected to the server by calling the Connect() method on the runspace. /// </summary> /// <param name="connectionInfo">Connection object for the target server.</param> /// <param name="host">Client host object.</param> /// <param name="typeTable">TypeTable object.</param> /// <returns>Array of Runspace objects each in the Disconnected state.</returns> internal static Runspace[] GetRemoteRunspaces(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable) { List<Runspace> runspaces = new List<Runspace>(); RunspacePool[] runspacePools = RemoteRunspacePoolInternal.GetRemoteRunspacePools(connectionInfo, host, typeTable); // We don't yet know how many runspaces there are in these runspace pool objects. This information isn't updated // until a Connect() is performed. But we can use the ConnectCommands list to prune runspace pool objects that // clearly have more than one command/runspace. foreach (RunspacePool runspacePool in runspacePools) { if (runspacePool.RemoteRunspacePoolInternal.ConnectCommands.Length < 2) { runspaces.Add(new RemoteRunspace(runspacePool)); } } return runspaces.ToArray(); } /// <summary> /// Creates a single disconnected remote Runspace object based on connection information and /// session / command identifiers. /// </summary> /// <param name="connectionInfo">Connection object for target machine</param> /// <param name="sessionId">Session Id to connect to</param> /// <param name="commandId">Optional command Id to connect to</param> /// <param name="host">Optional PSHost</param> /// <param name="typeTable">Optional TypeTable</param> /// <returns>Disconnect remote Runspace object</returns> internal static Runspace GetRemoteRunspace(RunspaceConnectionInfo connectionInfo, Guid sessionId, Guid? commandId, PSHost host, TypeTable typeTable) { RunspacePool runspacePool = RemoteRunspacePoolInternal.GetRemoteRunspacePool( connectionInfo, sessionId, commandId, host, typeTable); return new RemoteRunspace(runspacePool); } /// <summary> /// Disconnects the runspace synchronously. /// </summary> /// <remarks> /// Disconnects the remote runspace and any running command from the server /// machine. Any data generated by the running command on the server is /// cached on the server machine. This runspace object goes to the disconnected /// state. This object can be reconnected to the server by calling the /// Connect() method. /// If the remote runspace on the server remains disconnected for the IdleTimeout /// value (as defined in the WSManConnectionInfo object) then it is closed and /// torn down on the server. /// </remarks> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not Opened. /// </exception> public override void Disconnect() { if (!CanDisconnect) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.DisconnectNotSupportedOnServer); } UpdatePoolDisconnectOptions(); try { RunspacePool.Disconnect(); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Disconnects the runspace asynchronously. /// </summary> /// <remarks> /// Disconnects the remote runspace and any running command from the server /// machine. Any data generated by the running command on the server is /// cached on the server machine. This runspace object goes to the disconnected /// state. This object can be reconnected to the server by calling the /// Connect() method. /// If the remote runspace on the server remains disconnected for the IdleTimeout /// value (as defined in the WSManConnectionInfo object) then it is closed and /// torn down on the server. /// </remarks> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not Opened. /// </exception> public override void DisconnectAsync() { if (!CanDisconnect) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.DisconnectNotSupportedOnServer); } UpdatePoolDisconnectOptions(); try { RunspacePool.BeginDisconnect(null, null); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Connects the runspace to its remote counterpart synchronously. /// </summary> /// <remarks> /// Connects the runspace object to its corresponding runspace on the target /// server machine. The target server machine is identified by the connection /// object passed in during construction. The remote runspace is identified /// by the internal runspace Guid value. /// </remarks> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not Disconnected. /// </exception> public override void Connect() { if (!CanConnect) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.CannotConnect); } UpdatePoolDisconnectOptions(); try { RunspacePool.Connect(); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Connects a runspace to its remote counterpart asynchronously. /// </summary> /// <remarks> /// Connects the runspace object to its corresponding runspace on the target /// server machine. The target server machine is identified by the connection /// object passed in during construction. The remote runspace is identified /// by the internal runspace Guid value. /// </remarks> /// <exception cref="InvalidRunspaceStateException"> /// RunspaceState is not Disconnected. /// </exception> public override void ConnectAsync() { if (!CanConnect) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.CannotConnect); } UpdatePoolDisconnectOptions(); try { RunspacePool.BeginConnect(null, null); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } /// <summary> /// Creates a PipeLine object in the disconnected state for the currently disconnected /// remote running command associated with this runspace. /// </summary> /// <returns>Pipeline object in disconnected state.</returns> public override Pipeline CreateDisconnectedPipeline() { if (RemoteCommand == null) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.NoDisconnectedCommand); } return new RemotePipeline(this); } /// <summary> /// Creates a PowerShell object in the disconnected state for the currently disconnected /// remote running command associated with this runspace. /// </summary> /// <returns>PowerShell object in disconnected state.</returns> public override PowerShell CreateDisconnectedPowerShell() { if (RemoteCommand == null) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.NoDisconnectedCommand); } return new PowerShell(RemoteCommand, this); } /// <summary> /// Returns Runspace capabilities. /// </summary> /// <returns>RunspaceCapability</returns> public override RunspaceCapability GetCapabilities() { RunspaceCapability returnCaps = RunspaceCapability.Default; if (CanDisconnect) { returnCaps |= RunspaceCapability.SupportsDisconnect; } if (_connectionInfo is NamedPipeConnectionInfo) { returnCaps |= RunspaceCapability.NamedPipeTransport; } else if (_connectionInfo is VMConnectionInfo) { returnCaps |= RunspaceCapability.VMSocketTransport; } else if (_connectionInfo is SSHConnectionInfo) { returnCaps |= RunspaceCapability.SSHTransport; } else { ContainerConnectionInfo containerConnectionInfo = _connectionInfo as ContainerConnectionInfo; if ((containerConnectionInfo != null) && (containerConnectionInfo.ContainerProc.RuntimeId == Guid.Empty)) { returnCaps |= RunspaceCapability.NamedPipeTransport; } } return returnCaps; } /// <summary> /// Update the pool disconnect options so that any changes will be /// passed to the server during the disconnect/connect operations. /// </summary> private void UpdatePoolDisconnectOptions() { WSManConnectionInfo runspaceWSManConnectionInfo = RunspacePool.ConnectionInfo as WSManConnectionInfo; WSManConnectionInfo wsManConnectionInfo = ConnectionInfo as WSManConnectionInfo; Dbg.Assert(runspaceWSManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport"); Dbg.Assert(wsManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport"); runspaceWSManConnectionInfo.IdleTimeout = wsManConnectionInfo.IdleTimeout; runspaceWSManConnectionInfo.OutputBufferingMode = wsManConnectionInfo.OutputBufferingMode; } #endregion #region Remote Debugging /// <summary> /// Remote DebuggerStop event. /// </summary> internal event EventHandler<PSEventArgs> RemoteDebuggerStop; /// <summary> /// Remote BreakpointUpdated event. /// </summary> internal event EventHandler<PSEventArgs> RemoteDebuggerBreakpointUpdated; #endregion #region CreatePipeline /// <summary> /// Create an empty pipeline /// </summary> /// <returns>An empty pipeline</returns> public override Pipeline CreatePipeline() { return CoreCreatePipeline(null, false, false); } /// <summary> /// Create a pipeline from a command string /// </summary> /// <param name="command">A valid command string</param> /// <returns> /// A pipeline pre-filled with Commands specified in commandString. /// </returns> /// <exception cref="ArgumentNullException"> /// command is null /// </exception> public override Pipeline CreatePipeline(string command) { if (command == null) { throw PSTraceSource.NewArgumentNullException("command"); } return CoreCreatePipeline(command, false, false); } /// <summary> /// Create a pipeline from a command string. /// </summary> /// <param name="command">A valid command string</param> /// <param name="addToHistory">if true command is added to history</param> /// <returns> /// A pipeline pre-filled with Commands specified in commandString. /// </returns> /// <exception cref="ArgumentNullException"> /// command is null /// </exception> public override Pipeline CreatePipeline(string command, bool addToHistory) { if (command == null) { throw PSTraceSource.NewArgumentNullException("command"); } return CoreCreatePipeline(command, addToHistory, false); } /// <summary> /// Creates a nested pipeline. /// </summary> /// <remarks> /// Nested pipelines are needed for nested prompt scenario. Nested /// prompt requires that we execute new pipelines( child pipelines) /// while current pipeline (lets call it parent pipeline) is blocked. /// </remarks> /// <exception cref="PSNotSupportedException">Not supported in remoting /// scenarios</exception> public override Pipeline CreateNestedPipeline() { return CoreCreatePipeline(null, false, true); } /// <summary> /// Creates a nested pipeline. /// </summary> /// <param name="command">A valid command string</param> /// <param name="addToHistory">if true command is added to history</param> /// <returns> /// A pipeline pre-filled with Commands specified in commandString. /// </returns> /// <exception cref="PSNotSupportedException">Not supported in remoting /// scenarios</exception> public override Pipeline CreateNestedPipeline(string command, bool addToHistory) { if (command == null) { throw PSTraceSource.NewArgumentNullException("command"); } return CoreCreatePipeline(command, addToHistory, true); } #endregion CreatePipeline #region Running Pipeline Management /// <summary> /// Add the pipeline to list of pipelines in execution. /// </summary> /// <param name="pipeline">Pipeline to add to the /// list of pipelines in execution</param> /// /// <exception cref="InvalidRunspaceStateException"> /// Thrown if the runspace is not in the Opened state. /// <see cref="RunspaceState"/>. /// </exception> /// /// <exception cref="ArgumentNullException">Thrown if /// <paramref name="pipeline"/> is null. /// </exception> internal void AddToRunningPipelineList(RemotePipeline pipeline) { Dbg.Assert(pipeline != null, "caller should validate the parameter"); lock (_syncRoot) { if (_bypassRunspaceStateCheck == false && _runspaceStateInfo.State != RunspaceState.Opened && _runspaceStateInfo.State != RunspaceState.Disconnected) // Disconnected runspaces can have running pipelines. { InvalidRunspaceStateException e = new InvalidRunspaceStateException ( StringUtil.Format(RunspaceStrings.RunspaceNotOpenForPipeline, _runspaceStateInfo.State.ToString() ), _runspaceStateInfo.State, RunspaceState.Opened ); if (this.ConnectionInfo != null) { e.Source = this.ConnectionInfo.ComputerName; } throw e; } //Add the pipeline to list of Executing pipeline. //Note:_runningPipelines is always accessed with the lock so //there is no need to create a synchronized version of list _runningPipelines.Add(pipeline); } } /// <summary> /// Remove the pipeline from list of pipelines in execution. /// </summary> /// <param name="pipeline">Pipeline to remove from the /// list of pipelines in execution</param> /// /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="pipeline"/> is null. /// </exception> internal void RemoveFromRunningPipelineList(RemotePipeline pipeline) { Dbg.Assert(pipeline != null, "caller should validate the parameter"); lock (_syncRoot) { Dbg.Assert(_runspaceStateInfo.State != RunspaceState.BeforeOpen, "Runspace should not be before open when pipeline is running"); //Remove the pipeline to list of Executing pipeline. //Note:_runningPipelines is always accessed with the lock so //there is no need to create a synchronized version of list _runningPipelines.Remove(pipeline); pipeline.PipelineFinishedEvent.Set(); } } /// <summary> /// Check to see, if there is any other pipeline running in this /// runspace. If not, then add this to the list of pipelines /// </summary> /// <param name="pipeline">pipeline to check and add</param> /// <param name="syncCall">whether this is being called from /// a synchronous method call</param> internal void DoConcurrentCheckAndAddToRunningPipelines(RemotePipeline pipeline, bool syncCall) { //Concurrency check should be done under runspace lock lock (_syncRoot) { if (_bSessionStateProxyCallInProgress == true) { throw PSTraceSource.NewInvalidOperationException(RunspaceStrings.NoPipelineWhenSessionStateProxyInProgress); } //Delegate to pipeline to do check if it is fine to invoke if another //pipeline is running. pipeline.DoConcurrentCheck(syncCall); //Finally add to the list of running pipelines. AddToRunningPipelineList(pipeline); } } #endregion Running Pipeline Management #region SessionState Proxy /// <summary> /// Returns SessionState proxy object. /// </summary> /// <returns></returns> internal override SessionStateProxy GetSessionStateProxy() { return _sessionStateProxy ?? (_sessionStateProxy = new RemoteSessionStateProxy(this)); } private RemoteSessionStateProxy _sessionStateProxy = null; #endregion SessionState Proxy #region Private Methods private void HandleRunspacePoolStateChanged(object sender, RunspacePoolStateChangedEventArgs e) { RunspaceState newState = (RunspaceState)e.RunspacePoolStateInfo.State; RunspaceState prevState = SetRunspaceState(newState, e.RunspacePoolStateInfo.Reason); switch (newState) { case RunspaceState.Opened: switch (prevState) { case RunspaceState.Opening: // For newly opened remote runspaces, set the debug mode based on the // associated host. This involves running a remote command and is Ok // since this event is called on a worker thread and not a WinRM callback. SetDebugModeOnOpen(); break; case RunspaceState.Connecting: UpdateDisconnectExpiresOn(); // Application private data containing server debug state is updated on // a *reconstruct* connect operation when _applicationPrivateData is null. // Pass new information to the debugger. if (_applicationPrivateData == null) { _applicationPrivateData = GetApplicationPrivateData(); SetDebugInfo(_applicationPrivateData); } break; } break; case RunspaceState.Disconnected: UpdateDisconnectExpiresOn(); break; } RaiseRunspaceStateEvents(); } /// <summary> /// Set debug mode on remote session based on the interactive host /// setting, if available. /// </summary> private void SetDebugModeOnOpen() { // Update client remote debugger based on server capabilities. _applicationPrivateData = GetApplicationPrivateData(); bool serverSupportsDebugging = SetDebugInfo(_applicationPrivateData); if (!serverSupportsDebugging) { return; } // Set server side initial debug mode based on interactive host. DebugModes hostDebugMode = DebugModes.Default; try { IHostSupportsInteractiveSession interactiveHost = RunspacePool.RemoteRunspacePoolInternal.Host as IHostSupportsInteractiveSession; if (interactiveHost != null && interactiveHost.Runspace != null && interactiveHost.Runspace.Debugger != null) { hostDebugMode = interactiveHost.Runspace.Debugger.DebugMode; } } catch (PSNotImplementedException) { } if ((hostDebugMode & DebugModes.RemoteScript) == DebugModes.RemoteScript) { try { _remoteDebugger.SetDebugMode(hostDebugMode); } catch (Exception) { } } } private bool SetDebugInfo(PSPrimitiveDictionary psApplicationPrivateData) { DebugModes? debugMode = null; bool inDebugger = false; int breakpointCount = 0; bool breakAll = false; UnhandledBreakpointProcessingMode unhandledBreakpointMode = UnhandledBreakpointProcessingMode.Ignore; if (psApplicationPrivateData != null) { if (psApplicationPrivateData.ContainsKey(RemoteDebugger.DebugModeSetting)) { debugMode = (DebugModes)(int)psApplicationPrivateData[RemoteDebugger.DebugModeSetting]; } if (psApplicationPrivateData.ContainsKey(RemoteDebugger.DebugStopState)) { inDebugger = (bool)psApplicationPrivateData[RemoteDebugger.DebugStopState]; } if (psApplicationPrivateData.ContainsKey(RemoteDebugger.DebugBreakpointCount)) { breakpointCount = (int)psApplicationPrivateData[RemoteDebugger.DebugBreakpointCount]; } if (psApplicationPrivateData.ContainsKey(RemoteDebugger.BreakAllSetting)) { breakAll = (bool)psApplicationPrivateData[RemoteDebugger.BreakAllSetting]; } if (psApplicationPrivateData.ContainsKey(RemoteDebugger.UnhandledBreakpointModeSetting)) { unhandledBreakpointMode = (UnhandledBreakpointProcessingMode)(int)psApplicationPrivateData[RemoteDebugger.UnhandledBreakpointModeSetting]; } if (psApplicationPrivateData.ContainsKey(PSVersionInfo.PSVersionTableName)) { var psVersionTable = psApplicationPrivateData[PSVersionInfo.PSVersionTableName] as PSPrimitiveDictionary; if (psVersionTable.ContainsKey(PSVersionInfo.PSVersionName)) { ServerVersion = PSObject.Base(psVersionTable[PSVersionInfo.PSVersionName]) as Version; } } } if (debugMode != null) { // Server supports remote debugging. Create Debugger object for // this remote runspace. Dbg.Assert(_remoteDebugger == null, "Remote runspace should not have a debugger yet."); _remoteDebugger = new RemoteDebugger(this); // Set initial debugger state. _remoteDebugger.SetClientDebugInfo(debugMode, inDebugger, breakpointCount, breakAll, unhandledBreakpointMode, ServerVersion); return true; } return false; } /// <summary> /// Asserts if the current state of the runspace is BeforeOpen /// </summary> private void AssertIfStateIsBeforeOpen() { lock (_syncRoot) { //Call fails if RunspaceState is not BeforeOpen. if (_runspaceStateInfo.State != RunspaceState.BeforeOpen) { InvalidRunspaceStateException e = new InvalidRunspaceStateException ( StringUtil.Format(RunspaceStrings.CannotOpenAgain, new object[] { _runspaceStateInfo.State.ToString() } ), _runspaceStateInfo.State, RunspaceState.BeforeOpen ); throw e; } } } /// <summary> /// Set the new runspace state. /// </summary> /// <param name="state">the new state</param> /// <param name="reason">An exception indicating the state change is the /// result of an error, otherwise; null. /// </param> /// <returns>Previous runspace state</returns> /// <remarks> /// Sets the internal runspace state information member variable. It also /// adds RunspaceStateInfo to a queue. /// RaiseRunspaceStateEvents raises event for each item in this queue. /// </remarks> private RunspaceState SetRunspaceState(RunspaceState state, Exception reason) { RunspaceState prevState; lock (_syncRoot) { prevState = _runspaceStateInfo.State; if (state != prevState) { _runspaceStateInfo = new RunspaceStateInfo(state, reason); //Add _runspaceStateInfo to _runspaceEventQueue. //RaiseRunspaceStateEvents will raise event for each item //in this queue. //Note:We are doing clone here instead of passing the member //_runspaceStateInfo because we donot want outside //to change our runspace state. RunspaceAvailability previousAvailability = _runspaceAvailability; this.UpdateRunspaceAvailability(_runspaceStateInfo.State, false); _runspaceEventQueue.Enqueue( new RunspaceEventQueueItem( _runspaceStateInfo.Clone(), previousAvailability, _runspaceAvailability)); PSEtwLog.LogOperationalVerbose(PSEventId.RunspaceStateChange, PSOpcode.Open, PSTask.CreateRunspace, PSKeyword.UseAlwaysOperational, state.ToString()); } } return prevState; } /// <summary> /// Raises events for changes in runspace state. /// </summary> private void RaiseRunspaceStateEvents() { Queue<RunspaceEventQueueItem> tempEventQueue = null; EventHandler<RunspaceStateEventArgs> stateChanged = null; bool hasAvailabilityChangedSubscribers = false; lock (_syncRoot) { stateChanged = this.StateChanged; hasAvailabilityChangedSubscribers = this.HasAvailabilityChangedSubscribers; if (stateChanged != null || hasAvailabilityChangedSubscribers) { tempEventQueue = _runspaceEventQueue; _runspaceEventQueue = new Queue<RunspaceEventQueueItem>(); } else { //Clear the events if there are no EventHandlers. This //ensures that events do not get called for state //changes prior to their registration. _runspaceEventQueue.Clear(); } } if (tempEventQueue != null) { while (tempEventQueue.Count > 0) { RunspaceEventQueueItem queueItem = tempEventQueue.Dequeue(); if (hasAvailabilityChangedSubscribers && queueItem.NewRunspaceAvailability != queueItem.CurrentRunspaceAvailability) { this.OnAvailabilityChanged(new RunspaceAvailabilityEventArgs(queueItem.NewRunspaceAvailability)); } //Exception raised by events are not error condition for runspace //object. if (stateChanged != null) { try { stateChanged(this, new RunspaceStateEventArgs(queueItem.RunspaceStateInfo)); } catch (Exception) { } } } } } /// <summary> /// Creates a pipeline /// </summary> /// <param name="command"></param> /// <param name="addToHistory"></param> /// <param name="isNested"></param> /// <returns></returns> private Pipeline CoreCreatePipeline(string command, bool addToHistory, bool isNested) { return new RemotePipeline(this, command, addToHistory, isNested); } /// <summary> /// Waits till all the pipelines running in the runspace have /// finished execution. /// </summary> [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Finishof")] private bool WaitForFinishofPipelines() { //Take a snapshot of list of active pipelines. //Note:Before we enter to this CloseHelper routine //CoreClose has already set the state of Runspace //to closing. So no new pipelines can be executed on this //runspace and so no new pipelines will be added to //_runningPipelines. However we still need to lock because //running pipelines can be removed from this. RemotePipeline[] runningPipelines; lock (_syncRoot) { runningPipelines = (RemotePipeline[])_runningPipelines.ToArray(typeof(RemotePipeline)); } if (runningPipelines.Length > 0) { WaitHandle[] waitHandles = new WaitHandle[runningPipelines.Length]; for (int i = 0; i < runningPipelines.Length; i++) { waitHandles[i] = runningPipelines[i].PipelineFinishedEvent; } return WaitHandle.WaitAll(waitHandles); } else { return true; } } /// <summary> /// Gets the currently executing pipeline. /// </summary> /// <remarks>Internal because it is needed by invoke-history</remarks> internal override Pipeline GetCurrentlyRunningPipeline() { lock (_syncRoot) { if (_runningPipelines.Count != 0) { return (Pipeline)_runningPipelines[_runningPipelines.Count - 1]; } else { return null; } } } /// <summary> /// Handles any host calls received from the server /// </summary> /// <param name="sender">sender of this information, unused</param> /// <param name="eventArgs">arguments describing this event, contains /// a RemoteHostCall object</param> private void HandleHostCallReceived(object sender, RemoteDataEventArgs<RemoteHostCall> eventArgs) { ClientMethodExecutor.Dispatch( RunspacePool.RemoteRunspacePoolInternal.DataStructureHandler.TransportManager, RunspacePool.RemoteRunspacePoolInternal.Host, null, /* error stream */ null, /* method executor stream */ false, /* is method stream enabled */ RunspacePool.RemoteRunspacePoolInternal, Guid.Empty, /* powershell id */ eventArgs.Data); } /// <summary> /// When the client remote session reports a URI redirection, this method will report the /// message to the user as a Warning using Host method calls. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void HandleURIDirectionReported(object sender, RemoteDataEventArgs<Uri> eventArgs) { WSManConnectionInfo wsmanConnectionInfo = _connectionInfo as WSManConnectionInfo; if (null != wsmanConnectionInfo) { // change the runspace's uri to the new URI. wsmanConnectionInfo.ConnectionUri = eventArgs.Data; URIRedirectionReported.SafeInvoke(this, eventArgs); } } /// <summary> /// Forward the events from the runspace pool to the current instance /// </summary> private void HandleRunspacePoolForwardEvent(object sender, PSEventArgs e) { if (e.SourceIdentifier.Equals(RemoteDebugger.RemoteDebuggerStopEvent)) { // Special processing for forwarded remote DebuggerStop event. RemoteDebuggerStop.SafeInvoke(this, e); } else if (e.SourceIdentifier.Equals(RemoteDebugger.RemoteDebuggerBreakpointUpdatedEvent)) { // Special processing for forwarded remote DebuggerBreakpointUpdated event. RemoteDebuggerBreakpointUpdated.SafeInvoke(this, e); } else { _eventManager.AddForwardedEvent(e); } } /// <summary> /// The session has been successfully created. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void HandleSessionCreateCompleted(object sender, CreateCompleteEventArgs eventArgs) { // Update connectionInfo with updated information from the transport. if (eventArgs != null) { _connectionInfo.IdleTimeout = eventArgs.ConnectionInfo.IdleTimeout; _connectionInfo.MaxIdleTimeout = eventArgs.ConnectionInfo.MaxIdleTimeout; WSManConnectionInfo wsmanConnectionInfo = _connectionInfo as WSManConnectionInfo; if (wsmanConnectionInfo != null) { wsmanConnectionInfo.OutputBufferingMode = ((WSManConnectionInfo)eventArgs.ConnectionInfo).OutputBufferingMode; } } } /// <summary> /// Updates runspace DisconnectedOn/ExpiresOn based on RS Pool connectionInfo. /// </summary> private void UpdateDisconnectExpiresOn() { WSManConnectionInfo wsmanConnectionInfo = RunspacePool.RemoteRunspacePoolInternal.ConnectionInfo as WSManConnectionInfo; if (wsmanConnectionInfo != null) { this.DisconnectedOn = wsmanConnectionInfo.DisconnectedOn; this.ExpiresOn = wsmanConnectionInfo.ExpiresOn; } } #endregion Private Methods #region Internal Methods /// <summary> /// Determines if another Invoke-Command is executing /// in this runspace in the currently running local pipeline /// ahead on the specified invoke-command /// </summary> /// <param name="invokeCommand">current invoke-command /// instance</param> /// <param name="localPipelineId">local pipeline id</param> /// <returns>true, if another invoke-command is running /// before, false otherwise</returns> internal bool IsAnotherInvokeCommandExecuting(InvokeCommandCommand invokeCommand, long localPipelineId) { // the invoke-command's pipeline should be the currently // running pipeline. This will ensure that, we do not // return true, when one invoke-command is running as a // job and another invoke-command is entered at the // console prompt if (_currentLocalPipelineId != localPipelineId && _currentLocalPipelineId != 0) { return false; } else { // the local pipeline ids are the same // this invoke command is running may be // running in the same pipeline as another // invoke command if (_currentInvokeCommand == null) { // this is the first invoke-command, just // set the reference SetCurrentInvokeCommand(invokeCommand, localPipelineId); return false; } else if (_currentInvokeCommand.Equals(invokeCommand)) { // the currently active invoke command is the one // specified return false; } else { // the local pipeline id is the same and there // is another invoke command that is active already return true; } } } /// <summary> /// Keeps track of the current invoke command executing /// within the current local pipeline /// </summary> /// <param name="invokeCommand">reference to invoke command /// which is currently being processed</param> /// <param name="localPipelineId">the local pipeline id</param> internal void SetCurrentInvokeCommand(InvokeCommandCommand invokeCommand, long localPipelineId) { Dbg.Assert(invokeCommand != null, "InvokeCommand instance cannot be null, use ClearInvokeCommand() method to reset current command"); Dbg.Assert(localPipelineId != 0, "Local pipeline id needs to be supplied - cannot be 0"); _currentInvokeCommand = invokeCommand; _currentLocalPipelineId = localPipelineId; } /// <summary> /// Clears the current invoke-command reference stored within /// this remote runspace /// </summary> internal void ClearInvokeCommand() { _currentLocalPipelineId = 0; _currentInvokeCommand = null; } /// <summary> /// Aborts any current Opening process. If runspace is not opening then this has no effect. /// This is currently *only* for named pipe connections where a connection /// to a process is limited to a single client. /// </summary> internal void AbortOpen() { System.Management.Automation.Remoting.Client.NamedPipeClientSessionTransportManager transportManager = RunspacePool.RemoteRunspacePoolInternal.DataStructureHandler.TransportManager as System.Management.Automation.Remoting.Client.NamedPipeClientSessionTransportManager; if (transportManager != null) { transportManager.AbortConnect(); } } #endregion Internal Methods #region Misc Properties / Events /// <summary> /// The runspace pool that this remote runspace wraps /// </summary> internal RunspacePool RunspacePool { get; } /// <summary> /// EventHandler used to report connection URI redirections to the application /// </summary> internal event EventHandler<RemoteDataEventArgs<Uri>> URIRedirectionReported; #endregion Misc Properties #region Application private data /// <summary> /// Private data to be used by applications built on top of PowerShell. /// /// Remote runspace gets its application private data from the server (when creating the remote runspace pool) /// - calling this method on a remote runspace will block until the data is received from the server. /// /// Runspaces that are part of a <see cref="RunspacePool"/> inherit application private data from the pool. /// </summary> public override PSPrimitiveDictionary GetApplicationPrivateData() { try { return RunspacePool.GetApplicationPrivateData(); } catch (InvalidRunspacePoolStateException e) { throw e.ToInvalidRunspaceStateException(); } } internal override void SetApplicationPrivateData(PSPrimitiveDictionary applicationPrivateData) { Dbg.Assert(false, "RemoteRunspace.SetApplicationPrivateData shouldn't be called - this runspace does not belong to a runspace pool [although it does use a remote runspace pool internally]"); } #endregion } #region Remote Debugger /// <summary> /// RemoteDebugger /// </summary> internal sealed class RemoteDebugger : Debugger, IDisposable { #region Members private RemoteRunspace _runspace; private PowerShell _psDebuggerCommand; private bool _remoteDebugSupported; private bool _isActive; private int _breakpointCount; private Version _serverPSVersion; private volatile bool _handleDebuggerStop; private bool _isDebuggerSteppingEnabled; private UnhandledBreakpointProcessingMode _unhandledBreakpointMode; private bool _detachCommand; // Impersonation flow private WindowsIdentity _identityToPersonate; private bool _identityPersonationChecked; /// <summary> /// RemoteDebuggerStopEvent /// </summary> public const string RemoteDebuggerStopEvent = "PSInternalRemoteDebuggerStopEvent"; /// <summary> /// RemoteDebuggerBreakpointUpdatedEvent /// </summary> public const string RemoteDebuggerBreakpointUpdatedEvent = "PSInternalRemoteDebuggerBreakpointUpdatedEvent"; // Remote debugger settings public const string DebugModeSetting = "DebugMode"; public const string DebugStopState = "DebugStop"; public const string DebugBreakpointCount = "DebugBreakpointCount"; public const string BreakAllSetting = "BreakAll"; public const string UnhandledBreakpointModeSetting = "UnhandledBreakpointMode"; #endregion #region Constructor private RemoteDebugger() { } /// <summary> /// Constructor /// </summary> /// <param name="runspace">Associated remote runspace</param> public RemoteDebugger(RemoteRunspace runspace) { if (runspace == null) { throw new PSArgumentNullException("runspace"); } _runspace = runspace; _unhandledBreakpointMode = UnhandledBreakpointProcessingMode.Ignore; // Hook up remote debugger forwarded event handlers. _runspace.RemoteDebuggerStop += HandleForwardedDebuggerStopEvent; _runspace.RemoteDebuggerBreakpointUpdated += HandleForwardedDebuggerBreakpointUpdatedEvent; } #endregion #region Class overrides /// <summary> /// Process debugger command. /// </summary> /// <param name="command">Debugger PSCommand</param> /// <param name="output">Output</param> /// <returns>DebuggerCommandResults</returns> public override DebuggerCommandResults ProcessCommand(PSCommand command, PSDataCollection<PSObject> output) { CheckForValidateState(); _detachCommand = false; if (command == null) { throw new PSArgumentNullException("command"); } if (output == null) { throw new PSArgumentNullException("output"); } if (!DebuggerStopped) { throw new PSInvalidOperationException( DebuggerStrings.CannotProcessDebuggerCommandNotStopped, null, Debugger.CannotProcessCommandNotStopped, ErrorCategory.InvalidOperation, null); } DebuggerCommandResults results = null; // Execute command on server. bool executionError = false; using (_psDebuggerCommand = GetNestedPowerShell()) { foreach (var cmd in command.Commands) { cmd.MergeMyResults(PipelineResultTypes.All, PipelineResultTypes.Output); _psDebuggerCommand.AddCommand(cmd); } PSDataCollection<PSObject> internalOutput = new PSDataCollection<PSObject>(); internalOutput.DataAdded += (sender, args) => { foreach (var item in internalOutput.ReadAll()) { if (item == null) { return; } DebuggerCommand dbgCmd = item.BaseObject as DebuggerCommand; if (dbgCmd != null) { bool executedByDebugger = (dbgCmd.ResumeAction != null || dbgCmd.ExecutedByDebugger); results = new DebuggerCommandResults(dbgCmd.ResumeAction, executedByDebugger); } else if (item.BaseObject is DebuggerCommandResults) { results = item.BaseObject as DebuggerCommandResults; } else { output.Add(item); } } }; try { _psDebuggerCommand.Invoke(null, internalOutput, null); } catch (Exception e) { executionError = true; RemoteException re = e as RemoteException; if ((re != null) && (re.ErrorRecord != null)) { // Allow the IncompleteParseException to throw so that the console // can handle here strings and continued parsing. if (re.ErrorRecord.CategoryInfo.Reason == typeof(IncompleteParseException).Name) { throw new IncompleteParseException( (re.ErrorRecord.Exception != null) ? re.ErrorRecord.Exception.Message : null, re.ErrorRecord.FullyQualifiedErrorId); } // Allow the RemoteException and InvalidRunspacePoolStateException to propagate so that the host can // clean up the debug session. if ((re.ErrorRecord.CategoryInfo.Reason == typeof(InvalidRunspacePoolStateException).Name) || (re.ErrorRecord.CategoryInfo.Reason == typeof(RemoteException).Name)) { throw new PSRemotingTransportException( (re.ErrorRecord.Exception != null) ? re.ErrorRecord.Exception.Message : string.Empty); } } // Allow all PSRemotingTransportException and RemoteException errors to propagate as this // indicates a broken debug session. if ((e is PSRemotingTransportException) || (e is RemoteException)) { throw; } output.Add( new PSObject( new ErrorRecord( e, "DebuggerError", ErrorCategory.InvalidOperation, null))); } } executionError = executionError || _psDebuggerCommand.HadErrors; _psDebuggerCommand = null; // Special processing when the detach command is run. _detachCommand = (!executionError) && (command.Commands.Count > 0) && (command.Commands[0].CommandText.Equals("Detach", StringComparison.OrdinalIgnoreCase)); return results ?? new DebuggerCommandResults(null, false); } /// <summary> /// StopProcessCommand /// </summary> public override void StopProcessCommand() { CheckForValidateState(); PowerShell ps = _psDebuggerCommand; if ((ps != null) && (ps.InvocationStateInfo.State == PSInvocationState.Running)) { ps.BeginStop(null, null); } } /// <summary> /// SetDebuggerAction /// </summary> /// <param name="resumeAction">DebuggerResumeAction</param> public override void SetDebuggerAction(DebuggerResumeAction resumeAction) { CheckForValidateState(); SetRemoteDebug(false, RunspaceAvailability.Busy); using (PowerShell ps = GetNestedPowerShell()) { ps.AddCommand(DebuggerUtils.SetDebuggerActionFunctionName).AddParameter("ResumeAction", resumeAction); ps.Invoke(); // If an error exception is returned then throw it here. if (ps.ErrorBuffer.Count > 0) { Exception e = ps.ErrorBuffer[0].Exception; if (e != null) { throw e; } } } } /// <summary> /// GetDebuggerStopped /// </summary> /// <returns>DebuggerStopEventArgs</returns> public override DebuggerStopEventArgs GetDebuggerStopArgs() { CheckForValidateState(); DebuggerStopEventArgs rtnArgs = null; try { using (PowerShell ps = GetNestedPowerShell()) { ps.AddCommand(DebuggerUtils.GetDebuggerStopArgsFunctionName); Collection<PSObject> output = ps.Invoke<PSObject>(); foreach (var item in output) { if (item == null) { continue; } rtnArgs = item.BaseObject as DebuggerStopEventArgs; if (rtnArgs != null) { break; } } } } catch (Exception) { } return rtnArgs; } /// <summary> /// SetDebugMode /// </summary> /// <param name="mode"></param> public override void SetDebugMode(DebugModes mode) { CheckForValidateState(); // Only set debug mode on server if no commands are currently // running on remote runspace. if ((_runspace.GetCurrentlyRunningPipeline() != null) || (_runspace.RemoteCommand != null)) { return; } using (PowerShell ps = GetNestedPowerShell()) { ps.SetIsNested(false); ps.AddCommand(DebuggerUtils.SetDebugModeFunctionName).AddParameter("Mode", mode); ps.Invoke(); } base.SetDebugMode(mode); SetIsActive(_breakpointCount); } /// <summary> /// Sets debugger stepping mode. /// </summary> /// <param name="enabled">True if stepping is to be enabled</param> public override void SetDebuggerStepMode(bool enabled) { CheckForValidateState(); // This is supported only for PowerShell versions >= 5.0 if ((_serverPSVersion == null) || (_serverPSVersion.Major < PSVersionInfo.PSV5Version.Major)) { return; } try { // Ensure debugger is in correct mode. base.SetDebugMode(DebugModes.LocalScript | DebugModes.RemoteScript); // Send Enable-DebuggerStepping virtual command. using (PowerShell ps = GetNestedPowerShell()) { ps.AddCommand(DebuggerUtils.SetDebuggerStepMode).AddParameter("Enabled", enabled); ps.Invoke(); _isDebuggerSteppingEnabled = enabled; } } catch (Exception) { // Don't propagate exceptions. } } /// <summary> /// True when debugger is active with breakpoints. /// </summary> public override bool IsActive { get { return _isActive; } } /// <summary> /// True when debugger is stopped at a breakpoint. /// </summary> public override bool InBreakpoint { get { return _handleDebuggerStop || (_runspace.RunspaceAvailability == RunspaceAvailability.RemoteDebug); } } /// <summary> /// InternalProcessCommand /// </summary> /// <param name="command"></param> /// <param name="output"></param> /// <returns></returns> internal override DebuggerCommand InternalProcessCommand(string command, IList<PSObject> output) { throw new PSNotImplementedException(); } /// <summary> /// IsRemote /// </summary> internal override bool IsRemote { get { return true; } } /// <summary> /// Sets how the debugger deals with breakpoint events that are not handled. /// Ignore - This is the default behavior and ignores any breakpoint event /// if there is no handler. Releases any preserved event. /// Wait - This mode preserves a breakpoint event until a handler is /// subscribed. /// </summary> internal override UnhandledBreakpointProcessingMode UnhandledBreakpointMode { get { return _unhandledBreakpointMode; } set { CheckForValidateState(); // This is supported only for PowerShell versions >= 5.0 if ((_serverPSVersion == null) || (_serverPSVersion < PSVersionInfo.PSV5Version)) { return; } SetRemoteDebug(false, (RunspaceAvailability?)null); // Send Set-PSUnhandledBreakpointMode virtual command. using (PowerShell ps = GetNestedPowerShell()) { ps.AddCommand(DebuggerUtils.SetPSUnhandledBreakpointMode).AddParameter("UnhandledBreakpointMode", value); ps.Invoke(); } _unhandledBreakpointMode = value; } } #endregion #region IDisposable /// <summary> /// Dispose /// </summary> public void Dispose() { _runspace.RemoteDebuggerStop -= HandleForwardedDebuggerStopEvent; _runspace.RemoteDebuggerBreakpointUpdated -= HandleForwardedDebuggerBreakpointUpdatedEvent; if (_identityToPersonate != null) { _identityToPersonate.Dispose(); _identityToPersonate = null; } } #endregion #region Internal Methods /// <summary> /// Internal method that checks the debug state of /// the remote session and raises the DebuggerStop event /// if debugger is in stopped state. /// This is used internally to help clients get back to /// debug state when reconnecting to remote session in debug state. /// </summary> internal void CheckStateAndRaiseStopEvent() { DebuggerStopEventArgs stopArgs = GetDebuggerStopArgs(); if (stopArgs != null) { ProcessDebuggerStopEvent(stopArgs); } } /// <summary> /// IsRemoteDebug /// </summary> internal bool IsRemoteDebug { private set; get; } /// <summary> /// Sets client debug info state based on server info. /// </summary> /// <param name="debugMode">Debug mode</param> /// <param name="inBreakpoint">Currently in breakpoint</param> /// <param name="breakpointCount">Breakpoint count</param> /// <param name="breakAll">Break All setting</param> /// <param name="unhandledBreakpointMode">UnhandledBreakpointMode</param> /// <param name="serverPSVersion">Server PowerShell version</param> internal void SetClientDebugInfo( DebugModes? debugMode, bool inBreakpoint, int breakpointCount, bool breakAll, UnhandledBreakpointProcessingMode unhandledBreakpointMode, Version serverPSVersion) { if (debugMode != null) { _remoteDebugSupported = true; DebugMode = debugMode.Value; } else { _remoteDebugSupported = false; } if (inBreakpoint) { SetRemoteDebug(true, RunspaceAvailability.RemoteDebug); } _serverPSVersion = serverPSVersion; _breakpointCount = breakpointCount; _isDebuggerSteppingEnabled = breakAll; _unhandledBreakpointMode = unhandledBreakpointMode; SetIsActive(breakpointCount); } /// <summary> /// If a command is stopped while in debug stopped state and it /// is the only command running then server is no longer debug stopped. /// </summary> internal void OnCommandStopped() { if (IsRemoteDebug) { IsRemoteDebug = false; } } /// <summary> /// Gets breakpoint information from the target machine and passes that information /// on through the BreakpointUpdated event. /// </summary> internal void SendBreakpointUpdatedEvents() { if (!IsDebuggerBreakpointUpdatedEventSubscribed() || (_breakpointCount == 0)) { return; } PSDataCollection<PSObject> breakpoints = new PSDataCollection<PSObject>(); // Get breakpoint information by running "Get-PSBreakpoint" PowerShell command. using (PowerShell ps = GetNestedPowerShell()) { if (!this.InBreakpoint) { // Can't use nested PowerShell if we are not stopped in a breakpoint. ps.SetIsNested(false); } ps.AddCommand("Get-PSBreakpoint"); ps.Invoke(null, breakpoints); } // Raise BreakpointUpdated event to client for each breakpoint. foreach (PSObject obj in breakpoints) { Breakpoint breakpoint = obj.BaseObject as Breakpoint; if (breakpoint != null) { RaiseBreakpointUpdatedEvent( new BreakpointUpdatedEventArgs(breakpoint, BreakpointUpdateType.Set, _breakpointCount)); } } } /// <summary> /// IsDebuggerSteppingEnabled /// </summary> internal override bool IsDebuggerSteppingEnabled { get { return _isDebuggerSteppingEnabled; } } #endregion #region Private Methods // // Event handlers // private void HandleForwardedDebuggerStopEvent(object sender, PSEventArgs e) { Dbg.Assert(e.SourceArgs.Length == 1, "Forwarded debugger stop event args must always contain one SourceArgs item."); DebuggerStopEventArgs args; if (e.SourceArgs[0] is PSObject) { args = ((PSObject)e.SourceArgs[0]).BaseObject as DebuggerStopEventArgs; } else { args = e.SourceArgs[0] as DebuggerStopEventArgs; } ProcessDebuggerStopEvent(args); } private void ProcessDebuggerStopEvent(DebuggerStopEventArgs args) { // It is possible to get a stop event raise request while // debugger is already in stop mode (after remote runspace debugger // reconnect). In this case ignore the request. if (_handleDebuggerStop) { return; } // Attempt to process debugger stop event on original thread if it // is available (i.e., if it is blocked by EndInvoke). PowerShell powershell = _runspace.RunspacePool.RemoteRunspacePoolInternal.GetCurrentRunningPowerShell(); AsyncResult invokeAsyncResult = (powershell != null) ? powershell.EndInvokeAsyncResult : null; bool invokedOnBlockedThread = false; if ((invokeAsyncResult != null) && (!invokeAsyncResult.IsCompleted)) { invokedOnBlockedThread = invokeAsyncResult.InvokeCallbackOnThread( ProcessDebuggerStopEventProc, args); } if (!invokedOnBlockedThread) { #if CORECLR Threading.ThreadPool.QueueUserWorkItem( ProcessDebuggerStopEventProc, args); #else // Otherwise run on worker thread. Utils.QueueWorkItemWithImpersonation( _identityToPersonate, ProcessDebuggerStopEventProc, args); #endif } } private void ProcessDebuggerStopEventProc(object state) { RunspaceAvailability prevAvailability = _runspace.RunspaceAvailability; bool restoreAvailability = true; try { _handleDebuggerStop = true; // Update runspace availability SetRemoteDebug(true, RunspaceAvailability.RemoteDebug); // Raise event and wait for response. DebuggerStopEventArgs args = state as DebuggerStopEventArgs; if (args != null) { if (IsDebuggerStopEventSubscribed()) { try { // Blocking call. base.RaiseDebuggerStopEvent(args); } finally { _handleDebuggerStop = false; if (!_detachCommand && !args.SuspendRemote) { SetDebuggerAction(args.ResumeAction); } } } else { // If no debugger is subscribed to the DebuggerStop event then we // allow the server side script execution to remain blocked in debug // stop mode. The runspace Availability reflects this and the client // must take action (attach debugger or release remote debugger stop // via SetDebuggerAction()). restoreAvailability = false; _handleDebuggerStop = false; } } else { // Null arguments may indicate that remote runspace was created without // default type table and so arguments cannot be serialized. In this case // we don't want to block the remote side script execution. _handleDebuggerStop = false; SetDebuggerAction(DebuggerResumeAction.Continue); } } catch (Exception) { _handleDebuggerStop = false; } finally { // Restore runspace availability. if (restoreAvailability && (_runspace.RunspaceAvailability == RunspaceAvailability.RemoteDebug)) { SetRemoteDebug(false, prevAvailability); } if (_detachCommand) { _detachCommand = false; } } } private void HandleForwardedDebuggerBreakpointUpdatedEvent(object sender, PSEventArgs e) { Dbg.Assert(e.SourceArgs.Length == 1, "Forwarded debugger breakpoint event args must always contain one SourceArgs item."); BreakpointUpdatedEventArgs bpArgs = e.SourceArgs[0] as BreakpointUpdatedEventArgs; if (bpArgs != null) { UpdateBreakpointCount(bpArgs.BreakpointCount); base.RaiseBreakpointUpdatedEvent(bpArgs); } } private PowerShell GetNestedPowerShell() { PowerShell ps = PowerShell.Create(); ps.Runspace = _runspace; ps.SetIsNested(true); return ps; } private void CheckForValidateState() { if (!_remoteDebugSupported) { throw new PSInvalidOperationException( // The remote session to which you are connected does not support remote debugging. // You must connect to a remote computer that is running Windows PowerShell {0} or greater. StringUtil.Format(RemotingErrorIdStrings.RemoteDebuggingEndpointVersionError, PSVersionInfo.PSV4Version), null, "RemoteDebugger:RemoteDebuggingNotSupported", ErrorCategory.NotImplemented, null); } if (_runspace.RunspaceStateInfo.State != RunspaceState.Opened) { throw new InvalidRunspaceStateException(); } if (!_identityPersonationChecked) { _identityPersonationChecked = true; // Save identity to impersonate. WindowsIdentity currentIdentity = null; try { currentIdentity = WindowsIdentity.GetCurrent(); } catch (System.Security.SecurityException) { } _identityToPersonate = ((currentIdentity != null) && (currentIdentity.ImpersonationLevel == TokenImpersonationLevel.Impersonation)) ? currentIdentity : null; } } private void SetRemoteDebug(bool remoteDebug, RunspaceAvailability? availability) { if (_runspace.RunspaceStateInfo.State != RunspaceState.Opened) { return; } if (IsRemoteDebug != remoteDebug) { IsRemoteDebug = remoteDebug; _runspace.RunspacePool.RemoteRunspacePoolInternal.IsRemoteDebugStop = remoteDebug; } if (availability != null) { RunspaceAvailability newAvailability = availability.Value; if ((_runspace.RunspaceAvailability != newAvailability) && (remoteDebug || (newAvailability != RunspaceAvailability.RemoteDebug))) { try { _runspace.UpdateRunspaceAvailability(newAvailability, true); } catch (Exception) { } } } } private void UpdateBreakpointCount(int bpCount) { _breakpointCount = bpCount; SetIsActive(bpCount); } private void SetIsActive(int breakpointCount) { if ((DebugMode & DebugModes.RemoteScript) == 0) { // Debugger is always inactive if RemoteScript is not selected. if (_isActive) { _isActive = false; } return; } if (breakpointCount > 0) { if (!_isActive) { _isActive = true; } } else { if (_isActive) { _isActive = false; } } } #endregion } #endregion #region RemoteSessionStateProxy internal class RemoteSessionStateProxy : SessionStateProxy { private RemoteRunspace _runspace; internal RemoteSessionStateProxy(RemoteRunspace runspace) { Dbg.Assert(runspace != null, "Caller should validate the parameter"); _runspace = runspace; } private Exception _isInNoLanguageModeException = null; private Exception _getVariableCommandNotFoundException = null; private Exception _setVariableCommandNotFoundException = null; /// <summary> /// Set a variable in session state. /// </summary> /// /// <param name="name"> /// The name of the item to set. /// </param> /// /// <param name="value"> /// The new value of the item being set. /// </param> /// /// <exception cref="ArgumentNullException"> /// name is null /// </exception> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override void SetVariable(string name, object value) { if (name == null) { throw PSTraceSource.NewArgumentNullException("name"); } // Verify the runspace has the Set-Variable command. For performance, throw if we got an error // before. if (_setVariableCommandNotFoundException != null) throw _setVariableCommandNotFoundException; // Since these are implemented as pipelines, we don't need to do our own // locking of sessionStateCallInProgress like we do with local runspaces. Pipeline remotePipeline = _runspace.CreatePipeline(); Command command = new Command("Microsoft.PowerShell.Utility\\Set-Variable"); command.Parameters.Add("Name", name); command.Parameters.Add("Value", value); remotePipeline.Commands.Add(command); try { remotePipeline.Invoke(); } catch (RemoteException e) { if (String.Equals("CommandNotFoundException", e.ErrorRecord.FullyQualifiedErrorId, StringComparison.OrdinalIgnoreCase)) { _setVariableCommandNotFoundException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e); throw _setVariableCommandNotFoundException; } else throw; } if (remotePipeline.Error.Count > 0) { // Don't cache these errors, as they are related to the actual variable being set. ErrorRecord error = (ErrorRecord)remotePipeline.Error.Read(); throw new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, error.Exception); } } /// <summary> /// Get a variable out of session state. /// </summary> /// /// <param name="name"> /// name of variable to look up /// </param> /// /// <returns> /// The value of the specified variable. /// </returns> /// /// <exception cref="ArgumentNullException"> /// name is null /// </exception> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override object GetVariable(string name) { if (name == null) { throw PSTraceSource.NewArgumentNullException("name"); } // Verify the runspace has the Get-Variable command. For performance, throw if we got an error // before. if (_getVariableCommandNotFoundException != null) throw _getVariableCommandNotFoundException; // Since these are implemented as pipelines, we don't need to do our own // locking of sessionStateCallInProgress like we do with local runspaces. Pipeline remotePipeline = _runspace.CreatePipeline(); Command command = new Command("Microsoft.PowerShell.Utility\\Get-Variable"); command.Parameters.Add("Name", name); remotePipeline.Commands.Add(command); System.Collections.ObjectModel.Collection<PSObject> result = null; try { result = remotePipeline.Invoke(); } catch (RemoteException e) { if (String.Equals("CommandNotFoundException", e.ErrorRecord.FullyQualifiedErrorId, StringComparison.OrdinalIgnoreCase)) { _getVariableCommandNotFoundException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e); throw _getVariableCommandNotFoundException; } else throw; } if (remotePipeline.Error.Count > 0) { // Don't cache these errors, as they are related to the actual variable being set. ErrorRecord error = (ErrorRecord)remotePipeline.Error.Read(); if (string.Equals("CommandNotFoundException", error.FullyQualifiedErrorId, StringComparison.OrdinalIgnoreCase)) { throw new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, error.Exception); } else { throw new PSInvalidOperationException(error.Exception.Message, error.Exception); } } if (result.Count != 1) return null; else return result[0].Properties["Value"].Value; } /// <summary> /// Get the list of applications out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override List<string> Applications { get { // Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error // before. if (_isInNoLanguageModeException != null) throw _isInNoLanguageModeException; // Since these are implemented as pipelines, we don't need to do our own // locking of sessionStateCallInProgress like we do with local runspaces. Pipeline remotePipeline = _runspace.CreatePipeline(); remotePipeline.Commands.AddScript("$executionContext.SessionState.Applications"); List<string> result = new List<string>(); try { foreach (PSObject application in remotePipeline.Invoke()) { result.Add(application.BaseObject as string); } } catch (RemoteException e) { if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError) { _isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e); throw _isInNoLanguageModeException; } else throw; } return result; } } /// <summary> /// Get the list of scripts out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override List<string> Scripts { get { // Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error // before. if (_isInNoLanguageModeException != null) throw _isInNoLanguageModeException; // Since these are implemented as pipelines, we don't need to do our own // locking of sessionStateCallInProgress like we do with local runspaces. Pipeline remotePipeline = _runspace.CreatePipeline(); remotePipeline.Commands.AddScript("$executionContext.SessionState.Scripts"); List<string> result = new List<string>(); try { foreach (PSObject application in remotePipeline.Invoke()) { result.Add(application.BaseObject as string); } } catch (RemoteException e) { if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError) { _isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e); throw _isInNoLanguageModeException; } else throw; } return result; } } /// <summary> /// Get the APIs to access drives out of session state /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override DriveManagementIntrinsics Drive { get { throw new PSNotSupportedException(); } } /// <summary> /// Get/Set the language mode out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override PSLanguageMode LanguageMode { get { // Verify the runspace has is not in NoLanguage mode. For performance, return our // cached value if we got an error before. if (_isInNoLanguageModeException != null) return PSLanguageMode.NoLanguage; // Since these are implemented as pipelines, we don't need to do our own // locking of sessionStateCallInProgress like we do with local runspaces. Pipeline remotePipeline = _runspace.CreatePipeline(); remotePipeline.Commands.AddScript("$executionContext.SessionState.LanguageMode"); System.Collections.ObjectModel.Collection<PSObject> result = null; try { result = remotePipeline.Invoke(); } catch (RemoteException e) { if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError) { _isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e); return PSLanguageMode.NoLanguage; } else throw; } return (PSLanguageMode)LanguagePrimitives.ConvertTo(result[0], typeof(PSLanguageMode), CultureInfo.InvariantCulture); } set { throw new PSNotSupportedException(); } } /// <summary> /// Get the module info out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override PSModuleInfo Module { get { throw new PSNotSupportedException(); } } /// <summary> /// Get the APIs to access paths and locations out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override PathIntrinsics Path { get { throw new PSNotSupportedException(); } } /// <summary> /// Get the APIs to access a provider out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override CmdletProviderManagementIntrinsics Provider { get { throw new PSNotSupportedException(); } } /// <summary> /// Get the APIs to access variables out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override PSVariableIntrinsics PSVariable { get { throw new PSNotSupportedException(); } } /// <summary> /// Get the APIs to build script blocks and execute script out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override CommandInvocationIntrinsics InvokeCommand { get { throw new PSNotSupportedException(); } } /// <summary> /// Gets the instance of the provider interface APIs out of session state. /// </summary> /// /// <exception cref="InvalidRunspaceStateException"> /// Runspace is not open. /// </exception> /// /// <exception cref="InvalidOperationException"> /// Another SessionStateProxy call or another pipeline is in progress. /// </exception> public override ProviderIntrinsics InvokeProvider { get { throw new PSNotSupportedException(); } } } #endregion }
37.67041
202
0.555047
[ "Apache-2.0" ]
huamichaelchen/PowerShell
src/System.Management.Automation/engine/remoting/client/remoterunspace.cs
114,066
C#
using System; using Moq; using System.Collections.Generic; using Windows.Win32.UI.Input.KeyboardAndMouse; using Xunit; namespace Whim.Tests; public class CommandItemsTests { /// <summary> /// Add a command with no keybind. /// </summary> [Fact] public void AddCommand() { CommandItems commandItems = new(); Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object); Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); } /// <summary> /// Add a command with a keybind. /// </summary> [Fact] public void AddCommandWithKeybind() { CommandItems commandItems = new(); Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); commandItems.Add(command.Object, keybind); Assert.Equal(command.Object, commandItems.TryGetCommand(keybind)); Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); } /// <summary> /// Two commands with the same identifier. /// </summary> [Fact] public void AddTwoCommandsWithSameIdentifier() { CommandItems commandItems = new(); Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object); Mock<ICommand> command2 = new(); command2.Setup(c => c.Identifier).Returns("command"); Assert.Throws<ArgumentException>(() => commandItems.Add(command2.Object)); } /// <summary> /// Override an existing keybind with a new command. /// </summary> [Fact] public void OverrideKeybind() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the first command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Set up the second command. Mock<ICommand> command2 = new(); command2.Setup(c => c.Identifier).Returns("command2"); commandItems.Add(command2.Object, keybind); // Check that the first command is still there. Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); // Check that the second command is now the one bound to the keybind. Assert.Equal(command2.Object, commandItems.TryGetCommand(keybind)); Assert.Equal(command2.Object, commandItems.TryGetCommand(command2.Object.Identifier)); } /// <summary> /// Set a keybind to a command which doesn't exist. /// </summary> [Fact] public void SetKeybindToNonExistentCommand() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); Assert.False(commandItems.SetKeybind("command", keybind)); } /// <summary> /// Set a keybind to an existing command. /// </summary> [Fact] public void SetKeybindToExistingCommand() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the first command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Set up the second command. Mock<ICommand> command2 = new(); command2.Setup(c => c.Identifier).Returns("command2"); commandItems.Add(command2.Object); // Set the keybind to the second command. commandItems.SetKeybind(command2.Object.Identifier, keybind); // Check that the first command is still there. Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); // Check that the second command is now the one bound to the keybind. Assert.Equal(command2.Object, commandItems.TryGetCommand(keybind)); Assert.Equal(keybind, commandItems.TryGetKeybind(command2.Object.Identifier)); // Check that the first command is not bound to the keybind. Assert.Null(commandItems.TryGetKeybind(command.Object.Identifier)); } /// <summary> /// Remove a keybind, but verify the command is still there. /// </summary> [Fact] public void RemoveKeybind() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Remove the keybind. commandItems.RemoveKeybind(keybind); // Check that the command is still there. Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); // Check that the keybind is no longer there. Assert.Null(commandItems.TryGetCommand(keybind)); } /// <summary> /// Remove a keybind, given the command. /// </summary> [Fact] public void RemoveKeybindGivenCommand() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Remove the keybind. commandItems.RemoveKeybind(command.Object.Identifier); // Check that the command is still there. Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); // Check that the keybind is no longer there. Assert.Null(commandItems.TryGetCommand(keybind)); } /// <summary> /// Remove a command, and verify the keybind is no longer there. /// </summary> [Fact] public void RemoveBoundCommand() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Remove the command. commandItems.Remove(command.Object.Identifier); // Check that the command is no longer there. Assert.Null(commandItems.TryGetCommand(command.Object.Identifier)); // Check that the keybind is gone. Assert.Null(commandItems.TryGetCommand(keybind)); } /// <summary> /// Remove an unbound command. /// </summary> [Fact] public void RemoveUnboundCommand() { CommandItems commandItems = new(); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); // Remove the command. commandItems.Remove(command.Object.Identifier); // Check that the command is no longer there. Assert.Null(commandItems.TryGetCommand(command.Object.Identifier)); } /// <summary> /// Clear all commands. /// </summary> [Fact] public void Clear() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Clear all commands. commandItems.Clear(); // Check that the command is no longer there. Assert.Null(commandItems.TryGetCommand(command.Object.Identifier)); // Check that the keybind is gone. Assert.Null(commandItems.TryGetCommand(keybind)); } /// <summary> /// Clear all keybinds. /// </summary> [Fact] public void ClearKeybinds() { CommandItems commandItems = new(); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); // Set up the command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); commandItems.Add(command.Object, keybind); // Clear all keybinds. commandItems.ClearKeybinds(); // Check that the command is still there. Assert.Equal(command.Object, commandItems.TryGetCommand(command.Object.Identifier)); // Check that the keybind is no longer there. Assert.Null(commandItems.TryGetCommand(keybind)); } /// <summary> /// Enumerator. /// </summary> [Fact] public void Enumerator() { CommandItems commandItems = new(); // Set up the first command. Mock<ICommand> command = new(); command.Setup(c => c.Identifier).Returns("command"); Keybind keybind = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_F); commandItems.Add(command.Object, keybind); // Set up the second command. Mock<ICommand> command2 = new(); command2.Setup(c => c.Identifier).Returns("command2"); commandItems.Add(command2.Object); // Set up the third command. Mock<ICommand> command3 = new(); command3.Setup(c => c.Identifier).Returns("command3"); commandItems.Add(command3.Object); // Set up the fourth command. Mock<ICommand> command4 = new(); command4.Setup(c => c.Identifier).Returns("command4"); Keybind keybind4 = new(KeyModifiers.RWin, VIRTUAL_KEY.VK_G); commandItems.Add(command4.Object, keybind4); // Iterate over the commands. IEnumerator<(ICommand, IKeybind?)> commands = commandItems.GetEnumerator(); // Convert the IEnumerator to a List. List<(ICommand, IKeybind?)> commandsList = new(); while (commands.MoveNext()) { commandsList.Add(commands.Current); } // Check there's the right number of commands. Assert.Equal(4, commandsList.Count); // Check that each of the command-keybind pairs are in the list. Assert.Contains((command.Object, keybind), commandsList); Assert.Contains((command2.Object, null), commandsList); Assert.Contains((command3.Object, null), commandsList); Assert.Contains((command4.Object, keybind4), commandsList); } }
27.943114
88
0.716704
[ "MIT" ]
dalyIsaac/Whim
src/Whim.Tests/CommandItemsTests.cs
9,335
C#
//============================================================== // Copyright (C) 2020 Inc. All rights reserved. // //============================================================== // Create by 种道洋 at 2020/2/16 11:01:34. // Version 1.0 // 种道洋 //============================================================== using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Xml.Linq; namespace Cdy.Tag { /// <summary> /// /// </summary> public class PermissionDocument:INotifyPropertyChanged { #region ... Variables ... private bool mIsDirty = false; #endregion ...Variables... #region ... Events ... #endregion ...Events... #region ... Constructor... public PermissionDocument() { var superPermission = new UserPermission() { Name = "Super", SuperPermission = true, EnableWrite = true,Desc="Super Permission" }; Permissions.Add(superPermission.Name, superPermission); } #endregion ...Constructor... #region ... Properties ... /// <summary> /// /// </summary> public Dictionary<string, UserPermission> Permissions { get; set; } = new Dictionary<string, UserPermission>(); public bool IsDirty { get { return mIsDirty; } set { mIsDirty = value; OnPropertyChanged("IsDirty"); } } public event PropertyChangedEventHandler PropertyChanged; #endregion ...Properties... #region ... Methods ... /// <summary> /// /// </summary> /// <param name="name"></param> protected void OnPropertyChanged(string name) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(name)); } } /// <summary> /// /// </summary> /// <param name="permission"></param> public void Add(UserPermission permission) { if(!Permissions.ContainsKey(permission.Name)) { Permissions.Add(permission.Name, permission); } } /// <summary> /// /// </summary> /// <param name="name"></param> public void Remove(string name) { if(!Permissions.ContainsKey(name)) { Permissions.Remove(name); } } #endregion ...Methods... #region ... Interfaces ... #endregion ...Interfaces... } }
25.392157
142
0.489189
[ "Apache-2.0" ]
cdy816/mars
Common/Cdy.Tag/Security/PermissionDocument.cs
2,604
C#
#region S# License /****************************************************************************************** NOTICE!!! This program and source code is owned and licensed by StockSharp, LLC, www.stocksharp.com Viewing or use of this code requires your acceptance of the license agreement found at https://github.com/StockSharp/StockSharp/blob/master/LICENSE Removal of this comment is a violation of the license agreement. Project: StockSharp.Quik.Xaml.QuikPublic File: Extensions.cs Created: 2015, 11, 11, 2:32 PM Copyright 2010 by StockSharp, LLC *******************************************************************************************/ #endregion S# License using System; using System.Collections.Generic; using System.Linq; namespace StockSharp.Quik.Xaml { /// <summary> /// Вспомогательный класс для работы со списком столбцов DDE таблиц. /// </summary> static class Extensions { /// <summary> /// Получить список столбцов по их названиям. /// </summary> /// <param name="type">Тип таблицы.</param> /// <param name="columns">Названия столбцов.</param> /// <returns>Список столбцов.</returns> public static IEnumerable<DdeTableColumn> GetColumns(this Type type, IEnumerable<string> columns) { return columns.Select(column => (DdeTableColumn)type.GetProperty(column).GetValue(null, null)); } } }
34.230769
99
0.642697
[ "Apache-2.0" ]
Alexander2k/Stock-
Connectors/Quik/Xaml/Extensions.cs
1,464
C#
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using FsCheck; using FsCheck.MsTest.Examples.ClassesToTest; namespace FsCheck.MsTest.Examples { [TestClass] public class CounterTest { [TestMethod, ExpectedException(typeof(Exception))] public void QuickCounter() { new CounterSpec().ToSpecification().QuickCheckThrowOnFailure(); } [TestMethod, ExpectedException(typeof(Exception))] public void VerboseCounter() { new CounterSpec().ToSpecification().VerboseCheckThrowOnFailure(); } } }
25.333333
77
0.669408
[ "BSD-3-Clause" ]
forki/FsCheck
examples/FsCheck.MsTest.Examples/CounterTest.cs
610
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Management.Automation; namespace Microsoft.PowerShell.Commands { /// <summary> /// Types of breakpoints. /// </summary> public enum BreakpointType { /// <summary>Breakpoint on a line within a script</summary> Line, /// <summary> /// Breakpoint on a variable</summary> Variable, /// <summary>Breakpoint on a command</summary> Command }; /// <summary> /// This class implements Remove-PSBreakpoint. /// </summary> [Cmdlet(VerbsCommon.Get, "PSBreakpoint", DefaultParameterSetName = "Script", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113325")] [OutputType(typeof(Breakpoint))] public class GetPSBreakpointCommand : PSCmdlet { #region parameters /// <summary> /// Scripts of the breakpoints to output. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "It's OK to use arrays for cmdlet parameters")] [Parameter(ParameterSetName = "Script", Position = 0, ValueFromPipeline = true)] [Parameter(ParameterSetName = "Variable")] [Parameter(ParameterSetName = "Command")] [Parameter(ParameterSetName = "Type")] [ValidateNotNullOrEmpty()] public string[] Script { get { return _script; } set { _script = value; } } private string[] _script; /// <summary> /// IDs of the breakpoints to output. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "It's OK to use arrays for cmdlet parameters")] [Parameter(ParameterSetName = "Id", Mandatory = true, Position = 0, ValueFromPipeline = true)] [ValidateNotNull] public int[] Id { get { return _id; } set { _id = value; } } private int[] _id; /// <summary> /// Variables of the breakpoints to output. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "It's OK to use arrays for cmdlet parameters")] [Parameter(ParameterSetName = "Variable", Mandatory = true)] [ValidateNotNull] public string[] Variable { get { return _variable; } set { _variable = value; } } private string[] _variable; /// <summary> /// Commands of the breakpoints to output. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "It's OK to use arrays for cmdlet parameters")] [Parameter(ParameterSetName = "Command", Mandatory = true)] [ValidateNotNull] public string[] Command { get { return _command; } set { _command = value; } } private string[] _command; /// <summary> /// Commands of the breakpoints to output. /// </summary> [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "It's OK to use arrays for cmdlet parameters")] [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Type is OK for a cmdlet parameter")] [Parameter(ParameterSetName = "Type", Mandatory = true, Position = 0, ValueFromPipeline = true)] [ValidateNotNull] public BreakpointType[] Type { get { return _type; } set { _type = value; } } private BreakpointType[] _type; #endregion parameters /// <summary> /// Remove breakpoints. /// </summary> protected override void ProcessRecord() { List<Breakpoint> breakpoints = Context.Debugger.GetBreakpoints(); // // Filter by parameter set // if (this.ParameterSetName.Equals("Script", StringComparison.OrdinalIgnoreCase)) { // no filter } else if (this.ParameterSetName.Equals("Id", StringComparison.OrdinalIgnoreCase)) { breakpoints = Filter( breakpoints, _id, delegate (Breakpoint breakpoint, int id) { return breakpoint.Id == id; } ); } else if (this.ParameterSetName.Equals("Command", StringComparison.OrdinalIgnoreCase)) { breakpoints = Filter( breakpoints, _command, delegate (Breakpoint breakpoint, string command) { CommandBreakpoint commandBreakpoint = breakpoint as CommandBreakpoint; if (commandBreakpoint == null) { return false; } return commandBreakpoint.Command.Equals(command, StringComparison.OrdinalIgnoreCase); }); } else if (this.ParameterSetName.Equals("Variable", StringComparison.OrdinalIgnoreCase)) { breakpoints = Filter( breakpoints, _variable, delegate (Breakpoint breakpoint, string variable) { VariableBreakpoint variableBreakpoint = breakpoint as VariableBreakpoint; if (variableBreakpoint == null) { return false; } return variableBreakpoint.Variable.Equals(variable, StringComparison.OrdinalIgnoreCase); }); } else if (this.ParameterSetName.Equals("Type", StringComparison.OrdinalIgnoreCase)) { breakpoints = Filter( breakpoints, _type, delegate (Breakpoint breakpoint, BreakpointType type) { switch (type) { case BreakpointType.Line: if (breakpoint is LineBreakpoint) { return true; } break; case BreakpointType.Command: if (breakpoint is CommandBreakpoint) { return true; } break; case BreakpointType.Variable: if (breakpoint is VariableBreakpoint) { return true; } break; } return false; }); } else { Diagnostics.Assert(false, "Invalid parameter set: {0}", this.ParameterSetName); } // // Filter by script // if (_script != null) { breakpoints = Filter( breakpoints, _script, delegate (Breakpoint breakpoint, string script) { if (breakpoint.Script == null) { return false; } return string.Compare( SessionState.Path.GetUnresolvedProviderPathFromPSPath(breakpoint.Script), SessionState.Path.GetUnresolvedProviderPathFromPSPath(script), StringComparison.OrdinalIgnoreCase ) == 0; }); } // // Output results // foreach (Breakpoint b in breakpoints) { WriteObject(b); } } /// <summary> /// Gives the criteria to filter breakpoints. /// </summary> private delegate bool FilterSelector<T>(Breakpoint breakpoint, T target); /// <summary> /// Returns the items in the input list that match an item in the filter array according to /// the given selection criterion. /// </summary> private List<Breakpoint> Filter<T>(List<Breakpoint> input, T[] filter, FilterSelector<T> selector) { List<Breakpoint> output = new List<Breakpoint>(); for (int i = 0; i < input.Count; i++) { for (int j = 0; j < filter.Length; j++) { if (selector(input[i], filter[j])) { output.Add(input[i]); break; } } } return output; } } }
32.340909
155
0.46923
[ "MIT" ]
Aareon/PowerShellium
src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs
9,961
C#
using UnityEngine; using UnityEngine.UI; using System.Collections; namespace MoreMountains.Tools { /// <summary> /// Add this component to any object and it'll set the target frame rate and vsync count. Note that vsync count must be 0 for the target FPS to work. /// </summary> [AddComponentMenu("More Mountains/Tools/Performance/MMFPSUnlock")] public class MMFPSUnlock : MonoBehaviour { [MMInformation("Add this component to any object and it'll set the target frame rate and vsync count. Note that vsync count must be 0 for the target FPS to work.", MoreMountains.Tools.MMInformationAttribute.InformationType.Info, false)] /// the target FPS you want the game to run at public int TargetFPS; [Range(0,2)] /// whether vsync should be enabled or not (on a 60Hz screen, 1 : 60fps, 2 : 30fps, 0 : don't wait for vsync) public int VSyncCount = 0; /// <summary> /// On start we change our target fps and vsync settings /// </summary> protected virtual void Start() { UpdateSettings(); } /// <summary> /// When a value gets changed in the editor, we update our settings /// </summary> protected virtual void OnValidate() { UpdateSettings(); } /// <summary> /// Updates the target frame rate value and vsync count setting /// </summary> protected virtual void UpdateSettings() { QualitySettings.vSyncCount = VSyncCount; Application.targetFrameRate = TargetFPS; } } }
35.23913
244
0.628007
[ "MIT" ]
random-agile/slowmo_mobile
Assets/Amazing Assets/Feel/MMTools/Tools/MMPerformance/MMFPSUnlock.cs
1,621
C#
//------------------------------------------------------------ // 代码由工具自动生成,请勿手动修改 // 代码由工具自动生成,请勿手动修改 // 代码由工具自动生成,请勿手动修改 //------------------------------------------------------------ using ET; using GraphProcessor; namespace Plugins.NodeEditor { [NodeMenuItem("NPBehave行为树/Task/同步黑板bool值到客户端", typeof (NPBehaveGraph))] [NodeMenuItem("NPBehave行为树/Task/同步黑板bool值到客户端", typeof (SkillGraph))] public class NP_SyncNPBBValue_BoolActionNode: NP_TaskNodeBase { public override string name => "同步黑板bool值到客户端"; public NP_ActionNodeData NP_ActionNodeData = new NP_ActionNodeData() { NpClassForStoreAction = new NP_SyncNPBBValue_BoolAction() }; public override NP_NodeDataBase NP_GetNodeData() { return NP_ActionNodeData; } } }
31.153846
102
0.596296
[ "MIT" ]
futouyiba/ClubET
Unity/Assets/Plugins/NodeEditor/Examples/Editor/NPBehaveGraph/Nodes/Task/NP_SyncNPBBValue_BoolActionNode.cs
972
C#
namespace Des.Blazor.Authorization.Msal { internal class MsalConfig : IMsalConfig { public string ClientId { get; set; } public string Authority { get; set; } public LoginModes LoginMode { get; set; } } }
21.25
50
0.6
[ "MIT" ]
cradle77/Blazor.Msal
src/Des.Blazor.Authorization.Msal/MsalConfig.cs
257
C#
using System.IO; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace ShtikLive.Clients { public interface ISlidesClient { Task<string> Upload(string presenter, string show, int index, string contentType, byte[] source, CancellationToken ct = default); Task<HttpResponseMessage> Get(string presenter, string show, int index, CancellationToken ct = default); } }
33.538462
138
0.724771
[ "MIT" ]
RendleLabs/Shtik
src/ShtikLive/Clients/ISlidesClient.cs
436
C#
using System; using System.Diagnostics; namespace _01_time_complexity { class Program { static void Main(string[] args) { ArrayTimeComplexity.AccessByIndex(new object[] { 1, 3, -2, 1, -3, 0, 2 }); var watch = new Stopwatch(); watch.Start(); var triplets = TripletSum.Count(new int[] { 1, 3, -2, 1, -3, 0, 2 }); watch.Stop(); Console.WriteLine($"The number of zerp-sum triplets :{triplets}"); Console.Write($"The time taken: {watch.Elapsed:g}"); Console.Read(); } } }
24.2
86
0.530579
[ "MIT" ]
amishra138/data-structures
data-structures/01-time-complexity/Program.cs
607
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace TestLogCollecter { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
24.166667
65
0.627586
[ "MIT" ]
HuoYingCunCunZhang/Knifer
TestLogCollecter/Program.cs
580
C#
using System; using System.Collections.Generic; using System.ServiceModel; using Zonkey.ConnectionManagers.Specialized; namespace Zonkey.ConnectionManagers.Wcf { /// <summary> /// A Thread-safe connection manager for worker processes (not web-safe) /// </summary> public class WcfConnectionManager: BaseConnectionManager { [ThreadStatic] private static ConnectionManagerContext _threadContext; private static readonly Dictionary<OperationContext, ConnectionManagerContext> _opLookup = new Dictionary<OperationContext, ConnectionManagerContext>(); protected override ConnectionManagerContext Context { get { var opCtx = OperationContext.Current; if (opCtx == null) return (_threadContext ?? (_threadContext = new ConnectionManagerContext())); ConnectionManagerContext ctx; if (! _opLookup.TryGetValue(opCtx, out ctx)) { ctx = new ConnectionManagerContext(); _opLookup.Add(opCtx, ctx); opCtx.OperationCompleted += opCtx_OperationCompleted; } return ctx; } } private static void opCtx_OperationCompleted(object sender, EventArgs e) { var op = (OperationContext) sender; if (!_opLookup.ContainsKey(op)) return; _opLookup[op].CloseConnections(); _opLookup.Remove(op); } } }
25.6
92
0.735156
[ "MIT" ]
kellybirr/zonkey-archive
v4.2/ConnectionManagers/Wcf/WcfConnectionManager.cs
1,282
C#
using System; namespace SoundpadConnector.Response { /// <summary> /// Represents a <see cref="PlayStatus"/> response /// </summary> public class PlayStatusResponse : ResponseBase<PlayStatus> { /// <inheritdoc /> public override void Parse(string response) { if (Enum.TryParse<PlayStatus>(response, true, out var status)) { Value = status; IsSuccessful = true; } else { IsSuccessful = false; ErrorMessage = response; } } } }
24.44
76
0.505728
[ "MIT" ]
medokin/soundpad-connector
src/SoundpadConnector/Response/PlayStatusResponse.cs
613
C#
// Copyright 2022 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.Cloud.Compute.V1.Snippets { // [START compute_v1_generated_Instances_Get_sync_flattened] using Google.Cloud.Compute.V1; public sealed partial class GeneratedInstancesClientSnippets { /// <summary>Snippet for Get</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void Get() { // Create client InstancesClient instancesClient = InstancesClient.Create(); // Initialize request argument(s) string project = ""; string zone = ""; string instance = ""; // Make the request Instance response = instancesClient.Get(project, zone, instance); } } // [END compute_v1_generated_Instances_Get_sync_flattened] }
36.325581
89
0.670294
[ "Apache-2.0" ]
AlexandrTrf/google-cloud-dotnet
apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.GeneratedSnippets/InstancesClient.GetSnippet.g.cs
1,562
C#
// 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. // Generated code. DO NOT EDIT! namespace Google.Apis.CloudHealthcare.v1 { /// <summary>The CloudHealthcare Service.</summary> public class CloudHealthcareService : 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 CloudHealthcareService() : this(new Google.Apis.Services.BaseClientService.Initializer()) { } /// <summary>Constructs a new service.</summary> /// <param name="initializer">The service initializer.</param> public CloudHealthcareService(Google.Apis.Services.BaseClientService.Initializer initializer) : base(initializer) { Projects = new ProjectsResource(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 => "healthcare"; /// <summary>Gets the service base URI.</summary> public override string BaseUri => #if NETSTANDARD1_3 || NETSTANDARD2_0 || NET45 BaseUriOverride ?? "https://healthcare.googleapis.com/"; #else "https://healthcare.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://healthcare.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 Healthcare API.</summary> public class Scope { /// <summary>View and manage your data across Google Cloud Platform services</summary> public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Available OAuth 2.0 scope constants for use with the Cloud Healthcare API.</summary> public static class ScopeConstants { /// <summary>View and manage your data across Google Cloud Platform services</summary> public const string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform"; } /// <summary>Gets the Projects resource.</summary> public virtual ProjectsResource Projects { get; } } /// <summary>A base abstract class for CloudHealthcare requests.</summary> public abstract class CloudHealthcareBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse> { /// <summary>Constructs a new CloudHealthcareBaseServiceRequest instance.</summary> protected CloudHealthcareBaseServiceRequest(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, /// <summary>v2 error format</summary> [Google.Apis.Util.StringValueAttribute("2")] Value2, } /// <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, /// <summary>Media download with context-dependent Content-Type</summary> [Google.Apis.Util.StringValueAttribute("media")] Media, /// <summary>Responses with Content-Type of application/x-protobuf</summary> [Google.Apis.Util.StringValueAttribute("proto")] Proto, } /// <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 CloudHealthcare 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 "projects" collection of methods.</summary> public class ProjectsResource { private const string Resource = "projects"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public ProjectsResource(Google.Apis.Services.IClientService service) { this.service = service; Locations = new LocationsResource(service); } /// <summary>Gets the Locations resource.</summary> public virtual LocationsResource Locations { get; } /// <summary>The "locations" collection of methods.</summary> public class LocationsResource { private const string Resource = "locations"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public LocationsResource(Google.Apis.Services.IClientService service) { this.service = service; Datasets = new DatasetsResource(service); } /// <summary>Gets the Datasets resource.</summary> public virtual DatasetsResource Datasets { get; } /// <summary>The "datasets" collection of methods.</summary> public class DatasetsResource { private const string Resource = "datasets"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public DatasetsResource(Google.Apis.Services.IClientService service) { this.service = service; DicomStores = new DicomStoresResource(service); FhirStores = new FhirStoresResource(service); Hl7V2Stores = new Hl7V2StoresResource(service); Operations = new OperationsResource(service); } /// <summary>Gets the DicomStores resource.</summary> public virtual DicomStoresResource DicomStores { get; } /// <summary>The "dicomStores" collection of methods.</summary> public class DicomStoresResource { private const string Resource = "dicomStores"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public DicomStoresResource(Google.Apis.Services.IClientService service) { this.service = service; Studies = new StudiesResource(service); } /// <summary>Gets the Studies resource.</summary> public virtual StudiesResource Studies { get; } /// <summary>The "studies" collection of methods.</summary> public class StudiesResource { private const string Resource = "studies"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public StudiesResource(Google.Apis.Services.IClientService service) { this.service = service; Series = new SeriesResource(service); } /// <summary>Gets the Series resource.</summary> public virtual SeriesResource Series { get; } /// <summary>The "series" collection of methods.</summary> public class SeriesResource { private const string Resource = "series"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public SeriesResource(Google.Apis.Services.IClientService service) { this.service = service; Instances = new InstancesResource(service); } /// <summary>Gets the Instances resource.</summary> public virtual InstancesResource Instances { get; } /// <summary>The "instances" collection of methods.</summary> public class InstancesResource { private const string Resource = "instances"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public InstancesResource(Google.Apis.Services.IClientService service) { this.service = service; Frames = new FramesResource(service); } /// <summary>Gets the Frames resource.</summary> public virtual FramesResource Frames { get; } /// <summary>The "frames" collection of methods.</summary> public class FramesResource { private const string Resource = "frames"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public FramesResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>RetrieveFrames returns instances associated with the given study, /// series, SOP Instance UID and frame numbers. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4}. /// For details on the implementation of RetrieveFrames, see [DICOM /// frames](https://cloud.google.com/healthcare/docs/dicom#dicom_frames) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveFrames, see [Retrieving DICOM /// data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveFrames DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}`.</param> public virtual RetrieveFramesRequest RetrieveFrames(string parent, string dicomWebPath) { return new RetrieveFramesRequest(service, parent, dicomWebPath); } /// <summary>RetrieveFrames returns instances associated with the given study, /// series, SOP Instance UID and frame numbers. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4}. /// For details on the implementation of RetrieveFrames, see [DICOM /// frames](https://cloud.google.com/healthcare/docs/dicom#dicom_frames) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveFrames, see [Retrieving DICOM /// data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> public class RetrieveFramesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveFrames request.</summary> public RetrieveFramesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `p /// rojects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStor /// es/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveFrames DICOMweb request. For example, `stud /// ies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_l /// ist}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveFrames"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveFrames 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+/frames/[^/]+$", }); } } /// <summary>RetrieveRenderedFrames returns instances associated with the given /// study, series, SOP Instance UID and frame numbers in an acceptable Rendered /// Media Type. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). /// For details on the implementation of RetrieveRenderedFrames, see [Rendered /// resources](https://cloud.google.com/healthcare/docs/dicom#rendered_resources) in /// the Cloud Healthcare API conformance statement. For samples that show how to /// call RetrieveRenderedFrames, see [Retrieving consumer image /// formats](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_consumer_image_formats).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveRenderedFrames DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/frames/{frame_list}/rendered`.</param> public virtual RetrieveRenderedRequest RetrieveRendered(string parent, string dicomWebPath) { return new RetrieveRenderedRequest(service, parent, dicomWebPath); } /// <summary>RetrieveRenderedFrames returns instances associated with the given /// study, series, SOP Instance UID and frame numbers in an acceptable Rendered /// Media Type. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). /// For details on the implementation of RetrieveRenderedFrames, see [Rendered /// resources](https://cloud.google.com/healthcare/docs/dicom#rendered_resources) in /// the Cloud Healthcare API conformance statement. For samples that show how to /// call RetrieveRenderedFrames, see [Retrieving consumer image /// formats](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_consumer_image_formats).</summary> public class RetrieveRenderedRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveRendered request.</summary> public RetrieveRenderedRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `p /// rojects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStor /// es/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveRenderedFrames DICOMweb request. For /// example, `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/f /// rames/{frame_list}/rendered`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveRendered"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveRendered 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+/frames/[^/]+/rendered$", }); } } } /// <summary>DeleteInstance deletes an instance associated with the given study, series, /// and SOP Instance UID. Delete requests are equivalent to the GET requests specified /// in the Retrieve transaction. Study and series search results can take a few seconds /// to be updated after an instance is deleted using DeleteInstance. For samples that /// show how to call DeleteInstance, see [Deleting a study, series, or /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the DeleteInstance request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`.</param> public virtual DeleteRequest Delete(string parent, string dicomWebPath) { return new DeleteRequest(service, parent, dicomWebPath); } /// <summary>DeleteInstance deletes an instance associated with the given study, series, /// and SOP Instance UID. Delete requests are equivalent to the GET requests specified /// in the Retrieve transaction. Study and series search results can take a few seconds /// to be updated after an instance is deleted using DeleteInstance. For samples that /// show how to call DeleteInstance, see [Deleting a study, series, or /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Empty> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `proje /// cts/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dico /// m_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the DeleteInstance request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { 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/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes Delete 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+$", }); } } /// <summary>RetrieveInstance returns instance associated with the given study, series, /// and SOP Instance UID. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveInstance, see [DICOM study/series/instances /// ](https://cloud.google.com/healthcare/docs/dicom#dicom_studyseriesinstances) and /// [DICOM instances](https://cloud.google.com/healthcare/docs/dicom#dicom_instances) in /// the Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveInstance, see [Retrieving an /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_an_instance).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveInstance DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`.</param> public virtual RetrieveInstanceRequest RetrieveInstance(string parent, string dicomWebPath) { return new RetrieveInstanceRequest(service, parent, dicomWebPath); } /// <summary>RetrieveInstance returns instance associated with the given study, series, /// and SOP Instance UID. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveInstance, see [DICOM study/series/instances /// ](https://cloud.google.com/healthcare/docs/dicom#dicom_studyseriesinstances) and /// [DICOM instances](https://cloud.google.com/healthcare/docs/dicom#dicom_instances) in /// the Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveInstance, see [Retrieving an /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_an_instance).</summary> public class RetrieveInstanceRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveInstance request.</summary> public RetrieveInstanceRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `proje /// cts/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dico /// m_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveInstance DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveInstance"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveInstance 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+$", }); } } /// <summary>RetrieveInstanceMetadata returns instance associated with the given study, /// series, and SOP Instance UID presented as metadata with the bulk data removed. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveInstanceMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveInstanceMetadata, see [Retrieving /// metadata](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_metadata).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveInstanceMetadata DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`.</param> public virtual RetrieveMetadataRequest RetrieveMetadata(string parent, string dicomWebPath) { return new RetrieveMetadataRequest(service, parent, dicomWebPath); } /// <summary>RetrieveInstanceMetadata returns instance associated with the given study, /// series, and SOP Instance UID presented as metadata with the bulk data removed. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveInstanceMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveInstanceMetadata, see [Retrieving /// metadata](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_metadata).</summary> public class RetrieveMetadataRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveMetadata request.</summary> public RetrieveMetadataRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `proje /// cts/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dico /// m_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveInstanceMetadata DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/metadata`.</su /// mmary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveMetadata"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveMetadata 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+/metadata$", }); } } /// <summary>RetrieveRenderedInstance returns instance associated with the given study, /// series, and SOP Instance UID in an acceptable Rendered Media Type. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveRenderedInstance, see [Rendered /// resources](https://cloud.google.com/healthcare/docs/dicom#rendered_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveRenderedInstance, see [Retrieving consumer image /// formats](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_consumer_image_formats).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveRenderedInstance DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`.</param> public virtual RetrieveRenderedRequest RetrieveRendered(string parent, string dicomWebPath) { return new RetrieveRenderedRequest(service, parent, dicomWebPath); } /// <summary>RetrieveRenderedInstance returns instance associated with the given study, /// series, and SOP Instance UID in an acceptable Rendered Media Type. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveRenderedInstance, see [Rendered /// resources](https://cloud.google.com/healthcare/docs/dicom#rendered_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveRenderedInstance, see [Retrieving consumer image /// formats](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_consumer_image_formats).</summary> public class RetrieveRenderedRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveRendered request.</summary> public RetrieveRenderedRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `proje /// cts/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dico /// m_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveRenderedInstance DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/instances/{instance_uid}/rendered`.</su /// mmary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveRendered"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveRendered 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances/[^/]+/rendered$", }); } } } /// <summary>DeleteSeries deletes all instances within the given study and series. Delete /// requests are equivalent to the GET requests specified in the Retrieve transaction. The /// method returns an Operation which will be marked successful when the deletion is /// complete. Warning: Inserting instances into a series while a delete operation is running /// for that series could result in the new instances not appearing in search results until /// the deletion operation finishes. For samples that show how to call DeleteSeries, see /// [Deleting a study, series, or instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the DeleteSeries request. For example, /// `studies/{study_uid}/series/{series_uid}`.</param> public virtual DeleteRequest Delete(string parent, string dicomWebPath) { return new DeleteRequest(service, parent, dicomWebPath); } /// <summary>DeleteSeries deletes all instances within the given study and series. Delete /// requests are equivalent to the GET requests specified in the Retrieve transaction. The /// method returns an Operation which will be marked successful when the deletion is /// complete. Warning: Inserting instances into a series while a delete operation is running /// for that series could result in the new instances not appearing in search results until /// the deletion operation finishes. For samples that show how to call DeleteSeries, see /// [Deleting a study, series, or instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/ /// {project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_ /// id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the DeleteSeries request. For example, /// `studies/{study_uid}/series/{series_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { 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/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes Delete 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+$", }); } } /// <summary>RetrieveSeriesMetadata returns instance associated with the given study and /// series, presented as metadata with the bulk data removed. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveSeriesMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveSeriesMetadata, see [Retrieving /// metadata](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_metadata).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveSeriesMetadata DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/metadata`.</param> public virtual RetrieveMetadataRequest RetrieveMetadata(string parent, string dicomWebPath) { return new RetrieveMetadataRequest(service, parent, dicomWebPath); } /// <summary>RetrieveSeriesMetadata returns instance associated with the given study and /// series, presented as metadata with the bulk data removed. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveSeriesMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// RetrieveSeriesMetadata, see [Retrieving /// metadata](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_metadata).</summary> public class RetrieveMetadataRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveMetadata request.</summary> public RetrieveMetadataRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/ /// {project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_ /// id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveSeriesMetadata DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}/metadata`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveMetadata"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveMetadata 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/metadata$", }); } } /// <summary>RetrieveSeries returns all instances within the given study and series. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveSeries, see [DICOM study/series/instances](http /// s://cloud.google.com/healthcare/docs/dicom#dicom_studyseriesinstances) in the Cloud /// Healthcare API conformance statement. For samples that show how to call RetrieveSeries, /// see [Retrieving DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveSeries DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}`.</param> public virtual RetrieveSeriesRequest RetrieveSeries(string parent, string dicomWebPath) { return new RetrieveSeriesRequest(service, parent, dicomWebPath); } /// <summary>RetrieveSeries returns all instances within the given study and series. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For /// details on the implementation of RetrieveSeries, see [DICOM study/series/instances](http /// s://cloud.google.com/healthcare/docs/dicom#dicom_studyseriesinstances) in the Cloud /// Healthcare API conformance statement. For samples that show how to call RetrieveSeries, /// see [Retrieving DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> public class RetrieveSeriesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveSeries request.</summary> public RetrieveSeriesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/ /// {project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_ /// id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveSeries DICOMweb request. For example, /// `studies/{study_uid}/series/{series_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveSeries"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveSeries 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+$", }); } } /// <summary>SearchForInstances returns a list of matching instances. See [Search /// Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For /// details on the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// SearchForInstances, see [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForInstancesRequest DICOMweb request. For example, `instances`, /// `series/{series_uid}/instances`, or `studies/{study_uid}/instances`.</param> public virtual SearchForInstancesRequest SearchForInstances(string parent, string dicomWebPath) { return new SearchForInstancesRequest(service, parent, dicomWebPath); } /// <summary>SearchForInstances returns a list of matching instances. See [Search /// Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For /// details on the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the /// Cloud Healthcare API conformance statement. For samples that show how to call /// SearchForInstances, see [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForInstancesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForInstances request.</summary> public SearchForInstancesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/ /// {project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_ /// id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForInstancesRequest DICOMweb request. For example, /// `instances`, `series/{series_uid}/instances`, or /// `studies/{study_uid}/instances`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForInstances"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForInstances 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series/[^/]+/instances$", }); } } } /// <summary>DeleteStudy deletes all instances within the given study. Delete requests are /// equivalent to the GET requests specified in the Retrieve transaction. The method returns an /// Operation which will be marked successful when the deletion is complete. Warning: Inserting /// instances into a study while a delete operation is running for that study could result in /// the new instances not appearing in search results until the deletion operation finishes. For /// samples that show how to call DeleteStudy, see [Deleting a study, series, or /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> /// <param name="parent"></param> /// <param name="dicomWebPath">The path of the DeleteStudy request. For example, /// `studies/{study_uid}`.</param> public virtual DeleteRequest Delete(string parent, string dicomWebPath) { return new DeleteRequest(service, parent, dicomWebPath); } /// <summary>DeleteStudy deletes all instances within the given study. Delete requests are /// equivalent to the GET requests specified in the Retrieve transaction. The method returns an /// Operation which will be marked successful when the deletion is complete. Warning: Inserting /// instances into a study while a delete operation is running for that study could result in /// the new instances not appearing in search results until the deletion operation finishes. For /// samples that show how to call DeleteStudy, see [Deleting a study, series, or /// instance](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#deleting_a_study_series_or_instance).</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the DeleteStudy request. For example, /// `studies/{study_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { 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/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes Delete 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+$", }); } } /// <summary>RetrieveStudyMetadata returns instance associated with the given study presented as /// metadata with the bulk data removed. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For details /// on the implementation of RetrieveStudyMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the Cloud /// Healthcare API conformance statement. For samples that show how to call /// RetrieveStudyMetadata, see [Retrieving metadata](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#retrieving_metadata).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveStudyMetadata DICOMweb request. For example, /// `studies/{study_uid}/metadata`.</param> public virtual RetrieveMetadataRequest RetrieveMetadata(string parent, string dicomWebPath) { return new RetrieveMetadataRequest(service, parent, dicomWebPath); } /// <summary>RetrieveStudyMetadata returns instance associated with the given study presented as /// metadata with the bulk data removed. See [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For details /// on the implementation of RetrieveStudyMetadata, see [Metadata /// resources](https://cloud.google.com/healthcare/docs/dicom#metadata_resources) in the Cloud /// Healthcare API conformance statement. For samples that show how to call /// RetrieveStudyMetadata, see [Retrieving metadata](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#retrieving_metadata).</summary> public class RetrieveMetadataRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveMetadata request.</summary> public RetrieveMetadataRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</s /// ummary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveStudyMetadata DICOMweb request. For example, /// `studies/{study_uid}/metadata`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveMetadata"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveMetadata 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/metadata$", }); } } /// <summary>RetrieveStudy returns all instances within the given study. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For details /// on the implementation of RetrieveStudy, see [DICOM study/series/instances](https://cloud.goo /// gle.com/healthcare/docs/dicom#dicom_studyseriesinstances) in the Cloud Healthcare API /// conformance statement. For samples that show how to call RetrieveStudy, see [Retrieving /// DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the RetrieveStudy DICOMweb request. For example, /// `studies/{study_uid}`.</param> public virtual RetrieveStudyRequest RetrieveStudy(string parent, string dicomWebPath) { return new RetrieveStudyRequest(service, parent, dicomWebPath); } /// <summary>RetrieveStudy returns all instances within the given study. See /// [RetrieveTransaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.4). For details /// on the implementation of RetrieveStudy, see [DICOM study/series/instances](https://cloud.goo /// gle.com/healthcare/docs/dicom#dicom_studyseriesinstances) in the Cloud Healthcare API /// conformance statement. For samples that show how to call RetrieveStudy, see [Retrieving /// DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#retrieving_dicom_data).</summary> public class RetrieveStudyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new RetrieveStudy request.</summary> public RetrieveStudyRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</s /// ummary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the RetrieveStudy DICOMweb request. For example, /// `studies/{study_uid}`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "retrieveStudy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes RetrieveStudy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+$", }); } } /// <summary>SearchForInstances returns a list of matching instances. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details /// on the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForInstances, /// see [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForInstancesRequest DICOMweb request. For example, `instances`, /// `series/{series_uid}/instances`, or `studies/{study_uid}/instances`.</param> public virtual SearchForInstancesRequest SearchForInstances(string parent, string dicomWebPath) { return new SearchForInstancesRequest(service, parent, dicomWebPath); } /// <summary>SearchForInstances returns a list of matching instances. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details /// on the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForInstances, /// see [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForInstancesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForInstances request.</summary> public SearchForInstancesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</s /// ummary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForInstancesRequest DICOMweb request. For example, /// `instances`, `series/{series_uid}/instances`, or /// `studies/{study_uid}/instances`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForInstances"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForInstances 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/instances$", }); } } /// <summary>SearchForSeries returns a list of matching series. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details /// on the implementation of SearchForSeries, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForSeries, see /// [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForSeries DICOMweb request. For example, `series` or /// `studies/{study_uid}/series`.</param> public virtual SearchForSeriesRequest SearchForSeries(string parent, string dicomWebPath) { return new SearchForSeriesRequest(service, parent, dicomWebPath); } /// <summary>SearchForSeries returns a list of matching series. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details /// on the implementation of SearchForSeries, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForSeries, see /// [Searching for studies, series, instances, and /// frames](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForSeriesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForSeries request.</summary> public SearchForSeriesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</s /// ummary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForSeries DICOMweb request. For example, `series` or /// `studies/{study_uid}/series`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForSeries"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForSeries 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+/series$", }); } } /// <summary>StoreInstances stores DICOM instances associated with study instance unique /// identifiers (SUID). See [Store Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5). For details /// on the implementation of StoreInstances, see [Store /// transaction](https://cloud.google.com/healthcare/docs/dicom#store_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call StoreInstances, see /// [Storing DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#storing_dicom_data).</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the StoreInstances DICOMweb request. For example, `studies/[{study_uid}]`. /// Note that the `study_uid` is optional.</param> public virtual StoreInstancesRequest StoreInstances(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string dicomWebPath) { return new StoreInstancesRequest(service, body, parent, dicomWebPath); } /// <summary>StoreInstances stores DICOM instances associated with study instance unique /// identifiers (SUID). See [Store Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5). For details /// on the implementation of StoreInstances, see [Store /// transaction](https://cloud.google.com/healthcare/docs/dicom#store_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call StoreInstances, see /// [Storing DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#storing_dicom_data).</summary> public class StoreInstancesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new StoreInstances request.</summary> public StoreInstancesRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; Body = body; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</s /// ummary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the StoreInstances DICOMweb request. For example, /// `studies/[{study_uid}]`. Note that the `study_uid` is optional.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.HttpBody 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 => "storeInstances"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes StoreInstances 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies/[^/]+$", }); } } } /// <summary>Creates a new DICOM store within the parent dataset.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the dataset this DICOM store belongs to.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.DicomStore body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new DICOM store within the parent dataset.</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.DicomStore> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.DicomStore body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the dataset this DICOM store belongs to.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The ID of the DICOM store that is being created. Any string value up to 256 /// characters in length.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomStoreId", Google.Apis.Util.RequestParameterType.Query)] public virtual string DicomStoreId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.DicomStore 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}/dicomStores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); RequestParameters.Add("dicomStoreId", new Google.Apis.Discovery.Parameter { Name = "dicomStoreId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>De-identifies data from the source store and writes it to the destination store. The /// metadata field type is OperationMetadata. If the request is successful, the response field type /// is DeidentifyDicomStoreSummary. If errors occur, error is set. The LRO result may still be /// successful if de-identification fails for some DICOM instances. The output DICOM store will not /// contain these failed resources. Failed resource totals are tracked in Operation.metadata. Error /// details are also logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how- /// tos/logging)).</summary> /// <param name="body">The body of the request.</param> /// <param name="sourceStore">Source DICOM store resource name. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> public virtual DeidentifyRequest Deidentify(Google.Apis.CloudHealthcare.v1.Data.DeidentifyDicomStoreRequest body, string sourceStore) { return new DeidentifyRequest(service, body, sourceStore); } /// <summary>De-identifies data from the source store and writes it to the destination store. The /// metadata field type is OperationMetadata. If the request is successful, the response field type /// is DeidentifyDicomStoreSummary. If errors occur, error is set. The LRO result may still be /// successful if de-identification fails for some DICOM instances. The output DICOM store will not /// contain these failed resources. Failed resource totals are tracked in Operation.metadata. Error /// details are also logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how- /// tos/logging)).</summary> public class DeidentifyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Deidentify request.</summary> public DeidentifyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.DeidentifyDicomStoreRequest body, string sourceStore) : base(service) { SourceStore = sourceStore; Body = body; InitParameters(); } /// <summary>Source DICOM store resource name. For example, `projects/{project_id}/locations/{lo /// cation_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("sourceStore", Google.Apis.Util.RequestParameterType.Path)] public virtual string SourceStore { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.DeidentifyDicomStoreRequest 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 => "deidentify"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+sourceStore}:deidentify"; /// <summary>Initializes Deidentify parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("sourceStore", new Google.Apis.Discovery.Parameter { Name = "sourceStore", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>Deletes the specified DICOM store and removes all images that are contained within /// it.</summary> /// <param name="name">The resource name of the DICOM store to delete.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes the specified DICOM store and removes all images that are contained within /// it.</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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>The resource name of the DICOM store to delete.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>Exports data to the specified destination by copying it from the DICOM store. Errors /// are also logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging). The metadata field type is OperationMetadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The DICOM store resource name from which to export the data. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> public virtual ExportRequest Export(Google.Apis.CloudHealthcare.v1.Data.ExportDicomDataRequest body, string name) { return new ExportRequest(service, body, name); } /// <summary>Exports data to the specified destination by copying it from the DICOM store. Errors /// are also logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging). The metadata field type is OperationMetadata.</summary> public class ExportRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Export request.</summary> public ExportRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.ExportDicomDataRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The DICOM store resource name from which to export the data. For example, `projects /// /{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</ /// 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.CloudHealthcare.v1.Data.ExportDicomDataRequest 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 => "export"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}:export"; /// <summary>Initializes Export 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>Gets the specified DICOM store.</summary> /// <param name="name">The resource name of the DICOM store to get.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets the specified DICOM store.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.DicomStore> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource name of the DICOM store to get.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual GetIamPolicyRequest GetIamPolicy(string resource) { return new GetIamPolicyRequest(service, resource); } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> public class GetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new GetIamPolicy request.</summary> public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Optional. The policy format version to be returned. Valid values are 0, 1, and 3. /// Requests specifying an invalid value will be rejected. Requests for policies with any /// conditional bindings must specify version 3. Policies without any conditional bindings may /// specify any valid value 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> [Google.Apis.Util.RequestParameterAttribute("options.requestedPolicyVersion", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> OptionsRequestedPolicyVersion { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:getIamPolicy"; /// <summary>Initializes GetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("options.requestedPolicyVersion", new Google.Apis.Discovery.Parameter { Name = "options.requestedPolicyVersion", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Imports data into the DICOM store by copying it from the specified source. Errors are /// logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging). The metadata field type is OperationMetadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the DICOM store resource into which the data is imported. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> public virtual ImportRequest Import(Google.Apis.CloudHealthcare.v1.Data.ImportDicomDataRequest body, string name) { return new ImportRequest(service, body, name); } /// <summary>Imports data into the DICOM store by copying it from the specified source. Errors are /// logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging). The metadata field type is OperationMetadata.</summary> public class ImportRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Import request.</summary> public ImportRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.ImportDicomDataRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the DICOM store resource into which the data is imported. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_stor /// e_id}`.</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.CloudHealthcare.v1.Data.ImportDicomDataRequest 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 => "import"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}:import"; /// <summary>Initializes Import 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>Lists the DICOM stores in the given dataset.</summary> /// <param name="parent">Name of the dataset.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists the DICOM stores in the given dataset.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListDicomStoresResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Name of the dataset.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Restricts stores returned to those matching a filter. Syntax: /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings Only filtering /// on labels is supported. For example, `labels.key=value`.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Limit on the number of DICOM stores to return in a single response. If zero the /// default page size of 100 is used.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The next_page_token value returned from the previous List request, if /// any.</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}/dicomStores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); 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 the specified DICOM store.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Resource name of the DICOM store, of the form /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.DicomStore body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates the specified DICOM store.</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.DicomStore> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.DicomStore body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Resource name of the DICOM store, of the form `projects/{project_id}/locations/{loc /// ation_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The update mask applies to the resource. For the `FieldMask` definition, see /// https://developers.google.com/protocol- /// buffers/docs/reference/google.protobuf#fieldmask</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.CloudHealthcare.v1.Data.DicomStore 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>SearchForInstances returns a list of matching instances. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForInstances, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForInstancesRequest DICOMweb request. For example, `instances`, /// `series/{series_uid}/instances`, or `studies/{study_uid}/instances`.</param> public virtual SearchForInstancesRequest SearchForInstances(string parent, string dicomWebPath) { return new SearchForInstancesRequest(service, parent, dicomWebPath); } /// <summary>SearchForInstances returns a list of matching instances. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForInstances, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForInstances, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForInstancesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForInstances request.</summary> public SearchForInstancesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{project /// _id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForInstancesRequest DICOMweb request. For example, /// `instances`, `series/{series_uid}/instances`, or `studies/{study_uid}/instances`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForInstances"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForInstances 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^instances$", }); } } /// <summary>SearchForSeries returns a list of matching series. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForSeries, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForSeries, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForSeries DICOMweb request. For example, `series` or /// `studies/{study_uid}/series`.</param> public virtual SearchForSeriesRequest SearchForSeries(string parent, string dicomWebPath) { return new SearchForSeriesRequest(service, parent, dicomWebPath); } /// <summary>SearchForSeries returns a list of matching series. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForSeries, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForSeries, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForSeriesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForSeries request.</summary> public SearchForSeriesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{project /// _id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForSeries DICOMweb request. For example, `series` or /// `studies/{study_uid}/series`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForSeries"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForSeries 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^series$", }); } } /// <summary>SearchForStudies returns a list of matching studies. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForStudies, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForStudies, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the SearchForStudies DICOMweb request. For example, `studies`.</param> public virtual SearchForStudiesRequest SearchForStudies(string parent, string dicomWebPath) { return new SearchForStudiesRequest(service, parent, dicomWebPath); } /// <summary>SearchForStudies returns a list of matching studies. See [Search Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.6). For details on /// the implementation of SearchForStudies, see [Search /// transaction](https://cloud.google.com/healthcare/docs/dicom#search_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call SearchForStudies, see /// [Searching for studies, series, instances, and frames](https://cloud.google.com/healthcare/docs /// /how-tos/dicomweb#searching_for_studies_series_instances_and_frames).</summary> public class SearchForStudiesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new SearchForStudies request.</summary> public SearchForStudiesRequest(Google.Apis.Services.IClientService service, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{project /// _id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the SearchForStudies DICOMweb request. For example, /// `studies`.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets the method name.</summary> public override string MethodName => "searchForStudies"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes SearchForStudies 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies$", }); } } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</param> public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) { return new SetIamPolicyRequest(service, body, resource); } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> public class SetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new SetIamPolicy request.</summary> public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest 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 => "setIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:setIamPolicy"; /// <summary>Initializes SetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } /// <summary>StoreInstances stores DICOM instances associated with study instance unique identifiers /// (SUID). See [Store Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5). For details on /// the implementation of StoreInstances, see [Store /// transaction](https://cloud.google.com/healthcare/docs/dicom#store_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call StoreInstances, see /// [Storing DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#storing_dicom_data).</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the DICOM store that is being accessed. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</param> /// /// <param name="dicomWebPath">The path of the StoreInstances DICOMweb request. For example, `studies/[{study_uid}]`. /// Note that the `study_uid` is optional.</param> public virtual StoreInstancesRequest StoreInstances(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string dicomWebPath) { return new StoreInstancesRequest(service, body, parent, dicomWebPath); } /// <summary>StoreInstances stores DICOM instances associated with study instance unique identifiers /// (SUID). See [Store Transaction] /// (http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_10.5). For details on /// the implementation of StoreInstances, see [Store /// transaction](https://cloud.google.com/healthcare/docs/dicom#store_transaction) in the Cloud /// Healthcare API conformance statement. For samples that show how to call StoreInstances, see /// [Storing DICOM data](https://cloud.google.com/healthcare/docs/how- /// tos/dicomweb#storing_dicom_data).</summary> public class StoreInstancesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new StoreInstances request.</summary> public StoreInstancesRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string dicomWebPath) : base(service) { Parent = parent; DicomWebPath = dicomWebPath; Body = body; InitParameters(); } /// <summary>The name of the DICOM store that is being accessed. For example, `projects/{project /// _id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The path of the StoreInstances DICOMweb request. For example, /// `studies/[{study_uid}]`. Note that the `study_uid` is optional.</summary> [Google.Apis.Util.RequestParameterAttribute("dicomWebPath", Google.Apis.Util.RequestParameterType.Path)] public virtual string DicomWebPath { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.HttpBody 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 => "storeInstances"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/dicomWeb/{+dicomWebPath}"; /// <summary>Initializes StoreInstances 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); RequestParameters.Add("dicomWebPath", new Google.Apis.Discovery.Parameter { Name = "dicomWebPath", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^studies$", }); } } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) { return new TestIamPermissionsRequest(service, body, resource); } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> public class TestIamPermissionsRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsResponse> { /// <summary>Constructs a new TestIamPermissions request.</summary> public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the /// operation documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest 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 => "testIamPermissions"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:testIamPermissions"; /// <summary>Initializes TestIamPermissions 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/dicomStores/[^/]+$", }); } } } /// <summary>Gets the FhirStores resource.</summary> public virtual FhirStoresResource FhirStores { get; } /// <summary>The "fhirStores" collection of methods.</summary> public class FhirStoresResource { private const string Resource = "fhirStores"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public FhirStoresResource(Google.Apis.Services.IClientService service) { this.service = service; Fhir = new FhirResource(service); } /// <summary>Gets the Fhir resource.</summary> public virtual FhirResource Fhir { get; } /// <summary>The "fhir" collection of methods.</summary> public class FhirResource { private const string Resource = "fhir"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public FhirResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Retrieves a Patient resource and resources related to that patient. Implements the /// FHIR extended operation Patient-everything /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/patient-operations.html#everything), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything), /// [R4](http://hl7.org/implement/standards/fhir/R4/patient-operations.html#everything)). On /// success, the response body will contain a JSON-encoded representation of a `Bundle` resource /// of type `searchset`, containing the results of the operation. Errors generated by the FHIR /// store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the /// error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP /// error might be returned instead. The resources in scope for the response are: * The patient /// resource itself. * All the resources directly referenced by the patient resource. * /// Resources directly referencing the patient resource that meet the inclusion criteria. The /// inclusion criteria are based on the membership rules in the patient compartment definition /// ([DSTU2](http://hl7.org/fhir/DSTU2/compartment-patient.html), /// [STU3](http://www.hl7.org/fhir/stu3/compartmentdefinition-patient.html), /// [R4](http://hl7.org/fhir/R4/compartmentdefinition-patient.html)), which details the eligible /// resource types and referencing search parameters. For samples that show how to call /// `Patient-everything`, see [Getting all patient compartment resources](/healthcare/docs/how- /// tos/fhir-resources#getting_all_patient_compartment_resources).</summary> /// <param name="name">Name of the `Patient` resource for which the information is required.</param> public virtual PatientEverythingRequest PatientEverything(string name) { return new PatientEverythingRequest(service, name); } /// <summary>Retrieves a Patient resource and resources related to that patient. Implements the /// FHIR extended operation Patient-everything /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/patient-operations.html#everything), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/patient-operations.html#everything), /// [R4](http://hl7.org/implement/standards/fhir/R4/patient-operations.html#everything)). On /// success, the response body will contain a JSON-encoded representation of a `Bundle` resource /// of type `searchset`, containing the results of the operation. Errors generated by the FHIR /// store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the /// error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP /// error might be returned instead. The resources in scope for the response are: * The patient /// resource itself. * All the resources directly referenced by the patient resource. * /// Resources directly referencing the patient resource that meet the inclusion criteria. The /// inclusion criteria are based on the membership rules in the patient compartment definition /// ([DSTU2](http://hl7.org/fhir/DSTU2/compartment-patient.html), /// [STU3](http://www.hl7.org/fhir/stu3/compartmentdefinition-patient.html), /// [R4](http://hl7.org/fhir/R4/compartmentdefinition-patient.html)), which details the eligible /// resource types and referencing search parameters. For samples that show how to call /// `Patient-everything`, see [Getting all patient compartment resources](/healthcare/docs/how- /// tos/fhir-resources#getting_all_patient_compartment_resources).</summary> public class PatientEverythingRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new PatientEverything request.</summary> public PatientEverythingRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Name of the `Patient` resource for which the information is required.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Maximum number of resources in a page. Defaults to 100.</summary> [Google.Apis.Util.RequestParameterAttribute("_count", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> Count { get; set; } /// <summary>Used to retrieve the next or previous page of results when using pagination. /// Set `_page_token` to the value of _page_token set in next or previous page links' url. /// Next and previous page are returned in the response bundle's links field, where /// `link.relation` is "previous" or "next". Omit `_page_token` if no previous request has /// been made.</summary> [Google.Apis.Util.RequestParameterAttribute("_page_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>If provided, only resources updated after this time are returned. The time uses /// the format YYYY-MM-DDThh:mm:ss.sss+zz:zz. For example, `2015-02-07T13:28:17.239+02:00` /// or `2017-01-01T00:00:00Z`. The time must be specified to the second and include a time /// zone.</summary> [Google.Apis.Util.RequestParameterAttribute("_since", Google.Apis.Util.RequestParameterType.Query)] public virtual string Since { get; set; } /// <summary>String of comma-delimited FHIR resource types. If provided, only resources of /// the specified resource type(s) are returned.</summary> [Google.Apis.Util.RequestParameterAttribute("_type", Google.Apis.Util.RequestParameterType.Query)] public virtual string Type { get; set; } /// <summary>The response includes records prior to the end date. If no end date is /// provided, all records subsequent to the start date are in scope.</summary> [Google.Apis.Util.RequestParameterAttribute("end", Google.Apis.Util.RequestParameterType.Query)] public virtual string End { get; set; } /// <summary>The response includes records subsequent to the start date. If no start date is /// provided, all records prior to the end date are in scope.</summary> [Google.Apis.Util.RequestParameterAttribute("start", Google.Apis.Util.RequestParameterType.Query)] public virtual string Start { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "Patient-everything"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}/$everything"; /// <summary>Initializes PatientEverything 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/Patient/[^/]+$", }); RequestParameters.Add("_count", new Google.Apis.Discovery.Parameter { Name = "_count", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_page_token", new Google.Apis.Discovery.Parameter { Name = "_page_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_since", new Google.Apis.Discovery.Parameter { Name = "_since", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_type", new Google.Apis.Discovery.Parameter { Name = "_type", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("end", new Google.Apis.Discovery.Parameter { Name = "end", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("start", new Google.Apis.Discovery.Parameter { Name = "start", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes all the historical versions of a resource (excluding the current version) /// from the FHIR store. To remove all versions of a resource, first delete the current version /// and then call this method. This is not a FHIR standard operation. For samples that show how /// to call `Resource-purge`, see [Deleting historical versions of a FHIR /// resource](/healthcare/docs/how-tos/fhir- /// resources#deleting_historical_versions_of_a_fhir_resource).</summary> /// <param name="name">The name of the resource to purge.</param> public virtual ResourcePurgeRequest ResourcePurge(string name) { return new ResourcePurgeRequest(service, name); } /// <summary>Deletes all the historical versions of a resource (excluding the current version) /// from the FHIR store. To remove all versions of a resource, first delete the current version /// and then call this method. This is not a FHIR standard operation. For samples that show how /// to call `Resource-purge`, see [Deleting historical versions of a FHIR /// resource](/healthcare/docs/how-tos/fhir- /// resources#deleting_historical_versions_of_a_fhir_resource).</summary> public class ResourcePurgeRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Empty> { /// <summary>Constructs a new ResourcePurge request.</summary> public ResourcePurgeRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the resource to purge.</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 => "Resource-purge"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "DELETE"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}/$purge"; /// <summary>Initializes ResourcePurge 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); } } /// <summary>Gets the FHIR capability statement /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), or the /// [conformance statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) in /// the DSTU2 case for the store, which contains a description of functionality supported by the /// server. Implements the FHIR standard capabilities interaction /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), or the /// [conformance /// interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) in the /// DSTU2 case. On success, the response body will contain a JSON-encoded representation of a /// `CapabilityStatement` resource.</summary> /// <param name="name">Name of the FHIR store to retrieve the capabilities for.</param> public virtual CapabilitiesRequest Capabilities(string name) { return new CapabilitiesRequest(service, name); } /// <summary>Gets the FHIR capability statement /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/capabilitystatement.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)), or the /// [conformance statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) in /// the DSTU2 case for the store, which contains a description of functionality supported by the /// server. Implements the FHIR standard capabilities interaction /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), or the /// [conformance /// interaction](http://hl7.org/implement/standards/fhir/DSTU2/http.html#conformance) in the /// DSTU2 case. On success, the response body will contain a JSON-encoded representation of a /// `CapabilityStatement` resource.</summary> public class CapabilitiesRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Capabilities request.</summary> public CapabilitiesRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Name of the FHIR store to retrieve the capabilities for.</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 => "capabilities"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}/fhir/metadata"; /// <summary>Initializes Capabilities 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Creates a FHIR resource. Implements the FHIR standard create interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which creates a new /// resource with a server-assigned resource ID. The request body must contain a JSON-encoded /// FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. /// On success, the response body will contain a JSON-encoded representation of the resource as /// it was created on the server, including the server-assigned resource ID and version ID. /// Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `create`, see [Creating a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#creating_a_fhir_resource).</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the FHIR store this resource belongs to.</param> /// <param name="type">The /// FHIR resource type to create, such as Patient or Observation. For a complete list, see the FHIR Resource Index /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must match the resource type in the provided /// content.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string type) { return new CreateRequest(service, body, parent, type); } /// <summary>Creates a FHIR resource. Implements the FHIR standard create interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which creates a new /// resource with a server-assigned resource ID. The request body must contain a JSON-encoded /// FHIR resource, and the request headers must contain `Content-Type: application/fhir+json`. /// On success, the response body will contain a JSON-encoded representation of the resource as /// it was created on the server, including the server-assigned resource ID and version ID. /// Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `create`, see [Creating a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#creating_a_fhir_resource).</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent, string type) : base(service) { Parent = parent; Type = type; Body = body; InitParameters(); } /// <summary>The name of the FHIR store this resource belongs to.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The FHIR resource type to create, such as Patient or Observation. For a /// complete list, see the FHIR Resource Index /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must match the /// resource type in the provided content.</summary> [Google.Apis.Util.RequestParameterAttribute("type", Google.Apis.Util.RequestParameterType.Path)] public virtual string Type { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.HttpBody 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}/fhir/{+type}"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); RequestParameters.Add("type", new Google.Apis.Discovery.Parameter { Name = "type", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^[^/]+$", }); } } /// <summary>Deletes a FHIR resource. Implements the FHIR standard delete interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note: Unless resource /// versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, /// the deleted resources will be moved to a history repository that can still be retrieved /// through vread and related methods, unless they are removed by the purge method. For samples /// that show how to call `delete`, see [Deleting a FHIR resource](/healthcare/docs/how-tos /// /fhir-resources#deleting_a_fhir_resource).</summary> /// <param name="name">The name of the resource to delete.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes a FHIR resource. Implements the FHIR standard delete interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note: Unless resource /// versioning is disabled by setting the disable_resource_versioning flag on the FHIR store, /// the deleted resources will be moved to a history repository that can still be retrieved /// through vread and related methods, unless they are removed by the purge method. For samples /// that show how to call `delete`, see [Deleting a FHIR resource](/healthcare/docs/how-tos /// /fhir-resources#deleting_a_fhir_resource).</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Delete request.</summary> public DeleteRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the resource to delete.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); } } /// <summary>Executes all the requests in the given Bundle. Implements the FHIR standard /// batch/transaction interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). Supports all /// interactions within a bundle, except search. This method accepts Bundles of type `batch` and /// `transaction`, processing them according to the batch processing rules /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) and transaction /// processing rules /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The request body must /// contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain /// `Content-Type: application/fhir+json`. For a batch bundle or a successful transaction the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `batch-response` or `transaction-response` containing one entry for each entry in the /// request, with the outcome of processing the entry. In the case of an error for a transaction /// bundle, the response body will contain a JSON-encoded `OperationOutcome` resource describing /// the reason for the error. If the request cannot be mapped to a valid API method on a FHIR /// store, a generic GCP error might be returned instead. For samples that show how to call /// `executeBundle`, see [Managing FHIR resources using FHIR bundles](/healthcare/docs/how-tos /// /fhir-bundles).</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Name of the FHIR store in which this bundle will be executed.</param> public virtual ExecuteBundleRequest ExecuteBundle(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent) { return new ExecuteBundleRequest(service, body, parent); } /// <summary>Executes all the requests in the given Bundle. Implements the FHIR standard /// batch/transaction interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#transaction), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)). Supports all /// interactions within a bundle, except search. This method accepts Bundles of type `batch` and /// `transaction`, processing them according to the batch processing rules /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) and transaction /// processing rules /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The request body must /// contain a JSON-encoded FHIR `Bundle` resource, and the request headers must contain /// `Content-Type: application/fhir+json`. For a batch bundle or a successful transaction the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `batch-response` or `transaction-response` containing one entry for each entry in the /// request, with the outcome of processing the entry. In the case of an error for a transaction /// bundle, the response body will contain a JSON-encoded `OperationOutcome` resource describing /// the reason for the error. If the request cannot be mapped to a valid API method on a FHIR /// store, a generic GCP error might be returned instead. For samples that show how to call /// `executeBundle`, see [Managing FHIR resources using FHIR bundles](/healthcare/docs/how-tos /// /fhir-bundles).</summary> public class ExecuteBundleRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new ExecuteBundle request.</summary> public ExecuteBundleRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Name of the FHIR store in which this bundle will be executed.</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.CloudHealthcare.v1.Data.HttpBody 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 => "executeBundle"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/fhir"; /// <summary>Initializes ExecuteBundle 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Lists all the versions of a resource (including the current version and deleted /// versions) from the FHIR store. Implements the per-resource form of the FHIR standard history /// interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On success, the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `history`, containing the version history sorted from most recent to oldest versions. Errors /// generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `history`, see [Listing FHIR resource versions](/healthcare/docs/how-tos/fhir- /// resources#listing_fhir_resource_versions).</summary> /// <param name="name">The name of the resource to retrieve.</param> public virtual HistoryRequest History(string name) { return new HistoryRequest(service, name); } /// <summary>Lists all the versions of a resource (including the current version and deleted /// versions) from the FHIR store. Implements the per-resource form of the FHIR standard history /// interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On success, the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `history`, containing the version history sorted from most recent to oldest versions. Errors /// generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `history`, see [Listing FHIR resource versions](/healthcare/docs/how-tos/fhir- /// resources#listing_fhir_resource_versions).</summary> public class HistoryRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new History request.</summary> public HistoryRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the resource to retrieve.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Only include resource versions that were current at some point during the time /// period specified in the date time value. The date parameter format is yyyy-mm- /// ddThh:mm:ss[Z|(+|-)hh:mm] Clients may specify any of the following: * An entire year: /// `_at=2019` * An entire month: `_at=2019-01` * A specific day: `_at=2019-01-20` * A /// specific second: `_at=2018-12-31T23:59:58Z`</summary> [Google.Apis.Util.RequestParameterAttribute("_at", Google.Apis.Util.RequestParameterType.Query)] public virtual string At { get; set; } /// <summary>The maximum number of search results on a page. Defaults to 1000.</summary> [Google.Apis.Util.RequestParameterAttribute("_count", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> Count { get; set; } /// <summary>Used to retrieve the first, previous, next, or last page of resource versions /// when using pagination. Value should be set to the value of `_page_token` set in next or /// previous page links' URLs. Next and previous page are returned in the response bundle's /// links field, where `link.relation` is "previous" or "next". Omit `_page_token` if no /// previous request has been made.</summary> [Google.Apis.Util.RequestParameterAttribute("_page_token", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Only include resource versions that were created at or after the given instant /// in time. The instant in time uses the format YYYY-MM-DDThh:mm:ss.sss+zz:zz (for example /// 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z). The time must be specified to /// the second and include a time zone.</summary> [Google.Apis.Util.RequestParameterAttribute("_since", Google.Apis.Util.RequestParameterType.Query)] public virtual string Since { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "history"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}/_history"; /// <summary>Initializes History 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); RequestParameters.Add("_at", new Google.Apis.Discovery.Parameter { Name = "_at", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_count", new Google.Apis.Discovery.Parameter { Name = "_count", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_page_token", new Google.Apis.Discovery.Parameter { Name = "_page_token", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); RequestParameters.Add("_since", new Google.Apis.Discovery.Parameter { Name = "_since", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Updates part of an existing resource by applying the operations specified in a /// [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard patch interaction /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2 doesn't define a /// patch method, but the server supports it in the same way it supports STU3. The request body /// must contain a JSON Patch document, and the request headers must contain `Content-Type: /// application/json-patch+json`. On success, the response body will contain a JSON-encoded /// representation of the updated resource, including the server-assigned version ID. Errors /// generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `patch`, see [Patching a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#patching_a_fhir_resource).</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the resource to update.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates part of an existing resource by applying the operations specified in a /// [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard patch interaction /// ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2 doesn't define a /// patch method, but the server supports it in the same way it supports STU3. The request body /// must contain a JSON Patch document, and the request headers must contain `Content-Type: /// application/json-patch+json`. On success, the response body will contain a JSON-encoded /// representation of the updated resource, including the server-assigned version ID. Errors /// generated by the FHIR store will contain a JSON-encoded `OperationOutcome` resource /// describing the reason for the error. If the request cannot be mapped to a valid API method /// on a FHIR store, a generic GCP error might be returned instead. For samples that show how to /// call `patch`, see [Patching a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#patching_a_fhir_resource).</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the resource to update.</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.CloudHealthcare.v1.Data.HttpBody 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); } } /// <summary>Gets the contents of a FHIR resource. Implements the FHIR standard read interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). Also supports the FHIR /// standard conditional read interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified by supplying an /// `If-Modified-Since` header with a date/time value or an `If-None-Match` header with an ETag /// value. On success, the response body will contain a JSON-encoded representation of the /// resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` /// resource describing the reason for the error. If the request cannot be mapped to a valid API /// method on a FHIR store, a generic GCP error might be returned instead. For samples that show /// how to call `read`, see [Getting a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#getting_a_fhir_resource).</summary> /// <param name="name">The name of the resource to retrieve.</param> public virtual ReadRequest Read(string name) { return new ReadRequest(service, name); } /// <summary>Gets the contents of a FHIR resource. Implements the FHIR standard read interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). Also supports the FHIR /// standard conditional read interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified by supplying an /// `If-Modified-Since` header with a date/time value or an `If-None-Match` header with an ETag /// value. On success, the response body will contain a JSON-encoded representation of the /// resource. Errors generated by the FHIR store will contain a JSON-encoded `OperationOutcome` /// resource describing the reason for the error. If the request cannot be mapped to a valid API /// method on a FHIR store, a generic GCP error might be returned instead. For samples that show /// how to call `read`, see [Getting a FHIR resource](/healthcare/docs/how-tos/fhir- /// resources#getting_a_fhir_resource).</summary> public class ReadRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Read request.</summary> public ReadRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the resource to retrieve.</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 => "read"; /// <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 Read 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); } } /// <summary>Searches for resources in the given FHIR store according to criteria specified as /// query parameters. Implements the FHIR standard search interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search /// semantics described in the FHIR Search specification /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of /// search defined by the specification: * `GET [base]?[parameters]` to search across all /// resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * /// `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as /// the `GET` method. The `GET` methods do not support compartment searches. The `POST` method /// does not support `application/x-www-form-urlencoded` search parameters. On success, the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `searchset`, containing the results of the search. Errors generated by the FHIR store will /// contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If /// the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error /// might be returned instead. The server's capability statement, retrieved through /// capabilities, indicates what search parameters are supported on each FHIR resource. A list /// of all search parameters defined by the specification can be found in the FHIR Search /// Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter- /// registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter- /// registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition /// page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not- /// in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result /// parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, /// and `_elements`. The maximum number of search results returned defaults to 100, which can be /// overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional /// results, the returned `Bundle` will contain pagination links. Resources with a total size /// larger than 5MB or a field count larger than 50,000 might not be fully searchable as the /// server might trim its generated search index in those cases. Note: FHIR resources are /// indexed asynchronously, so there might be a slight delay between the time a resource is /// created or changes and when the change is reflected in search results. For samples and /// detailed information, see [Searching for FHIR resources](/healthcare/docs/how-tos/fhir- /// search) and [Advanced FHIR search features](/healthcare/docs/how-tos/fhir-advanced- /// search).</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">Name of the FHIR store to retrieve resources from.</param> public virtual SearchRequest Search(Google.Apis.CloudHealthcare.v1.Data.SearchResourcesRequest body, string parent) { return new SearchRequest(service, body, parent); } /// <summary>Searches for resources in the given FHIR store according to criteria specified as /// query parameters. Implements the FHIR standard search interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the search /// semantics described in the FHIR Search specification /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports three methods of /// search defined by the specification: * `GET [base]?[parameters]` to search across all /// resources. * `GET [base]/[type]?[parameters]` to search resources of a specified type. * /// `POST [base]/[type]/_search?[parameters]` as an alternate form having the same semantics as /// the `GET` method. The `GET` methods do not support compartment searches. The `POST` method /// does not support `application/x-www-form-urlencoded` search parameters. On success, the /// response body will contain a JSON-encoded representation of a `Bundle` resource of type /// `searchset`, containing the results of the search. Errors generated by the FHIR store will /// contain a JSON-encoded `OperationOutcome` resource describing the reason for the error. If /// the request cannot be mapped to a valid API method on a FHIR store, a generic GCP error /// might be returned instead. The server's capability statement, retrieved through /// capabilities, indicates what search parameters are supported on each FHIR resource. A list /// of all search parameters defined by the specification can be found in the FHIR Search /// Parameter Registry ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter- /// registry.html), [R4](http://hl7.org/implement/standards/fhir/R4/searchparameter- /// registry.html)). FHIR search parameters for DSTU2 can be found on each resource's definition /// page. Supported search modifiers: `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not- /// in`, `:above`, `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result /// parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`, `_summary=data`, /// and `_elements`. The maximum number of search results returned defaults to 100, which can be /// overridden by the `_count` parameter up to a maximum limit of 1000. If there are additional /// results, the returned `Bundle` will contain pagination links. Resources with a total size /// larger than 5MB or a field count larger than 50,000 might not be fully searchable as the /// server might trim its generated search index in those cases. Note: FHIR resources are /// indexed asynchronously, so there might be a slight delay between the time a resource is /// created or changes and when the change is reflected in search results. For samples and /// detailed information, see [Searching for FHIR resources](/healthcare/docs/how-tos/fhir- /// search) and [Advanced FHIR search features](/healthcare/docs/how-tos/fhir-advanced- /// search).</summary> public class SearchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Search request.</summary> public SearchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.SearchResourcesRequest body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>Name of the FHIR store to retrieve resources from.</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.CloudHealthcare.v1.Data.SearchResourcesRequest 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 => "search"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/fhir/_search"; /// <summary>Initializes Search 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Updates the entire contents of a resource. Implements the FHIR standard update /// interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the specified /// resource does not exist and the FHIR store has enable_update_create set, creates the /// resource with the client-specified ID. The request body must contain a JSON-encoded FHIR /// resource, and the request headers must contain `Content-Type: application/fhir+json`. The /// resource must contain an `id` element having an identical value to the ID in the REST path /// of the request. On success, the response body will contain a JSON-encoded representation of /// the updated resource, including the server-assigned version ID. Errors generated by the FHIR /// store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the /// error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP /// error might be returned instead. For samples that show how to call `update`, see [Updating a /// FHIR resource](/healthcare/docs/how-tos/fhir-resources#updating_a_fhir_resource).</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the resource to update.</param> public virtual UpdateRequest Update(Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string name) { return new UpdateRequest(service, body, name); } /// <summary>Updates the entire contents of a resource. Implements the FHIR standard update /// interaction ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the specified /// resource does not exist and the FHIR store has enable_update_create set, creates the /// resource with the client-specified ID. The request body must contain a JSON-encoded FHIR /// resource, and the request headers must contain `Content-Type: application/fhir+json`. The /// resource must contain an `id` element having an identical value to the ID in the REST path /// of the request. On success, the response body will contain a JSON-encoded representation of /// the updated resource, including the server-assigned version ID. Errors generated by the FHIR /// store will contain a JSON-encoded `OperationOutcome` resource describing the reason for the /// error. If the request cannot be mapped to a valid API method on a FHIR store, a generic GCP /// error might be returned instead. For samples that show how to call `update`, see [Updating a /// FHIR resource](/healthcare/docs/how-tos/fhir-resources#updating_a_fhir_resource).</summary> public class UpdateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Update request.</summary> public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.HttpBody body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the resource to update.</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.CloudHealthcare.v1.Data.HttpBody 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 => "update"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "PUT"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}"; /// <summary>Initializes Update 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+$", }); } } /// <summary>Gets the contents of a version (current or historical) of a FHIR resource by /// version ID. Implements the FHIR standard vread interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On success, the response /// body will contain a JSON-encoded representation of the resource. Errors generated by the /// FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for /// the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic /// GCP error might be returned instead. For samples that show how to call `vread`, see /// [Retrieving a FHIR resource version](/healthcare/docs/how-tos/fhir- /// resources#retrieving_a_fhir_resource_version).</summary> /// <param name="name">The name of the resource version to retrieve.</param> public virtual VreadRequest Vread(string name) { return new VreadRequest(service, name); } /// <summary>Gets the contents of a version (current or historical) of a FHIR resource by /// version ID. Implements the FHIR standard vread interaction /// ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread), /// [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On success, the response /// body will contain a JSON-encoded representation of the resource. Errors generated by the /// FHIR store will contain a JSON-encoded `OperationOutcome` resource describing the reason for /// the error. If the request cannot be mapped to a valid API method on a FHIR store, a generic /// GCP error might be returned instead. For samples that show how to call `vread`, see /// [Retrieving a FHIR resource version](/healthcare/docs/how-tos/fhir- /// resources#retrieving_a_fhir_resource_version).</summary> public class VreadRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.HttpBody> { /// <summary>Constructs a new Vread request.</summary> public VreadRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the resource version to retrieve.</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 => "vread"; /// <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 Vread 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+/fhir/[^/]+/[^/]+/_history/[^/]+$", }); } } } /// <summary>Creates a new FHIR store within the parent dataset.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the dataset this FHIR store belongs to.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.FhirStore body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new FHIR store within the parent dataset.</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.FhirStore> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.FhirStore body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the dataset this FHIR store belongs to.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The ID of the FHIR store that is being created. The string must match the following /// regex: `[\p{L}\p{N}_\-\.]{1,256}`.</summary> [Google.Apis.Util.RequestParameterAttribute("fhirStoreId", Google.Apis.Util.RequestParameterType.Query)] public virtual string FhirStoreId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.FhirStore 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}/fhirStores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); RequestParameters.Add("fhirStoreId", new Google.Apis.Discovery.Parameter { Name = "fhirStoreId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>De-identifies data from the source store and writes it to the destination store. The /// metadata field type is OperationMetadata. If the request is successful, the response field type /// is DeidentifyFhirStoreSummary. If errors occur, error is set. Error details are also logged to /// Cloud Logging (see [Viewing logs](/healthcare/docs/how-tos/logging)).</summary> /// <param name="body">The body of the request.</param> /// <param name="sourceStore">Source FHIR store resource name. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</param> public virtual DeidentifyRequest Deidentify(Google.Apis.CloudHealthcare.v1.Data.DeidentifyFhirStoreRequest body, string sourceStore) { return new DeidentifyRequest(service, body, sourceStore); } /// <summary>De-identifies data from the source store and writes it to the destination store. The /// metadata field type is OperationMetadata. If the request is successful, the response field type /// is DeidentifyFhirStoreSummary. If errors occur, error is set. Error details are also logged to /// Cloud Logging (see [Viewing logs](/healthcare/docs/how-tos/logging)).</summary> public class DeidentifyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Deidentify request.</summary> public DeidentifyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.DeidentifyFhirStoreRequest body, string sourceStore) : base(service) { SourceStore = sourceStore; Body = body; InitParameters(); } /// <summary>Source FHIR store resource name. For example, `projects/{project_id}/locations/{loc /// ation_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("sourceStore", Google.Apis.Util.RequestParameterType.Path)] public virtual string SourceStore { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.DeidentifyFhirStoreRequest 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 => "deidentify"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+sourceStore}:deidentify"; /// <summary>Initializes Deidentify parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("sourceStore", new Google.Apis.Discovery.Parameter { Name = "sourceStore", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Deletes the specified FHIR store and removes all resources within it.</summary> /// <param name="name">The resource name of the FHIR store to delete.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes the specified FHIR store and removes all resources within it.</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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>The resource name of the FHIR store to delete.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Export resources from the FHIR store to the specified destination. This method returns /// an Operation that can be used to track the status of the export by calling GetOperation. /// Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see /// [Viewing logs](/healthcare/docs/how-tos/logging)). Otherwise, when the operation finishes, a /// detailed response of type ExportResourcesResponse is returned in the response field. The /// metadata field type for this operation is OperationMetadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the FHIR store to export resource from, in the format of /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</param> public virtual ExportRequest Export(Google.Apis.CloudHealthcare.v1.Data.ExportResourcesRequest body, string name) { return new ExportRequest(service, body, name); } /// <summary>Export resources from the FHIR store to the specified destination. This method returns /// an Operation that can be used to track the status of the export by calling GetOperation. /// Immediate fatal errors appear in the error field, errors are also logged to Cloud Logging (see /// [Viewing logs](/healthcare/docs/how-tos/logging)). Otherwise, when the operation finishes, a /// detailed response of type ExportResourcesResponse is returned in the response field. The /// metadata field type for this operation is OperationMetadata.</summary> public class ExportRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Export request.</summary> public ExportRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.ExportResourcesRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the FHIR store to export resource from, in the format of `projects/{pro /// ject_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</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.CloudHealthcare.v1.Data.ExportResourcesRequest 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 => "export"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}:export"; /// <summary>Initializes Export 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Gets the configuration of the specified FHIR store.</summary> /// <param name="name">The resource name of the FHIR store to get.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets the configuration of the specified FHIR store.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.FhirStore> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource name of the FHIR store to get.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual GetIamPolicyRequest GetIamPolicy(string resource) { return new GetIamPolicyRequest(service, resource); } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> public class GetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new GetIamPolicy request.</summary> public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Optional. The policy format version to be returned. Valid values are 0, 1, and 3. /// Requests specifying an invalid value will be rejected. Requests for policies with any /// conditional bindings must specify version 3. Policies without any conditional bindings may /// specify any valid value 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> [Google.Apis.Util.RequestParameterAttribute("options.requestedPolicyVersion", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> OptionsRequestedPolicyVersion { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:getIamPolicy"; /// <summary>Initializes GetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); RequestParameters.Add("options.requestedPolicyVersion", new Google.Apis.Discovery.Parameter { Name = "options.requestedPolicyVersion", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Imports resources to the FHIR store by loading data from the specified sources. This /// method is optimized to load large quantities of data using import semantics that ignore some /// FHIR store configuration options and are not suitable for all use cases. It is primarily /// intended to load data into an empty FHIR store that is not being used by other clients. In cases /// where this method is not appropriate, consider using ExecuteBundle to load data. Every resource /// in the input must contain a client-supplied ID. Each resource is stored using the supplied ID /// regardless of the enable_update_create setting on the FHIR store. The import process does not /// enforce referential integrity, regardless of the disable_referential_integrity setting on the /// FHIR store. This allows the import of resources with arbitrary interdependencies without /// considering grouping or ordering, but if the input data contains invalid references or if some /// resources fail to be imported, the FHIR store might be left in a state that violates referential /// integrity. The import process does not trigger Pub/Sub notification or BigQuery streaming /// update, regardless of how those are configured on the FHIR store. If a resource with the /// specified ID already exists, the most recent version of the resource is overwritten without /// creating a new historical version, regardless of the disable_resource_versioning setting on the /// FHIR store. If transient failures occur during the import, it's possible that successfully /// imported resources will be overwritten more than once. The import operation is idempotent unless /// the input data contains multiple valid resources with the same ID but different contents. In /// that case, after the import completes, the store contains exactly one resource with that ID but /// there is no ordering guarantee on which version of the contents it will have. The operation /// result counters do not count duplicate IDs as an error and count one success for each resource /// in the input, which might result in a success count larger than the number of resources in the /// FHIR store. This often occurs when importing data organized in bundles produced by Patient- /// everything where each bundle contains its own copy of a resource such as Practitioner that might /// be referred to by many patients. If some resources fail to import, for example due to parsing /// errors, successfully imported resources are not rolled back. The location and format of the /// input data is specified by the parameters in ImportResourcesRequest. Note that if no format is /// specified, this method assumes the `BUNDLE` format. When using the `BUNDLE` format this method /// ignores the `Bundle.type` field, except that `history` bundles are rejected, and does not apply /// any of the bundle processing semantics for batch or transaction bundles. Unlike in /// ExecuteBundle, transaction bundles are not executed as a single transaction and bundle-internal /// references are not rewritten. The bundle is treated as a collection of resources to be written /// as provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As an example, this /// allows the import of `searchset` bundles produced by a FHIR search or Patient-everything /// operation. This method returns an Operation that can be used to track the status of the import /// by calling GetOperation. Immediate fatal errors appear in the error field, errors are also /// logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how-tos/logging)). Otherwise, when /// the operation finishes, a detailed response of type ImportResourcesResponse is returned in the /// response field. The metadata field type for this operation is OperationMetadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the FHIR store to import FHIR resources to, in the format of /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</param> public virtual ImportRequest Import(Google.Apis.CloudHealthcare.v1.Data.ImportResourcesRequest body, string name) { return new ImportRequest(service, body, name); } /// <summary>Imports resources to the FHIR store by loading data from the specified sources. This /// method is optimized to load large quantities of data using import semantics that ignore some /// FHIR store configuration options and are not suitable for all use cases. It is primarily /// intended to load data into an empty FHIR store that is not being used by other clients. In cases /// where this method is not appropriate, consider using ExecuteBundle to load data. Every resource /// in the input must contain a client-supplied ID. Each resource is stored using the supplied ID /// regardless of the enable_update_create setting on the FHIR store. The import process does not /// enforce referential integrity, regardless of the disable_referential_integrity setting on the /// FHIR store. This allows the import of resources with arbitrary interdependencies without /// considering grouping or ordering, but if the input data contains invalid references or if some /// resources fail to be imported, the FHIR store might be left in a state that violates referential /// integrity. The import process does not trigger Pub/Sub notification or BigQuery streaming /// update, regardless of how those are configured on the FHIR store. If a resource with the /// specified ID already exists, the most recent version of the resource is overwritten without /// creating a new historical version, regardless of the disable_resource_versioning setting on the /// FHIR store. If transient failures occur during the import, it's possible that successfully /// imported resources will be overwritten more than once. The import operation is idempotent unless /// the input data contains multiple valid resources with the same ID but different contents. In /// that case, after the import completes, the store contains exactly one resource with that ID but /// there is no ordering guarantee on which version of the contents it will have. The operation /// result counters do not count duplicate IDs as an error and count one success for each resource /// in the input, which might result in a success count larger than the number of resources in the /// FHIR store. This often occurs when importing data organized in bundles produced by Patient- /// everything where each bundle contains its own copy of a resource such as Practitioner that might /// be referred to by many patients. If some resources fail to import, for example due to parsing /// errors, successfully imported resources are not rolled back. The location and format of the /// input data is specified by the parameters in ImportResourcesRequest. Note that if no format is /// specified, this method assumes the `BUNDLE` format. When using the `BUNDLE` format this method /// ignores the `Bundle.type` field, except that `history` bundles are rejected, and does not apply /// any of the bundle processing semantics for batch or transaction bundles. Unlike in /// ExecuteBundle, transaction bundles are not executed as a single transaction and bundle-internal /// references are not rewritten. The bundle is treated as a collection of resources to be written /// as provided in `Bundle.entry.resource`, ignoring `Bundle.entry.request`. As an example, this /// allows the import of `searchset` bundles produced by a FHIR search or Patient-everything /// operation. This method returns an Operation that can be used to track the status of the import /// by calling GetOperation. Immediate fatal errors appear in the error field, errors are also /// logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how-tos/logging)). Otherwise, when /// the operation finishes, a detailed response of type ImportResourcesResponse is returned in the /// response field. The metadata field type for this operation is OperationMetadata.</summary> public class ImportRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Import request.</summary> public ImportRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.ImportResourcesRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the FHIR store to import FHIR resources to, in the format of `projects/ /// {project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</sum /// mary> [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.CloudHealthcare.v1.Data.ImportResourcesRequest 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 => "import"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}:import"; /// <summary>Initializes Import 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Lists the FHIR stores in the given dataset.</summary> /// <param name="parent">Name of the dataset.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists the FHIR stores in the given dataset.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListFhirStoresResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Name of the dataset.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Restricts stores returned to those matching a filter. Syntax: /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings Only filtering /// on labels is supported, for example `labels.key=value`.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Limit on the number of FHIR stores to return in a single response. If zero the /// default page size of 100 is used.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The next_page_token value returned from the previous List request, if /// any.</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}/fhirStores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); 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 the configuration of the specified FHIR store.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Output only. Resource name of the FHIR store, of the form /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.FhirStore body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates the configuration of the specified FHIR store.</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.FhirStore> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.FhirStore body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Output only. Resource name of the FHIR store, of the form /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The update mask applies to the resource. For the `FieldMask` definition, see /// https://developers.google.com/protocol- /// buffers/docs/reference/google.protobuf#fieldmask</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.CloudHealthcare.v1.Data.FhirStore 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</param> public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) { return new SetIamPolicyRequest(service, body, resource); } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> public class SetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new SetIamPolicy request.</summary> public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest 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 => "setIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:setIamPolicy"; /// <summary>Initializes SetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) { return new TestIamPermissionsRequest(service, body, resource); } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> public class TestIamPermissionsRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsResponse> { /// <summary>Constructs a new TestIamPermissions request.</summary> public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the /// operation documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest 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 => "testIamPermissions"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:testIamPermissions"; /// <summary>Initializes TestIamPermissions 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/fhirStores/[^/]+$", }); } } } /// <summary>Gets the Hl7V2Stores resource.</summary> public virtual Hl7V2StoresResource Hl7V2Stores { get; } /// <summary>The "hl7V2Stores" collection of methods.</summary> public class Hl7V2StoresResource { private const string Resource = "hl7V2Stores"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public Hl7V2StoresResource(Google.Apis.Services.IClientService service) { this.service = service; Messages = new MessagesResource(service); } /// <summary>Gets the Messages resource.</summary> public virtual MessagesResource Messages { get; } /// <summary>The "messages" collection of methods.</summary> public class MessagesResource { private const string Resource = "messages"; /// <summary>The service which this resource belongs to.</summary> private readonly Google.Apis.Services.IClientService service; /// <summary>Constructs a new resource.</summary> public MessagesResource(Google.Apis.Services.IClientService service) { this.service = service; } /// <summary>Parses and stores an HL7v2 message. This method triggers an asynchronous /// notification to any Cloud Pub/Sub topic configured in /// projects.locations.datasets.hl7V2Stores.Hl7V2NotificationConfig, if the filtering matches /// the message. If an MLLP adapter is configured to listen to a Cloud Pub/Sub topic, the /// adapter transmits the message when a notification is received.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the dataset this message belongs to.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.CreateMessageRequest body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Parses and stores an HL7v2 message. This method triggers an asynchronous /// notification to any Cloud Pub/Sub topic configured in /// projects.locations.datasets.hl7V2Stores.Hl7V2NotificationConfig, if the filtering matches /// the message. If an MLLP adapter is configured to listen to a Cloud Pub/Sub topic, the /// adapter transmits the message when a notification is received.</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Message> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.CreateMessageRequest body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the dataset this message belongs to.</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.CloudHealthcare.v1.Data.CreateMessageRequest 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}/messages"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } /// <summary>Deletes an HL7v2 message.</summary> /// <param name="name">The resource name of the HL7v2 message to delete.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes an HL7v2 message.</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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>The resource name of the HL7v2 message to delete.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+/messages/[^/]+$", }); } } /// <summary>Gets an HL7v2 message.</summary> /// <param name="name">The resource name of the HL7v2 message to retrieve.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets an HL7v2 message.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Message> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource name of the HL7v2 message to retrieve.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>Specifies which parts of the Message resource to return in the response. When /// unspecified, equivalent to FULL.</summary> [Google.Apis.Util.RequestParameterAttribute("view", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<ViewEnum> View { get; set; } /// <summary>Specifies which parts of the Message resource to return in the response. When /// unspecified, equivalent to FULL.</summary> public enum ViewEnum { /// <summary>Not specified, equivalent to FULL.</summary> [Google.Apis.Util.StringValueAttribute("MESSAGE_VIEW_UNSPECIFIED")] MESSAGEVIEWUNSPECIFIED, /// <summary>Server responses include all the message fields except parsed_data /// field.</summary> [Google.Apis.Util.StringValueAttribute("RAW_ONLY")] RAWONLY, /// <summary>Server responses include all the message fields except data /// field.</summary> [Google.Apis.Util.StringValueAttribute("PARSED_ONLY")] PARSEDONLY, /// <summary>Server responses include all the message fields.</summary> [Google.Apis.Util.StringValueAttribute("FULL")] FULL, /// <summary>Server responses include only the name field.</summary> [Google.Apis.Util.StringValueAttribute("BASIC")] BASIC, } /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+/messages/[^/]+$", }); RequestParameters.Add("view", new Google.Apis.Discovery.Parameter { Name = "view", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Parses and stores an HL7v2 message. This method triggers an asynchronous /// notification to any Cloud Pub/Sub topic configured in /// projects.locations.datasets.hl7V2Stores.Hl7V2NotificationConfig, if the filtering matches /// the message. If an MLLP adapter is configured to listen to a Cloud Pub/Sub topic, the /// adapter transmits the message when a notification is received. This method also generates a /// response containing an HL7v2 acknowledgement (`ACK`) message when successful or a negative /// acknowledgement (`NACK`) message in case of error, suitable for replying to HL7v2 interface /// systems that expect these acknowledgements.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the HL7v2 store this message belongs to.</param> public virtual IngestRequest Ingest(Google.Apis.CloudHealthcare.v1.Data.IngestMessageRequest body, string parent) { return new IngestRequest(service, body, parent); } /// <summary>Parses and stores an HL7v2 message. This method triggers an asynchronous /// notification to any Cloud Pub/Sub topic configured in /// projects.locations.datasets.hl7V2Stores.Hl7V2NotificationConfig, if the filtering matches /// the message. If an MLLP adapter is configured to listen to a Cloud Pub/Sub topic, the /// adapter transmits the message when a notification is received. This method also generates a /// response containing an HL7v2 acknowledgement (`ACK`) message when successful or a negative /// acknowledgement (`NACK`) message in case of error, suitable for replying to HL7v2 interface /// systems that expect these acknowledgements.</summary> public class IngestRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.IngestMessageResponse> { /// <summary>Constructs a new Ingest request.</summary> public IngestRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.IngestMessageRequest body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the HL7v2 store this message belongs to.</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.CloudHealthcare.v1.Data.IngestMessageRequest 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 => "ingest"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+parent}/messages:ingest"; /// <summary>Initializes Ingest 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } /// <summary>Lists all the messages in the given HL7v2 store with support for filtering. Note: /// HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time /// a message is created and when it can be found through a filter.</summary> /// <param name="parent">Name of the HL7v2 store to retrieve messages from.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists all the messages in the given HL7v2 store with support for filtering. Note: /// HL7v2 messages are indexed asynchronously, so there might be a slight delay between the time /// a message is created and when it can be found through a filter.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListMessagesResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Name of the HL7v2 store to retrieve messages from.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Restricts messages returned to those matching a filter. Syntax: /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings /// Fields/functions available for filtering are: * `message_type`, from the MSH-9.1 field. /// For example, `NOT message_type = "ADT"`. * `send_date` or `sendDate`, the YYYY-MM-DD /// date the message was sent in the dataset's time_zone, from the MSH-7 segment. For /// example, `send_date < "2017-01-02"`. * `send_time`, the timestamp when the message was /// sent, using the RFC3339 time format for comparisons, from the MSH-7 segment. For /// example, `send_time < "2017-01-02T00:00:00-05:00"`. * `send_facility`, the care center /// that the message came from, from the MSH-4 segment. For example, `send_facility = /// "ABC"`. * `PatientId(value, type)`, which matches if the message lists a patient having /// an ID of the given value and type in the PID-2, PID-3, or PID-4 segments. For example, /// `PatientId("123456", "MRN")`. * `labels.x`, a string value of the label with key `x` as /// set using the Message.labels map. For example, `labels."priority"="high"`. The operator /// `:*` can be used to assert the existence of a label. For example, /// `labels."priority":*`.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Orders messages returned by the specified order_by clause. Syntax: /// https://cloud.google.com/apis/design/design_patterns#sorting_order Fields available for /// ordering are: * `send_time`</summary> [Google.Apis.Util.RequestParameterAttribute("orderBy", Google.Apis.Util.RequestParameterType.Query)] public virtual string OrderBy { get; set; } /// <summary>Limit on the number of messages to return in a single response. If zero the /// default page size of 100 is used.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The next_page_token value returned from the previous List request, if /// any.</summary> [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)] public virtual string PageToken { get; set; } /// <summary>Specifies the parts of the Message to return in the response. When unspecified, /// equivalent to BASIC. Setting this to anything other than BASIC with a `page_size` larger /// than the default can generate a large response, which impacts the performance of this /// method.</summary> [Google.Apis.Util.RequestParameterAttribute("view", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<ViewEnum> View { get; set; } /// <summary>Specifies the parts of the Message to return in the response. When unspecified, /// equivalent to BASIC. Setting this to anything other than BASIC with a `page_size` larger /// than the default can generate a large response, which impacts the performance of this /// method.</summary> public enum ViewEnum { /// <summary>Not specified, equivalent to FULL.</summary> [Google.Apis.Util.StringValueAttribute("MESSAGE_VIEW_UNSPECIFIED")] MESSAGEVIEWUNSPECIFIED, /// <summary>Server responses include all the message fields except parsed_data /// field.</summary> [Google.Apis.Util.StringValueAttribute("RAW_ONLY")] RAWONLY, /// <summary>Server responses include all the message fields except data /// field.</summary> [Google.Apis.Util.StringValueAttribute("PARSED_ONLY")] PARSEDONLY, /// <summary>Server responses include all the message fields.</summary> [Google.Apis.Util.StringValueAttribute("FULL")] FULL, /// <summary>Server responses include only the name field.</summary> [Google.Apis.Util.StringValueAttribute("BASIC")] BASIC, } /// <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}/messages"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); RequestParameters.Add("filter", new Google.Apis.Discovery.Parameter { Name = "filter", 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("view", new Google.Apis.Discovery.Parameter { Name = "view", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Update the message. The contents of the message in Message.data and data extracted /// from the contents such as Message.create_time cannot be altered. Only the Message.labels /// field is allowed to be updated. The labels in the request are merged with the existing set /// of labels. Existing labels with the same keys are updated.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Resource name of the Message, of the form /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the /// server.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.Message body, string name) { return new PatchRequest(service, body, name); } /// <summary>Update the message. The contents of the message in Message.data and data extracted /// from the contents such as Message.create_time cannot be altered. Only the Message.labels /// field is allowed to be updated. The labels in the request are merged with the existing set /// of labels. Existing labels with the same keys are updated.</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Message> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.Message body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Resource name of the Message, of the form `projects/{project_id}/datasets/{data /// set_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned by the /// server.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The update mask applies to the resource. For the `FieldMask` definition, see /// https://developers.google.com/protocol- /// buffers/docs/reference/google.protobuf#fieldmask</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.CloudHealthcare.v1.Data.Message 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+/messages/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } } /// <summary>Creates a new HL7v2 store within the parent dataset.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the dataset this HL7v2 store belongs to.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new HL7v2 store within the parent dataset.</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the dataset this HL7v2 store belongs to.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The ID of the HL7v2 store that is being created. The string must match the /// following regex: `[\p{L}\p{N}_\-\.]{1,256}`.</summary> [Google.Apis.Util.RequestParameterAttribute("hl7V2StoreId", Google.Apis.Util.RequestParameterType.Query)] public virtual string Hl7V2StoreId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store 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}/hl7V2Stores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); RequestParameters.Add("hl7V2StoreId", new Google.Apis.Discovery.Parameter { Name = "hl7V2StoreId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Deletes the specified HL7v2 store and removes all messages that it contains.</summary> /// <param name="name">The resource name of the HL7v2 store to delete.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes the specified HL7v2 store and removes all messages that it contains.</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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>The resource name of the HL7v2 store to delete.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } /// <summary>Gets the specified HL7v2 store.</summary> /// <param name="name">The resource name of the HL7v2 store to get.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets the specified HL7v2 store.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource name of the HL7v2 store to get.</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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual GetIamPolicyRequest GetIamPolicy(string resource) { return new GetIamPolicyRequest(service, resource); } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> public class GetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new GetIamPolicy request.</summary> public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Optional. The policy format version to be returned. Valid values are 0, 1, and 3. /// Requests specifying an invalid value will be rejected. Requests for policies with any /// conditional bindings must specify version 3. Policies without any conditional bindings may /// specify any valid value 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> [Google.Apis.Util.RequestParameterAttribute("options.requestedPolicyVersion", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> OptionsRequestedPolicyVersion { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:getIamPolicy"; /// <summary>Initializes GetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); RequestParameters.Add("options.requestedPolicyVersion", new Google.Apis.Discovery.Parameter { Name = "options.requestedPolicyVersion", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Lists the HL7v2 stores in the given dataset.</summary> /// <param name="parent">Name of the dataset.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists the HL7v2 stores in the given dataset.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListHl7V2StoresResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>Name of the dataset.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>Restricts stores returned to those matching a filter. Syntax: /// https://cloud.google.com/appengine/docs/standard/python/search/query_strings Only filtering /// on labels is supported. For example, `labels.key=value`.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>Limit on the number of HL7v2 stores to return in a single response. If zero the /// default page size of 100 is used.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The next_page_token value returned from the previous List request, if /// any.</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}/hl7V2Stores"; /// <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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); 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 the HL7v2 store.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Resource name of the HL7v2 store, of the form /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates the HL7v2 store.</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.Hl7V2Store body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Resource name of the HL7v2 store, of the form /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The update mask applies to the resource. For the `FieldMask` definition, see /// https://developers.google.com/protocol- /// buffers/docs/reference/google.protobuf#fieldmask</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.CloudHealthcare.v1.Data.Hl7V2Store 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</param> public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) { return new SetIamPolicyRequest(service, body, resource); } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> public class SetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new SetIamPolicy request.</summary> public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest 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 => "setIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:setIamPolicy"; /// <summary>Initializes SetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) { return new TestIamPermissionsRequest(service, body, resource); } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does /// not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This /// operation is designed to be used for building permission-aware UIs and command-line tools, not /// for authorization checking. This operation may "fail open" without warning.</summary> public class TestIamPermissionsRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsResponse> { /// <summary>Constructs a new TestIamPermissions request.</summary> public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the /// operation documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest 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 => "testIamPermissions"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:testIamPermissions"; /// <summary>Initializes TestIamPermissions 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/hl7V2Stores/[^/]+$", }); } } } /// <summary>Gets the Operations resource.</summary> public virtual OperationsResource Operations { get; } /// <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>Starts asynchronous cancellation on a long-running operation. The server makes a best /// effort to cancel the operation, but success is not guaranteed. If the server doesn't support /// this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation /// or other methods to check whether the cancellation succeeded or whether the operation completed /// despite cancellation. On successful cancellation, the operation is not deleted; instead, it /// becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, /// corresponding to `Code.CANCELLED`.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">The name of the operation resource to be cancelled.</param> public virtual CancelRequest Cancel(Google.Apis.CloudHealthcare.v1.Data.CancelOperationRequest body, string name) { return new CancelRequest(service, body, name); } /// <summary>Starts asynchronous cancellation on a long-running operation. The server makes a best /// effort to cancel the operation, but success is not guaranteed. If the server doesn't support /// this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation /// or other methods to check whether the cancellation succeeded or whether the operation completed /// despite cancellation. On successful cancellation, the operation is not deleted; instead, it /// becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, /// corresponding to `Code.CANCELLED`.</summary> public class CancelRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Empty> { /// <summary>Constructs a new Cancel request.</summary> public CancelRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.CancelOperationRequest body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>The name of the operation resource to be cancelled.</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.CloudHealthcare.v1.Data.CancelOperationRequest 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 => "cancel"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+name}:cancel"; /// <summary>Initializes Cancel 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+$", }); } } /// <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 : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+/operations/[^/]+$", }); } } /// <summary>Lists operations that match the specified filter in the request. If the server doesn't /// support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to /// override the binding to use different resource name schemes, such as `users/operations`. To /// override the binding, API services can add a binding such as `"/v1/{name=users}/operations"` to /// their service configuration. For backwards compatibility, the default name includes the /// operations collection id, however overriding users must ensure the name binding is the parent /// resource, without the operations collection id.</summary> /// <param name="name">The name of the operation's parent resource.</param> public virtual ListRequest List(string name) { return new ListRequest(service, name); } /// <summary>Lists operations that match the specified filter in the request. If the server doesn't /// support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to /// override the binding to use different resource name schemes, such as `users/operations`. To /// override the binding, API services can add a binding such as `"/v1/{name=users}/operations"` to /// their service configuration. For backwards compatibility, the default name includes the /// operations collection id, however overriding users must ensure the name binding is the parent /// resource, without the operations collection id.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListOperationsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The name of the operation's parent resource.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The standard list filter.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>The standard list page size.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The standard list 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/{+name}/operations"; /// <summary>Initializes List 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); 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>Creates a new health dataset. Results are returned through the Operation interface which /// returns either an `Operation.response` which contains a Dataset or `Operation.error`. The metadata /// field type is OperationMetadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="parent">The name of the project where the server creates the dataset. For example, /// `projects/{project_id}/locations/{location_id}`.</param> public virtual CreateRequest Create(Google.Apis.CloudHealthcare.v1.Data.Dataset body, string parent) { return new CreateRequest(service, body, parent); } /// <summary>Creates a new health dataset. Results are returned through the Operation interface which /// returns either an `Operation.response` which contains a Dataset or `Operation.error`. The metadata /// field type is OperationMetadata.</summary> public class CreateRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Create request.</summary> public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.Dataset body, string parent) : base(service) { Parent = parent; Body = body; InitParameters(); } /// <summary>The name of the project where the server creates the dataset. For example, /// `projects/{project_id}/locations/{location_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The ID of the dataset that is being created. The string must match the following regex: /// `[\p{L}\p{N}_\-\.]{1,256}`.</summary> [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Query)] public virtual string DatasetId { get; set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.Dataset 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}/datasets"; /// <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 = @"^projects/[^/]+/locations/[^/]+$", }); RequestParameters.Add("datasetId", new Google.Apis.Discovery.Parameter { Name = "datasetId", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Creates a new dataset containing de-identified data from the source dataset. The metadata /// field type is OperationMetadata. If the request is successful, the response field type is /// DeidentifySummary. If errors occur, error is set. The LRO result may still be successful if de- /// identification fails for some DICOM instances. The new de-identified dataset will not contain these /// failed resources. Failed resource totals are tracked in Operation.metadata. Error details are also /// logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging).</summary> /// <param name="body">The body of the request.</param> /// <param name="sourceDataset">Source dataset resource name. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</param> public virtual DeidentifyRequest Deidentify(Google.Apis.CloudHealthcare.v1.Data.DeidentifyDatasetRequest body, string sourceDataset) { return new DeidentifyRequest(service, body, sourceDataset); } /// <summary>Creates a new dataset containing de-identified data from the source dataset. The metadata /// field type is OperationMetadata. If the request is successful, the response field type is /// DeidentifySummary. If errors occur, error is set. The LRO result may still be successful if de- /// identification fails for some DICOM instances. The new de-identified dataset will not contain these /// failed resources. Failed resource totals are tracked in Operation.metadata. Error details are also /// logged to Cloud Logging. For more information, see [Viewing logs](/healthcare/docs/how- /// tos/logging).</summary> public class DeidentifyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Operation> { /// <summary>Constructs a new Deidentify request.</summary> public DeidentifyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.DeidentifyDatasetRequest body, string sourceDataset) : base(service) { SourceDataset = sourceDataset; Body = body; InitParameters(); } /// <summary>Source dataset resource name. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("sourceDataset", Google.Apis.Util.RequestParameterType.Path)] public virtual string SourceDataset { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.DeidentifyDatasetRequest 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 => "deidentify"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+sourceDataset}:deidentify"; /// <summary>Initializes Deidentify parameter list.</summary> protected override void InitParameters() { base.InitParameters(); RequestParameters.Add("sourceDataset", new Google.Apis.Discovery.Parameter { Name = "sourceDataset", IsRequired = true, ParameterType = "path", DefaultValue = null, Pattern = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); } } /// <summary>Deletes the specified health dataset and all data contained in the dataset. Deleting a /// dataset does not affect the sources from which the dataset was imported (if any).</summary> /// <param name="name">The name of the dataset to delete. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</param> public virtual DeleteRequest Delete(string name) { return new DeleteRequest(service, name); } /// <summary>Deletes the specified health dataset and all data contained in the dataset. Deleting a /// dataset does not affect the sources from which the dataset was imported (if any).</summary> public class DeleteRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.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>The name of the dataset to delete. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); } } /// <summary>Gets any metadata associated with a dataset.</summary> /// <param name="name">The name of the dataset to read. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets any metadata associated with a dataset.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Dataset> { /// <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 dataset to read. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); } } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> /// <param name="resource">REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual GetIamPolicyRequest GetIamPolicy(string resource) { return new GetIamPolicyRequest(service, resource); } /// <summary>Gets the access control policy for a resource. Returns an empty policy if the resource /// exists and does not have a policy set.</summary> public class GetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new GetIamPolicy request.</summary> public GetIamPolicyRequest(Google.Apis.Services.IClientService service, string resource) : base(service) { Resource = resource; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being requested. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Optional. The policy format version to be returned. Valid values are 0, 1, and 3. /// Requests specifying an invalid value will be rejected. Requests for policies with any /// conditional bindings must specify version 3. Policies without any conditional bindings may /// specify any valid value 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> [Google.Apis.Util.RequestParameterAttribute("options.requestedPolicyVersion", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> OptionsRequestedPolicyVersion { get; set; } /// <summary>Gets the method name.</summary> public override string MethodName => "getIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "GET"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:getIamPolicy"; /// <summary>Initializes GetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); RequestParameters.Add("options.requestedPolicyVersion", new Google.Apis.Discovery.Parameter { Name = "options.requestedPolicyVersion", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Lists the health datasets in the current project.</summary> /// <param name="parent">The name of the project whose datasets should be listed. For example, /// `projects/{project_id}/locations/{location_id}`.</param> public virtual ListRequest List(string parent) { return new ListRequest(service, parent); } /// <summary>Lists the health datasets in the current project.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListDatasetsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string parent) : base(service) { Parent = parent; InitParameters(); } /// <summary>The name of the project whose datasets should be listed. For example, /// `projects/{project_id}/locations/{location_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)] public virtual string Parent { get; private set; } /// <summary>The maximum number of items to return. Capped to 100 if not specified. May not be /// larger than 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 value returned from a previous List request, if any.</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}/datasets"; /// <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 = @"^projects/[^/]+/locations/[^/]+$", }); 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 dataset metadata.</summary> /// <param name="body">The body of the request.</param> /// <param name="name">Resource name of the dataset, of the form /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</param> public virtual PatchRequest Patch(Google.Apis.CloudHealthcare.v1.Data.Dataset body, string name) { return new PatchRequest(service, body, name); } /// <summary>Updates dataset metadata.</summary> public class PatchRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Dataset> { /// <summary>Constructs a new Patch request.</summary> public PatchRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.Dataset body, string name) : base(service) { Name = name; Body = body; InitParameters(); } /// <summary>Resource name of the dataset, of the form /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The update mask applies to the resource. For the `FieldMask` definition, see /// https://developers.google.com/protocol- /// buffers/docs/reference/google.protobuf#fieldmask</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.CloudHealthcare.v1.Data.Dataset 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); RequestParameters.Add("updateMask", new Google.Apis.Discovery.Parameter { Name = "updateMask", IsRequired = false, ParameterType = "query", DefaultValue = null, Pattern = null, }); } } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. Can /// return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</param> public virtual SetIamPolicyRequest SetIamPolicy(Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) { return new SetIamPolicyRequest(service, body, resource); } /// <summary>Sets the access control policy on the specified resource. Replaces any existing policy. Can /// return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.</summary> public class SetIamPolicyRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Policy> { /// <summary>Constructs a new SetIamPolicy request.</summary> public SetIamPolicyRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy is being specified. See the operation /// documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.SetIamPolicyRequest 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 => "setIamPolicy"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:setIamPolicy"; /// <summary>Initializes SetIamPolicy 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); } } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not /// exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation /// is designed to be used for building permission-aware UIs and command-line tools, not for /// authorization checking. This operation may "fail open" without warning.</summary> /// <param name="body">The body of the request.</param> /// <param name="resource">REQUIRED: The resource for which the policy detail is being requested. See the operation /// documentation for the appropriate value for this field.</param> public virtual TestIamPermissionsRequest TestIamPermissions(Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) { return new TestIamPermissionsRequest(service, body, resource); } /// <summary>Returns permissions that a caller has on the specified resource. If the resource does not /// exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation /// is designed to be used for building permission-aware UIs and command-line tools, not for /// authorization checking. This operation may "fail open" without warning.</summary> public class TestIamPermissionsRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsResponse> { /// <summary>Constructs a new TestIamPermissions request.</summary> public TestIamPermissionsRequest(Google.Apis.Services.IClientService service, Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest body, string resource) : base(service) { Resource = resource; Body = body; InitParameters(); } /// <summary>REQUIRED: The resource for which the policy detail is being requested. See the /// operation documentation for the appropriate value for this field.</summary> [Google.Apis.Util.RequestParameterAttribute("resource", Google.Apis.Util.RequestParameterType.Path)] public virtual string Resource { get; private set; } /// <summary>Gets or sets the body of this request.</summary> Google.Apis.CloudHealthcare.v1.Data.TestIamPermissionsRequest 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 => "testIamPermissions"; /// <summary>Gets the HTTP method.</summary> public override string HttpMethod => "POST"; /// <summary>Gets the REST path.</summary> public override string RestPath => "v1/{+resource}:testIamPermissions"; /// <summary>Initializes TestIamPermissions 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 = @"^projects/[^/]+/locations/[^/]+/datasets/[^/]+$", }); } } } /// <summary>Gets information about a location.</summary> /// <param name="name">Resource name for the location.</param> public virtual GetRequest Get(string name) { return new GetRequest(service, name); } /// <summary>Gets information about a location.</summary> public class GetRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.Location> { /// <summary>Constructs a new Get request.</summary> public GetRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>Resource name for the location.</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 = @"^projects/[^/]+/locations/[^/]+$", }); } } /// <summary>Lists information about the supported locations for this service.</summary> /// <param name="name">The resource that owns the locations collection, if applicable.</param> public virtual ListRequest List(string name) { return new ListRequest(service, name); } /// <summary>Lists information about the supported locations for this service.</summary> public class ListRequest : CloudHealthcareBaseServiceRequest<Google.Apis.CloudHealthcare.v1.Data.ListLocationsResponse> { /// <summary>Constructs a new List request.</summary> public ListRequest(Google.Apis.Services.IClientService service, string name) : base(service) { Name = name; InitParameters(); } /// <summary>The resource that owns the locations collection, if applicable.</summary> [Google.Apis.Util.RequestParameterAttribute("name", Google.Apis.Util.RequestParameterType.Path)] public virtual string Name { get; private set; } /// <summary>The standard list filter.</summary> [Google.Apis.Util.RequestParameterAttribute("filter", Google.Apis.Util.RequestParameterType.Query)] public virtual string Filter { get; set; } /// <summary>The standard list page size.</summary> [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)] public virtual System.Nullable<int> PageSize { get; set; } /// <summary>The standard list 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/{+name}/locations"; /// <summary>Initializes List 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 = @"^projects/[^/]+$", }); 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, }); } } } } } namespace Google.Apis.CloudHealthcare.v1.Data { /// <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>Associates `members` 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 members 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 identities 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 `members`. 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 request message for Operations.CancelOperation.</summary> public class CancelOperationRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Mask a string by replacing its characters with a fixed character.</summary> public class CharacterMaskConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Character to mask the sensitive values. If not supplied, defaults to "*".</summary> [Newtonsoft.Json.JsonPropertyAttribute("maskingCharacter")] public virtual string MaskingCharacter { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Creates a new message.</summary> public class CreateMessageRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>HL7v2 message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("message")] public virtual Message Message { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Pseudonymization method that generates surrogates via cryptographic hashing. Uses SHA-256. Outputs a /// base64-encoded representation of the hashed output (for example, /// `L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=`).</summary> public class CryptoHashConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>An AES 128/192/256 bit key. Causes the hash to be computed based on this key. A default key is /// generated for each Deidentify operation and is used wherever crypto_key is not specified.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cryptoKey")] public virtual string CryptoKey { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A message representing a health dataset. A health dataset represents a collection of healthcare data /// pertaining to one or more patients. This may include multiple modalities of healthcare data, such as electronic /// medical records or medical imaging data.</summary> public class Dataset : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Resource name of the dataset, of the form /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>The default timezone used by this dataset. Must be a either a valid IANA time zone name such as /// "America/New_York" or empty, which defaults to UTC. This is used for parsing times in resources, such as HL7 /// messages, where no explicit timezone is specified.</summary> [Newtonsoft.Json.JsonPropertyAttribute("timeZone")] public virtual string TimeZone { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Shift a date forward or backward in time by a random amount which is consistent for a given patient and /// crypto key combination.</summary> public class DateShiftConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>An AES 128/192/256 bit key. Causes the shift to be computed based on this key and the patient ID. A /// default key is generated for each Deidentify operation and is used wherever crypto_key is not /// specified.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cryptoKey")] public virtual string CryptoKey { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Configures de-id options specific to different types of content. Each submessage customizes the /// handling of an https://tools.ietf.org/html/rfc6838 media type or subtype. Configs are applied in a nested manner /// at runtime.</summary> public class DeidentifyConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Configures de-id of application/DICOM content.</summary> [Newtonsoft.Json.JsonPropertyAttribute("dicom")] public virtual DicomConfig Dicom { get; set; } /// <summary>Configures de-id of application/FHIR content.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fhir")] public virtual FhirConfig Fhir { get; set; } /// <summary>Configures de-identification of image pixels wherever they are found in the /// source_dataset.</summary> [Newtonsoft.Json.JsonPropertyAttribute("image")] public virtual ImageConfig Image { get; set; } /// <summary>Configures de-identification of text wherever it is found in the source_dataset.</summary> [Newtonsoft.Json.JsonPropertyAttribute("text")] public virtual TextConfig Text { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Redacts identifying information from the specified dataset.</summary> public class DeidentifyDatasetRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Deidentify configuration.</summary> [Newtonsoft.Json.JsonPropertyAttribute("config")] public virtual DeidentifyConfig Config { get; set; } /// <summary>The name of the dataset resource to create and write the redacted data to. * The destination /// dataset must not exist. * The destination dataset must be in the same project and location as the source /// dataset. De-identifying data across multiple projects or locations is not supported.</summary> [Newtonsoft.Json.JsonPropertyAttribute("destinationDataset")] public virtual string DestinationDataset { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Creates a new DICOM store with sensitive information de-identified.</summary> public class DeidentifyDicomStoreRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>De-identify configuration.</summary> [Newtonsoft.Json.JsonPropertyAttribute("config")] public virtual DeidentifyConfig Config { get; set; } /// <summary>The name of the DICOM store to create and write the redacted data to. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dicomStores/{dicom_store_id}`. * The /// destination dataset must exist. * The source dataset and destination dataset must both reside in the same /// project. De-identifying data across multiple projects is not supported. * The destination DICOM store must /// not exist. * The caller must have the necessary permissions to create the destination DICOM store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("destinationStore")] public virtual string DestinationStore { get; set; } /// <summary>Filter configuration.</summary> [Newtonsoft.Json.JsonPropertyAttribute("filterConfig")] public virtual DicomFilterConfig FilterConfig { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Creates a new FHIR store with sensitive information de-identified.</summary> public class DeidentifyFhirStoreRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Deidentify configuration.</summary> [Newtonsoft.Json.JsonPropertyAttribute("config")] public virtual DeidentifyConfig Config { get; set; } /// <summary>The name of the FHIR store to create and write the redacted data to. For example, /// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`. * The /// destination dataset must exist. * The source dataset and destination dataset must both reside in the same /// project. De-identifying data across multiple projects is not supported. * The destination FHIR store must /// exist. * The caller must have the healthcare.fhirResources.update permission to write to the destination /// FHIR store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("destinationStore")] public virtual string DestinationStore { get; set; } /// <summary>A filter specifying the resources to include in the output. If not specified, all resources are /// included in the output.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceFilter")] public virtual FhirFilter ResourceFilter { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Contains a summary of the Deidentify operation.</summary> public class DeidentifySummary : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies the parameters needed for de-identification of DICOM stores.</summary> public class DicomConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Tag filtering profile that determines which tags to keep/remove.</summary> [Newtonsoft.Json.JsonPropertyAttribute("filterProfile")] public virtual string FilterProfile { get; set; } /// <summary>List of tags to keep. Remove all other tags.</summary> [Newtonsoft.Json.JsonPropertyAttribute("keepList")] public virtual TagFilterList KeepList { get; set; } /// <summary>List of tags to remove. Keep all other tags.</summary> [Newtonsoft.Json.JsonPropertyAttribute("removeList")] public virtual TagFilterList RemoveList { get; set; } /// <summary>If true, skip replacing StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID, and /// MediaStorageSOPInstanceUID and leave them untouched. The Cloud Healthcare API regenerates these UIDs by /// default based on the DICOM Standard's reasoning: "Whilst these UIDs cannot be mapped directly to an /// individual out of context, given access to the original images, or to a database of the original images /// containing the UIDs, it would be possible to recover the individual's identity." /// http://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.9.html</summary> [Newtonsoft.Json.JsonPropertyAttribute("skipIdRedaction")] public virtual System.Nullable<bool> SkipIdRedaction { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies the filter configuration for DICOM resources.</summary> public class DicomFilterConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The Cloud Storage location of the filter configuration file. The `gcs_uri` must be in the format /// `gs://bucket/path/to/object`. The filter configuration file must contain a list of resource paths separated /// by newline characters (\n or \r\n). Each resource path must be in the format /// "/studies/{studyUID}[/series/{seriesUID}[/instances/{instanceUID}]]" The Cloud Healthcare API service /// account must have the `roles/storage.objectViewer` Cloud IAM role for this Cloud Storage location.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resourcePathsGcsUri")] public virtual string ResourcePathsGcsUri { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents a DICOM store.</summary> public class DicomStore : Google.Apis.Requests.IDirectResponseSchema { /// <summary>User-supplied key-value pairs used to organize DICOM stores. Label keys must be between 1 and 63 /// characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular /// expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a /// UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: /// [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>Resource name of the DICOM store, of the form `projects/{project_id}/locations/{location_id}/datase /// ts/{dataset_id}/dicomStores/{dicom_store_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Notification destination for new DICOM instances. Supplied by the client.</summary> [Newtonsoft.Json.JsonPropertyAttribute("notificationConfig")] public virtual NotificationConfig NotificationConfig { 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>Exports data from the specified DICOM store. If a given resource, such as a DICOM object with the same /// SOPInstance UID, already exists in the output, it is overwritten with the version in the source dataset. /// Exported DICOM data persists when the DICOM store from which it was exported is deleted.</summary> public class ExportDicomDataRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The BigQuery output destination. You can only export to a BigQuery dataset that's in the same /// project as the DICOM store you're exporting from. The BigQuery location requires two IAM roles: /// `roles/bigquery.dataEditor` and `roles/bigquery.jobUser`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("bigqueryDestination")] public virtual GoogleCloudHealthcareV1DicomBigQueryDestination BigqueryDestination { get; set; } /// <summary>The Cloud Storage output destination. The Cloud Storage location requires the /// `roles/storage.objectAdmin` Cloud IAM role.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsDestination")] public virtual GoogleCloudHealthcareV1DicomGcsDestination GcsDestination { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Returns additional information in regards to a completed DICOM store export.</summary> public class ExportDicomDataResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request to export resources.</summary> public class ExportResourcesRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The BigQuery output destination. The BigQuery location requires two IAM roles: /// `roles/bigquery.dataEditor` and `roles/bigquery.jobUser`. The output is one BigQuery table per resource /// type.</summary> [Newtonsoft.Json.JsonPropertyAttribute("bigqueryDestination")] public virtual GoogleCloudHealthcareV1FhirBigQueryDestination BigqueryDestination { get; set; } /// <summary>The Cloud Storage output destination. The Healthcare Service Agent account requires the /// `roles/storage.objectAdmin` role on the Cloud Storage location. The exported outputs are organized by FHIR /// resource types. The server creates one object per resource type. Each object contains newline delimited /// JSON, and each line is a FHIR resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsDestination")] public virtual GoogleCloudHealthcareV1FhirGcsDestination GcsDestination { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response when all resources export successfully. This structure is included in the response to describe /// the detailed outcome after the operation finishes successfully.</summary> public class ExportResourcesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <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() < 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' && 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>Specifies how to handle de-identification of a FHIR store.</summary> public class FhirConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Specifies FHIR paths to match and how to transform them. Any field that is not matched by a /// FieldMetadata is passed through to the output dataset unmodified. All extensions are removed in the /// output.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fieldMetadataList")] public virtual System.Collections.Generic.IList<FieldMetadata> FieldMetadataList { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Filter configuration.</summary> public class FhirFilter : Google.Apis.Requests.IDirectResponseSchema { /// <summary>List of resources to include in the output. If this list is empty or not specified, all resources /// are included in the output.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual Resources Resources { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents a FHIR store.</summary> public class FhirStore : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Whether to disable referential integrity in this FHIR store. This field is immutable after FHIR /// store creation. The default value is false, meaning that the API enforces referential integrity and fails /// the requests that result in inconsistent state in the FHIR store. When this field is set to true, the API /// skips referential integrity checks. Consequently, operations that rely on references, such as /// GetPatientEverything, do not return all the results if broken references exist.</summary> [Newtonsoft.Json.JsonPropertyAttribute("disableReferentialIntegrity")] public virtual System.Nullable<bool> DisableReferentialIntegrity { get; set; } /// <summary>Whether to disable resource versioning for this FHIR store. This field can not be changed after the /// creation of FHIR store. If set to false, which is the default behavior, all write operations cause /// historical versions to be recorded automatically. The historical versions can be fetched through the history /// APIs, but cannot be updated. If set to true, no historical versions are kept. The server sends errors for /// attempts to read the historical versions.</summary> [Newtonsoft.Json.JsonPropertyAttribute("disableResourceVersioning")] public virtual System.Nullable<bool> DisableResourceVersioning { get; set; } /// <summary>Whether this FHIR store has the [updateCreate capability](https://www.hl7.org/fhir /// /capabilitystatement-definitions.html#CapabilityStatement.rest.resource.updateCreate). This determines if /// the client can use an Update operation to create a new resource with a client-specified ID. If false, all /// IDs are server-assigned through the Create operation and attempts to update a non-existent resource return /// errors. Please treat the audit logs with appropriate levels of care if client-specified resource IDs contain /// sensitive data such as patient identifiers, those IDs are part of the FHIR resource path recorded in Cloud /// audit logs and Cloud Pub/Sub notifications.</summary> [Newtonsoft.Json.JsonPropertyAttribute("enableUpdateCreate")] public virtual System.Nullable<bool> EnableUpdateCreate { get; set; } /// <summary>User-supplied key-value pairs used to organize FHIR stores. Label keys must be between 1 and 63 /// characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular /// expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a /// UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: /// [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>Output only. Resource name of the FHIR store, of the form /// `projects/{project_id}/datasets/{dataset_id}/fhirStores/{fhir_store_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>If non-empty, publish all resource modifications of this FHIR store to this destination. The Cloud /// Pub/Sub message attributes contain a map with a string describing the action that has triggered the /// notification. For example, "action":"CreateResource".</summary> [Newtonsoft.Json.JsonPropertyAttribute("notificationConfig")] public virtual NotificationConfig NotificationConfig { get; set; } /// <summary>A list of streaming configs that configure the destinations of streaming export for every resource /// mutation in this FHIR store. Each store is allowed to have up to 10 streaming configs. After a new config is /// added, the next resource mutation is streamed to the new location in addition to the existing ones. When a /// location is removed from the list, the server stops streaming to that location. Before adding a new config, /// you must add the required [`bigquery.dataEditor`](https://cloud.google.com/bigquery/docs/access- /// control#bigquery.dataEditor) role to your project's **Cloud Healthcare Service Agent** [service /// account](https://cloud.google.com/iam/docs/service-accounts). Some lag (typically on the order of dozens of /// seconds) is expected before the results show up in the streaming destination.</summary> [Newtonsoft.Json.JsonPropertyAttribute("streamConfigs")] public virtual System.Collections.Generic.IList<StreamConfig> StreamConfigs { get; set; } /// <summary>The FHIR specification version that this FHIR store supports natively. This field is immutable /// after store creation. Requests are rejected if they contain FHIR resources of a different version. Version /// is required for every FHIR store.</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>Specifies FHIR paths to match, and how to handle de-identification of matching fields.</summary> public class FieldMetadata : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Deidentify action for one field.</summary> [Newtonsoft.Json.JsonPropertyAttribute("action")] public virtual string Action { get; set; } /// <summary>List of paths to FHIR fields to be redacted. Each path is a period-separated list where each /// component is either a field name or FHIR type name, for example: Patient, HumanName. For "choice" types /// (those defined in the FHIR spec with the form: field[x]) we use two separate components. For example, /// "deceasedAge.unit" is matched by "Deceased.Age.unit". Supported types are: AdministrativeGenderCode, Code, /// Date, DateTime, Decimal, HumanName, Id, LanguageCode, Markdown, Oid, String, Uri, Uuid, Xhtml. Base64Binary /// is also supported, but may only be kept as-is or have all the content removed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("paths")] public virtual System.Collections.Generic.IList<string> Paths { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Contains a summary of the DeidentifyDicomStore operation.</summary> public class GoogleCloudHealthcareV1DeidentifyDeidentifyDicomStoreSummary : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Contains a summary of the DeidentifyFhirStore operation.</summary> public class GoogleCloudHealthcareV1DeidentifyDeidentifyFhirStoreSummary : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The BigQuery table where the server writes the output.</summary> public class GoogleCloudHealthcareV1DicomBigQueryDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary>If the destination table already exists and this flag is `TRUE`, the table is overwritten by the /// contents of the DICOM store. If the flag is not set and the destination table already exists, the export /// call returns an error.</summary> [Newtonsoft.Json.JsonPropertyAttribute("force")] public virtual System.Nullable<bool> Force { get; set; } /// <summary>BigQuery URI to a table, up to 2000 characters long, in the format /// `bq://projectId.bqDatasetId.tableId`</summary> [Newtonsoft.Json.JsonPropertyAttribute("tableUri")] public virtual string TableUri { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The Cloud Storage location where the server writes the output and the export configuration.</summary> public class GoogleCloudHealthcareV1DicomGcsDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary>MIME types supported by DICOM spec. Each file is written in the following format: /// `.../{study_id}/{series_id}/{instance_id}[/{frame_number}].{extension}` The frame_number component exists /// only for multi-frame instances. Supported MIME types are consistent with supported formats in DICOMweb: /// https://cloud.google.com/healthcare/docs/dicom#retrieve_transaction. Specifically, the following are /// supported: - application/dicom; transfer-syntax=1.2.840.10008.1.2.1 (uncompressed DICOM) - /// application/dicom; transfer-syntax=1.2.840.10008.1.2.4.50 (DICOM with embedded JPEG Baseline) - /// application/dicom; transfer-syntax=1.2.840.10008.1.2.4.90 (DICOM with embedded JPEG 2000 Lossless Only) - /// application/dicom; transfer-syntax=1.2.840.10008.1.2.4.91 (DICOM with embedded JPEG 2000) - /// application/dicom; transfer-syntax=* (DICOM with no transcoding) - application/octet-stream; transfer- /// syntax=1.2.840.10008.1.2.1 (raw uncompressed PixelData) - application/octet-stream; transfer-syntax=* (raw /// PixelData in whatever format it was uploaded in) - image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50 /// (Consumer JPEG) - image/png The following extensions are used for output files: - application/dicom -> .dcm /// - image/jpeg -> .jpg - image/png -> .png - application/octet-stream -> no extension If unspecified, the /// instances are exported in the original DICOM format they were uploaded in.</summary> [Newtonsoft.Json.JsonPropertyAttribute("mimeType")] public virtual string MimeType { get; set; } /// <summary>The Cloud Storage destination to export to. URI for a Cloud Storage directory where the server /// writes the result files, in the format `gs://{bucket-id}/{path/to/destination/dir}`). If there is no /// trailing slash, the service appends one when composing the object path. The user is responsible for creating /// the Cloud Storage bucket referenced in `uri_prefix`.</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>Specifies the configuration for importing data from Cloud Storage.</summary> public class GoogleCloudHealthcareV1DicomGcsSource : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Points to a Cloud Storage URI containing file(s) with content only. The URI must be in the /// following format: `gs://{bucket_id}/{object_id}`. The URI can include wildcards in `object_id` and thus /// identify multiple files. Supported wildcards: '*' to match 0 or more non-separator characters '**' to match /// 0 or more characters (including separators). Must be used at the end of a path and with no other wildcards /// in the path. Can also be used with a file extension (such as .dcm), which imports all files with the /// extension in the specified directory and its sub-directories. For example, `gs://my-bucket/my- /// directory*.dcm` imports all files with .dcm extensions in `my-directory/` and its sub-directories. '?' to /// match 1 character All other URI formats are invalid. Files matching the wildcard are expected to contain /// content only, no metadata.</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>The configuration for exporting to BigQuery.</summary> public class GoogleCloudHealthcareV1FhirBigQueryDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary>BigQuery URI to an existing dataset, up to 2000 characters long, in the format /// `bq://projectId.bqDatasetId`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("datasetUri")] public virtual string DatasetUri { get; set; } /// <summary>If this flag is `TRUE`, all tables are deleted from the dataset before the new exported tables are /// written. If the flag is not set and the destination dataset contains tables, the export call returns an /// error.</summary> [Newtonsoft.Json.JsonPropertyAttribute("force")] public virtual System.Nullable<bool> Force { get; set; } /// <summary>The configuration for the exported BigQuery schema.</summary> [Newtonsoft.Json.JsonPropertyAttribute("schemaConfig")] public virtual SchemaConfig SchemaConfig { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The configuration for exporting to Cloud Storage.</summary> public class GoogleCloudHealthcareV1FhirGcsDestination : Google.Apis.Requests.IDirectResponseSchema { /// <summary>URI for a Cloud Storage directory where result files should be written, in the format of `gs /// ://{bucket-id}/{path/to/destination/dir}`. If there is no trailing slash, the service appends one when /// composing the object path. The user is responsible for creating the Cloud Storage bucket referenced in /// `uri_prefix`.</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>Specifies the configuration for importing data from Cloud Storage.</summary> public class GoogleCloudHealthcareV1FhirGcsSource : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Points to a Cloud Storage URI containing file(s) to import. The URI must be in the following /// format: `gs://{bucket_id}/{object_id}`. The URI can include wildcards in `object_id` and thus identify /// multiple files. Supported wildcards: * `*` to match 0 or more non-separator characters * `**` to match 0 or /// more characters (including separators). Must be used at the end of a path and with no other wildcards in the /// path. Can also be used with a file extension (such as .ndjson), which imports all files with the extension /// in the specified directory and its sub-directories. For example, `gs://my-bucket/my-directory*.ndjson` /// imports all files with `.ndjson` extensions in `my-directory/` and its sub-directories. * `?` to match 1 /// character Files matching the wildcard are expected to contain content only, no metadata.</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>Specifies where and whether to send notifications upon changes to a data store.</summary> public class Hl7V2NotificationConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Restricts notifications sent for messages matching a filter. If this is empty, all messages are /// matched. Syntax: https://cloud.google.com/appengine/docs/standard/python/search/query_strings The following /// fields and functions are available for filtering: * `message_type`, from the MSH-9.1 field. For example, /// `NOT message_type = "ADT"`. * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in the /// dataset's time_zone, from the MSH-7 segment. For example, `send_date < "2017-01-02"`. * `send_time`, the /// timestamp when the message was sent, using the RFC3339 time format for comparisons, from the MSH-7 segment. /// For example, `send_time < "2017-01-02T00:00:00-05:00"`. * `send_facility`, the care center that the message /// came from, from the MSH-4 segment. For example, `send_facility = "ABC"`. * `PatientId(value, type)`, which /// matches if the message lists a patient having an ID of the given value and type in the PID-2, PID-3, or /// PID-4 segments. For example, `PatientId("123456", "MRN")`. * `labels.x`, a string value of the label with /// key `x` as set using the Message.labels map. For example, `labels."priority"="high"`. The operator `:*` can /// be used to assert the existence of a label. For example, `labels."priority":*`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("filter")] public virtual string Filter { get; set; } /// <summary>The [Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/) topic that notifications of changes are /// published on. Supplied by the client. The notification is a `PubsubMessage` with the following fields: * /// `PubsubMessage.Data` contains the resource name. * `PubsubMessage.MessageId` is the ID of this notification. /// It's guaranteed to be unique within the topic. * `PubsubMessage.PublishTime` is the time when the message /// was published. Note that notifications are only sent if the topic is non-empty. [Topic /// names](https://cloud.google.com/pubsub/docs/overview#names) must be scoped to a project. The Cloud /// Healthcare API service account, service-PROJECT_NUMBER@gcp-sa-healthcare.iam.gserviceaccount.com, must have /// publisher permissions on the given Pub/Sub topic. Not having adequate permissions causes the calls that send /// notifications to fail. If a notification cannot be published to Cloud Pub/Sub, errors are logged to Cloud /// Logging. For more information, see [Viewing error logs in Cloud Logging](/healthcare/docs/how- /// tos/logging)).</summary> [Newtonsoft.Json.JsonPropertyAttribute("pubsubTopic")] public virtual string PubsubTopic { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Represents an HL7v2 store.</summary> public class Hl7V2Store : Google.Apis.Requests.IDirectResponseSchema { /// <summary>User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 /// characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular /// expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a /// UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: /// [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>Resource name of the HL7v2 store, of the form /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7v2_store_id}`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>A list of notification configs. Each configuration uses a filter to determine whether to publish a /// message (both Ingest & Create) on the corresponding notification destination. Only the message name is sent /// as part of the notification. Supplied by the client.</summary> [Newtonsoft.Json.JsonPropertyAttribute("notificationConfigs")] public virtual System.Collections.Generic.IList<Hl7V2NotificationConfig> NotificationConfigs { get; set; } /// <summary>The configuration for the parser. It determines how the server parses the messages.</summary> [Newtonsoft.Json.JsonPropertyAttribute("parserConfig")] public virtual ParserConfig ParserConfig { get; set; } /// <summary>Determines whether to reject duplicate messages. A duplicate message is a message with the same raw /// bytes as a message that has already been ingested/created in this HL7v2 store. The default value is false, /// meaning that the store accepts the duplicate messages and it also returns the same ACK message in the /// IngestMessageResponse as has been returned previously. Note that only one resource is created in the store. /// When this field is set to true, CreateMessage/IngestMessage requests with a duplicate message will be /// rejected by the store, and IngestMessageErrorDetail returns a NACK message upon rejection.</summary> [Newtonsoft.Json.JsonPropertyAttribute("rejectDuplicateMessage")] public virtual System.Nullable<bool> RejectDuplicateMessage { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't /// be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non- /// streaming API methods in the request as well as the response. It can be used as a top-level request field, which /// is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields /// and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string /// request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service /// ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc /// UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service /// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc /// UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes /// how the request and response bodies are handled, all other features will continue to work unchanged.</summary> public class HttpBody : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The HTTP Content-Type header value specifying the content type of the body.</summary> [Newtonsoft.Json.JsonPropertyAttribute("contentType")] public virtual string ContentType { get; set; } /// <summary>The HTTP request/response body as raw binary.</summary> [Newtonsoft.Json.JsonPropertyAttribute("data")] public virtual string Data { get; set; } /// <summary>Application specific response metadata. Must be set in the first response for streaming /// APIs.</summary> [Newtonsoft.Json.JsonPropertyAttribute("extensions")] public virtual System.Collections.Generic.IList<System.Collections.Generic.IDictionary<string, object>> Extensions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies how to handle de-identification of image pixels.</summary> public class ImageConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Determines how to redact text from image.</summary> [Newtonsoft.Json.JsonPropertyAttribute("textRedactionMode")] public virtual string TextRedactionMode { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Imports data into the specified DICOM store. Returns an error if any of the files to import are not /// DICOM files. This API accepts duplicate DICOM instances by ignoring the newly-pushed instance. It does not /// overwrite.</summary> public class ImportDicomDataRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Cloud Storage source data location and import configuration. The Cloud Storage location requires /// the `roles/storage.objectViewer` Cloud IAM role.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsSource")] public virtual GoogleCloudHealthcareV1DicomGcsSource GcsSource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Returns additional information in regards to a completed DICOM store import.</summary> public class ImportDicomDataResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request to import resources.</summary> public class ImportResourcesRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The content structure in the source location. If not specified, the server treats the input source /// files as BUNDLE.</summary> [Newtonsoft.Json.JsonPropertyAttribute("contentStructure")] public virtual string ContentStructure { get; set; } /// <summary>Cloud Storage source data location and import configuration. The Healthcare Service Agent account /// requires the `roles/storage.objectAdmin` role on the Cloud Storage location. Each Cloud Storage object /// should be a text file that contains the format specified in ContentStructure.</summary> [Newtonsoft.Json.JsonPropertyAttribute("gcsSource")] public virtual GoogleCloudHealthcareV1FhirGcsSource GcsSource { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Final response of importing resources. This structure is included in the response to describe the /// detailed outcome after the operation finishes successfully.</summary> public class ImportResourcesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A transformation to apply to text that is identified as a specific info_type.</summary> public class InfoTypeTransformation : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Config for character mask.</summary> [Newtonsoft.Json.JsonPropertyAttribute("characterMaskConfig")] public virtual CharacterMaskConfig CharacterMaskConfig { get; set; } /// <summary>Config for crypto hash.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cryptoHashConfig")] public virtual CryptoHashConfig CryptoHashConfig { get; set; } /// <summary>Config for date shift.</summary> [Newtonsoft.Json.JsonPropertyAttribute("dateShiftConfig")] public virtual DateShiftConfig DateShiftConfig { get; set; } /// <summary>InfoTypes to apply this transformation to. If this is not specified, the transformation applies to /// any info_type.</summary> [Newtonsoft.Json.JsonPropertyAttribute("infoTypes")] public virtual System.Collections.Generic.IList<string> InfoTypes { get; set; } /// <summary>Config for text redaction.</summary> [Newtonsoft.Json.JsonPropertyAttribute("redactConfig")] public virtual RedactConfig RedactConfig { get; set; } /// <summary>Config for replace with InfoType.</summary> [Newtonsoft.Json.JsonPropertyAttribute("replaceWithInfoTypeConfig")] public virtual ReplaceWithInfoTypeConfig ReplaceWithInfoTypeConfig { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Ingests a message into the specified HL7v2 store.</summary> public class IngestMessageRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>HL7v2 message to ingest.</summary> [Newtonsoft.Json.JsonPropertyAttribute("message")] public virtual Message Message { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Acknowledges that a message has been ingested into the specified HL7v2 store.</summary> public class IngestMessageResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>HL7v2 ACK message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("hl7Ack")] public virtual string Hl7Ack { get; set; } /// <summary>Created message resource.</summary> [Newtonsoft.Json.JsonPropertyAttribute("message")] public virtual Message Message { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Lists the available datasets.</summary> public class ListDatasetsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The first page of datasets.</summary> [Newtonsoft.Json.JsonPropertyAttribute("datasets")] public virtual System.Collections.Generic.IList<Dataset> Datasets { get; set; } /// <summary>Token to retrieve the next page of results, or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Lists the DICOM stores in the given dataset.</summary> public class ListDicomStoresResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The returned DICOM stores. Won't be more DICOM stores than the value of page_size in the /// request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("dicomStores")] public virtual System.Collections.Generic.IList<DicomStore> DicomStores { get; set; } /// <summary>Token to retrieve the next page of results or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Lists the FHIR stores in the given dataset.</summary> public class ListFhirStoresResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The returned FHIR stores. Won't be more FHIR stores than the value of page_size in the /// request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("fhirStores")] public virtual System.Collections.Generic.IList<FhirStore> FhirStores { get; set; } /// <summary>Token to retrieve the next page of results or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Lists the HL7v2 stores in the given dataset.</summary> public class ListHl7V2StoresResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The returned HL7v2 stores. Won't be more HL7v2 stores than the value of page_size in the /// request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("hl7V2Stores")] public virtual System.Collections.Generic.IList<Hl7V2Store> Hl7V2Stores { get; set; } /// <summary>Token to retrieve the next page of results or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The response message for Locations.ListLocations.</summary> public class ListLocationsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A list of locations that matches the specified filter in the request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("locations")] public virtual System.Collections.Generic.IList<Location> Locations { get; set; } /// <summary>The standard List next-page token.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Lists the messages in the specified HL7v2 store.</summary> public class ListMessagesResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The returned Messages. Won't be more Messages than the value of page_size in the request. See view /// for populated fields.</summary> [Newtonsoft.Json.JsonPropertyAttribute("hl7V2Messages")] public virtual System.Collections.Generic.IList<Message> Hl7V2Messages { get; set; } /// <summary>Token to retrieve the next page of results or empty if there are no more results in the /// list.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The response message for Operations.ListOperations.</summary> public class ListOperationsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The standard List next-page token.</summary> [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")] public virtual string NextPageToken { get; set; } /// <summary>A list of operations that matches the specified filter in the request.</summary> [Newtonsoft.Json.JsonPropertyAttribute("operations")] public virtual System.Collections.Generic.IList<Operation> Operations { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A resource that represents Google Cloud Platform location.</summary> public class Location : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The friendly name for this location, typically a nearby city name. For example, "Tokyo".</summary> [Newtonsoft.Json.JsonPropertyAttribute("displayName")] public virtual string DisplayName { get; set; } /// <summary>Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us- /// east1"}</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The canonical id for this location. For example: `"us-east1"`.</summary> [Newtonsoft.Json.JsonPropertyAttribute("locationId")] public virtual string LocationId { get; set; } /// <summary>Service-specific metadata. For example the available capacity at the given location.</summary> [Newtonsoft.Json.JsonPropertyAttribute("metadata")] public virtual System.Collections.Generic.IDictionary<string, object> Metadata { get; set; } /// <summary>Resource name for the location, which may vary between implementations. For example: `"projects /// /example-project/locations/us-east1"`</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>A complete HL7v2 message. See [Introduction to HL7 Standards] /// (https://www.hl7.org/implement/standards/index.cfm?ref=common) for details on the standard.</summary> public class Message : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Output only. The datetime when the message was created. Set by the server.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>Raw message bytes.</summary> [Newtonsoft.Json.JsonPropertyAttribute("data")] public virtual string Data { get; set; } /// <summary>User-supplied key-value pairs used to organize HL7v2 stores. Label keys must be between 1 and 63 /// characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular /// expression: \p{Ll}\p{Lo}{0,62} Label values are optional, must be between 1 and 63 characters long, have a /// UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: /// [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be associated with a given store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("labels")] public virtual System.Collections.Generic.IDictionary<string, string> Labels { get; set; } /// <summary>The message type for this message. MSH-9.1.</summary> [Newtonsoft.Json.JsonPropertyAttribute("messageType")] public virtual string MessageType { get; set; } /// <summary>Resource name of the Message, of the form /// `projects/{project_id}/datasets/{dataset_id}/hl7V2Stores/{hl7_v2_store_id}/messages/{message_id}`. Assigned /// by the server.</summary> [Newtonsoft.Json.JsonPropertyAttribute("name")] public virtual string Name { get; set; } /// <summary>Output only. The parsed version of the raw message data.</summary> [Newtonsoft.Json.JsonPropertyAttribute("parsedData")] public virtual ParsedData ParsedData { get; set; } /// <summary>All patient IDs listed in the PID-2, PID-3, and PID-4 segments of this message.</summary> [Newtonsoft.Json.JsonPropertyAttribute("patientIds")] public virtual System.Collections.Generic.IList<PatientId> PatientIds { get; set; } /// <summary>The hospital that this message came from. MSH-4.</summary> [Newtonsoft.Json.JsonPropertyAttribute("sendFacility")] public virtual string SendFacility { get; set; } /// <summary>The datetime the sending application sent this message. MSH-7.</summary> [Newtonsoft.Json.JsonPropertyAttribute("sendTime")] public virtual object SendTime { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Specifies where to send notifications upon changes to a data store.</summary> public class NotificationConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The [Cloud Pub/Sub](https://cloud.google.com/pubsub/docs/) topic that notifications of changes are /// published on. Supplied by the client. PubsubMessage.Data contains the resource name. PubsubMessage.MessageId /// is the ID of this message. It is guaranteed to be unique within the topic. PubsubMessage.PublishTime is the /// time at which the message was published. Notifications are only sent if the topic is non-empty. [Topic /// names](https://cloud.google.com/pubsub/docs/overview#names) must be scoped to a project. Cloud Healthcare /// API service account must have publisher permissions on the given Cloud Pub/Sub topic. Not having adequate /// permissions causes the calls that send notifications to fail. If a notification can't be published to Cloud /// Pub/Sub, errors are logged to Cloud Logging (see [Viewing logs](/healthcare/docs/how-tos/logging)). If the /// number of errors exceeds a certain rate, some aren't submitted. Note that not all operations trigger /// notifications, see [Configuring Pub/Sub notifications](https://cloud.google.com/healthcare/docs/how- /// tos/pubsub) for specific details.</summary> [Newtonsoft.Json.JsonPropertyAttribute("pubsubTopic")] public virtual string PubsubTopic { 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>OperationMetadata provides information about the operation execution. Returned in the long-running /// operation's metadata field.</summary> public class OperationMetadata : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The name of the API method that initiated the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("apiMethodName")] public virtual string ApiMethodName { get; set; } /// <summary>Specifies if cancellation was requested for the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("cancelRequested")] public virtual System.Nullable<bool> CancelRequested { get; set; } [Newtonsoft.Json.JsonPropertyAttribute("counter")] public virtual ProgressCounter Counter { get; set; } /// <summary>The time at which the operation was created by the API.</summary> [Newtonsoft.Json.JsonPropertyAttribute("createTime")] public virtual object CreateTime { get; set; } /// <summary>The time at which execution was completed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("endTime")] public virtual object EndTime { get; set; } /// <summary>A link to audit and error logs in the log viewer. Error logs are generated only by some operations, /// listed at [Viewing logs](/healthcare/docs/how-tos/logging).</summary> [Newtonsoft.Json.JsonPropertyAttribute("logsUrl")] public virtual string LogsUrl { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The content of a HL7v2 message in a structured format.</summary> public class ParsedData : Google.Apis.Requests.IDirectResponseSchema { [Newtonsoft.Json.JsonPropertyAttribute("segments")] public virtual System.Collections.Generic.IList<Segment> Segments { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>The configuration for the parser. It determines how the server parses the messages.</summary> public class ParserConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Determines whether messages with no header are allowed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("allowNullHeader")] public virtual System.Nullable<bool> AllowNullHeader { get; set; } /// <summary>Byte(s) to use as the segment terminator. If this is unset, '\r' is used as segment /// terminator.</summary> [Newtonsoft.Json.JsonPropertyAttribute("segmentTerminator")] public virtual string SegmentTerminator { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A patient identifier and associated type.</summary> public class PatientId : Google.Apis.Requests.IDirectResponseSchema { /// <summary>ID type. For example, MRN or NHS.</summary> [Newtonsoft.Json.JsonPropertyAttribute("type")] public virtual string Type { get; set; } /// <summary>The patient's unique identifier.</summary> [Newtonsoft.Json.JsonPropertyAttribute("value")] public virtual string Value { 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` to a single `role`. /// Members 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 < 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 < 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` to 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 member.</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>ProgressCounter provides counters to describe an operation's progress.</summary> public class ProgressCounter : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The number of units that failed in the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("failure")] public virtual System.Nullable<long> Failure { get; set; } /// <summary>The number of units that are pending in the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("pending")] public virtual System.Nullable<long> Pending { get; set; } /// <summary>The number of units that succeeded in the operation.</summary> [Newtonsoft.Json.JsonPropertyAttribute("success")] public virtual System.Nullable<long> Success { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Define how to redact sensitive values. Default behaviour is erase. For example, "My name is Jane." /// becomes "My name is ."</summary> public class RedactConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>When using the INSPECT_AND_TRANSFORM action, each match is replaced with the name of the info_type. For /// example, "My name is Jane" becomes "My name is [PERSON_NAME]." The TRANSFORM action is equivalent to /// redacting.</summary> public class ReplaceWithInfoTypeConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A list of FHIR resources.</summary> public class Resources : Google.Apis.Requests.IDirectResponseSchema { /// <summary>List of resources IDs. For example, "Patient/1234".</summary> [Newtonsoft.Json.JsonPropertyAttribute("resources")] public virtual System.Collections.Generic.IList<string> ResourcesValue { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Configuration for the FHIR BigQuery schema. Determines how the server generates the schema.</summary> public class SchemaConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The depth for all recursive structures in the output analytics schema. For example, `concept` in /// the CodeSystem resource is a recursive structure; when the depth is 2, the CodeSystem table will have a /// column called `concept.concept` but not `concept.concept.concept`. If not specified or set to 0, the server /// will use the default value 2. The maximum depth allowed is 5.</summary> [Newtonsoft.Json.JsonPropertyAttribute("recursiveStructureDepth")] public virtual System.Nullable<long> RecursiveStructureDepth { get; set; } /// <summary>Specifies the output schema type. Schema type is required.</summary> [Newtonsoft.Json.JsonPropertyAttribute("schemaType")] public virtual string SchemaType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request to search the resources in the specified FHIR store.</summary> public class SearchResourcesRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The FHIR resource type to search, such as Patient or Observation. For a complete list, see the FHIR /// Resource Index ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html), /// [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), /// [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)).</summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceType")] public virtual string ResourceType { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>A segment in a structured format.</summary> public class Segment : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A mapping from the positional location to the value. The key string uses zero-based indexes /// separated by dots to identify Fields, components and sub-components. A bracket notation is also used to /// identify different instances of a repeated field. Regex for key: (\d+)(\[\d+\])?(.\d+)?(.\d+)? Examples of /// (key, value) pairs: * (0.1, "hemoglobin") denotes that the first component of Field 0 has the value /// "hemoglobin". * (1.1.2, "CBC") denotes that the second sub-component of the first component of Field 1 has /// the value "CBC". * (1[0].1, "HbA1c") denotes that the first component of the first Instance of Field 1, /// which is repeated, has the value "HbA1c".</summary> [Newtonsoft.Json.JsonPropertyAttribute("fields")] public virtual System.Collections.Generic.IDictionary<string, string> Fields { get; set; } /// <summary>A string that indicates the type of segment. For example, EVN or PID.</summary> [Newtonsoft.Json.JsonPropertyAttribute("segmentId")] public virtual string SegmentId { get; set; } /// <summary>Set ID for segments that can be in a set. This can be empty if it's missing or isn't /// applicable.</summary> [Newtonsoft.Json.JsonPropertyAttribute("setId")] public virtual string SetId { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request message for `SetIamPolicy` method.</summary> public class SetIamPolicyRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to /// a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) /// might reject them.</summary> [Newtonsoft.Json.JsonPropertyAttribute("policy")] public virtual Policy Policy { get; set; } /// <summary>OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask /// will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, /// etag"`</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>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>Contains configuration for streaming FHIR export.</summary> public class StreamConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The destination BigQuery structure that contains both the dataset location and corresponding schema /// config. The output is organized in one table per resource type. The server reuses the existing tables (if /// any) that are named after the resource types. For example, "Patient", "Observation". When there is no /// existing table for a given resource type, the server attempts to create one. When a table schema doesn't /// align with the schema config, either because of existing incompatible schema or out of band incompatible /// modification, the server does not stream in new data. BigQuery imposes a 1 MB limit on streaming insert row /// size, therefore any resource mutation that generates more than 1 MB of BigQuery data is not streamed. One /// resolution in this case is to delete the incompatible table and let the server recreate one, though the /// newly created table only contains data after the table recreation. Results are appended to the corresponding /// BigQuery tables. Different versions of the same resource are distinguishable by the meta.versionId and /// meta.lastUpdated columns. The operation (CREATE/UPDATE/DELETE) that results in the new version is recorded /// in the meta.tag. The tables contain all historical resource versions since streaming was enabled. For query /// convenience, the server also creates one view per table of the same name containing only the current /// resource version. The streamed data in the BigQuery dataset is not guaranteed to be completely unique. The /// combination of the id and meta.versionId columns should ideally identify a single unique row. But in rare /// cases, duplicates may exist. At query time, users may use the SQL select statement to keep only one of the /// duplicate rows given an id and meta.versionId pair. Alternatively, the server created view mentioned above /// also filters out duplicates. If a resource mutation cannot be streamed to BigQuery, errors are logged to /// Cloud Logging. For more information, see [Viewing error logs in Cloud Logging](/healthcare/docs/how- /// tos/logging)).</summary> [Newtonsoft.Json.JsonPropertyAttribute("bigqueryDestination")] public virtual GoogleCloudHealthcareV1FhirBigQueryDestination BigqueryDestination { get; set; } /// <summary>Supply a FHIR resource type (such as "Patient" or "Observation"). See https://www.hl7.org/fhir /// /valueset-resource-types.html for a list of all FHIR resource types. The server treats an empty list as an /// intent to stream all the supported resource types in this FHIR store.</summary> [Newtonsoft.Json.JsonPropertyAttribute("resourceTypes")] public virtual System.Collections.Generic.IList<string> ResourceTypes { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>List of tags to be filtered.</summary> public class TagFilterList : Google.Apis.Requests.IDirectResponseSchema { /// <summary>Tags to be filtered. Tags must be DICOM Data Elements, File Meta Elements, or Directory Structuring /// Elements, as defined at: http://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,. /// They may be provided by "Keyword" or "Tag". For example "PatientID", "00100010".</summary> [Newtonsoft.Json.JsonPropertyAttribute("tags")] public virtual System.Collections.Generic.IList<string> Tags { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Request message for `TestIamPermissions` method.</summary> public class TestIamPermissionsRequest : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or /// 'storage.*') are not allowed. For more information see [IAM /// Overview](https://cloud.google.com/iam/docs/overview#permissions).</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } /// <summary>Response message for `TestIamPermissions` method.</summary> public class TestIamPermissionsResponse : Google.Apis.Requests.IDirectResponseSchema { /// <summary>A subset of `TestPermissionsRequest.permissions` that the caller is allowed.</summary> [Newtonsoft.Json.JsonPropertyAttribute("permissions")] public virtual System.Collections.Generic.IList<string> Permissions { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } public class TextConfig : Google.Apis.Requests.IDirectResponseSchema { /// <summary>The transformations to apply to the detected data.</summary> [Newtonsoft.Json.JsonPropertyAttribute("transformations")] public virtual System.Collections.Generic.IList<InfoTypeTransformation> Transformations { get; set; } /// <summary>The ETag of the item.</summary> public virtual string ETag { get; set; } } }
63.071967
204
0.53364
[ "Apache-2.0" ]
17666349388/google-api-dotnet-client
Src/Generated/Google.Apis.CloudHealthcare.v1/Google.Apis.CloudHealthcare.v1.cs
527,597
C#
using System; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Configuration; using Steamboat.Data.Entities; using Steamboat.Data.Repos; using Steamboat.Steam; using Steamboat.Steam.Dtos; namespace Steamboat.Crons.Apps { internal class AppListUpdaterCron : ICron { private readonly IAppListApiService _appListApiService; private readonly IAppRepository _appRepository; private readonly IAppListLastUpdateTimeStore _lastUpdateTimeStore; public AppListUpdaterCron( IAppListApiService appListApiService, IAppRepository appRepository, IAppListLastUpdateTimeStore lastUpdateTimeStore) { _appListApiService = appListApiService; _appRepository = appRepository; _lastUpdateTimeStore = lastUpdateTimeStore; } public async Task Update(CancellationToken cancellationToken) { Console.WriteLine("Updating app list..."); DateTimeOffset? lastUpdate = await _lastUpdateTimeStore.GetAsync(); var apps = await _appListApiService.GetAsync(lastUpdate, cancellationToken); Console.WriteLine($"Fetched a total of {apps.Count} apps"); await _appRepository.AddOrUpdateAppsAsync(apps.Select(MapApp), false, false); await _lastUpdateTimeStore.StoreAsync(DateTimeOffset.UtcNow); } private static AppEntity MapApp(SteamAppDto appDto) { return new() { Id = appDto.AppId, Name = appDto.Name, LastModified = appDto.LastModified, PriceChangeNumber = appDto.PriceChangeNumber, }; } public class Config : CronConfig<AppListUpdaterCron> { private readonly IConfiguration _configuration; public Config(IConfiguration configuration) { _configuration = configuration; } public override int UpdateIntervalMs { get { var intervalHours = _configuration.GetValue<int?>("AppListUpdateIntervalHours"); intervalHours ??= ConfigDefaults.AppListUpdateIntervalHours; return (int)TimeSpan.FromHours(intervalHours.Value).TotalMilliseconds; } } public override int? UpdateTimeoutMs => (int)TimeSpan.FromMinutes(30).TotalMilliseconds; } } }
33.789474
100
0.630062
[ "MIT" ]
daver32/Steamboat
Steamboat/Crons/Apps/AppListUpdaterCron.cs
2,570
C#
using System; using System.Threading; using System.Threading.Tasks; namespace GenericBuffer.Core { public class AsyncGenericBuffer<T> : IAsyncGenericBuffer<T> { private readonly SemaphoreSlim _semaphoreSlim_ = new SemaphoreSlim(1); private readonly Func<T, CancellationToken, Task<T>> _factory_; private readonly Func<DateTime> _clock_; private readonly TimeSpan _bufferingPeriod_; private DateTime validUntil = DateTime.MinValue; private T buffer; public AsyncGenericBuffer(Func<T, CancellationToken, Task<T>> factory, T initialValue, TimeSpan bufferingPeriod) : this(factory, initialValue, bufferingPeriod, () => DateTime.UtcNow) { } public AsyncGenericBuffer(Func<T, CancellationToken, Task<T>> factory, T initialValue, TimeSpan bufferingPeriod, Func<DateTime> clock) { _factory_ = factory ?? throw new ArgumentNullException(nameof(factory)); _clock_ = clock ?? throw new ArgumentNullException(nameof(clock)); _bufferingPeriod_ = bufferingPeriod; buffer = initialValue; } public AsyncGenericBuffer(Func<CancellationToken, Task<T>> factory, TimeSpan bufferingPeriod) : this(factory, bufferingPeriod, () => DateTime.UtcNow) { } public AsyncGenericBuffer(Func<CancellationToken, Task<T>> factory, TimeSpan bufferingPeriod, Func<DateTime> clock) : this(factory, default, bufferingPeriod, clock) { } public AsyncGenericBuffer(Func<CancellationToken, Task<T>> factory, T initialValue, TimeSpan bufferingPeriod, Func<DateTime> clock) { if (factory == null) throw new ArgumentNullException(nameof(factory)); _factory_ = (_, ct) => factory(ct); _clock_ = clock ?? throw new ArgumentNullException(nameof(clock)); ; _bufferingPeriod_ = bufferingPeriod; buffer = initialValue; } public async Task ResetAsync(CancellationToken cancellationToken) { await _semaphoreSlim_.WaitAsync(cancellationToken); try { buffer = default; validUntil = DateTime.MinValue; } finally { _semaphoreSlim_.Release(); } } public async Task<T> ForceRefreshAsync(CancellationToken cancellationToken) { return await RefreshAsync(false, cancellationToken); } public async Task<T> GetValueAsync(CancellationToken cancellationToken) { if (_clock_() < validUntil) return buffer; return await RefreshAsync(true, cancellationToken); } private DateTime NewValidUntil() => _clock_().Add(_bufferingPeriod_); private async Task<T> RefreshAsync(Boolean considerBuffer, CancellationToken cancellationToken) { await _semaphoreSlim_.WaitAsync(cancellationToken); try { if (considerBuffer && _clock_() < validUntil) return buffer; buffer = await _factory_(buffer, cancellationToken); validUntil = NewValidUntil(); return buffer; } finally { _semaphoreSlim_.Release(); } } } }
38.689655
194
0.623292
[ "MIT" ]
chyczewski-maciej/GenericBuffer
GenericBuffer.Core/AsyncGenericBuffer.cs
3,368
C#
using System; using System.Collections.Generic; using System.Text; namespace OpenMelissa.Models { /// <summary> /// ELot Number and Order /// </summary> public class ELotOrder : IEquatable<ELotOrder> { /// <summary> /// Where the current address falls in the delivery order within the ZIP+4 /// </summary> public string Number { get; set; } /// <summary> /// <para>Order returns the letters "A" or "D" to indicate whether the Post Office delviers mail within /// the ZIP+4 in ascending or descending order.</para> /// <para>Example, if the eLot number is 1 and the eLot Order is "D", then the address is typically the last delivery of the day.</para> /// </summary> public string Order { get; set; } public ELotOrder() { } public ELotOrder(string eLotNumber, string eLotOrder) { Number = eLotNumber; Order = eLotOrder; } public bool Equals(ELotOrder other) { return Number == other.Number && Order == other.Order; } } }
31.675676
145
0.56314
[ "MIT" ]
teh-random-name/OpenMelissa
src/Models/ElotOrder.cs
1,174
C#
//------------------------------------------------------------ // Game Framework // Copyright © 2013-2021 Jiang Yin. All rights reserved. // Homepage: https://gameframework.cn/ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ using GameFramework; using GameFramework.DataTable; using UnityEngine; namespace BinBall { public class ShowGame : GameBase { public override GameMode GameMode { get { return GameMode.Show; } } public float Score { get { float realScore = m_TimeScore; if (m_MyBall != null) { realScore += m_MyBall.Score; } return realScore; } } private float m_TimeScore; public override void Initialize(BinBall ball) { base.Initialize(ball); m_TimeScore = 0; if (ball != null) { ball.ResumeBall(); } } public override void Shutdown() { base.Shutdown(); } public override void Update(float elapseSeconds, float realElapseSeconds) { base.Update(elapseSeconds, realElapseSeconds); m_TimeScore += realElapseSeconds * 0.5f; if (m_MyBall != null) { if (!m_MyBall.Visible) { GameOver = true; } } } } }
24.439394
81
0.433354
[ "MIT" ]
ZeroyiQ/StarForce
Assets/GameMain/Scripts/Game/ShowGame.cs
1,616
C#
using System; using System.Collections.Generic; using System.Text; using Core.Entities.Abstract; namespace Core.Entities.Concrete { public class OperationClaim : IEntity { public int Id { get; set; } public string OperationClaimName { get; set; } } }
20.071429
54
0.690391
[ "MIT" ]
melihsahtiyan/CarRentalProject
Core/Entities/Concrete/OperationClaim.cs
283
C#
// Copyright 2009, Novell, Inc. // Copyright 2010, Novell, Inc. // Copyright 2011, 2014 Xamarin Inc // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using Foundation; using ObjCRuntime; using AudioToolbox; using System; namespace AVFoundation { #if !WATCH public partial class AVAudioPlayer { public static AVAudioPlayer FromUrl (NSUrl url, out NSError error) { unsafe { IntPtr errhandle; IntPtr ptrtohandle = (IntPtr) (&errhandle); var ap = new AVAudioPlayer (url, ptrtohandle); if (ap.Handle == IntPtr.Zero){ error = (NSError) Runtime.GetNSObject (errhandle); return null; } else error = null; return ap; } } public static AVAudioPlayer FromUrl (NSUrl url) { unsafe { var ap = new AVAudioPlayer (url, IntPtr.Zero); if (ap.Handle == IntPtr.Zero) return null; return ap; } } public static AVAudioPlayer FromData (NSData data, out NSError error) { unsafe { IntPtr errhandle; IntPtr ptrtohandle = (IntPtr) (&errhandle); var ap = new AVAudioPlayer (data, ptrtohandle); if (ap.Handle == IntPtr.Zero){ error = (NSError) Runtime.GetNSObject (errhandle); return null; } else error = null; return ap; } } public static AVAudioPlayer FromData (NSData data) { unsafe { var ap = new AVAudioPlayer (data, IntPtr.Zero); if (ap.Handle == IntPtr.Zero) return null; return ap; } } } #endif // !WATCH }
27.988764
73
0.696507
[ "BSD-3-Clause" ]
NormanChiflen/xamarin-all-IOS
src/AVFoundation/AVAudioPlayer.cs
2,491
C#
using System; using System.Collections.Generic; using System.Linq; using WarpDeck.Application.Key; using WarpDeck.Domain.KeyAction; using WarpDeck.Domain.KeyAction.Descriptors; using WindowsInput; using WindowsInput.Events; namespace WarpDeck.Plugins.Actions.Macro { public class KeyMacro : KeyAction<KeyMacroModelModel>, IHasActionParameters { public KeyMacro(Dictionary<string, string> parameters) : base(parameters) { } public KeyMacro() { } public override void StartAction() { string keys = Model.Keys; EventBuilder eventBuilder = Simulate.Events(); string[] events = keys.Split('|'); foreach (string keyEvent in events) { if (keyEvent.StartsWith('(') && keyEvent.EndsWith(")")) eventBuilder.ClickChord(ParseChord(keyEvent)); else eventBuilder.Click(keyEvent.Trim('\'')); } eventBuilder.Invoke(); } private KeyCode[] ParseChord(string chordString) { string[] chordParts = chordString.Trim('(', ')').Split('+'); return chordParts.Select(ParseKeyCode).ToArray(); } private KeyCode ParseKeyCode(string chordPart) { return Enum.Parse<KeyCode>(chordPart, true); } public ActionParamDescriptorSet SpecifyParameters() { return new ActionParamDescriptorSet() { Parameters = { new ActionParamDescriptor() { Name = "keys", FriendlyName = "Keys", Description = "The key macro to press" } } }; } } }
27.441176
81
0.530011
[ "MIT" ]
armunro/WarpDeck
WarpDeck.Plugins/Actions/Macro/KeyMacro.cs
1,866
C#
namespace rest_api_blueprint.Services.Authentication { public interface IAccessTokenService : IBaseJwtService { } }
19.285714
59
0.725926
[ "MIT" ]
florianrubel/rest-api-blueprint
rest-api-blueprint/Services/Authentication/AccessTokenService.Interface.cs
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. #nullable disable using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests { internal static partial class Extensions { public static AssemblySymbol GetReferencedAssemblySymbol(this CSharpCompilation compilation, MetadataReference reference) { return (AssemblySymbol)compilation.GetAssemblyOrModuleSymbol(reference); } public static ModuleSymbol GetReferencedModuleSymbol(this CSharpCompilation compilation, MetadataReference reference) { return (ModuleSymbol)compilation.GetAssemblyOrModuleSymbol(reference); } public static TypeDeclarationSyntax AsTypeDeclarationSyntax(this SyntaxNode node) { return node as TypeDeclarationSyntax; } public static MethodDeclarationSyntax AsMethodDeclarationSyntax(this SyntaxNode node) { return node as MethodDeclarationSyntax; } public static SyntaxNodeOrToken FindNodeOrTokenByKind(this SyntaxTree syntaxTree, SyntaxKind kind, int occurrence = 1) { if (!(occurrence > 0)) { throw new ArgumentException("Specified value must be greater than zero.", nameof(occurrence)); } SyntaxNodeOrToken foundNode = default(SyntaxNodeOrToken); if (TryFindNodeOrToken(syntaxTree.GetCompilationUnitRoot(), kind, ref occurrence, ref foundNode)) { return foundNode; } return default(SyntaxNodeOrToken); } private static bool TryFindNodeOrToken(SyntaxNodeOrToken node, SyntaxKind kind, ref int occurrence, ref SyntaxNodeOrToken foundNode) { if (node.IsKind(kind)) { occurrence--; if (occurrence == 0) { foundNode = node; return true; } } // we should probably did into trivia if this is a Token, but we won't foreach (var child in node.ChildNodesAndTokens()) { if (TryFindNodeOrToken(child, kind, ref occurrence, ref foundNode)) { return true; } } return false; } public static AssemblySymbol[] BoundReferences(this AssemblySymbol @this) { return (from m in @this.Modules from @ref in m.GetReferencedAssemblySymbols() select @ref).ToArray(); } public static SourceAssemblySymbol SourceAssembly(this CSharpCompilation @this) { return (SourceAssemblySymbol)@this.Assembly; } public static bool HasUnresolvedReferencesByComparisonTo(this AssemblySymbol @this, AssemblySymbol that) { var thisRefs = @this.BoundReferences(); var thatRefs = that.BoundReferences(); for (int i = 0; i < Math.Max(thisRefs.Length, thatRefs.Length); i++) { if (thisRefs[i].IsMissing && !thatRefs[i].IsMissing) { return true; } } return false; } public static bool RepresentsTheSameAssemblyButHasUnresolvedReferencesByComparisonTo(this AssemblySymbol @this, AssemblySymbol that) { var thisPEAssembly = @this as Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEAssemblySymbol; if (thisPEAssembly != null) { var thatPEAssembly = that as Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEAssemblySymbol; return thatPEAssembly != null && ReferenceEquals(thisPEAssembly.Assembly, thatPEAssembly.Assembly) && @this.HasUnresolvedReferencesByComparisonTo(that); } var thisRetargetingAssembly = @this as Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingAssemblySymbol; if (thisRetargetingAssembly != null) { var thatRetargetingAssembly = that as Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingAssemblySymbol; if (thatRetargetingAssembly != null) { return ReferenceEquals(thisRetargetingAssembly.UnderlyingAssembly, thatRetargetingAssembly.UnderlyingAssembly) && @this.HasUnresolvedReferencesByComparisonTo(that); } var thatSourceAssembly = that as SourceAssemblySymbol; return thatSourceAssembly != null && ReferenceEquals(thisRetargetingAssembly.UnderlyingAssembly, thatSourceAssembly) && @this.HasUnresolvedReferencesByComparisonTo(that); } return false; } private static ImmutableArray<string> SplitMemberName(string name) { if (name.StartsWith(".", StringComparison.Ordinal)) { return ImmutableArray.Create(name); } var builder = ArrayBuilder<string>.GetInstance(); string part = name; while (part.Length > 0) { builder.Add(MetadataHelpers.SplitQualifiedName(part, out part)); } builder.ReverseContents(); return builder.ToImmutableAndFree(); } public static Symbol GetMember(this CSharpCompilation compilation, string qualifiedName) { return compilation.GlobalNamespace.GetMember(qualifiedName); } public static ISymbol GetMember(this Compilation compilation, string qualifiedName) { return compilation.GlobalNamespace.GetMember(qualifiedName); } public static T GetMember<T>(this CSharpCompilation compilation, string qualifiedName) where T : Symbol { return (T)compilation.GlobalNamespace.GetMember(qualifiedName); } public static T GetMember<T>(this Compilation compilation, string qualifiedName) where T : ISymbol { return (T)compilation.GlobalNamespace.GetMember(qualifiedName); } public static ImmutableArray<Symbol> GetMembers(this Compilation compilation, string qualifiedName) { NamespaceOrTypeSymbol lastContainer; var members = GetMembers(((CSharpCompilation)compilation).GlobalNamespace, qualifiedName, out lastContainer); if (members.IsEmpty) { Assert.True(false, string.Format("Could not find member named '{0}'. Available members:\r\n{1}", qualifiedName, string.Join("\r\n", lastContainer.GetMembers().Select(m => "\t\t" + m.Name)))); } return members; } private static ImmutableArray<Symbol> GetMembers(NamespaceOrTypeSymbol container, string qualifiedName, out NamespaceOrTypeSymbol lastContainer) { var parts = SplitMemberName(qualifiedName); lastContainer = container; for (int i = 0; i < parts.Length - 1; i++) { var nestedContainer = (NamespaceOrTypeSymbol)lastContainer.GetMember(parts[i]); if (nestedContainer == null) { // If there wasn't a nested namespace or type with that name, assume it's a // member name that includes dots (e.g. explicit interface implementation). return lastContainer.GetMembers(string.Join(".", parts.Skip(i))); } else { lastContainer = nestedContainer; } } return lastContainer.GetMembers(parts[parts.Length - 1]); } private static ImmutableArray<ISymbol> GetMembers(INamespaceOrTypeSymbol container, string qualifiedName, out INamespaceOrTypeSymbol lastContainer) { var parts = SplitMemberName(qualifiedName); lastContainer = container; for (int i = 0; i < parts.Length - 1; i++) { var nestedContainer = (INamespaceOrTypeSymbol)lastContainer.GetMember(parts[i]); if (nestedContainer == null) { // If there wasn't a nested namespace or type with that name, assume it's a // member name that includes dots (e.g. explicit interface implementation). return lastContainer.GetMembers(string.Join(".", parts.Skip(i))); } else { lastContainer = nestedContainer; } } return lastContainer.GetMembers(parts[parts.Length - 1]); } public static Symbol GetMember(this NamespaceOrTypeSymbol container, string qualifiedName) { NamespaceOrTypeSymbol lastContainer; var members = GetMembers(container, qualifiedName, out lastContainer); if (members.Length == 0) { return null; } else if (members.Length > 1) { Assert.True(false, "Found multiple members of specified name:\r\n" + string.Join("\r\n", members)); } return members.Single(); } public static ISymbol GetMember(this INamespaceOrTypeSymbol container, string qualifiedName) { INamespaceOrTypeSymbol lastContainer; var members = GetMembers(container, qualifiedName, out lastContainer); if (members.Length == 0) { return null; } else if (members.Length > 1) { Assert.True(false, "Found multiple members of specified name:\r\n" + string.Join("\r\n", members)); } return members.Single(); } public static T GetMember<T>(this NamespaceOrTypeSymbol symbol, string qualifiedName) where T : Symbol { return (T)symbol.GetMember(qualifiedName); } public static T GetMember<T>(this INamespaceOrTypeSymbol symbol, string qualifiedName) where T : ISymbol { return (T)symbol.GetMember(qualifiedName); } public static PropertySymbol GetProperty(this NamedTypeSymbol symbol, string name) { return (PropertySymbol)symbol.GetMembers(name).Single(); } public static EventSymbol GetEvent(this NamedTypeSymbol symbol, string name) { return (EventSymbol)symbol.GetMembers(name).Single(); } public static MethodSymbol GetMethod(this NamedTypeSymbol symbol, string name) { return (MethodSymbol)symbol.GetMembers(name).Single(); } public static FieldSymbol GetField(this NamedTypeSymbol symbol, string name) { return (FieldSymbol)symbol.GetMembers(name).Single(); } public static NamedTypeSymbol GetTypeMember(this NamespaceOrTypeSymbol symbol, string name) { return symbol.GetTypeMembers(name).Single(); } public static INamedTypeSymbol GetTypeMember(this INamespaceOrTypeSymbol symbol, string name) { return symbol.GetTypeMembers(name).Single(); } public static string[] GetFieldNames(this ModuleSymbol module, string qualifiedTypeName) { var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember(qualifiedTypeName); return type.GetMembers().OfType<FieldSymbol>().Select(f => f.Name).ToArray(); } public static string[] GetFieldNamesAndTypes(this ModuleSymbol module, string qualifiedTypeName) { var type = (NamedTypeSymbol)module.GlobalNamespace.GetMember(qualifiedTypeName); return type.GetMembers().OfType<FieldSymbol>().Select(f => f.Name + ": " + f.TypeWithAnnotations).ToArray(); } public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, NamedTypeSymbol c) { return @this.GetAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2)); } public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, string namespaceName, string typeName) { return @this.GetAttributes().Where(a => a.IsTargetAttribute(namespaceName, typeName)); } public static IEnumerable<CSharpAttributeData> GetAttributes(this Symbol @this, AttributeDescription description) { return @this.GetAttributes().Where(a => a.IsTargetAttribute(@this, description)); } public static CSharpAttributeData GetAttribute(this Symbol @this, NamedTypeSymbol c) { return @this.GetAttributes().Where(a => TypeSymbol.Equals(a.AttributeClass, c, TypeCompareKind.ConsiderEverything2)).First(); } public static CSharpAttributeData GetAttribute(this Symbol @this, string namespaceName, string typeName) { return @this.GetAttributes().Where(a => a.IsTargetAttribute(namespaceName, typeName)).First(); } public static CSharpAttributeData GetAttribute(this Symbol @this, MethodSymbol m) { return (from a in @this.GetAttributes() where a.AttributeConstructor.Equals(m) select a).ToList().First(); } public static bool HasAttribute(this Symbol @this, MethodSymbol m) { return (from a in @this.GetAttributes() where a.AttributeConstructor.Equals(m) select a).ToList().FirstOrDefault() != null; } public static void VerifyValue<T>(this CSharpAttributeData attr, int i, TypedConstantKind kind, T v) { var arg = attr.CommonConstructorArguments[i]; Assert.Equal(kind, arg.Kind); Assert.True(IsEqual(arg, v)); } public static void VerifyNamedArgumentValue<T>(this CSharpAttributeData attr, int i, string name, TypedConstantKind kind, T v) { var namedArg = attr.CommonNamedArguments[i]; Assert.Equal(namedArg.Key, name); var arg = namedArg.Value; Assert.Equal(arg.Kind, kind); Assert.True(IsEqual(arg, v)); } internal static bool IsEqual(TypedConstant arg, object expected) { switch (arg.Kind) { case TypedConstantKind.Array: return AreEqual(arg.Values, expected); case TypedConstantKind.Enum: return expected.Equals(arg.Value); case TypedConstantKind.Type: var typeSym = arg.ValueInternal as TypeSymbol; if ((object)typeSym == null) { return false; } var expTypeSym = expected as TypeSymbol; if (typeSym.Equals(expTypeSym)) { return true; } // TODO: improve the comparison mechanism for generic types. if (typeSym.Kind == SymbolKind.NamedType && ((NamedTypeSymbol)typeSym).IsGenericType) { var s1 = typeSym.ToDisplayString(SymbolDisplayFormat.TestFormat); var s2 = expected.ToString(); if ((s1 == s2)) { return true; } } var expType = expected as Type; if (expType == null) { return false; } //Can't always simply compare string as <T>.ToString() is IL format return IsEqual(typeSym, expType); default: //Assert.Equal(expected, CType(arg.Value, T)) return expected == null ? arg.Value == null : expected.Equals(arg.Value); } } /// For argument is not simple 'Type' (generic or array) private static bool IsEqual(TypeSymbol typeSym, Type expType) { // namedType if ((typeSym.TypeKind == TypeKind.Interface || typeSym.TypeKind == TypeKind.Class || typeSym.TypeKind == TypeKind.Struct || typeSym.TypeKind == TypeKind.Delegate)) { NamedTypeSymbol namedType = (NamedTypeSymbol)typeSym; // name should be same if it's not generic (NO ByRef in attribute) if ((namedType.Arity == 0)) { return typeSym.Name == expType.Name; } // generic if (!(expType.GetTypeInfo().IsGenericType)) { return false; } var nameOnly = expType.Name; //generic <Name>'1 var idx = expType.Name.LastIndexOfAny(new char[] { '`' }); if ((idx > 0)) { nameOnly = expType.Name.Substring(0, idx); } if (!(typeSym.Name == nameOnly)) { return false; } var expArgs = expType.GetGenericArguments(); var actArgs = namedType.TypeArguments(); if (!(expArgs.Count() == actArgs.Length)) { return false; } for (var i = 0; i <= expArgs.Count() - 1; i++) { if (!IsEqual(actArgs[i], expArgs[i])) { return false; } } return true; // array type } else if (typeSym.TypeKind == TypeKind.Array) { if (!expType.IsArray) { return false; } var arySym = (ArrayTypeSymbol)typeSym; if (!IsEqual(arySym.ElementType, expType.GetElementType())) { return false; } if (!IsEqual(arySym.BaseType(), expType.GetTypeInfo().BaseType)) { return false; } return arySym.Rank == expType.GetArrayRank(); } return false; } // Compare an Object with a TypedConstant. This compares the TypeConstant's value and ignores the TypeConstant's type. private static bool AreEqual(ImmutableArray<TypedConstant> tc, object o) { if (o == null) { return tc.IsDefault; } else if (tc.IsDefault) { return false; } if (!o.GetType().IsArray) { return false; } var a = (Array)o; bool ret = true; for (var i = 0; i <= a.Length - 1; i++) { var v = a.GetValue(i); var c = tc[i]; ret = ret & IsEqual(c, v); } return ret; } public static void CheckAccessorShape(this MethodSymbol accessor, Symbol propertyOrEvent) { Assert.Same(propertyOrEvent, accessor.AssociatedSymbol); CheckAccessorModifiers(accessor, propertyOrEvent); Assert.Contains(accessor, propertyOrEvent.ContainingType.GetMembers(accessor.Name)); var propertyOrEventType = propertyOrEvent.GetTypeOrReturnType().Type; switch (accessor.MethodKind) { case MethodKind.EventAdd: case MethodKind.EventRemove: Assert.Equal(SpecialType.System_Void, accessor.ReturnType.SpecialType); Assert.Equal(propertyOrEventType, accessor.Parameters.Single().Type); break; case MethodKind.PropertyGet: case MethodKind.PropertySet: var property = (PropertySymbol)propertyOrEvent; var isSetter = accessor.MethodKind == MethodKind.PropertySet; if (isSetter) { Assert.Equal(SpecialType.System_Void, accessor.ReturnType.SpecialType); } else { Assert.Equal(propertyOrEventType, accessor.ReturnType); } var propertyParameters = property.Parameters; var accessorParameters = accessor.Parameters; Assert.Equal(propertyParameters.Length, accessorParameters.Length - (isSetter ? 1 : 0)); for (int i = 0; i < propertyParameters.Length; i++) { var propertyParam = propertyParameters[i]; var accessorParam = accessorParameters[i]; Assert.Equal(propertyParam.Type, accessorParam.Type); Assert.Equal(propertyParam.RefKind, accessorParam.RefKind); Assert.Equal(propertyParam.Name, accessorParam.Name); } if (isSetter) { var valueParameter = accessorParameters[propertyParameters.Length]; Assert.Equal(propertyOrEventType, valueParameter.Type); Assert.Equal(RefKind.None, valueParameter.RefKind); Assert.Equal(ParameterSymbol.ValueParameterName, valueParameter.Name); } break; default: Assert.False(true, "Unexpected accessor kind " + accessor.MethodKind); break; } } internal static void CheckAccessorModifiers(this MethodSymbol accessor, Symbol propertyOrEvent) { Assert.Equal(propertyOrEvent.DeclaredAccessibility, accessor.DeclaredAccessibility); Assert.Equal(propertyOrEvent.IsAbstract, accessor.IsAbstract); Assert.Equal(propertyOrEvent.IsOverride, accessor.IsOverride); Assert.Equal(propertyOrEvent.IsVirtual, accessor.IsVirtual); Assert.Equal(propertyOrEvent.IsSealed, accessor.IsSealed); Assert.Equal(propertyOrEvent.IsExtern, accessor.IsExtern); Assert.Equal(propertyOrEvent.IsStatic, accessor.IsStatic); } } } // This is deliberately declared in the global namespace so that it will always be discoverable (regardless of usings). internal static class Extensions { /// <summary> /// This method is provided as a convenience for testing the SemanticModel.GetDeclaredSymbol implementation. /// </summary> /// <param name="declaration">This parameter will be type checked, and a NotSupportedException will be thrown if the type is not currently supported by an overload of GetDeclaredSymbol.</param> internal static Symbol GetDeclaredSymbolFromSyntaxNode(this CSharpSemanticModel model, Microsoft.CodeAnalysis.SyntaxNode declaration, CancellationToken cancellationToken = default(CancellationToken)) { // NOTE: Do not add types to this condition unless you have verified that there is an overload of SemanticModel.GetDeclaredSymbol // that supports the type you're adding. if (!( declaration is AnonymousObjectCreationExpressionSyntax || declaration is AnonymousObjectMemberDeclaratorSyntax || declaration is BaseTypeDeclarationSyntax || declaration is CatchDeclarationSyntax || declaration is ExternAliasDirectiveSyntax || declaration is ForEachStatementSyntax || declaration is JoinIntoClauseSyntax || declaration is LabeledStatementSyntax || declaration is MemberDeclarationSyntax || declaration is BaseNamespaceDeclarationSyntax || declaration is ParameterSyntax || declaration is QueryClauseSyntax || declaration is QueryContinuationSyntax || declaration is SwitchLabelSyntax || declaration is TypeParameterSyntax || declaration is UsingDirectiveSyntax || declaration is VariableDeclaratorSyntax)) { throw new NotSupportedException("This node type is not supported."); } return (Symbol)model.GetDeclaredSymbol(declaration, cancellationToken); } public static NamedTypeSymbol BaseType(this TypeSymbol symbol) { return symbol.BaseTypeNoUseSiteDiagnostics; } public static ImmutableArray<NamedTypeSymbol> Interfaces(this TypeSymbol symbol) { return symbol.InterfacesNoUseSiteDiagnostics(); } public static ImmutableArray<NamedTypeSymbol> AllInterfaces(this TypeSymbol symbol) { return symbol.AllInterfacesNoUseSiteDiagnostics; } public static ImmutableArray<TypeSymbol> TypeArguments(this NamedTypeSymbol symbol) { return TypeMap.AsTypeSymbols(symbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics); } public static ImmutableArray<TypeSymbol> ConstraintTypes(this TypeParameterSymbol symbol) { return TypeMap.AsTypeSymbols(symbol.ConstraintTypesNoUseSiteDiagnostics); } public static ImmutableArray<INamedTypeSymbol> AllEffectiveInterfacesNoUseSiteDiagnostics(this ITypeParameterSymbol symbol) { return ((Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.TypeParameterSymbol)symbol).UnderlyingTypeParameterSymbol.AllEffectiveInterfacesNoUseSiteDiagnostics.GetPublicSymbols(); } public static ITypeSymbol GetParameterType(this IMethodSymbol method, int index) => method.Parameters[index].Type; public static bool IsNullableType(this ITypeSymbol typeOpt) { return ITypeSymbolHelpers.IsNullableType(typeOpt); } public static ITypeSymbol GetNullableUnderlyingType(this ITypeSymbol type) { return ITypeSymbolHelpers.GetNullableUnderlyingType(type); } public static bool IsDynamic(this ITypeSymbol type) { return type.TypeKind == TypeKind.Dynamic; } public static bool IsDelegateType(this ITypeSymbol type) { return type.TypeKind == TypeKind.Delegate; } public static bool IsErrorType(this ITypeSymbol type) { return type.Kind == SymbolKind.ErrorType; } public static ITypeSymbol StrippedType(this ITypeSymbol type) { return type.IsNullableType() ? type.GetNullableUnderlyingType() : type; } public static string ToTestDisplayString(this Symbol symbol) { return symbol.ToDisplayString(SymbolDisplayFormat.TestFormat); } public static ISymbol GetSpecialTypeMember(this Compilation compilation, SpecialMember specialMember) { return ((CSharpCompilation)compilation).GetSpecialTypeMember(specialMember).GetPublicSymbol(); } public static INamedTypeSymbol GetWellKnownType(this Compilation compilation, WellKnownType type) { return ((CSharpCompilation)compilation).GetWellKnownType(type).GetPublicSymbol(); } public static NamedTypeSymbol Modifier(this CustomModifier m) { return ((CSharpCustomModifier)m).ModifierSymbol; } public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol member) { switch (member.Kind) { case SymbolKind.Method: return ((IMethodSymbol)member).Parameters; case SymbolKind.Property: return ((IPropertySymbol)member).Parameters; case SymbolKind.Event: return ImmutableArray<IParameterSymbol>.Empty; default: throw ExceptionUtilities.UnexpectedValue(member.Kind); } } public static bool IsUnboundGenericType(this ITypeSymbol type) { return type is INamedTypeSymbol namedType && namedType.IsUnboundGenericType; } public static bool GivesAccessTo(this AssemblySymbol first, AssemblySymbol second) { return first.GetPublicSymbol().GivesAccessTo(second.GetPublicSymbol()); } public static INamedTypeSymbol CreateTupleTypeSymbol( this CSharpCompilation comp, NamedTypeSymbol underlyingType, ImmutableArray<string> elementNames = default, ImmutableArray<Location> elementLocations = default) { return comp.CreateTupleTypeSymbol(underlyingType.GetPublicSymbol(), elementNames, elementLocations); } public static INamedTypeSymbol CreateTupleTypeSymbol( this CSharpCompilation comp, ImmutableArray<TypeSymbol> elementTypes, ImmutableArray<string> elementNames = default, ImmutableArray<Location> elementLocations = default, ImmutableArray<Microsoft.CodeAnalysis.NullableAnnotation> elementNullableAnnotations = default) { return comp.CreateTupleTypeSymbol(elementTypes.GetPublicSymbols(), elementNames, elementLocations, elementNullableAnnotations); } public static INamedTypeSymbol Construct(this INamedTypeSymbol definition, params TypeSymbol[] typeArguments) { return definition.Construct(typeArguments.Select(s => s.GetPublicSymbol()).ToArray()); } public static INamespaceSymbol CreateErrorNamespaceSymbol(this CSharpCompilation comp, NamespaceSymbol container, string name) { return comp.CreateErrorNamespaceSymbol(container.GetPublicSymbol(), name); } public static bool Equals(this ITypeSymbol first, ITypeSymbol second, TypeCompareKind typeCompareKind) { return first.Equals(second, new Microsoft.CodeAnalysis.SymbolEqualityComparer(typeCompareKind)); } public static ITypeSymbol GetTypeOrReturnType(this ISymbol symbol) { switch (symbol.Kind) { case SymbolKind.Field: return ((IFieldSymbol)symbol).Type; case SymbolKind.Method: return ((IMethodSymbol)symbol).ReturnType; case SymbolKind.Property: return ((IPropertySymbol)symbol).Type; case SymbolKind.Event: return ((IEventSymbol)symbol).Type; case SymbolKind.Local: return ((ILocalSymbol)symbol).Type; case SymbolKind.Parameter: return ((IParameterSymbol)symbol).Type; case SymbolKind.ErrorType: return (ITypeSymbol)symbol; default: throw ExceptionUtilities.UnexpectedValue(symbol.Kind); } } public static ITypeSymbol EnumUnderlyingTypeOrSelf(this ITypeSymbol type) { return type.TypeKind == TypeKind.Enum ? ((INamedTypeSymbol)type).EnumUnderlyingType : type; } public static INamedTypeSymbol GetEnumUnderlyingType(this ITypeSymbol type) { var namedType = type as INamedTypeSymbol; return ((object)namedType != null) ? namedType.EnumUnderlyingType : null; } public static ISymbol ConstructedFrom(this ISymbol symbol) { switch (symbol.Kind) { case SymbolKind.NamedType: return ((INamedTypeSymbol)symbol).ConstructedFrom; case SymbolKind.Method: return ((IMethodSymbol)symbol).ConstructedFrom; default: throw ExceptionUtilities.UnexpectedValue(symbol.Kind); } } public static INamespaceSymbol GetNestedNamespace(this INamespaceSymbol ns, string name) { foreach (var sym in ns.GetMembers(name)) { if (sym.Kind == SymbolKind.Namespace) { return (INamespaceSymbol)sym; } } return null; } public static IEnumerable<Microsoft.CodeAnalysis.NullableAnnotation> TypeArgumentNullableAnnotations(this INamedTypeSymbol type) { return type.TypeArguments.Select(t => t.NullableAnnotation); } public static IEnumerable<Microsoft.CodeAnalysis.NullableAnnotation> TypeArgumentNullableAnnotations(this IMethodSymbol method) { return method.TypeArguments.Select(t => t.NullableAnnotation); } public static DiagnosticInfo GetUseSiteDiagnostic(this Symbol @this) { return @this.GetUseSiteInfo().DiagnosticInfo; } public static Conversion ClassifyConversionFromType(this ConversionsBase conversions, TypeSymbol source, TypeSymbol destination, ref HashSet<DiagnosticInfo> useSiteDiagnostics, bool forCast = false) { CompoundUseSiteInfo<AssemblySymbol> useSiteInfo = default; Conversion result = conversions.ClassifyConversionFromType(source, destination, isChecked: false, ref useSiteInfo, forCast); AddDiagnosticInfos(ref useSiteDiagnostics, useSiteInfo); return result; } private static void AddDiagnosticInfos(ref HashSet<DiagnosticInfo> useSiteDiagnostics, CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) { if (useSiteInfo.Diagnostics is object) { if (useSiteDiagnostics is null) { useSiteDiagnostics = (HashSet<DiagnosticInfo>)useSiteInfo.Diagnostics; } else { useSiteDiagnostics.AddAll(useSiteInfo.Diagnostics); } } } public static Conversion ClassifyConversionFromExpression(this Conversions conversions, BoundExpression sourceExpression, TypeSymbol destination, ref HashSet<DiagnosticInfo> useSiteDiagnostics, bool forCast = false) { CompoundUseSiteInfo<AssemblySymbol> useSiteInfo = default; Conversion result = conversions.ClassifyConversionFromExpression(sourceExpression, destination, isChecked: false, ref useSiteInfo, forCast); AddDiagnosticInfos(ref useSiteDiagnostics, useSiteInfo); return result; } public static void LookupSymbolsSimpleName( this Microsoft.CodeAnalysis.CSharp.Binder binder, LookupResult result, NamespaceOrTypeSymbol qualifierOpt, string plainName, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics) { CompoundUseSiteInfo<AssemblySymbol> useSiteInfo = default; binder.LookupSymbolsSimpleName(result, qualifierOpt, plainName, arity, basesBeingResolved, options, diagnose, ref useSiteInfo); AddDiagnosticInfos(ref useSiteDiagnostics, useSiteInfo); } public static ImmutableArray<Symbol> BindCref(this Microsoft.CodeAnalysis.CSharp.Binder binder, CrefSyntax syntax, out Symbol ambiguityWinner, DiagnosticBag diagnostics) { return binder.BindCref(syntax, out ambiguityWinner, new Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag(diagnostics)); } public static BoundBlock BindEmbeddedBlock(this Microsoft.CodeAnalysis.CSharp.Binder binder, BlockSyntax node, DiagnosticBag diagnostics) { return binder.BindEmbeddedBlock(node, new Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag(diagnostics)); } public static BoundExpression BindExpression(this Microsoft.CodeAnalysis.CSharp.Binder binder, ExpressionSyntax node, DiagnosticBag diagnostics) { return binder.BindExpression(node, new Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag(diagnostics)); } public static void Verify(this ImmutableBindingDiagnostic<AssemblySymbol> actual, params Microsoft.CodeAnalysis.Test.Utilities.DiagnosticDescription[] expected) { actual.Diagnostics.Verify(expected); } }
40.050328
219
0.618478
[ "MIT" ]
AlexanderSemenyak/roslyn
src/Compilers/Test/Utilities/CSharp/Extensions.cs
36,608
C#
using System; using System.Collections.Generic; using Aop.Api.Response; namespace Aop.Api.Request { /// <summary> /// AOP API: alipay.siteprobe.shop.info.add /// </summary> public class AlipaySiteprobeShopInfoAddRequest : IAopRequest<AlipaySiteprobeShopInfoAddResponse> { /// <summary> /// Json格式的业务参数,其中 third_party_shop_id :第三方ShopId(必须) third_party_shop_name :第三方店铺名称(必须) shop_notice :店铺公告 h5_rul :广告页URL(可选) /// </summary> public string BizContent { get; set; } #region IAopRequest Members private string apiVersion = "1.0"; private string terminalType; private string terminalInfo; private string prodCode; private string notifyUrl; public void SetNotifyUrl(string notifyUrl){ this.notifyUrl = notifyUrl; } public string GetNotifyUrl(){ return this.notifyUrl; } public void SetTerminalType(String terminalType){ this.terminalType=terminalType; } public string GetTerminalType(){ return this.terminalType; } public void SetTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public string GetTerminalInfo(){ return this.terminalInfo; } public void SetProdCode(String prodCode){ this.prodCode=prodCode; } public string GetProdCode(){ return this.prodCode; } public string GetApiName() { return "alipay.siteprobe.shop.info.add"; } public void SetApiVersion(string apiVersion){ this.apiVersion=apiVersion; } public string GetApiVersion(){ return this.apiVersion; } public IDictionary<string, string> GetParameters() { AopDictionary parameters = new AopDictionary(); parameters.Add("biz_content", this.BizContent); return parameters; } #endregion } }
25.316456
137
0.623
[ "Apache-2.0" ]
oceanho/AnyPayment
docs/alipay-sdk-NET-20151130120112/Request/AlipaySiteprobeShopInfoAddRequest.cs
2,086
C#
using Amazon.JSII.Runtime.Deputy; #pragma warning disable CS0672,CS0809,CS1591 namespace aws { [JsiiByValue(fqn: "aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatch")] public class Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatch : aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatch { /// <summary>all_query_arguments block.</summary> [JsiiOptional] [JsiiProperty(name: "allQueryArguments", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchAllQueryArguments\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchAllQueryArguments[]? AllQueryArguments { get; set; } /// <summary>body block.</summary> [JsiiOptional] [JsiiProperty(name: "body", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchBody\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchBody[]? Body { get; set; } /// <summary>method block.</summary> [JsiiOptional] [JsiiProperty(name: "method", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchMethod\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchMethod[]? Method { get; set; } /// <summary>query_string block.</summary> [JsiiOptional] [JsiiProperty(name: "queryString", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchQueryString\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchQueryString[]? QueryString { get; set; } /// <summary>single_header block.</summary> [JsiiOptional] [JsiiProperty(name: "singleHeader", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleHeader\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleHeader[]? SingleHeader { get; set; } /// <summary>single_query_argument block.</summary> [JsiiOptional] [JsiiProperty(name: "singleQueryArgument", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleQueryArgument\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchSingleQueryArgument[]? SingleQueryArgument { get; set; } /// <summary>uri_path block.</summary> [JsiiOptional] [JsiiProperty(name: "uriPath", typeJson: "{\"collection\":{\"elementtype\":{\"fqn\":\"aws.Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchUriPath\"},\"kind\":\"array\"}}", isOptional: true, isOverride: true)] public aws.IWafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatchUriPath[]? UriPath { get; set; } } }
61.310811
304
0.737492
[ "MIT" ]
scottenriquez/cdktf-alpha-csharp-testing
resources/.gen/aws/aws/Wafv2RuleGroupRuleStatementOrStatementStatementOrStatementStatementRegexPatternSetReferenceStatementFieldToMatch.cs
4,537
C#
using System; using TvShowReminder.Contracts; using TvShowReminder.Contracts.Command; using TvShowReminder.DataSource; namespace TvShowReminder.Service.Command { public class AddSubscriptionCommandHandler : ICommandHandler<AddSubscriptionCommand> { private readonly ISubscriptionCommandDataSource _subscriptionCommandDataSource; public AddSubscriptionCommandHandler(ISubscriptionCommandDataSource subscriptionCommandDataSource) { _subscriptionCommandDataSource = subscriptionCommandDataSource; } public void Handle(AddSubscriptionCommand command) { DateTime defaultLastAirDate = DateTime.Now; _subscriptionCommandDataSource.Insert(command.ShowId, command.ShowName, defaultLastAirDate); } } }
33.333333
106
0.76125
[ "MIT" ]
jonasf/tv-show-reminder
TvShowReminder.Service/Command/AddSubscriptionCommandHandler.cs
802
C#
using IntegrationTests.Context; using System; using System.Collections.Generic; using System.Linq; using System.Net.Mqtt; using System.Net.Sockets; using System.Reactive.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Xunit; using System.Net.Mqtt.Sdk; namespace IntegrationTests { public class ConnectionSpec : IntegrationContext, IDisposable { readonly IMqttServer server; public ConnectionSpec () { server = GetServerAsync ().Result; } [Fact] public async Task when_connecting_client_to_non_existing_server_then_fails() { try { await GetClientAsync(); } catch (Exception ex) { Assert.True(ex is MqttClientException); Assert.NotNull(ex.InnerException); Assert.True(ex.InnerException is MqttException); Assert.NotNull(ex.InnerException.InnerException); Assert.True(ex.InnerException.InnerException is SocketException); } } [Fact] public async Task when_clients_connect_and_disconnect_then_server_raises_events() { var fooClient = await GetClientAsync(); var barClient = await GetClientAsync(); var clientId1 = GetClientId(); var clientId2 = GetClientId(); var connected = new List<string>(); var disconnected = new List<string>(); server.ClientConnected += (sender, id) => connected.Add(id); server.ClientDisconnected += (sender, id) => { connected.Remove(id); disconnected.Add(id); }; await fooClient.ConnectAsync(new MqttClientCredentials(clientId1)); Assert.Equal(new[] { clientId1 }, connected); await barClient.ConnectAsync(new MqttClientCredentials(clientId2)); Assert.Equal(new[] { clientId1, clientId2 }, connected); await barClient.DisconnectAsync(); Assert.Equal(new[] { clientId2 }, disconnected); Assert.Equal(new[] { clientId1 }, connected); await fooClient.DisconnectAsync(); Assert.Equal(new[] { clientId2, clientId1 }, disconnected); Assert.Equal(0, connected.Count); } [Fact] public async Task when_connect_clients_and_one_client_drops_connection_then_other_client_survives() { var fooClient = await GetClientAsync (); var barClient = await GetClientAsync (); await fooClient.ConnectAsync (new MqttClientCredentials (GetClientId ())); await barClient.ConnectAsync (new MqttClientCredentials (GetClientId ())); var initialConnectedClients = server.ActiveClients.Count (); var exceptionThrown = false; try { //Force an exception to be thrown by publishing null message await fooClient.PublishAsync (message: null, qos: MqttQualityOfService.AtMostOnce); } catch { exceptionThrown = true; } var serverSignal = new ManualResetEventSlim (); while (!serverSignal.IsSet) { if (server.ActiveConnections == 1 && server.ActiveClients.Count () == 1) { serverSignal.Set (); } } serverSignal.Wait (); Assert.Equal (2, initialConnectedClients); Assert.True (exceptionThrown); Assert.Equal (1, server.ActiveConnections); Assert.Equal (1, server.ActiveClients.Count ()); fooClient.Dispose (); barClient.Dispose (); } [Fact] public async Task when_connect_clients_then_succeeds() { var count = GetTestLoad (); var clients = new List<IMqttClient> (); var tasks = new List<Task> (); for (var i = 1; i <= count; i++) { var client = await GetClientAsync (); tasks.Add (client.ConnectAsync (new MqttClientCredentials (GetClientId ()))); clients.Add (client); } await Task.WhenAll (tasks); Assert.Equal (count, server.ActiveClients.Count ()); Assert.True (clients.All(c => c.IsConnected)); Assert.True (clients.All(c => !string.IsNullOrEmpty (c.Id))); foreach (var client in clients) { client.Dispose (); } } [Fact] public async Task when_connecting_twice_with_same_client_then_fails() { var client = await GetClientAsync (); var clientId = GetClientId (); var clientDisconnectedEvent = new ManualResetEventSlim (); client.Disconnected += (sender, e) => { if (e.Reason == DisconnectedReason.RemoteDisconnected) { clientDisconnectedEvent.Set (); } }; await client.ConnectAsync (new MqttClientCredentials (clientId)); await client.ConnectAsync (new MqttClientCredentials (clientId)); var clientRemoteDisconnected = clientDisconnectedEvent.Wait (2000); Assert.True (clientRemoteDisconnected); } [Fact] public async Task when_connecting_client_with_invalid_id_then_fails() { var client = await GetClientAsync (); var clientId = "#invalid*client-id"; var ex = Assert.Throws<AggregateException> (() => client.ConnectAsync (new MqttClientCredentials (clientId)).Wait ()); Assert.NotNull (ex); Assert.NotNull (ex.InnerException); Assert.True (ex.InnerException is MqttClientException); Assert.NotNull (ex.InnerException.InnerException); Assert.True (ex.InnerException.InnerException is MqttException); } [Fact] public async Task when_connecting_client_with_empty_id_then_fails() { var client = await GetClientAsync (); var clientId = string.Empty; var ex = Assert.Throws<AggregateException> (() => client.ConnectAsync (new MqttClientCredentials (clientId)).Wait ()); Assert.NotNull (ex); Assert.NotNull (ex.InnerException); Assert.True (ex.InnerException is MqttClientException); Assert.NotNull (ex.InnerException.InnerException); Assert.True (ex.InnerException.InnerException is ArgumentNullException); } [Fact] public async Task when_server_doesnt_receive_connect_then_disconnects_channel() { var client = await GetClientAsync (); var clientDisconnectedEvent = new ManualResetEventSlim (); client.Disconnected += (sender, e) => { if (e.Reason == DisconnectedReason.RemoteDisconnected) { clientDisconnectedEvent.Set (); } }; var clientRemoteDisconnected = clientDisconnectedEvent.Wait (2500); Assert.True (clientRemoteDisconnected); } [Fact] public async Task when_disconnect_clients_then_succeeds() { var count = GetTestLoad (); var clients = new List<IMqttClient> (); var connectTasks = new List<Task> (); for (var i = 1; i <= count; i++) { var client = await GetClientAsync (); connectTasks.Add(client.ConnectAsync (new MqttClientCredentials (GetClientId ()))); clients.Add (client); } await Task.WhenAll (connectTasks); var initialConnectedClients = server.ActiveClients.Count (); var disconnectTasks = new List<Task> (); foreach (var client in clients) { disconnectTasks.Add(client.DisconnectAsync ()); } await Task.WhenAll (disconnectTasks); var disconnectedSignal = new ManualResetEventSlim (initialState: false); while (!disconnectedSignal.IsSet) { if (server.ActiveClients.Count () == 0 && clients.All(c => !c.IsConnected)) { disconnectedSignal.Set (); } } Assert.Equal (clients.Count, initialConnectedClients); Assert.Equal (0, server.ActiveClients.Count ()); Assert.True (clients.All(c => !c.IsConnected)); Assert.True (clients.All(c => string.IsNullOrEmpty (c.Id))); foreach (var client in clients) { client.Dispose (); } } [Fact] public async Task when_disconnect_client_then_server_decrease_active_client_list() { var client = await GetClientAsync (); await client.ConnectAsync (new MqttClientCredentials (GetClientId ())) .ConfigureAwait(continueOnCapturedContext: false); var clientId = client.Id; var existClientAfterConnect = server.ActiveClients.Any (c => c == clientId); await client.DisconnectAsync () .ConfigureAwait(continueOnCapturedContext: false); var clientClosed = new ManualResetEventSlim (); var subscription = Observable.Create<bool> (observer => { var timer = new System.Timers.Timer(); timer.Interval = 200; timer.Elapsed += (sender, args) => { if (server.ActiveClients.Any (c => c == clientId)) { observer.OnNext (false); } else { observer.OnNext (true); clientClosed.Set (); observer.OnCompleted (); } }; timer.Start(); return () => { timer.Dispose(); }; }) .Subscribe ( _ => { }, ex => { Console.WriteLine (string.Format ("Error: {0}", ex.Message)); }); var clientDisconnected = clientClosed.Wait (2000); Assert.True (existClientAfterConnect); Assert.True (clientDisconnected); Assert.False (server.ActiveClients.Any (c => c == clientId)); client.Dispose (); } [Fact] public async Task when_client_disconnects_by_protocol_then_will_message_is_not_sent() { var client1 = await GetClientAsync (); var client2 = await GetClientAsync(); var client3 = await GetClientAsync(); var topic = Guid.NewGuid ().ToString (); var qos = MqttQualityOfService.ExactlyOnce; var retain = true; var message = "Client 1 has been disconnected unexpectedly"; var will = new MqttLastWill(topic, qos, retain, message); await client1.ConnectAsync (new MqttClientCredentials (GetClientId ()), will); await client2.ConnectAsync (new MqttClientCredentials (GetClientId ())); await client3.ConnectAsync (new MqttClientCredentials (GetClientId ())); await client2.SubscribeAsync(topic, MqttQualityOfService.AtMostOnce); await client3.SubscribeAsync(topic, MqttQualityOfService.AtLeastOnce); var willReceivedSignal = new ManualResetEventSlim (initialState: false); client2.MessageStream.Subscribe (m => { if (m.Topic == topic) { willReceivedSignal.Set (); } }); client3.MessageStream.Subscribe (m => { if (m.Topic == topic) { willReceivedSignal.Set (); } }); await client1.DisconnectAsync (); var willReceived = willReceivedSignal.Wait (2000); Assert.False (willReceived); client1.Dispose (); client2.Dispose (); client3.Dispose (); } [Fact] public async Task when_client_disconnects_unexpectedly_then_will_message_is_sent() { var client1 = await GetClientAsync(); var client2 = await GetClientAsync(); var client3 = await GetClientAsync(); var topic = Guid.NewGuid ().ToString (); var qos = MqttQualityOfService.ExactlyOnce; var retain = true; var message = "Client 1 has been disconnected unexpectedly"; var will = new MqttLastWill(topic, qos, retain, message); await client1.ConnectAsync (new MqttClientCredentials (GetClientId ()), will); await client2.ConnectAsync (new MqttClientCredentials (GetClientId ())); await client3.ConnectAsync (new MqttClientCredentials (GetClientId ())); await client2.SubscribeAsync(topic, MqttQualityOfService.AtMostOnce); await client3.SubscribeAsync(topic, MqttQualityOfService.AtLeastOnce); var willReceivedSignal = new ManualResetEventSlim (initialState: false); var willMessage = default (MqttApplicationMessage); client2.MessageStream.Subscribe (m => { if (m.Topic == topic) { willMessage = m; willReceivedSignal.Set (); } }); client3.MessageStream.Subscribe (m => { if (m.Topic == topic) { willMessage = m; willReceivedSignal.Set (); } }); //Forces socket disconnection without using protocol Disconnect (Disconnect or Dispose Client method) (client1 as MqttClientImpl).Channel.Dispose (); var willReceived = willReceivedSignal.Wait (2000); Assert.True (willReceived); Assert.NotNull (willMessage); Assert.Equal (topic, willMessage.Topic); Assert.Equal (message, Encoding.UTF8.GetString (willMessage.Payload)); client2.Dispose (); client3.Dispose (); } public void Dispose () { if (server != null) { server.Stop (); } } } }
30.301471
130
0.660358
[ "MIT" ]
mauroa/hermes
src/IntegrationTests/ConnectionSpec.cs
12,365
C#
/* * Prime Developer Trial * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1 * Generated by: https://github.com/openapitools/openapi-generator.git */ using Newtonsoft.Json.Converters; namespace FactSet.SDK.CompanyLogoAPIforDigitalPortals.Client { /// <summary> /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types /// </summary> public class OpenAPIDateConverter : IsoDateTimeConverter { /// <summary> /// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class. /// </summary> public OpenAPIDateConverter() { // full-date = date-fullyear "-" date-month "-" date-mday DateTimeFormat = "yyyy-MM-dd"; } } }
31.9
109
0.662487
[ "Apache-2.0" ]
factset/enterprise-sdk
code/dotnet/CompanyLogoAPIforDigitalPortals/v2/src/FactSet.SDK.CompanyLogoAPIforDigitalPortals/Client/OpenAPIDateConverter.cs
957
C#
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Entities.Schemas.Commands; using Squidex.Infrastructure.Collections; using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Validation; namespace Squidex.Areas.Api.Controllers.Schemas.Models { public sealed class UpdateSchemaDto { /// <summary> /// Optional label for the editor. /// </summary> [LocalizedStringLength(100)] public string? Label { get; set; } /// <summary> /// Hints to describe the schema. /// </summary> [LocalizedStringLength(1000)] public string? Hints { get; set; } /// <summary> /// The url to a the sidebar plugin for content lists. /// </summary> public string? ContentsSidebarUrl { get; set; } /// <summary> /// The url to a the sidebar plugin for content items. /// </summary> public string? ContentSidebarUrl { get; set; } /// <summary> /// The url to the editor plugin. /// </summary> public string? ContentEditorUrl { get; set; } /// <summary> /// True to validate the content items on publish. /// </summary> public bool ValidateOnPublish { get; set; } /// <summary> /// Tags for automation processes. /// </summary> public ImmutableList<string>? Tags { get; set; } public UpdateSchema ToCommand() { var properties = SimpleMapper.Map(this, new SchemaProperties()); return new UpdateSchema { Properties = properties }; } } }
31.952381
78
0.530055
[ "MIT" ]
BrightsDigi/squidex
backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/UpdateSchemaDto.cs
2,015
C#
/****************************************************************************** * Spine Runtimes License Agreement * Last updated January 1, 2020. Replaces all prior versions. * * Copyright (c) 2013-2020, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and * conditions of Section 2 of the Spine Editor License Agreement: * http://esotericsoftware.com/spine-editor-license * * Otherwise, it is permitted to integrate the Spine Runtimes into software * or otherwise create derivative works of the Spine Runtimes (collectively, * "Products"), provided that each user of the Products must obtain their own * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine.Unity { public delegate void UpdateBonesDelegate (ISkeletonAnimation animated); /// <summary>A Spine-Unity Component that animates a Skeleton but not necessarily with a Spine.AnimationState.</summary> public interface ISkeletonAnimation { event UpdateBonesDelegate UpdateLocal; event UpdateBonesDelegate UpdateWorld; event UpdateBonesDelegate UpdateComplete; Skeleton Skeleton { get; } } /// <summary>Holds a reference to a SkeletonDataAsset.</summary> public interface IHasSkeletonDataAsset { /// <summary>Gets the SkeletonDataAsset of the Spine Component.</summary> SkeletonDataAsset SkeletonDataAsset { get; } } /// <summary>A Spine-Unity Component that manages a Spine.Skeleton instance, instantiated from a SkeletonDataAsset.</summary> public interface ISkeletonComponent { /// <summary>Gets the SkeletonDataAsset of the Spine Component.</summary> //[System.Obsolete] SkeletonDataAsset SkeletonDataAsset { get; } /// <summary>Gets the Spine.Skeleton instance of the Spine Component. This is equivalent to SkeletonRenderer's .skeleton.</summary> Skeleton Skeleton { get; } } /// <summary>A Spine-Unity Component that uses a Spine.AnimationState to animate its skeleton.</summary> public interface IAnimationStateComponent { /// <summary>Gets the Spine.AnimationState of the animated Spine Component. This is equivalent to SkeletonAnimation.state.</summary> AnimationState AnimationState { get; } } /// <summary>A Spine-Unity Component that holds a reference to a SkeletonRenderer.</summary> public interface IHasSkeletonRenderer { SkeletonRenderer SkeletonRenderer { get; } } /// <summary>A Spine-Unity Component that holds a reference to an ISkeletonComponent.</summary> public interface IHasSkeletonComponent { ISkeletonComponent SkeletonComponent { get; } } }
48.547945
134
0.742664
[ "MIT" ]
BaekNothing/Dalpangyeekiwoogi
Assets/Spine/Runtime/spine-unity/ISkeletonAnimation.cs
3,544
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.EC2.Model { /// <summary> /// Describes a Spot Instance state change. /// </summary> public partial class SpotInstanceStateFault { private string _code; private string _message; /// <summary> /// Gets and sets the property Code. /// <para> /// The reason code for the Spot Instance state change. /// </para> /// </summary> public string Code { get { return this._code; } set { this._code = value; } } // Check to see if Code property is set internal bool IsSetCode() { return this._code != null; } /// <summary> /// Gets and sets the property Message. /// <para> /// The message for the Spot Instance state change. /// </para> /// </summary> public string Message { get { return this._message; } set { this._message = value; } } // Check to see if Message property is set internal bool IsSetMessage() { return this._message != null; } } }
27.346667
101
0.60117
[ "Apache-2.0" ]
Bio2hazard/aws-sdk-net
sdk/src/Services/EC2/Generated/Model/SpotInstanceStateFault.cs
2,051
C#
using Esprima; using Jint.Runtime.Debugger; using Xunit; namespace Jint.Tests.Runtime.Debugger { public class BreakPointTests { [Fact] public void BreakPointBreaksAtPosition() { string script = @"let x = 1, y = 2; if (x === 1) { x++; y *= 2; }"; var engine = new Engine(options => options.DebugMode()); bool didBreak = false; engine.Break += (sender, info) => { Assert.Equal(4, info.CurrentStatement.Location.Start.Line); Assert.Equal(5, info.CurrentStatement.Location.Start.Column); didBreak = true; return StepMode.None; }; engine.BreakPoints.Add(new BreakPoint(4, 5)); engine.Execute(script); Assert.True(didBreak); } [Fact] public void BreakPointBreaksInCorrectSource() { string script1 = @"let x = 1, y = 2; if (x === 1) { x++; y *= 2; }"; string script2 = @"function test(x) { return x + 2; }"; string script3 = @"const z = 3; test(z);"; var engine = new Engine(options => { options.DebugMode(); }); engine.BreakPoints.Add(new BreakPoint("script2", 3, 0)); bool didBreak = false; engine.Break += (sender, info) => { Assert.Equal("script2", info.CurrentStatement.Location.Source); Assert.Equal(3, info.CurrentStatement.Location.Start.Line); Assert.Equal(0, info.CurrentStatement.Location.Start.Column); didBreak = true; return StepMode.None; }; // We need to specify the source to the parser. // And we need locations too (Jint specifies that in its default options) engine.Execute(script1, new ParserOptions("script1")); Assert.False(didBreak); engine.Execute(script2, new ParserOptions("script2")); Assert.False(didBreak); // Note that it's actually script3 that executes the function in script2 // and triggers the breakpoint engine.Execute(script3, new ParserOptions("script3")); Assert.True(didBreak); } [Fact] public void DebuggerStatementTriggersBreak() { string script = @"'dummy'; debugger; 'dummy';"; var engine = new Engine(options => options .DebugMode() .DebuggerStatementHandling(DebuggerStatementHandling.Script)); bool didBreak = false; engine.Break += (sender, info) => { didBreak = true; return StepMode.None; }; engine.Execute(script); Assert.True(didBreak); } [Fact(Skip = "Non-source breakpoint is triggered before Statement, while debugger statement is now triggered by ExecuteInternal")] public void DebuggerStatementAndBreakpointTriggerSingleBreak() { string script = @"'dummy'; debugger; 'dummy';"; var engine = new Engine(options => options .DebugMode() .DebuggerStatementHandling(DebuggerStatementHandling.Script)); engine.BreakPoints.Add(new BreakPoint(2, 0)); int breakTriggered = 0; engine.Break += (sender, info) => { breakTriggered++; return StepMode.None; }; engine.Execute(script); Assert.Equal(1, breakTriggered); } [Fact] public void BreakpointOverridesStepOut() { string script = @"function test() { 'dummy'; 'source'; 'dummy'; 'target'; } test();"; var engine = new Engine(options => options.DebugMode()); engine.BreakPoints.Add(new BreakPoint(4, 0)); engine.BreakPoints.Add(new BreakPoint(6, 0)); int step = 0; engine.Break += (sender, info) => { step++; switch (step) { case 1: return StepMode.Out; case 2: Assert.True(info.ReachedLiteral("target")); break; } return StepMode.None; }; engine.Execute(script); Assert.Equal(2, step); } } }
27.406061
138
0.514374
[ "BSD-2-Clause" ]
Dogwei/jint
Jint.Tests/Runtime/Debugger/BreakPointTests.cs
4,524
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System; using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.CosmosDB.Models { /// <summary> Parameters to create and update Cosmos DB MongoDB database. </summary> public partial class MongoDBDatabaseCreateUpdateOptions : TrackedResourceData { /// <summary> Initializes a new instance of MongoDBDatabaseCreateUpdateOptions. </summary> /// <param name="location"> The location. </param> /// <param name="resource"> The standard JSON format of a MongoDB database. </param> /// <exception cref="ArgumentNullException"> <paramref name="resource"/> is null. </exception> public MongoDBDatabaseCreateUpdateOptions(AzureLocation location, MongoDBDatabaseResource resource) : base(location) { if (resource == null) { throw new ArgumentNullException(nameof(resource)); } Resource = resource; } /// <summary> Initializes a new instance of MongoDBDatabaseCreateUpdateOptions. </summary> /// <param name="id"> The id. </param> /// <param name="name"> The name. </param> /// <param name="type"> The type. </param> /// <param name="systemData"> The systemData. </param> /// <param name="tags"> The tags. </param> /// <param name="location"> The location. </param> /// <param name="resource"> The standard JSON format of a MongoDB database. </param> /// <param name="options"> A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. </param> internal MongoDBDatabaseCreateUpdateOptions(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary<string, string> tags, AzureLocation location, MongoDBDatabaseResource resource, CreateUpdateOptions options) : base(id, name, type, systemData, tags, location) { Resource = resource; Options = options; } /// <summary> The standard JSON format of a MongoDB database. </summary> internal MongoDBDatabaseResource Resource { get; set; } /// <summary> Name of the Cosmos DB MongoDB database. </summary> public string ResourceId { get => Resource is null ? default : Resource.Id; set => Resource = new MongoDBDatabaseResource(value); } /// <summary> A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. </summary> public CreateUpdateOptions Options { get; set; } } }
46.683333
301
0.661549
[ "MIT" ]
Kyle8329/azure-sdk-for-net
sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateUpdateOptions.cs
2,801
C#
#region License Header /* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Modifications Copyright 2018 Quantler B.V. * */ #endregion License Header using Quantler.Indicators; using System; using System.Linq; using Xunit; namespace Quantler.Tests.Indicators { public class IndicatorExtensionsTests { #region Public Methods [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void MinusSubtractsLeftAndRightAfterBothUpdated() { var left = new Identity("left"); var right = new Identity("right"); var composite = left.Minus(right); left.Update(DateTime.Today, TimeZone.Utc, 1m); right.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.Equal(0m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 2m); Assert.Equal(0m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 3m); Assert.Equal(0m, composite.Current.Price); right.Update(DateTime.Today, TimeZone.Utc, 4m); Assert.Equal(-1m, composite.Current.Price); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void MultiChainEMA() { var identity = new Identity("identity"); var delay = new Delay(2); // create the EMA of chained methods var ema = delay.Of(identity).EMA(2, 1); // Assert.True(ema. == 1); identity.Update(DateTime.UtcNow, TimeZone.Utc, 1m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(ema.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 2m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(ema.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 3m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.False(ema.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 4m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.True(ema.IsReady); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void MultiChainMAX() { var identity = new Identity("identity"); var delay = new Delay(2); // create the MAX of the delay of the identity var max = delay.Of(identity).MAX(2); identity.Update(DateTime.UtcNow, TimeZone.Utc, 1m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(max.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 2m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(max.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 3m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.False(max.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 4m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.True(max.IsReady); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void MultiChainMIN() { var identity = new Identity("identity"); var delay = new Delay(2); // create the MIN of the delay of the identity var min = delay.Of(identity).MIN(2); identity.Update(DateTime.UtcNow, TimeZone.Utc, 1m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(min.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 2m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(min.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 3m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.False(min.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 4m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.True(min.IsReady); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void MultiChainSMA() { var identity = new Identity("identity"); var delay = new Delay(2); // create the SMA of the delay of the identity var sma = delay.Of(identity).SMA(2); identity.Update(DateTime.UtcNow, TimeZone.Utc, 1m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(sma.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 2m); Assert.True(identity.IsReady); Assert.False(delay.IsReady); Assert.False(sma.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 3m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.False(sma.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 4m); Assert.True(identity.IsReady); Assert.True(delay.IsReady); Assert.True(sma.IsReady); Assert.Equal(1.5m, sma); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void NewDataPushesToDerivedIndicators() { var identity = new Identity("identity"); var sma = new SimpleMovingAverage(3); identity.Updated += (sender, consolidated) => { sma.Update(consolidated); }; identity.Update(DateTime.UtcNow, TimeZone.Utc, 1m); identity.Update(DateTime.UtcNow, TimeZone.Utc, 2m); Assert.False(sma.IsReady); identity.Update(DateTime.UtcNow, TimeZone.Utc, 3m); Assert.True(sma.IsReady); Assert.Equal(2m, sma); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void OverDivdesLeftAndRightAfterBothUpdated() { var left = new Identity("left"); var right = new Identity("right"); var composite = left.Over(right); left.Update(DateTime.Today, TimeZone.Utc, 1m); right.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.Equal(1m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 2m); Assert.Equal(1m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 3m); Assert.Equal(1m, composite.Current.Price); right.Update(DateTime.Today, TimeZone.Utc, 4m); Assert.Equal(3m / 4m, composite.Current.Price); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void OverHandlesDivideByZero() { var left = new Identity("left"); var right = new Identity("right"); var composite = left.Over(right); var updatedEventFired = false; composite.Updated += delegate { updatedEventFired = true; }; left.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.False(updatedEventFired); right.Update(DateTime.Today, TimeZone.Utc, 0m); Assert.False(updatedEventFired); // submitting another update to right won't cause an update without corresponding update to left right.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.False(updatedEventFired); left.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.True(updatedEventFired); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void PipesDataFirstWeightedBySecond() { const int period = 4; var value = new Identity("Value"); var weight = new Identity("Weight"); var third = value.WeightedBy(weight, period); var data = Enumerable.Range(1, 10).ToList(); var window = Enumerable.Reverse(data).Take(period); var current = window.Sum(x => 2 * x * x) / (decimal)window.Sum(x => x); foreach (var item in data) { value.Update(new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, Convert.ToDecimal(2 * item))); weight.Update(new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, Convert.ToDecimal(item))); } Assert.Equal(current, third.Current.Price); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void PipesDataUsingOfFromFirstToSecond() { var first = new SimpleMovingAverage(2); var second = new Delay(1); // this is a configuration step, but returns the reference to the second for method chaining second.Of(first); var data1 = new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, 1m); var data2 = new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, 2m); var data3 = new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, 3m); var data4 = new IndicatorDataPoint(DateTime.UtcNow, TimeZone.Utc, 4m); // sma has one item first.Update(data1); Assert.False(first.IsReady); Assert.Equal(0m, second.Current.Price); // sma is ready, delay will repeat this value first.Update(data2); Assert.True(first.IsReady); Assert.False(second.IsReady); Assert.Equal(1.5m, second.Current.Price); // delay is ready, and repeats its first input first.Update(data3); Assert.True(second.IsReady); Assert.Equal(1.5m, second.Current.Price); // now getting the delayed data first.Update(data4); Assert.Equal(2.5m, second.Current.Price); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void PlusAddsLeftAndRightAfterBothUpdated() { var left = new Identity("left"); var right = new Identity("right"); var composite = left.Plus(right); left.Update(DateTime.Today, TimeZone.Utc, 1m); right.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.Equal(2m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 2m); Assert.Equal(2m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 3m); Assert.Equal(2m, composite.Current.Price); right.Update(DateTime.Today, TimeZone.Utc, 4m); Assert.Equal(7m, composite.Current.Price); } [Fact] [Trait("Quantler.Indicators", "IndicatorExtensions")] public void TimesMultipliesLeftAndRightAfterBothUpdated() { var left = new Identity("left"); var right = new Identity("right"); var composite = left.Times(right); left.Update(DateTime.Today, TimeZone.Utc, 1m); right.Update(DateTime.Today, TimeZone.Utc, 1m); Assert.Equal(1m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 2m); Assert.Equal(1m, composite.Current.Price); left.Update(DateTime.Today, TimeZone.Utc, 3m); Assert.Equal(1m, composite.Current.Price); right.Update(DateTime.Today, TimeZone.Utc, 4m); Assert.Equal(12m, composite.Current.Price); } #endregion Public Methods } }
35.844193
113
0.591796
[ "Apache-2.0" ]
Quantler/Core
Quantler.Tests/Indicators/IndicatorExtensionsTests.cs
12,655
C#
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("ApplicationShell")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ApplicationShell")] [assembly: AssemblyCopyright("Copyright © 2020")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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")]
42.5
98
0.710504
[ "MIT" ]
athulrajts/Resusables
Application/ApplicationShell/Properties/AssemblyInfo.cs
2,383
C#
using System; using System.Collections.Generic; using System.Linq; using Redwood.Framework.Parser.RwHtml.Tokenizer; namespace Redwood.Framework.Parser.RwHtml.Parser { public abstract class RwHtmlNode { public int StartPosition { get { return Tokens.First().StartPosition; } } public int Length { get { return Tokens.Sum(t => t.Length); } } public List<RwHtmlToken> Tokens { get; private set; } public RwHtmlNode() { Tokens = new List<RwHtmlToken>(); } } }
20.344828
61
0.584746
[ "Apache-2.0" ]
exyi/redwood
src/Redwood.Framework/Parser/RwHtml/Parser/RwHtmlNode.cs
592
C#
using System; using System.Collections.Generic; using System.Text; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Media.Imaging; namespace ListaDeLeituraApresentacao.Converters { public class StringToImageConverter : IValueConverter { private static Uri _baseUri = new Uri("ms-appx:///Data/"); public object Convert(object value, Type targetType, object parameter, string language) { if (value == null) return null; var url = (string)value; Uri uri; if (url.ToUpper().Contains("HTTP://") || url.ToUpper().Contains("HTTPS://")) { uri = new Uri(url); } else { uri = new Uri(_baseUri, url); } return new BitmapImage(uri); } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } }
26.710526
99
0.562562
[ "Apache-2.0" ]
ricardodemauro/TDC2015-MVVM
ListaDeLeituraApresentacao/ListaDeLeituraApresentacao/ListaDeLeituraApresentacao.Shared/Converters/StringToImageConverter.cs
1,017
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Cease.Interface.Log; namespace Cease.Interface.PowerCtrl { /// <summary> /// 电源控制接口集合 /// </summary> public interface InterfacePowerCtrl { double _dLeakCur { get; set; } /// <summary> /// 注册log接口 /// </summary> /// <param name="_Ilog">Log接口</param> /// <returns></returns> void RegisterLogger(InterfaceLog _Ilog); /// <summary> /// 初始化电源 /// </summary> /// <param name="strResourceName">地址</param> /// <param name="Timeout">超时门限</param> /// <param name="DoReset">仪器复位标志位</param> /// <returns>返回函数执行结果</returns> bool InitialInstr(string strResourceName, int Timeout, bool DoReset); /// <summary> /// 释放电源 /// </summary> /// <returns>返回函数执行结果</returns> bool ReleaseInstr(); /// <summary> /// 阶梯上电 /// </summary> /// <returns></returns> void PowerStepOn(string strVolt,string strVPTVolt,int InternalTime); void PowerSetVolt(string strVolt, string VPTVolt, int InternalTime); /// <summary> /// 关闭电源 /// </summary> /// <returns></returns> void PowerOff(); /// <summary> /// 获取测量电流值,单位mA /// </summary> /// <param name="_dfCur">测量电流</param> /// <returns>返回函数执行结果</returns> bool MeasureCur(ref double _dfCur); /// <summary> /// 设置电源电压 /// </summary> /// <param name="_volt">设置的电压值(mV)</param> /// <returns></returns> void SetVoltmv(double _volt); } }
25.58209
77
0.530922
[ "Apache-2.0" ]
szk21/Cease
Interfaces/IPowerCtrl/InterfacePowerCtrl.cs
1,908
C#
using FX.Core.Config.Settings.Abstract; using FX.Core.Config.Settings.Models; using FX.Core.Config.Settings.Settings; using FX.Core.Storage.Serialization.Abstract; using Microsoft.Extensions.Options; namespace FX.Core.Common.Settings.Implementations { public class BasicSettings<TSettings>: IBasicSettings<TSettings> where TSettings: class, ISettingsObject { public TSettings Settings { get; set; } protected readonly IDataSerializer _dataSaver; protected readonly BasicSettingsConfig _config; public BasicSettings(IDataSerializer dataSaver, IOptions<BasicSettingsConfig> options) { _dataSaver = dataSaver; _config = options.Value; } public virtual ISettingsConfig GetConfig() { return _config; } public virtual bool CanLoadSettings() { return _dataSaver.DataExists(_config.SettingsPath); } public virtual void LoadSettings() { Settings = _dataSaver.GetData<TSettings>(_config.SettingsPath).GetAwaiter().GetResult(); if (Settings == null) throw new System.Exception("Cannot read settings"); // validate Settings.Validate(); } public virtual void SaveSettings() { if (Settings == null) throw new System.Exception("Settings not initialized, cannot save"); // validate Settings.Validate(); // encrypt _dataSaver.SaveDataAsync(Settings, _config.SettingsPath).GetAwaiter().GetResult(); } public virtual void DeleteSettings() { if (_dataSaver.DataExists(_config.SettingsPath)) _dataSaver.DeleteDataAsync(_config.SettingsPath).GetAwaiter().GetResult(); } } }
29.84127
100
0.62234
[ "MIT" ]
StefanLaiu/fx-core
FX.Core.Config/Settings/Implementations/BasicSettings.cs
1,882
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace ConvocaApp.Models { public class Test { public Array Convocado { get; set; } public Array Evento { get; set; } } }
18
44
0.670635
[ "MIT" ]
DaniMeneses10/ConvocaApp
Models/Test.cs
254
C#
using System.Drawing; using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { public class VisualStudioColorTable : ProfessionalColorTable { private DockPanelColorPalette _palette; public VisualStudioColorTable(DockPanelColorPalette palette) { _palette = palette; } public Color ButtonCheckedHoveredBorder { get { return _palette.CommandBarToolbarButtonCheckedHovered.Border; } } public Color ButtonCheckedHoveredBackground { get { return _palette.CommandBarMenuPopupHovered.CheckmarkBackground; } } public Color ButtonCheckedBorder { get { return _palette.CommandBarToolbarButtonChecked.Border; } } public override Color ButtonCheckedGradientBegin { get { return _palette.CommandBarToolbarButtonChecked.Background; } } public override Color ButtonCheckedGradientMiddle { get { return _palette.CommandBarToolbarButtonChecked.Background; } } public override Color ButtonCheckedGradientEnd { get { return _palette.CommandBarToolbarButtonChecked.Background; } } //public override Color ButtonCheckedHighlight //{ // get { return _palette.CommandBarMenuPopupDefault.CheckmarkBackground; } //} //public override Color ButtonCheckedHighlightBorder //{ // get { return _palette.CommandBarMenuPopupDefault.Checkmark; } //} public override Color CheckBackground { get { return _palette.CommandBarMenuPopupDefault.CheckmarkBackground; } } public override Color CheckSelectedBackground { get { return _palette.CommandBarMenuPopupHovered.CheckmarkBackground; } } public override Color CheckPressedBackground { get { return _palette.CommandBarMenuPopupHovered.CheckmarkBackground; } } //public override Color ButtonPressedHighlight //{ // get { return ButtonPressedGradientMiddle; } //} //public override Color ButtonPressedHighlightBorder //{ // get { return ButtonPressedBorder; } //} public override Color ButtonPressedBorder { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Border; } } public override Color ButtonPressedGradientBegin { get { return _palette.CommandBarToolbarButtonPressed.Background; } } public override Color ButtonPressedGradientMiddle { get { return _palette.CommandBarToolbarButtonPressed.Background; } } public override Color ButtonPressedGradientEnd { get { return _palette.CommandBarToolbarButtonPressed.Background; } } public override Color MenuItemPressedGradientBegin { get { return _palette.CommandBarMenuPopupDefault.BackgroundTop; } } public override Color MenuItemPressedGradientMiddle { get { return _palette.CommandBarMenuPopupDefault.BackgroundTop; } } public override Color MenuItemPressedGradientEnd { get { return _palette.CommandBarMenuPopupDefault.BackgroundTop; } } //public override Color ButtonSelectedHighlight //{ // get { return Color.Red; } //} //public override Color ButtonSelectedHighlightBorder //{ // get { return ButtonSelectedBorder; } //} public override Color ButtonSelectedBorder { get { return _palette.CommandBarToolbarButtonChecked.Border; } } public override Color ButtonSelectedGradientBegin { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Background; } } public override Color ButtonSelectedGradientMiddle { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Background; } } public override Color ButtonSelectedGradientEnd { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Background; } } public override Color MenuItemSelected { get { return _palette.CommandBarMenuPopupHovered.ItemBackground; } } public override Color MenuItemSelectedGradientBegin { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Background; } } public override Color MenuItemSelectedGradientEnd { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Background; } } public override Color GripDark { get { return _palette.CommandBarToolbarDefault.Grip; } } public override Color GripLight { get { return _palette.CommandBarToolbarDefault.Grip; } } public override Color ImageMarginGradientBegin { get { return _palette.CommandBarMenuPopupDefault.IconBackground; } } public override Color ImageMarginGradientMiddle { get { return _palette.CommandBarMenuPopupDefault.IconBackground; } } public override Color ImageMarginGradientEnd { get { return _palette.CommandBarMenuPopupDefault.IconBackground; } } //public override Color ImageMarginRevealedGradientBegin //{ // get { return Color.FromArgb(255, 231, 232, 236); } //} //public override Color ImageMarginRevealedGradientMiddle //{ // get { return Color.FromArgb(255, 231, 232, 236); } //} //public override Color ImageMarginRevealedGradientEnd //{ // get { return Color.FromArgb(255, 231, 232, 236); } //} public override Color MenuStripGradientBegin { get { return _palette.CommandBarMenuDefault.Background; } } public override Color MenuStripGradientEnd { get { return _palette.CommandBarMenuDefault.Background; } } public override Color MenuItemBorder { get { return _palette.CommandBarMenuTopLevelHeaderHovered.Border; } } public override Color MenuBorder { get { return _palette.CommandBarMenuPopupDefault.Border; } } //public override Color RaftingContainerGradientBegin //{ // get { return Color.FromArgb(255, 186, 192, 201); } //} //public override Color RaftingContainerGradientEnd //{ // get { return Color.FromArgb(255, 186, 192, 201); } //} public override Color SeparatorDark { get { return _palette.CommandBarToolbarDefault.Separator; } } public override Color SeparatorLight { get { return _palette.CommandBarToolbarDefault.SeparatorAccent; } } public override Color StatusStripGradientBegin { get { return _palette.MainWindowStatusBarDefault.Background; } } public override Color StatusStripGradientEnd { get { return _palette.MainWindowStatusBarDefault.Background; } } public override Color ToolStripBorder { get { return _palette.CommandBarToolbarDefault.Border; } } public override Color ToolStripDropDownBackground { get { return _palette.CommandBarMenuPopupDefault.BackgroundBottom; } } public override Color ToolStripGradientBegin { get { return _palette.CommandBarToolbarDefault.Background; } } public override Color ToolStripGradientMiddle { get { return _palette.CommandBarToolbarDefault.Background; } } public override Color ToolStripGradientEnd { get { return _palette.CommandBarToolbarDefault.Background; } } public override Color ToolStripContentPanelGradientBegin { get { return _palette.CommandBarMenuDefault.Background; } } public override Color ToolStripContentPanelGradientEnd { get { return _palette.CommandBarMenuDefault.Background; } } public override Color ToolStripPanelGradientBegin { get { return _palette.CommandBarMenuDefault.Background; } } public override Color ToolStripPanelGradientEnd { get { return _palette.CommandBarMenuDefault.Background; } } public override Color OverflowButtonGradientBegin { get { return _palette.CommandBarToolbarDefault.OverflowButtonBackground; } } public override Color OverflowButtonGradientMiddle { get { return _palette.CommandBarToolbarDefault.OverflowButtonBackground; } } public override Color OverflowButtonGradientEnd { get { return _palette.CommandBarToolbarDefault.OverflowButtonBackground; } } } }
30.467105
86
0.625999
[ "MIT" ]
BrisingrAerowing/dockpanelsuite
WinFormsUI/Docking/VisualStudioColorTable.cs
9,264
C#
using System; using System.Collections.Generic; using Xamarin.Forms; using Xamarin.Forms.Labs.Mvvm; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace Xamarin.Forms.Labs.Sample { public partial class CanvasWebHybrid : BaseView { public CanvasWebHybrid () { InitializeComponent (); this.hybridWebView.RegisterCallback("dataCallback", t => System.Diagnostics.Debug.WriteLine(t) ); this.hybridWebView.RegisterCallback("chartUpdated", t => System.Diagnostics.Debug.WriteLine(t) ); var model = ChartViewModel.Dummy; this.BindingContext = model; model.PropertyChanged += HandlePropertyChanged; model.DataPoints.CollectionChanged += HandleCollectionChanged; foreach (var datapoint in model.DataPoints) { datapoint.PropertyChanged += HandlePropertyChanged; } this.hybridWebView.LoadFinished += (s, e) => { this.hybridWebView.CallJsFunction ("onViewModelData", this.BindingContext); }; } void HandleCollectionChanged (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { foreach (var datapoint in e.NewItems.OfType<DataPoint>()) { datapoint.PropertyChanged += HandlePropertyChanged; } foreach (var datapoint in e.OldItems.OfType<DataPoint>()) { datapoint.PropertyChanged -= HandlePropertyChanged; } } void HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { this.hybridWebView.CallJsFunction ("onViewModelData", this.BindingContext); } protected override void OnAppearing() { base.OnAppearing(); this.hybridWebView.LoadFromContent("HTML/home.html"); } } }
28.680556
119
0.604843
[ "Apache-2.0" ]
Applifting/Xamarin-Forms-Labs
samples/Xamarin.Forms.Labs.Sample/Pages/Mvvm/CanvasWebHybrid.xaml.cs
2,067
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace VisitorPattern { internal class CTImage:DIImage { public string CTImageData; public CTImage() { CTImageData = "CTImageData"; } public void CreateImage() { Console.WriteLine("Creating CT Image"); } public void Accept(IPlanningTool planningTool) { planningTool.Plan(this); } } }
19.777778
54
0.59176
[ "MIT" ]
gautamvr/DesignPatterns
Behavioral_Patterns/VisitorPattern/CTImage.cs
536
C#
using System; using System.IO; using Xunit; using Xunit.Abstractions; namespace Kether.Test { public class ERC20 { private readonly ITestOutputHelper output; string ethAbi; dynamic config; public ERC20(ITestOutputHelper output) { this.output = output; using (StreamReader r = new StreamReader("follow-abi.json")) { ethAbi = r.ReadToEnd(); } string json; using (StreamReader r = new StreamReader("follow-config.json")) { json = r.ReadToEnd(); } config = Newtonsoft.Json.JsonConvert.DeserializeObject(json); } [Fact] public async void totalSupplyAsync() { Kether.ERC20 eth = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.ownerAddress, (string)config.ownerPK, (string)config.node ); var totalSupply = await eth.totalSupplyAsync(); output.WriteLine("Ethereum response:"); output.WriteLine($"totalSupply: {totalSupply}"); Assert.True(!String.IsNullOrEmpty(totalSupply)); Assert.True(totalSupply == "5000000"); } [Fact] public async void balanceOfAsync() { Kether.ERC20 eth = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.userAddress, (string)config.userPK, (string)config.node ); string holder = "0xd7c2c73a5c36bb61cbbf7c02a9bee6bf8df8a129"; var balanceOf = long.Parse(await eth.balanceOfAsync(holder)); Assert.True(balanceOf >= 0); output.WriteLine($"balanceOf: {balanceOf}"); var totalSupply = long.Parse(await eth.totalSupplyAsync()); Assert.True(totalSupply > 0); Assert.True(balanceOf <= totalSupply); } [Fact] public async void transferAsync() { Kether.ERC20 ethOwner = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.ownerAddress, (string)config.ownerPK, (string)config.node); Kether.ERC20 ethUser = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.userAddress, (string)config.userPK, (string)config.node); string amount = "101"; bool ok = false; ok = await ethOwner.transferAsync((string)config.userAddress, amount); Assert.True(ok); ok = await ethUser.transferAsync((string)config.ownerAddress, amount); Assert.True(ok); output.WriteLine($"transfered: {amount}"); output.WriteLine($" (from: {(string)config.ownerAddress})"); output.WriteLine($" (to: {(string)config.userAddress})"); } [Fact] public async void approveAsync() { Kether.ERC20 eth = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.userAddress, (string)config.userPK, (string)config.node ); string amount = "101"; bool ok = false; var allowanceBefore = await eth.allowanceAsync((string)config.userAddress, (string)config.ownerAddress); ok = await eth.approveAsync((string)config.ownerAddress, amount); Assert.True(ok); var allowanceAfter = await eth.allowanceAsync((string)config.userAddress, (string)config.ownerAddress); Assert.True(!String.IsNullOrEmpty(allowanceBefore)); Assert.True(!String.IsNullOrEmpty(allowanceAfter)); Assert.True(allowanceAfter == amount); ok = await eth.approveAsync((string)config.ownerAddress, "0"); Assert.True(ok); output.WriteLine($"allowanceAfter: {allowanceAfter}"); output.WriteLine($"amount: {amount}"); output.WriteLine($"approved: {allowanceAfter}"); output.WriteLine($" (holder: {(string)config.userAddress})"); output.WriteLine($" (recipient: {(string)config.ownerAddress})"); } [Fact] public async void allowanceAsync() { Kether.ERC20 eth = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.userAddress, (string)config.userPK, (string)config.node ); var allowance = await eth.allowanceAsync((string)config.userAddress, (string)config.ownerAddress); output.WriteLine($"allowance: {allowance}"); output.WriteLine($" (holder: {(string)config.userAddress})"); output.WriteLine($" (recipient: {(string)config.ownerAddress})"); Assert.True(!String.IsNullOrEmpty(allowance)); } [Fact] public async void transferFromAsync() { Kether.ERC20 ethUser = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.userAddress, (string)config.userPK, (string)config.node ); Kether.ERC20 ethOwner = new Kether.ERC20((string)config.contractAddress, ethAbi, (string)config.ownerAddress, (string)config.ownerPK, (string)config.node ); string amount = "101"; bool ok = false; ok = await ethOwner.transferAsync((string)config.ownerAddress, amount); Assert.True(ok); ok = await ethUser.approveAsync((string)config.ownerAddress, amount); Assert.True(ok); ok = await ethOwner.transferFromAsync((string)config.userAddress, (string)config.ownerAddress, amount); Assert.True(ok); output.WriteLine($"transferFrom: {amount}"); output.WriteLine($" (from: {(string)config.userAddress})"); output.WriteLine($" (to: {(string)config.ownerAddress})"); } } }
39.43
117
0.446995
[ "MIT" ]
allownulls/kether
Kether.test/ERC20.cs
7,888
C#
// This file is auto-generated, don't edit it. Thanks. using System; using System.Collections.Generic; using System.IO; using Tea; namespace AlibabaCloud.SDK.Dingtalkesign_1_0.Models { public class ChannelOrderResponseBody : TeaModel { [NameInMap("code")] [Validation(Required=false)] public int? Code { get; set; } [NameInMap("data")] [Validation(Required=false)] public ChannelOrderResponseBodyData Data { get; set; } public class ChannelOrderResponseBodyData : TeaModel { [NameInMap("esignOrderId")] [Validation(Required=false)] public string EsignOrderId { get; set; } }; [NameInMap("message")] [Validation(Required=false)] public string Message { get; set; } } }
25.21875
62
0.63197
[ "Apache-2.0" ]
aliyun/dingtalk-sdk
dingtalk/csharp/core/esign_1_0/Models/ChannelOrderResponseBody.cs
807
C#
//~ Generated by SearchRecordTemplate.tt #pragma warning disable 1591 using System; namespace com.celigo.net.ServiceManager.SuiteTalk { public partial class CustomerCategorySearchBasic : ISearchBasic { } public partial class CustomerCategorySearch : ISearchRecord { /// <summary> /// Gets the basic search criteria. /// </summary> /// <returns>The basic search criteria</returns> public ISearchBasic GetSearchBasic() { return this.basic; } /// <summary> /// Gets the basic search criteria. /// </summary> /// <param name="create">if set to <c>true</c> creates the basic criteria if null.</param> /// <returns>The basic search criteria</returns> public ISearchBasic GetSearchBasic(bool create) { if (create && this.basic == null) this.basic = new CustomerCategorySearchBasic(); return this.basic; } } }
26.205882
93
0.673401
[ "Apache-2.0" ]
celigo/netsuite-service-manager-dotnet
ServiceManager/SuiteTalk/CustomerCategorySearch.cs
891
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace RemoteRunClient { internal static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
22.478261
66
0.584139
[ "MIT" ]
Antizhy/RemoteControlClient
RemoteControlClient/Program.cs
539
C#
// WARNING // // This file has been generated automatically by Xamarin Studio to store outlets and // actions made in the UI designer. If it is removed, they will be lost. // Manual changes to this file may not be handled correctly. // using Foundation; using System.CodeDom.Compiler; namespace Xamarin.Interactive.Preferences { [Register ("PreferencesUpdaterViewController")] partial class PreferencesUpdaterViewController { [Outlet] AppKit.NSTextField channelTextField { get; set; } [Outlet] AppKit.NSPopUpButton frequencyPopUpButton { get; set; } [Outlet] AppKit.NSTextField lastCheckedTextField { get; set; } [Outlet] AppKit.NSButton switchChannelsButton { get; set; } void ReleaseDesignerOutlets () { if (frequencyPopUpButton != null) { frequencyPopUpButton.Dispose (); frequencyPopUpButton = null; } if (channelTextField != null) { channelTextField.Dispose (); channelTextField = null; } if (lastCheckedTextField != null) { lastCheckedTextField.Dispose (); lastCheckedTextField = null; } if (switchChannelsButton != null) { switchChannelsButton.Dispose (); switchChannelsButton = null; } } } }
28.313725
84
0.590028
[ "MIT" ]
Bhaskers-Blu-Org2/workbooks
Clients/Xamarin.Interactive.Client.Mac/Preferences/PreferencesUpdaterViewController.designer.cs
1,444
C#
using OmniSharp.Extensions.JsonRpc; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Extensions.LanguageServer.Protocol.Server; // ReSharper disable CheckNamespace namespace OmniSharp.Extensions.LanguageServer.Protocol.Client { [Serial, Method(WindowNames.TelemetryEvent)] public interface ITelemetryEventHandler : IJsonRpcNotificationHandler<TelemetryEventParams> { } }
33.916667
99
0.840295
[ "MIT" ]
Bia10/csharp-language-server-protocol
src/Protocol/Window/Client/ITelemetryEventHandler.cs
407
C#
// Copyright 2016, 2017, 2018 TRUMPF Werkzeugmaschinen GmbH + Co. KG. // // 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. namespace Trumpf.Coparoo.Web.Controls { using System.Collections.Generic; using System.Linq; using OpenQA.Selenium; using Trumpf.Coparoo.Web.Controls.Interfaces; /// <summary> /// Partial Table control object. /// </summary> public partial class Table { /// <summary> /// Table row control object. /// </summary> public class Row : ControlObject, IRow { /// <summary> /// Gets the search pattern. /// </summary> protected override By SearchPattern => By.TagName("tr"); /// <summary> /// Gets the enumeration of cell control objects. /// </summary> public IEnumerable<ICell> Cells => FindAll<Cell>(); /// <summary> /// Returns the cell element at a specified index in the cell sequence. /// </summary> /// <exception cref="System.ArgumentNullException">Cell sequence is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Index is less than 0 or greater than or equal to the number of cell elements in the cell sequence.</exception> /// <param name="index">The zero-based index of the cell to retrieve.</param> /// <returns>The cell element at the specified position in the cell sequence.</returns> public ICell CellAt(int index) => Cells.ElementAt(index); /// <summary> /// Returns the cell element at a specified index in the cell sequence as a control object like provided. /// </summary> /// <exception cref="System.ArgumentNullException">Cell sequence is null.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Index is less than 0 or greater than or equal to the number of cell elements in the cell sequence.</exception> /// <typeparam name="T">Control object type.</typeparam> /// <param name="index">The zero-based index of the cell to retrieve.</param> /// <returns>The cell element at the specified position in the cell sequence as a control object like provided.</returns> public T CellAt<T>(int index) where T : IControlObject => Cells.ElementAt(index).As<T>(); } } }
44.681818
179
0.638861
[ "Apache-2.0" ]
trumpf-code/Trumpf.Coparoo.Web
Trumpf.Coparoo.Web/Controls/Table/Row.cs
2,951
C#